Академический Документы
Профессиональный Документы
Культура Документы
Network Layer!
CS655!
9-1!
A note on the
use of these
ppt slides:
All
material
copyright
19962010
J.F
Kurose
and K.W.
Ross, All
Rights
Reserved
th
2
0
0
9
.
"
!
5 edition. "
Jim
Kurose,
Keith
Ross"
Computer
Networking: A Addison
Top Down
Wesley,
Approach "
April
CS65 5!
9-2!
Network layer!
ents
trans into
data
port gram
segm s!
ent
from
sendi
ng to
recei
ving
host !
on
sendin
g side
encap
sulate
s
segm
app
licat
ion!
trans
port!
!
data
link
!
n
e
t
w
o
r
k
!
d
a
t
a
l
i
n
k
!
p
h
y
s
i
c
a
l
!
network!
data link!
physical
network!
data link!
physical
!
network!
data link!
physical
!
network!
data link!
physical
m
on en
r t
es
ct
eio
vi
nt
gr
si a
dn
es
, p
do
elr
iv t
el
r a
y
se
sr
e!
g
ni
etn
we
ov
re
kr
ly
ah
yo
es
rt
,
p
rr
oo
tu
ot
ce
or
l!
s
!
netw
ork!
d
a
t
a
li
n
k
!
p
h
y
s
i
c
a
l
!
network!
netw
data link!
physical
data link!
physical
!
network!
!
data link!
network!
physical
data link!
physical
C
data
phys
application!
transport!
!
data link!
physical
server
application
application
transport
transport
network
network
network
network
link
link
link
link
physical
physical
physical
physical
router router
CS655!
9-4!
Internet Protocols!
Application! FTP Telnet NFS SMTP HTTP !
Transport!
TCP!
UDP!
Segment!
Network!
Datagram!
Data Link!
Physical!
Radio!
CS655!
9-5!
Frame!
VCs)!
transport: between two processes!
CS655!
9-6!
3
2
2
1
value in arriving
packets header
0111
3 2
CS655!
9-7!
s : host-to-host!
e no choice: network provides
r
v one or the other!
i
c implementation: in network
e
core!
CS655!
9-8!
Virtual Circuits!
source-to-destination path behaves much like telephone
circuit!
p formance-wise!
e network actions along
r source-to-destination path!
Vifier (not
each passing
Cdestination host
connection!
call setup, teardown address)!
link, router resources
i
(bandwidth, buffers)
for each call before
every
router
on
d sourcemay be allocated to
data can flow!
e destination
VC (dedicated
maintains resources =
each packet carries nt path
predictable service)!
state for
!
CS655!
9-9!
Datagram networks!
no call setup at network layer!
routers: no state about end-to-end connections!
no network-level concept of connection!
different paths!
application!
transport!
application!
transport!
2. Receive data network!
data link!
data link!
physical
physical
CS655!
9-10!
routing algorithm
IP destination
address in
arriving
packets
individual
destination
address!
list range
of
addresse
s!
(aggregat
e table
entries)!
2
2
1
h
e
a
d
e
1
3
CS655!
9-11!
otherwise
timing req. !
(computers)!
can adapt, perform control,
error recovery!
simple inside network,
complexity at edge!
dum
ATM (VC)!
evolved from
telephony!
end
human
syst
ems!
conversation: !
strict
telep
timing,
reliabilit
y
require
ments!
hone
s!
complexity
inside
network!
need for
guaranteed
service!
CS655!
9-13!
switching!
fabric!
!
processor!
9-14!
link !
layer !
protocol!
(receive)!
lookup,!
forwarding!
switch!
fabric!
queueing!
Physical layer:!
bit-level reception!
Data link layer:! e.g., Ethernet!
De
ce
ntr
aliz
ed
swi
tch
ing
:!
given
datagram
destination,
queuing:
if datagrams
arrive faster than
forwarding rate into
switch fabric!
CS655!
9-15!
Network!
layer!
IP protocol!
addressing conventions!
Routing protocols!
path selection!
RIP, OSPF, BGP!
datagram format!
packet handling conventions!
forwarding!
table!
ICMP protocol!
error reporting!
router signaling!
Link layer!
Physical layer!
CS655!
9-16!
IP datagram format!
IP protocol
ve
rsi
on
!
nu
m
be
r
header
l
e
n
g
t
h
!
(
b
y
t
remaining hops!
e
(decremented at
s
! each router)!
)
upper layer
t protocol! to deliver
y payload to!
p
e
o
f
d
a
t
a
m
ax
nu
m
be
r!
32 bits
head.! type of!
ver len service
16-bit identifier
time to!
upper!
live
layer
total datagram!
length (bytes)!
length
fragment!
flgs
offset
header!
for!
fragmentation/!
reassembly!
checksum
E.g. timestamp,!
record route!
taken, specify!
data !
(variable length,!
list of routers !
typically a TCP !
to visit.!
or UDP segment)
CS655!
9-17!
(maximum transmission
unit): largest possible linklevel
frame.!
different link types,
different MTUs !
large IP datagram
divided (fragmented)
within net!
one datagram
becomes several
datagrams!
reassembled only at
final destination!
IP header bits
us
ed
to
id
en
tify
,
or
de
r
rel
at
ed
fra
g
m
ents!
o
ut
:
3
s
m
al
le
fragmentatio
n: !
in: one large
datagram!
CS655!
9-18!
r
datag
rams!
reassembly!
IP Addressing: introduction!
223.1
.1.1!
IP address: 32-bit
identifier for
host, router
interface !
interface:
connectio
n
between
host/route
r
and
physical
link!
223
.1.1
.2!
223.1
.1.4!
223.1.
2.9!
21.2.1!
2
3
.
223.1.1.3
223.1.3.27!
s
routers typically
have
t
multiple interfaces!
223.1.2.2!
t
y
p
i
c
a
l
l
y
h
a
s
IP addresses associated
1!
1!
Subnets!
IP
add
res
s: !
s
u
b
n
e
t
p
a
r
t
(
h
i
g
h
o
r
d
e
r
b
i
t
s
)
!
host
part
(low
orde
r
bits)
!
Wh
ats a
subn
et ?!
d
e
v
i
c
e
i
n
t
e
r
f
a
c
e
s
w
i
t
h
s
a
m
e
s
u
b
n
e
t
p
a
rt
o
f
I
P
a
dd
re
ss
!
c
a
n
p
h
y
s
i
c
a
l
l
y
r
e
a
c
h
e
a
c
h
o
t
h
e
r
w
i
th
o
ut
in
te
rv
e
ni
n
g
ro
ut
er
!
223.1.1.
1!
223.1.2.1!
223.1.1.
2!
223.
1.1.4
!
223.
1.2.9
!
223.1.1.
3!
223.1.3.2
7!
223.1.2.
2!
!
2
2
3
.
1
.
3
.
Sub
net
1
.
!
(223.1 ) !
.3.0/24
CS6 55!
9-20!
IPv6!
Initial motivation: 32-bit address space soon to be completely allocated.
Additional motivation:!
header format helps speed processing/forwarding!
header changes to facilitate QoS !
CS655!
9-21!
flow label!
payload len!
next hdr!
source address!
(128 bits)!
destination address!
(128 bits)!
data!
32 bits!
CS655!
9-22!
hop limit!
CS655!
9-23!
3
2
2
1
value in arriving
packets header
0111
3 2
CS655!
9-24!
Graph abstraction!
5
2
Graph: G=(N,E)!
3 w
x!
5
1
z!
2
9-25!
iterative
Global:!
di
process of
computation
, exchange
of info with
neighbors!
complete topology,
link cost info!
Decentralized: !
9-26!
sta
nc
e
ve
cto
r
(D
V)
alg
ori
th
ms
!
Static or
dynamic?!
Static: !
routes
change slowly
over time!
Dynamic: !
routes
change more
quickly!
periodic
update!
in response
to link cost
changes!
Dijkstras algorithm: computes least cost paths from one node (source) to
all other nodes!
gives forwarding table for that node!
CS655!
9-27!
definitively known!
Dijsktras Algorithm!
current value of cost
of path from source to
1 Initialization:
3
4
8
9
10
11
12
13
14
15
2 N' = {u}
destination v!
for all nodes v
if v adjacent to u
5
then
= c(u,v)
6
else D(v) =
7
Loop
find w not in N' such that D(w) is a minimum
add w to N'
update D(v) for all v adjacent to w and not in N' :
D(v) = min( D(v), D(w) + c(w,v) )
/* new cost to v is either old cost to v or known
shortest path cost to w plus cost from w to v */
until all nodes in N'
CS655!
9-28!
N'
u
ux
uxyv
uxyvw
uxyvwz
D(v),p(v) D(w),p(w)
2,u
5,u
2,u
4,x
2,u
3,y
3,y
1,u
!
2,x
4,y
4,y
4,y
5
2
x!
1
CS655!
3 w
9-29!
3
1
z!
2
z!
x!
9-30!
18!
(dynamic programming)!
y!
Define!
dx(y) := cost of least-cost path from x to y!
2
5
!
!
Then!
2!
2
0
!
3!
3!
CS655!
9-31!
Bellman-Ford example !
5
2
3 w
x!
1
3
1
z!
Node that
achieves
min
imu
m
5 + 3} = 4!
is next! hop forwarding
in shortest table!
path
CS655!
9-32!
Dv = [Dv(y): y $ N ]!
from time-to-time, each node sends its own distance vector estimate to
neighbors!
CS655!
9-33!
Distributed:!
wait for
(change in
local link
cost or
msg from
neighbor)
recompute estimates
neighbors if necessary!
CS655!
9-34!
t
o
!
node x table!
node y table!
from
cost to!
x y z!
x! ! ! !
y! 2 0 1!
z! !! !
node z table!
c
o
s
t
from
y! 2 0 1!
z! 7 1 0!
from
y! !! !
z! !! !
cost to!
x y z!
x! 0! 2 !3!
!
from
cost to!
x y z!
x! 0 2 7!
z
!
x! !
y! !! !
z! 7! 1! 0!
= min{2+1 , 7+0} = 3!
2 1
CS655!
9-35!
time!
z!
Dx(y) =
min{c(x,y) +
Dy(y), c(x,z)
+ Dz(y)} "
Dx(z) = min{c(x,y) + "
= min{2+0 , 7+1} = 2!
Dy(z), c(x,z) +
node x table!
!from
from
x! 0 2 3!
!from
from
y! !! !
z! !! !
cost to!
x y z!
x! 0 2 7!
z! !! !
node z table!
z!
y!
z!
2 0 1!
7 1 0!
cost to! x y z!
x! 0 2 7!
y!
z!
y!
z!
2 0 1! 7 1 0!
cost to! x y z!
x! 0 2 7!
0!
cost to!
x y
!from
from
= min{2+1 , 7+0
cost to! x y z!
2 0 1!
31
x y z!
x! 0 2 3!
cost to! x
y z!
fro
cost to!
S6
55!
9-36!
z!
3 1 0!
ti
m
e
!
Speed of Convergence!
Robustness:
what
happens if
router
malfunction
s?!
LS: !
node can
advertise
incorrect
link cost!
each
node
computes
only its
own table!
DV:!
DV
nod
e
can
adve
rtise
incor
rect
path
cost!
each
nodes
table
used by others !
error
propagate thru
CS655!
9-37!
network!
Hierarchical Routing!
So far we assumed!
each network admin may want to control routing in its own network!
!
CS655 !
9-38!
Hierarchical Routing!
aggregate routers into regions, autonomous systems (AS)!
gateway router!
at
edge
of
its
own
has
i
another
!
AS!
link to nAS!
router
CS655!
9-39!
from router A to
u! v!
A
x! z! C!
B
D
shops!
u 21
w!b 22
n 23
e 24
y! t
25
26
1!
2!
2!
3!
3!
2!
destination subnets:!
RIP: Example !
z!
w!
x!
A!
y!
D!
B!
C!
routing table in router D!
destination subnet
next router
# hops to dest
w
y
z
x
A
B
B
--
2
2
7
1
....
CS655!
9-41!
RIP: Example !
dest
w
x
z
.
w!
A-to-D advertisement!
next hops
1
1
C
4
...
z!
x!
A!
y!
D!
B!
C!
routing table in router D!
destination subnet
next router
# hops to dest
w
y
z
x
A
B
B A
--
2
2
7
1
....
CS655!
9-42!
OSPF advertisement
carries one entry per
neighbor router!
algorithm !
LS packet
r te computation using
dissemination! o Dijkstras algorithm!
topology map at u
each node!
t to entire AS
advertis e(via flooding)!
ements d
carried in
dissemina
9-43!
9-44!
Hierarchical OSPF!
boundary router!
backbone router!
backbone!
area!
border!
routers!
Area 3!
internal!
Area 1!
routers!
Area 2!
CS655!
9-45!
Hierarchical OSPF!
two-level hierarchy: local area, backbone.!
9-46!