Professional Documents
Culture Documents
Chapter goals:
understand principles behind network layer
services:
routing (path selection)
dealing with scale
how a router works
on receiving side,
network
data link
network
physical
delivers segments to data link
physical
transport layer network
network
network layer protocols
data link
data link
physical
physical
passing through it
Routing algorithms
routing algorithm
value in arriving
packet’s header
0111 1
3 2
call setup, teardown for each call before data can flow
each packet carries VC identifier (not destination host
address)
every router on source-dest path maintains “state” for
each passing connection
link, router resources (bandwidth, buffers) may be
allocated to VC
application
6. Receive data application
transport 5. Data flow begins
network 4. Call connected 3. Accept call transport
data link 1. Initiate call 2. incoming call network
data link
physical
physical
12 22 32
1 3
2
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …
application
application
transport
transport
network
data link 1. Send data 2. Receive data network
data link
physical
physical
otherwise 3
Examples
Internet ATM
data exchange among evolved from telephony
computers
human conversation:
“elastic” service, no strict
strict timing, reliability
timing req.
requirements
“smart” end systems
need for guaranteed
(computers)
service
can adapt, perform
“dumb” end systems
control, error recovery
telephones
simple inside network,
complexity inside
complexity at “edge”
network
many link types
different characteristics
uniform service difficult
Network Layer 4-13
The Internet Network layer
Host, router network layer functions:
Link layer
physical layer
Recipe
To determine the
subnets, detach each
interface from its
host or router,
creating islands of
isolated networks.
Each isolated network
is called a subnet. 223.1.3.0/24
223.1.1.3
223.1.9.2 223.1.7.0
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
Network Layer 4-22
IP addresses: how to get one?
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”
“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
A B C D E F
Physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
data data
A-to-B: E-to-F:
B-to-C: B-to-C:
IPv6 IPv6
IPv6 inside IPv6 inside
IPv4 IPv4
Network Layer 4-39
Interplay between routing and
forwarding
routing algorithm
value in arriving
packet’s header
0111 1
3 2
v 3 w
2 5
u 2 1 z
3
1 2
x 1
y
Graph: G = (N,E)
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
1 A A A A
1+e 2+e 0 0 2+e 2+e 0
D 0 0 B D 1+e 1 B D B D 1+e 1 B
0 0
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing
Network Layer 4-47
Distance Vector Algorithm (1)
Bellman-Ford Equation (dynamic programming)
Define
dx(y) := cost of least-cost path from x to y
Then
At all nodes, X:
1 Initialization:
2 for all adjacent nodes v:
3 DX(*,v) = infinity /* the * operator means "for all rows" */
X
4 D (v,v) = c(X,v)
5 for all destinations, y
X
6 send min D (y,w) to each neighbor /* w over all X's neighbors */
w
Y
2 1
X Z
7
Y
2 1
X Z X Z
7 D (Y,Z) = c(X,Z) + minw{D (Y,w)}
= 7+1 = 8
X Y
D (Z,Y) = c(X,Y) + minw {D (Z,w)}
= 2+1 = 3
algorithm
terminates
“good
news
travels
fast”
algorithm
continues
on!
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
Forwarding table is
configured by both
intra- and inter-AS
Intra-AS
Routing
Inter-AS
Routing routing algorithm
algorithm
Intra-AS sets entries
algorithm
Forwarding for internal dests
table
Inter-AS & Intra-As
sets entries for
external dests
Network Layer 4-63
Inter-AS tasks AS1 needs:
Suppose router in AS1 1. to learn which dests
receives datagram for are reachable through
which dest is outside AS2 and which
of AS1 through AS3
Router should forward 2. to propagate this
packet towards on of
reachability info to all
the gateway routers,
but which one? routers in AS1
Job of inter-AS routing!
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
Network Layer 4-64
Example: Setting forwarding table
in router 1d
u destination hops
v
u 1
A B w v 2
w 2
x 3
x y 3
z C D z 2
y
C
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B 7
x -- 1
…. …. ....
Routing table in D
C
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B A 7 5
x -- 1
…. …. ....
Routing table in D Network Layer 4-71
RIP: Link Failure and Recovery
If no advertisement heard after 180 sec -->
neighbor/link declared dead
routes via neighbor invalidated
new advertisements sent to neighbors
neighbors in turn send out new advertisements (if
tables changed)
link failure info quickly propagates to entire net
poison reverse used to prevent ping-pong loops
(infinite distance = 16 hops)
Transport Transport
(UDP) (UDP)
network forwarding forwarding network
(IP) table table (IP)
link link
physical physical
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
eBGP session
iBGP session
Network Layer 4-79
Distributing reachability info
With eBGP session between 3a and 1c, AS3 sends prefix
reachability info to AS1.
1c can then use iBGP do distribute this new prefix reach info
to all routers in AS1
1b can then re-advertise the new reach info to AS2 over the
1b-to-2a eBGP session
When router learns about a new prefix, it creates an entry
for the prefix in its forwarding table.
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
eBGP session
iBGP session
Network Layer 4-80
Path attributes & BGP routes
When advertising a prefix, advert includes BGP
attributes.
prefix + attributes = “route”
Two important attributes:
AS-PATH: contains the ASs through which the advert
for the prefix passed: AS 67 AS 17
NEXT-HOP: Indicates the specific internal-AS router to
next-hop AS. (There may be multiple links from current
AS to next-hop-AS.)
When gateway router receives route advert, uses
import policy to accept/decline.
Policy:
Inter-AS: admin wants control over how its traffic
routed, who routes through its net.
Intra-AS: single admin, so no policy decisions needed
Scale:
hierarchical routing saves table size, reduced update
traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance
Physical layer:
bit-level reception
Data link layer: Decentralized switching:
e.g., Ethernet given datagram dest., lookup output port
see chapter 5 using forwarding table in input port
memory
goal: complete input port processing at
‘line speed’
queuing: if datagrams arrive faster than
forwarding rate into switch fabric
System Bus