0% found this document useful (0 votes)
2 views

Chapter5-NetworkLayer

Chapter 5 of 'Computer Networks' discusses the network layer, focusing on design issues such as store-and-forward packet switching, connectionless and connection-oriented services, and routing algorithms. It compares virtual-circuit and datagram networks, and explains various routing techniques including distance vector and link state routing. The chapter emphasizes the importance of optimality in routing and addresses challenges like the count-to-infinity problem.

Uploaded by

namanmathur3232
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Chapter5-NetworkLayer

Chapter 5 of 'Computer Networks' discusses the network layer, focusing on design issues such as store-and-forward packet switching, connectionless and connection-oriented services, and routing algorithms. It compares virtual-circuit and datagram networks, and explains various routing techniques including distance vector and link state routing. The chapter emphasizes the importance of optimality in routing and addresses challenges like the count-to-infinity problem.

Uploaded by

namanmathur3232
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 125

The Network Layer

Chapter 5

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
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

ISP’s equipment

The environment of the network layer protocols.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Services Provided to the Transport Layer
1. Services independent of router technology.
2. Transport layer shielded from number,
type, topology of routers.
3. Network addresses available to transport
layer use uniform numbering plan
– even across LANs and WANs

• Connectionless v/s Connection Oriented Services

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Implementation of Connectionless Service
ISP’s equipment

A’s table (initially) A’s table (later) C’s Table E’s Table

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
ISP’s equipment

A’s table C’s Table E’s Table

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

Comparison of datagram and virtual-circuit networks


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Routing Algorithms (1)

• 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
Fairness vs. Efficiency

Network with a conflict between fairness and efficiency.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Optimality Principle
if router J is on the optimal path from router I to
router K, then the optimal path from J to K also falls
along the same route.

(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
Shortest Path Algorithm (2)

...

Dijkstra’s algorithm to compute the shortest path through a graph.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Shortest Path Algorithm (3)
...

...

Dijkstra’s algorithm to compute the shortest path through a graph.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Shortest Path Algorithm (4)
...

Dijkstra’s algorithm to compute the shortest path through a graph.


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

• Every incoming
packet is sent out on
every outgoing line
except the one it
arrived on.
• Flooding generates
vast numbers of
duplicate packets
Flooding: Preventing Duplicates
• Have a hop counter contained in the header of each packet
that is decremented at each hop, with the packet being
discarded when the counter reaches zero. This can
produce an exponential number of duplicate
• To avoid sending them out a second time, routers keep
track of which packets have been flooded.
• One way to achieve this goal is to have the source router
put a sequence number in each packet it receives from its
hosts.
• Each router then needs a list per source router telling which
sequence numbers originating at that source have already
been seen.
• If an incoming packet is on the list, it is not flooded.
Flooding: Pros ‘n’ Cons
1. Flooding is not practical for sending most packets, but it does have
some important uses.
2. It ensures that a packet is delivered to every node in the network.
– wasteful if there is a single destination that needs the packet
– but it is effective for broadcasting information.
– In wireless networks, all messages transmitted by a station can be
received by all other stations within its radio range, which is, in fact,
flooding, and some algorithms utilize this property. F
3.Flooding is tremendously robust.
– Even if large numbers of routers are blown to bits flooding will find a path if
one exists, to get a packet to its destination.
4.Flooding also requires little in the way of setup.
5. Flooding always chooses the shortest path because it chooses every
possible path in parallel. Consequently, no other algorithm can
produce a shorter delay. Flooding can also be used as a metric
against which other routing algorithms can be compared.
Bellman-Ford Algorithm
• Also known as v
2 y
1
3 1
Distance Vector u
x 4 z
Routing 2 1
5 t
• Define distances at w 4 3
each node x s
– dx(y) = cost of least-
cost path from x to y du(z) = min{c(u,v) +
dv(z), c(u,w) +
• Update distances
dw(z)}
based on neighbors
– dx(y) = min {c(x,v) +
dv(y)} over all
neighbors v
Distance Vector Algorithm
• c(x,v) = cost for direct link from x to v
– Node x maintains costs of direct links c(x,v)
• Dx(y) = estimate of least cost from x to y
– Node x maintains distance vector Dx = [Dx(y): y є N ]
• Node x maintains its neighbors’ distance
vectors
– For each neighbor v, x maintains Dv = [Dv(y): y є N ]
• Each node v periodically sends D v to its
neighbors
– And neighbors update their own distance vectors
– Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N
Distance Vector Algorithm
Each node:
Iterative, asynchronous: each
local iteration caused by:
• Local link cost change wait for (change in local link cost
• Distance vector update message or message from neighbor)
from neighbor
Distributed: recompute estimates
• Each node notifies neighbors
only when its DV changes
if distance to any destination has
• Neighbors then notify their
neighbors if necessary changed, notify neighbors

21
Distance Vector Example: Step 1
Optimum 1-hop paths
Table for A Table for B
E 3 C
Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A
F 1
B 4 B B 0 B 2
6
C  – C  –
1
D  – D 3 D 3 D
 A 4
E 2 E E –
B
F 6 F F 1 F
Table for C Table for D Table for E Table for F
Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A  – A  – A 2 A A 6 A
B  – B 3 B B  – B 1 B
C 0 C C 1 C C  – C 1 C
D 1 D D 0 D D  – D  –
E  – E  – E 0 E E 3 E
F 1 F F  – F 3 F F 0 F
22
Distance Vector Example: Step 2
Optimum 2-hop paths
Table for A Table for B
E 3 C
Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A
F 1
B 4 B B 0 B 2
C 7 F C 2 F 6
1
D 7 B D 3 D 3 D
E 2 E E 4 F A 4
F 5 E F 1 F B

Table for C Table for D Table for E Table for F


Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A 7 F A 7 B A 2 A A 5 B
B 2 F B 3 B B 4 F B 1 B
C 0 C C 1 C C 4 F C 1 C
D 1 D D 0 D D  – D 2 C
E 4 F E  – E 0 E E 3 E
F 1 F F 2 C F 3 F F 0 F
23
Distance Vector Example: Step 3
Optimum 3-hop paths
Table for A Table for B
E 3 C
Dst Cst Hop Dst Cst Hop 1
A 0 A A 4 A
F 1
B 4 B B 0 B 2
C 6 E C 2 F 6
1
D 7 B D 3 D 3 D
E 2 E E 4 F A 4
F 5 E F 1 F B

Table for C Table for D Table for E Table for F


Dst Cst Hop Dst Cst Hop Dst Cst Hop Dst Cst Hop
A 6 F A 7 B A 2 A A 5 B
B 2 F B 3 B B 4 F B 1 B
C 0 C C 1 C C 4 F C 1 C
D 1 D D 0 D D 5 F D 2 C
E 4 F E 5 C E 0 E E 3 E
F 1 F F 2 C F 3 F F 0 F
24
Distance Vector: Link Cost Changes
Link cost changes: 1
Y
• Node detects local link cost change 4 1
• Updates the distance table X Z
50
• If cost change in least cost path, notify neighbors

algorithm
terminates
“good
news
travels
fast”

25
Distance Vector: Link Cost Changes
Link cost changes: 60
• Good news travels fast Y
4 1
• Bad news travels slow - “count to
X Z
infinity” problem! 50

algorithm
continues
on!

26
Distance Vector: Poison Reverse
If Z routes through Y to get to X : 60
• Z tells Y its (Z’s) distance to X is infinite (so Y won’t Y
route to X via Z) 4 1
• Still, can have problems when more than 2 routers are X Z
50
involved

algorithm
terminates

27
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. DV updates existing tables following a change in
topology
2. Causes “Count to infinity” problem
3. Link State Routing builds tables from scratch
following change in topology
4. Phases
i. Discover neighbors, learn network addresses.
ii. Set distance/cost metric to each neighbor.
iii. Construct packet telling all learned.
iv. Send packet to, receive packets from other routers.
v. 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)

• Every router sends a


HELLO packet onto
every outgoing link
• Receives REPLY with
unique name of the
neighbour
Nine routers and a
broadcast LAN.
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
Setting Link Costs
a) The cost to reach neighbors can be set automatically, or
configured by the network operator.
b) A common choice is to make the cost inversely proportional
to the bandwidth of the link.
– For example, 1-Gbps Ethernet may have a cost of 1 and 100-Mbps
Ethernet a cost of 10.
– This makes higher-capacity paths better choices.

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 (1)
• Use Flooding
• To keep the flood in check, each packet contains a sequence
number that is incremented for each new packet sent.
• If the sequence numbers wrap around, confusion will reign.
The solution here is to use a 32-bit sequence number.
• Second, if a router ever crashes, it will lose track of its
sequence number. If it starts again at 0, the next packet it
sends will be rejected as a duplicate.
• Third, if a sequence number is ever corrupted and 65,540 is
received instead of 4 (a 1-bit error), packets 5 through 65,540
will be rejected as obsolete, since the current sequence
number will be thought to be 65,540.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Distributing the Link State Packets (2)
• Solution to all these problems is to include the age of each
packet after the sequence number and decrement it once per
second. When the age hits zero, the information from that
router is discarded.
• When a link state packet comes in to a router for flooding, it is
not queued for transmission immediately. Instead, it is put in a
holding area to wait a short while in case more links are
coming up or going down. If another link state packet from the
same source comes in before the first packet is transmitted,
their sequence numbers are compared. If they are equal, the
duplicate is discarded. If they are different, the older one is
thrown out.
• To guard against errors on the links, all link state packets are
acknowledged
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Distributing the Link State Packets (3)

The packet buffer for router B in previous slide


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
General Comment on Routing Algorithms
• Link state, distance vector, and other algorithms rely on processing at
all the routers to compute routes. Problems with the hardware or
software at even a small number of routers can wreak havoc across
the network.
• For example, if a router claims to have a link it does not have or
forgets a link it does have, the network graph will be incorrect.
• If a router fails to forward packets or corrupts them while forwarding
them, the route will not work as expected.
• Finally, if it runs out of memory or does the routing calculation wrong,
bad things will happen.
• As the network grows into the range of tens or hundreds of
thousands of nodes, the probability of some router failing
occasionally becomes non-negligible.
• The trick is to try to arrange to limit the damage when the inevitable
happens

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hierarchical Routing (1)
• This is essentially a 'Divide and Conquer' strategy.
• The network is divided into different regions and a router for a
particular region knows only about its own domain and other
routers. Thus, the network is viewed at two levels:
• The Sub-network level, where each node in a region has information
about its peers in the same region and about the region's interface
with other regions. Different regions may have different 'local' routing
algorithms. Each local algorithm handles the traffic between nodes of
the same region and also directs the outgoing packets to the
appropriate interface.
• The Network Level, where each region is considered as a single node
connected to its interface nodes. The routing algorithms at this level
handle the routing of packets between two interface nodes, and is
isolated from intra-regional transfer.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hierarchical Routing (2)
• Networks can be organized in
hierarchies of many levels;
e.g. local networks of a city at
one level, the cities of a
country at a level above it,
and finally the network of all
nations. In Hierarchical
routing, the interfaces need to
store information about:
– All nodes in its region which are
at one level below it.
– Its peer interfaces.
– At least one interface at a
level above it, for outgoing
packages.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hierarchical Routing (3)

Hierarchical routing.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Hierarchical Routing (4)
a) Advantages of Hierarchical Routing :
– Smaller sizes of routing tables.
– Substantially lesser calculations and updates of routing tables.
b) Disadvantage :
– Once the hierarchy is imposed on the network, it is followed and
possibility of direct paths is ignored. This may lead to sub optimal
routing.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Broadcast Routing
a) Broadcasting: sending a packet to all N receivers .
– routing updates in LS routing.
– service/request advertisement in application layer (e.g., Novell)
b) Broadcast algorithm 1:
– N point-to-point sends: Send packet to every destination point-to-point;
wasteful of bandwidth; requires knowledge of all destinations
– Broadcast algorithm 2: flooding .
• when node receives a broadcast packet, send it out on every
link; node may receive many copies of broadcast packet;
hence must be able to detect duplicates.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Broadcast Routing: Reverse Path
Forwarding
• Goal:
– avoid flooding duplicates
• Assumptions:
– A wants to broadcast.
– all nodes know predecessor
node on shortest path back to
A (a) A network
• Reverse path forwarding:
o if node receives a broadcast
packet:
– if packet arrived on predecessor . (b) A sink
on shortest path to A, then flood to tree.
all neighbors;
– otherwise ignore broadcast packet

- either already arrived, or will


arrive from predecessor (c) The tree built by
reverse path forwarding.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Reverse Path Forwarding
• flood if packet arrives from source on link that router would
use to send packets to source;
• Otherwise discard.
• Rule avoids flooding loops.
• Uses shortest path tree from destinations to source (reverse
tree)

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
Routing for Mobile Hosts

Packet routing for mobile hosts

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Routing in Ad Hoc Networks

The shaded nodes are


(a) Range of A’s broadcast. new recipients. The
(b) After B and D receive it. dashed lines show
(c) After C, F, and G receive it. possible reverse routes.
(d) After E, H, and I receive it. The solid lines show the
discovered route.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Congestion Control Algorithms (1)

• Approaches to congestion control


• Traffic-aware routing
• Admission control
• Traffic throttling
• Load shedding

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Congestion Control Algorithms (2)

When too much traffic is offered, congestion sets in and


performance degrades sharply.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Approaches to Congestion Control

Timescales of approaches to congestion control

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

A network in which the East and West parts


are connected by two links.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Traffic Throttling (1)

(a) A congested network. (b) The portion of the network that is


not congested. A virtual circuit from A to B is also shown.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Traffic Throttling (2)

Explicit congestion notification

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Load Shedding (1)

A choke packet that affects only the source..


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Load Shedding (2)

A choke packet that affects each hop it passes through.


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

• Application requirements
• Traffic shaping
• Packet scheduling
• Admission control
• Integrated services
• Differentiated services

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Application Requirements (1)

How stringent the quality-of-service requirements are.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Categories of QoS and Examples

1. Constant bit rate


• Telephony
2. Real-time variable bit rate
• Compressed videoconferencing
3. Non-real-time variable bit rate
• Watching a movie on demand
4. Available bit rate
• File transfer
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Traffic Shaping (1)

(a) Shaping packets. (b) A leaky bucket. (c) A token bucket

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Traffic Shaping (2)

(a) Traffic from a host. Output shaped by a token bucket of rate


200 Mbps and capacity (b) 9600 KB, (c) 0 KB.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Traffic Shaping (3)

Token bucket level for shaping with rate 200 Mbps and capacity
(d) 16000 KB, (e) 9600 KB, and (f) 0KB..
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Scheduling (1)

Kinds of resources can potentially be


reserved for different flows:

1. Bandwidth.
2. Buffer space.
3. CPU cycles.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Scheduling (2)

Round-robin Fair Queuing

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Scheduling (3)

(a) Weighted Fair Queueing.


(b) Finishing times for the packets.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Admission Control (1)

An example flow specification

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Admission Control (2)

Bandwidth and delay guarantees with token buckets and WFQ.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Integrated Services (1)

(a) A network. (b) The multicast spanning tree for host 1.


(c) The multicast spanning tree for host 2.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Integrated Services (2)

(a) Host 3 requests a channel to host 1. (b) Host 3 then


requests a second channel, to host 2.
(c) Host 5 requests a channel to host 1.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Differentiated Services (1)

Expedited packets experience a traffic-free network

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Differentiated Services (2)

A possible implementation of assured forwarding

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

• How networks differ


• How networks can be connected
• Tunneling
• Internetwork routing
• Packet fragmentation

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

Some of the many ways networks can differ

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
How Networks Can Be Connected

(a) A packet crossing different networks.


(b) Network and link layer protocol processing.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Tunneling (1)

Tunneling a packet from Paris to London.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Tunneling (2)

Tunneling a car from France to England

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internetwork Routing (1)
• The networks may internally use different routing algorithms. For example,
one network may use link state routing and another distance vector routing.
Since link state algorithms need to know the topology but distance vector
algorithms do not, this difference alone would make it unclear how to find the
shortest paths across the internet.
• Different operators may have different ideas about what is a good path
through the network.
• Operator may not want another operator to even know the details of the
paths in its network, perhaps because the weights and paths may reflect
sensitive information (such as the monetary cost) that represents a
competitive business advantage.
• The internet may be much larger than any of the networks that comprise it. It
may therefore require routing algorithms that scale well by using a hierarchy,
even if none of the individual networks need to use a hierarchy.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internetwork Routing (2)
• All of these considerations lead to a two-level routing
algorithm.
• Within each network, an intra-domain or interior gateway
protocol is used for routing.
• an inter-domain or exterior gateway protocol is used.
• The networks may all use different intra-domain protocols, but
they must use the same inter-domain protocol.
• Since each network is operated independently of all the
others, it is often referred to as an AS (Autonomous
System). A good mental model for an AS is an ISP
network.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internetwork Routing (3)

• How the routes across the networks of the internet are


determined?
• a large determining factor is the business arrangements between ISPs.
Each ISP may charge or receive money from the other ISPs for carrying
traffic.
• Another factor is that if internetwork routing requires crossing
international boundaries, various laws may suddenly come into play,
such as Sweden’s strict privacy laws about exporting personal data
about Swedish citizens from Sweden.
• All of these nontechnical factors are wrapped up in the concept
of a routing policy that governs the way autonomous
networks select the routes that they use.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (1)

Packet size issues: • The result of all these


factors is that the network
1. Hardware
designers are not free to
2. Operating system choose any old maximum
3. Protocols packet size they wish.
4. Compliance with • Maximum payloads for
(inter)national standard. some common technologies
5. Reduce error-induced are 1500 bytes for Ethernet
retransmissions and 2272 bytes for 802.11.
6. Prevent packet occupying • IP is more generous, allows
channel too long. for packets as big as 65,515
bytes.
Packet Fragmentation (2)

(a) Transparent fragmentation.


(b) Nontransparent fragmentation
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (3)

Fragmentation when the elementary data size is 1 byte.


(a) Original packet, containing 10 data bytes.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (4)

Fragmentation when the elementary data size is 1 byte


(b) Fragments after passing through a network
with maximum packet size of 8 payload bytes plus header.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (5)

Fragmentation when the elementary data size is 1 byte


(c) Fragments after passing through a size 5 gateway.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet Fragmentation (6)

Path MTU Discovery

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Network Layer Principles (1)

1.Make sure it works 6. Avoid static options


and parameters
2.Keep it simple
7. Look for good design
3.Make clear choices (not perfect)
4.Exploit modularity 8. Strict sending,
5.Expect tolerant receiving
heterogeneity 9. Think about scalability
... 10.Consider
performance and cost
The Network Layer in the Internet (1)

• The IP Version 4 Protocol


• IP Addresses
• IP Version 6
• Internet Control Protocols
• Label Switching and MPLS
• OSPF—An Interior Gateway Routing Protocol
• BGP—The Exterior Gateway Routing Protocol
• Internet Multicasting
• Mobile IP
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Network Layer in the Internet (2)

The Internet is an interconnected collection of many networks.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IP Version 4 Protocol (1)

The IPv4 (Internet Protocol) header.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IP Version 4 Protocol (2)

Some of the IP options.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (1)
• IP addresses are hierarchical, unlike Ethernet addresses.
• Each 32-bit address is comprised of a variable-length
network portion in the top bits and a host portion in the
bottom bits.
• The network portion has the same value for all hosts on a
single network, such as an Ethernet LAN.
• This means that a network corresponds to a contiguous
block of IP address space. This block is called a prefix.

An IP prefix
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (2)
•IP addresses are written in dotted decimal notation. In this
format, each of the 4 bytes is written in decimal, from 0 to 255.
•For example, the 32-bit hexadecimal address 80D00297 is
written as 128.208.2.151.
•Prefixes are written by giving the lowest IP address in the block
and the size of the block.
•The size is determined by the number of bits in the network
portion; the remaining bits in the host portion can vary.
•This means that the size must be a power of two. By
convention, it is written after the prefix IP address as a slash
followed by the length in bits of the network portion.
•In our example, if the prefix contains 28 addresses and so
leaves 24 bits for the network portion, it is written as
128.208.0.0/24.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (3)
• Hierarchical addresses have significant advantages and
disadvantages. The key advantage of prefixes is that routers
can forward packets based on only the network portion of the
address, as long as each of the networks has a unique
address block.
• Using a hierarchy lets Internet routing scale, it has two
disadvantages.
– First, the IP address of a host depends on where it is located in the network.
An Ethernet address can be used anywhere in the world, but every IP address
belongs to a specific network, and routers will only be able to deliver packets
destined to that address to the network. Designs such as mobile IP are needed
to support hosts that move between networks but want to keep the same IP
addresses.
– The second disadvantage is that the hierarchy is wasteful of addresses unless
it is carefully managed.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (3)

Splitting an IP prefix into separate networks with subnetting.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (3)

A set of IP address assignments


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (4)

Aggregation of IP prefixes

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (5)

Longest matching prefix routing at the New York router.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Address Aggregation (1)
Ex. 1: Aggregate the following set of four /24 IP network
addresses to the highest degree possible.
– 212.56.132.0/24
– 212.56.133.0/24
– 212.56.134.0/24
– 212.56.135.0/24
Sol.: List each address in binary format and determine the
common prefix for all of the addresses:
– 212.56.132.0/24 11010100.00111000.10000100.00000000
212.56.133.0/24 11010100.00111000.10000101.00000000
212.56.134.0/24 11010100.00111000.10000110.00000000
212.56.135.0/24 11010100.00111000.10000111.00000000
– Common Prefix: 11010100.00111000.10000100.00000000
Ans: The CIDR aggregation is: 212.56.132.0/22
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Address Aggregation (2)
Ex.2: Aggregate the following set of four /24 IP network addresses to the
highest degree possible.
– 212.56.146.0/24
– 212.56.147.0/24
– 212.56.148.0/24
– 212.56.149.0/24
Sol.: Expanding each address
212.56.146.0/24 11010100.00111000.10010010.00000000
212.56.147.0/24 11010100.00111000.10010011.00000000
212.56.148.0/24 11010100.00111000.10010100.00000000
212.56.148.0/24 11010100.00111000.10010101.00000000
a) Note that this set of four /24s cannot be summarized as a single /23.
– 212.56.146.0/23 11010100.00111000.10010010.00000000
212.56.148.0/23 11010100.00111000.10010100.00000000
b) The CIDR aggregation is:
– 212.56.146.0/23
– 212.56.148.0/23
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (6)

IP address formats

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (7)

Special IP addresses

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Address (8)

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Addresses (9)

Placement and operation of a NAT box.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 Goals
• Support billions of hosts
• Reduce routing table size
• Simplify protocol
• Better security
• Attention to type of service
• Aid multicasting
• Roaming host without changing address
• Allow future protocol evolution
• Permit coexistence of old, new protocols. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (1)

The IPv6 fixed header (required).

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (2)

IPv6 extension headers

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (3)

The hop-by-hop extension header for


large datagrams (jumbograms).
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
IP Version 6 (4)

The extension header for routing.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet Control Protocols (1)
• Apart from IP, network layer also has control protocols
• Internet Control Message Protocol (ICMP)
• Address Resolution Protocol (ARP, RARP, Proxy ARP)
• Dynamic Host Configuration Protocol (DHCP)

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet Control Message Protocol

Type 0 – Echo Code 0 Echo reply Query


Reply

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet Control Protocols (1)

The principal ICMP message types.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Internet Control Protocols (2)

Two switched Ethernet LANs joined by a router

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Label Switching and MPLS (1)

Transmitting a TCP segment using IP, MPLS, and PPP.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Label Switching and MPLS (2)

Forwarding an IP packet through an MPLS network

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway
Routing Protocol (1)

An autonomous system

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway
Routing Protocol (2)

A graph representation of the previous slide.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway
Routing Protocol (3)

The relation between ASes, backbones, and areas in OSPF.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
OSPF—An Interior Gateway
Routing Protocol (4)

The five types of OSPF messages

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BGP—The Exterior Gateway
Routing Protocol (1)
Examples of routing constraints:

1. No commercial traffic for educat. network


2. Never put Iraq on route starting at Pentagon
3. Choose cheaper network
4. Choose better performing network
5. Don’t go from Apple to Google to Apple

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BGP—The Exterior Gateway
Routing Protocol (2)

Routing policies between four Autonomous Systems

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
BGP—The Exterior Gateway
Routing Protocol (3)

Propagation of BGP route advertisements

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Mobile IP
Goals
1. Mobile host use home IP address anywhere.
2. No software changes to fixed hosts
3. No changes to router software, tables
4. Packets for mobile hosts – restrict detours
5. No overhead for mobile host at home.

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

Chapter 5

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

You might also like