Академический Документы
Профессиональный Документы
Культура Документы
8 Routing algorithms
value in arriving
packets header
0111 1
3 2
Graph abstraction
v 3 w
2 5
u 2 z
1
3
1
x y 2
1
Graph: G = (N,E)
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (u,w), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Dijsktras Algorithm
1 Initialization: 5
2 N' = {u}
3 for all nodes v v 3 w
2 5
4 if v adjacent to u
u 2 z
5 then D(v) = c(u,v) 1
3
6 else D(v) = 1
x y 2
7 1
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'
v 3 w
2 5
u 2 z
1
3
1
x y 2
1
Bellman-Ford example
5
Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
v 3 w
2 5
u 2 z B-F equation says:
1
3
1 du(z) = min { c(u,v) + dv(z),
x y 2
1 c(u,x) + dx(z),
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3,
5 + 3} = 4
Node that achieves minimum is next
hop in shortest path forwarding table
Dr. Vicente Alarcn Aquino
Copyright 1996-2017 J.F Kurose 199
and K.W. Ross
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z)= min{c(x,y) + Dy(z), c(x,z) + Dz(z)}
= min{2+0 , 7+1} = 2 = min{2+1 , 7+0} = 3
node x table
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y y 2 0 1
from
y 2 0 1
z z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x x 0 2 7
from x 0 2 3 x z
y 2 0 1 y 2 0 1
from
from
y 2 0 1 7
z z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z
x x 0 2 7 x 0 2 3
from
y 2 0 1 from y 2 0 1
from
y
z 71 0 z 3 1 0 z 3 1 0
Dr. Vicente Alarcn Aquino
time
Copyright 1996-2017 J.F Kurose 200
and K.W. Ross
Comparison
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
Forwarding table is
configured by both intra-
and inter-AS routing
Intra-AS Inter-AS
Routing Routing algorithm
algorithm algorithm
Intra-AS sets entries for
Forwarding internal dests
table
Inter-AS & Intra-As sets
entries for external dests
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
eBGP session
iBGP session
Dr. Vicente Alarcn Aquino
Copyright 1996-2017 J.F Kurose 208
and K.W. Ross
Error Correction:
receiver identifies and corrects bit error(s) without
resorting to retransmission
Half-duplex and full-duplex
with half duplex, nodes at both ends of link can
transmit, but not at same time
Adaptors Communicating
datagram
link layer protocol rcving
sending node
node
frame frame
adapter adapter
link layer implemented in receiving side
adaptor (aka NIC) looks for errors, rdt, flow
Ethernet card, 802.11 card control, etc
sending side: extracts datagram, passes to
encapsulates datagram in a rcving node
frame adapter is semi-autonomous
adds error checking bits, rdt link & physical layers
(reliable data transfer), flow
control, etc.
Parity Checking
0 0
CRC Example
if we divide by D.2r
G, want remainder R
D .2 r
R = remainder[ ]
G