Sie sind auf Seite 1von 101

Unit3DATACOMMUNICATIONNETWORKS

The Network Layer: Design Issues.


Routing Algorithms.
Congestion control Algorithms.
Subnet concept
Virtual circuit and Data gram Subnet
Flow control,
Internetworking
Bridges, Routers, Gateways and different level
switches.

Network Layer Design Issues

Store-and-forward packet switching


Services provided to transport layer
Implementation of connectionless service
Implementation of connection-oriented service
Comparison of virtual-circuit and datagram
networks

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Store-and-Forward Packet Switching


ISPs equipment

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Implementation of Connectionless Service


ISPs equipment

Routing within a datagram network


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Implementation of
Connection-Oriented Service
ISPs equipment

Routing within a virtual-circuit network


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Comparison of Virtual-Circuit
and Datagram Networks

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Bridges, Routers, Gateways and different level


switches. (Network Devices)

Modem: a device that modulates a digital signal onto analog signal for transmission over
telephone lines.
Repeater: Re-generates the signal again.

Hyung Min Lee

Switches/routers/gateways (cont.)

Mainly from the point of software, i.e., containing functions of lower three layers
There are some requirements for hardware such as speed, disk, memory, multiple
interfaces.
Bridge: used to connect multiple similar LANs.
Circuit switch, used in telephone networks
Packet switch/router/gateway:
Generally consider them as the same meaning
Packet switch deals with a uniform routing procedure, within one homogenous
network, one pair of data link and physical layer
Router/gateway deals with routing in multiple heterogeneous networks, more
than one pair of data link and physical layers
Gateway : used to connect multiple different LANs

Hyung Min Lee

DEVICES :
1. Hub, a distributor that has a lot of ports
which connected to computers.
2. Switches, like a hub but it transmit packets to
it destination

3. Bridge, it is used to connect two similar


LANs.
4. Routers, choose the best path to transmit
the packet.
5. Gateway, it is use to connect two
different LANs and connect different
application protocols.
6. Repeaters, repeats signals that travels via
long distance

Hyung Min Lee

Network devices With Layer


Layers

Network Devices

Application Layer

Application gateway

Transport Layer

Transport gateway

Network Layer

Router and gateway

Data link layer

Bridge and Switch

Physical Layer

Repeater, Hub and


Modem.

Hyung Min Lee

Routing Algorithms

Optimality principle
Shortest path algorithm
Flooding
Distance vector routing
Link state routing
Routing in ad hoc networks

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Routing Algorithms (2)

Broadcast routing
Multicast routing
Anycast routing
Routing for mobile hosts
Routing in ad hoc networks

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

The Optimality Principle

(a) A network. (b) A sink tree for router B.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Shortest Path Algorithm (1)

The first five steps used in computing the shortest path from A
to D. The arrows indicate the working node
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Distance Vector Routing

(a) A network.
(b) Input from A, I, H, K, and the new routing table for J.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

The Count-to-Infinity Problem

The count-to-infinity problem


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Link State Routing


1.
2.
3.
4.
5.

Discover neighbors, learn network addresses.


Set distance/cost metric to each neighbor.
Construct packet telling all learned.
Send packet to, receive packets from other routers.
Compute shortest path to every other router.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Learning about the Neighbors (1)

Nine routers and a broadcast LAN.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Learning about the Neighbors (2)

A graph model of previous slide.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Building Link State Packets

(a) A network. (b) The link state packets for this network.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Distributing the Link State Packets

The packet buffer for router B in previous slide


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Hierarchical Routing

Hierarchical routing.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Broadcast Routing

Reverse path forwarding. (a) A network. (b) A sink tree.


(c) The tree built by reverse path forwarding.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Multicast Routing (1)

(a) A network. (b) A spanning tree for the leftmost router. (c) A
multicast tree for group 1. (d) A multicast tree for group 2.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Multicast Routing (2)

(a) Core-based tree for group 1.


(b) Sending to group 1.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

Anycast Routing

(a) Anycast routes to group 1.


(b) Topology seen by the routing protocol.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, Pearson Education-Prentice Hall, 2011

CONGESTIONCONTROL
Congestion in a network may occur if the load on the
networkthe number of packets sent to the network
is greater than the capacity of the networkthe
number of packets a network can handle.
Congestion control refers to the mechanisms and
techniques to control the congestion and keep the load
below the capacity.

Figure Traffic descriptors

Figure Three traffic profiles

Congestion Control

When one part of the subnet (e.g. one or more


routers in an area) becomes overloaded,
congestion results.
Because routers are receiving packets faster
than they can forward them, one of two things
must happen:

The subnet must prevent additional packets from


entering the congested region until those already
present can be processed.
The congested routers can discard queued packets to
make room for those that are arriving.

CONGESTIONCONTROL
Congestion control refers to techniques and mechanisms
that can either prevent congestion, before it happens, or
remove congestion, after it has happened.
In general, we can divide congestion control mechanisms
into two broad categories:
1.open-loop congestion control (prevention)
2.closed-loop congestion control (removal).

General Principles of Congestion Control


closed-loop congestion control
A.

Monitor the system .


detect when and where congestion occurs.
B. Pass information to where action can be taken.
C. Adjust system operation to correct the problem.

Figure Congestion control categories

Figure Backpressure method for alleviating congestion

Congestion Control in Datagram Subnets:


Warning Bit
Congestion Control is concerned with efficiently using a network at high
load.
Several techniques can be employed. These include:
1. Warning bit
2. Choke packets
3. Load shedding
4. Random early discard
5. Traffic shaping
The first 3 deal with congestion detection and recovery. The last 2 deal
with congestion avoidance.

Warning Bit

A special bit in the packet header is set by the router


to warn the source when congestion is detected.
The bit is copied and piggy-backed on the ACK and
sent to the sender.
The sender monitors the number of ACK packets it
receives with the warning bit set and adjusts its
transmission rate accordingly.

Choke Packets

A more direct way of telling the source to slow


down.
A choke packet is a control packet generated at
a congested node and transmitted to restrict
traffic flow.
The source, on receiving the choke packet must
reduce its transmission rate by a certain
percentage.

Figure Choke packet

Hop-by-Hop Choke Packets

Over long distances or at high speeds choke packets are not


very effective.
A more efficient method is to send to choke packets hop-byhop.
This requires each hop to reduce its transmission even before
the choke packet arrive at the source.

Load Shedding

When buffers become full, routers simply discard


packets.
Which packet is chosen to be the victim depends on the
application and on the error strategy used in the data
link layer.
For a file transfer, for, e.g. cannot discard older packets
since this will cause a gap in the received data.
For real-time voice or video it is probably better to
throw away old data and keep new packets.
Get the application to mark packets with discard
priority.

Random Early Discard (RED)

This is a proactive approach in which the router discards one


or more packets before the buffer becomes completely full.
Each time a packet arrives, the RED algorithm computes the
average queue length, avg.
If avg is lower than some lower threshold, congestion is
assumed to be minimal or non-existent and the packet is
queued.
If avg is greater than some upper threshold, congestion is
assumed to be serious and the packet is discarded.
If avg is between the two thresholds, this might indicate the
onset of congestion. The probability of congestion is then
calculated.

QUALITYOFSERVICE
Quality of service (QoS) is an internetworking issue
that can be defined as something a flow seeks to
attain.

TECHNIQUESTOIMPROVEQoS
Scheduling
Traffic Shaping
Resource Reservation
Admission Control

Figure FIFO queue

Figure Priority queuing

Figure Weighted fair queuing

Traffic Shaping

Another method of congestion control is to shape the


traffic before it enters the network.
Traffic shaping controls the rate at which packets are
sent (not just how many). Used in ATM and Integrated
Services networks.
At connection set-up time, the sender and carrier
negotiate a traffic pattern (shape).
Two traffic shaping algorithms are:
Leaky Bucket
Token Bucket

The Leaky Bucket


Algorithm

The Leaky Bucket Algorithm


used to control rate in a network. It
is implemented as a single-server
queue with constant service time. If
the bucket (buffer) overflows then
packets are discarded.

The Leaky Bucket Algorithm

(a) A leaky bucket with water. (b) a leaky bucket


with packets.

Leaky Bucket Algorithm, cont.


The leaky bucket enforces a constant output rate
(average rate) regardless of the burstiness of the input.
Does nothing when input is idle.

The host injects one packet per clock tick onto the
network. This results in a uniform flow of packets,
smoothing out bursts and reducing congestion.
When packets are the same size (as in ATM cells), the one
packet per tick is okay. For variable length packets though,
it is better to allow a fixed number of bytes per tick. E.g.
1024 bytes per tick will allow one 1024-byte packet or two
512-byte packets or four 256-byte packets on 1 tick.

Token Bucket Algorithm

In contrast to the LB, the Token Bucket


Algorithm, allows the output rate to vary,
depending on the size of the burst.
In the TB algorithm, the bucket holds
tokens. To transmit a packet, the host
must capture and destroy one token.
Tokens are generated by a clock at the
rate of one token every t sec.
Idle hosts can capture and save up
tokens (up to the max. size of the bucket)
in order to send larger bursts later.

The Token Bucket Algorithm

5-34

(a) Before.

(b) After.

Leaky Bucket vs Token Bucket

LB discards packets; TB does not. TB


discards tokens.
With TB, a packet can only be
transmitted if there are enough tokens
to cover its length in bytes.
LB sends packets at an average rate.
TB allows for large bursts to be sent
faster by speeding up the output.
TB allows saving up tokens
(permissions) to send large bursts. LB
does not allow saving.

Figure Leaky bucket

Figure Leaky bucket implementation

Note

A leaky bucket algorithm shapes bursty


traffic into fixed-rate traffic by averaging
the data rate. It may drop the packets if
the bucket is full.

Note

The token bucket allows bursty traffic at


a regulated maximum rate.

Figure Token bucket

Subnetting and Supernetting


About subnetting & Supernetting

In subnetting, a network is divided into several smaller subnetwork with each


subnetwork(or subnet) having its own subnetwork address.

In supernetting, an organization can combine several class C addresses to create a larger


range of addresses(supernetwork).

5.1 SUBNETTING

Class A, B, C in IP addressing are designed with two levels of hierarchy.(netis and


hostid)

The organization has two-level hierarchical addressing, but it cannot have more than one
physical network./ The host cannot be organized into groups, and all of the hosts are at
the same level./ The organization has one network with many hosts.

One solution to this problem is subnetting, the further division of a network into smaller
networks called subnetworks.

Hyung Min Lee

Figure 5-1 A network with two levels of hierarchy (not subnetted)

Hyung Min Lee

Figure 5-2 A network with three levels of hierarchy (subnetted)

The router R1 uses the first two octet(141.14)as the netid, the third
octet(2) as the subnetid, and the fourth octet(21) as the hostid.
Hyung Min Lee

Subnetting and Supernetting

Three Levels of Hierarchy

Adding subnetworks creates an intermediate level of hierarchy in the IP


addressing system.
Netid:
It defines the site.
Subnetid : It defines the physical subnetwork
Hostid:
It defines the connection of the host to the network.

Hyung Min Lee

Figure 5-3 Addresses in a network with and without subnetting

Hyung Min Lee

Figure 5-4 Hierarchy concept in a telephone number

Hyung Min Lee

Subnetting and Supernetting


5.2 MASKING

Masking is a process that extracts the address of the physical network from an
IP address.
Masking can be done whether we have subnetting or not.
Not subnetted the network: Masking extracts the network address an IP
address.
Subnetted the network: Masking extracts the subnetwork address an IP
address.
In masking, we perform a mathematical operation on a 32-bit IP address at the
bit level using another 32-bit number called the mask.
To get the network or subnetwork address, we must apply the bit-wise-and
operation on the IP address an the mask.
The part of the mask containing 1s defines the netid(network portion) or
combination of netid and subnetid(subnetwork portion), The part of the mask
containing 0s defines the hostid.

Hyung Min Lee

Figure 5-5 Masking

Hyung Min Lee

Figure 5-6 Applying bit-wise-and operation to achieve masking

Hyung Min Lee

Subnetting and Supernetting

Special Addresses in Subnetting

A subnetid of all 1s or all 0s is not assigned to any host.


The address with the hostid of all 1s is reserved for broadcasting to all hosts in a specific
subnet.
The address with the hostid of all 0s is also reserved to define the subnetwork itself.

Hyung Min Lee

Figure 5-7 Special addresses in subnetting

Hyung Min Lee

Subnetting and Supernetting


5.3 EXAMPLES OF SUBNETTING
( Example 1 / Class A)
An organization with a class A address at least 1,000 subnetworks. Find the subnet mask and
configuration of each subnetwork.
(Solution)
1.
There is a need for at least 1,000 subnetworks.(we need at least 1,002 subnetworks to
allow for the all-1s and all-0s subnetids)
2.
This means that the minimum number of bits to be allocated for subnetting should be
10, (29 < 1,002 < 210).
3.
14 bits are left to define the hostids. Subnet mask (11000000 = 192).

Hyung Min Lee

Figure 5-8 Masks in example 1

Hyung Min Lee

Figure 5-9 Range of addresses in example 1

Hyung Min Lee

Figure 5-10 Subnetworks in example 1

Hyung Min Lee

Subnetting and Supernetting


( Example 2 / Class B)
An organization with a class B address needs at least 12 subnetworks. Find the subnet mask
and configuration of each subnetwork.
(Solution)
1.
There is a need for at least 14 subnetworks.(we need at least 14 subetworks to allow
for the all-1s and all-0s subnetids)
2.
This means that the minimum number of bits to be allocated for subnetting should be
4, (23 < 14 < 24).
3.
12 bits are left to define the hostids. Subnet mask (11110000 = 240).

Hyung Min Lee

Figure 5-11 Masks in example 2

Hyung Min Lee

Figure 5-12 Range of addresses in example 2

Hyung Min Lee

Figure 5-13 Subnetworks in example 2

Hyung Min Lee

Subnetting and Supernetting


( Example 3 / Class C)
An organization with a class C address needs at least 5 subnetworks. Find the subnet mask
and configuration of each subnetwork.
(Solution)
1.
There is a need for at least 7 subnetworks.(we need at least 14 subetworks to allow
for the all-1s and all-0s subnetids)
2.
This means that the minimum number of bits to be allocated for subnetting should be
3, (22 < 7 < 23).
3.
5 bits are left to define the hostids. Subnet mask (11100000 = 224).

Hyung Min Lee

Figure 5-14

Hyung Min Lee

Masks in example 3

Figure 5-15 Range of addresses in example 3

Hyung Min Lee

Figure 5-16 Subnetworks in example 3

Hyung Min Lee

Subnet Short Cut Table

# of Bits

Incrementing
Value

128

64

32

16

Subnet Mask

128

192

224

240

248

252

254

255

14

30

62

126

254

# of Networks(2n- 0
2)

Hyung Min Lee

Subnetting and Supernetting


5.4 VARIABLE-LENGTH SUBNETTING

The Internet allows a site to use variable-length subnetting.

( Example)

An organization with a class C address and needs to have 5 subnets with the
following number of hosts: 60, 60, 60, 30, 30.

(Solution)

1.
2.
3.
4.
5.

The site cannot use a subnet mask with only 2 bits in the subnet section
because this allows only 4 subnetworks each 62 hosts(256/4 2 = 62),
(22<5<23)
Nor can the site use a subnet mask with 3 bits in the subnet section because
this allows 8 subnetworks each with 30 hosts(256/8 2 30).
(Variable length subnetting ) / The router uses 2 different masks, one applied
after the other.
It first uses the masks with 26 1s(11111111 11111111 11111111 11000000 or
255.255.255.192) to divide the network into 4 subnets.
Then it applies the mask with 27 1s (11111111 11111111 11111111 11100000
or 255.255.255.224) to one of the subnets to divide it into two smaller subnets.

Hyung Min Lee

Figure 5-17 Variable-length subnetting

Hyung Min Lee

Subnetting and Supernetting


5.5 SUPPERNETTING

4 class C addresses combine to make one supernetwork. Figure 5-18

Suppernet Mask

A supernet mask is the reverse of the subnet mask.


In a supernet mask, we change some 1s in the netid section to 0s.
Be aware that the position of 1s in the supernet mask defines the lowest address.

( Example)

With the supernet mask of 255.255.252.0 we can have 4 class C address combined
into one supernetwork.

If we choose the first address to be X.Y.32.0, the other three addresses are X.Y.33.0,
X.Y.34.0, and X.Y.35.0.

Whenever the router receives a packet, it applies the supernet mask to the destination
address and compares the result to the lowest address. If the result and the lowest
address are the same, the packet belongs to the supernet.

Hyung Min Lee

Figure 5-18 Supernetwork

Hyung Min Lee

Figure 5-19 Supernet mask

Hyung Min Lee

Figure 5-20 Two ways of defining a supernet

210 = 1024
Hyung Min Lee

Figure 5-21 Example of supernetting

Hyung Min Lee

Subnetting and Supernetting


Classless Interdomain Routing(CIDR)

Supernetting means assigning a set of class C addresses to an organization that needs


more than 254 host addresses.

However , when these class C addresses are entered into the routing table, each
occupies one entry in the routing table./ 256 entries in the routing table.

The classless interdomain routing(CIDR) technique is devised to reduce the


number of routing table entries.

In this technique, instead of entering each single class C address with its
corresponding default mask(255.255.255.0), the router can use the supernet mask
and the lowest network address in the group.

Hyung Min Lee

Figure 5-22 CIDR

Hyung Min Lee

Internetworking

Hyung Min Lee

How networks differ


How networks can be connected
Tunneling
Internetwork routing
Packet fragmentation

How Networks Differ

Some of the many ways networks can differ


Hyung Min Lee

How Networks Can Be Connected

(a) A packet crossing different networks.


(b) Network and link layer protocol processing.
Hyung Min Lee

Tunneling (1)

Tunneling a packet from Paris to London.


Hyung Min Lee

Tunneling (2)

Tunneling a car from France to England


Hyung Min Lee

Packet Fragmentation (1)


Packet size issues:
1.Hardware
2.Operating system
3.Protocols
4.Compliance with (inter)national standard.
5.Reduce error-induced retransmissions
6.Prevent packet occupying channel too long.
Hyung Min Lee

Packet Fragmentation (2)

(a)Transparent fragmentation.
(b)Nontransparent fragmentation
Hyung Min Lee

Packet Fragmentation (3)

Fragmentation when the elementary data size is 1 byte.


(a) Original packet, containing 10 data bytes.
Hyung Min Lee

Packet Fragmentation (5)

Fragmentation when the elementary data size is 1 byte


(c) Fragments after passing through a size 5 gateway.
Hyung Min Lee

Packet Fragmentation (6)

Path MTU Discovery


Hyung Min Lee

Das könnte Ihnen auch gefallen