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

Chapter_5_part2 (1)

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

Chapter_5_part2 (1)

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

Chapter 5

Network
Layer:
Control
Plane Computer
Networking: A Top-
Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector
 intra-ISP routing: OSPF
 routing among ISPs: BGP  network management,
 SDN control plane configuration
 Internet Control • SNMP
Message Protocol • NETCONF/YANG

Network Layer: 5-2


Dijkstra’s link-state routing
algorithm
 centralized: network topology, notation
link costs known to all nodes
 cx,y: direct link cost from
• accomplished via “link state node x to y; = ∞ if not
broadcast” direct neighbors
• all nodes have same info  D(v): current estimate of
 computes least cost paths cost of least-cost-path from
source to destination v
from one node (“source”) to all  p(v): predecessor node
other nodes along path from source to v
• gives forwarding table for that  N': set of nodes whose least-
node cost-path definitively known

 iterative: after k iterations,


know least cost path to k
destinations
Network Layer: 5-3
Dijkstra’s link-state routing algorithm
1 Initialization:
2 N' = {u} /* compute least cost path from u to all other nodes */
3 for all nodes v
4 if v adjacent to u /* u initially knows direct-path-cost only to direct
neighbors */
5 then D(v) = cu,v /* but may not be minimum cost!
*/
6 else D(v) = ∞
7

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) + cw,v )
13 /* new least-path-cost to v is either old least-cost-path to v or known
14 least-cost-path to w plus direct-cost from w to v */
15 until all nodes in N'

Network Layer: 5-4


Dijkstra’s algorithm: an example
v w x y z
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
Initialization (step 0): For all a: if a adjacent to then D(a) = cu,a
5
find a not in N' such that D(a) is a minimum
3
v w 5 add a to N'
2
update D(b) for all b adjacent to a and not in N' :
u 2 1 z
3 D(b) = min ( D(b), D(a) + ca,b )
1 2
x 1
y

Network Layer: 5-5


Dijkstra’s algorithm: an example
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

resulting least-cost-path tree from u: resulting forwarding table in u:


destinationoutgoing link
v w
v (u,v) route from u to v directly
u z x (u,x)
y (u,x) route from u to
x y w (u,x) all other
x (u,x) destinations via
x Network Layer: 5-6
Dijkstra’s algorithm: another example
v w x y z
D(v), D(w), D(x), D(y), D(z), x
9
Step N' p(v) p(w) p(x) p(y) p(z)

0 u 7,u 3,u 5,u ∞ ∞ 5 7


4
1 uw 6,w 5,u 11,w ∞ 8
2 uwx 6,w 11,w 14,x 3 w z
u y
2
3 uwx 10,v 14,x
3
v 7 4
4 uwxvy 12,y
5 uwxvyz v

notes:
 construct least-cost-path tree by tracing predecessor nodes
 ties can exist (can be broken arbitrarily)

Network Layer: 5-7


Dijkstra’s algorithm: discussion
algorithm complexity: n nodes
 each of n iteration: need to check all nodes, w, not in N
 n(n+1)/2 comparisons: O(n2) complexity
 more efficient implementations possible: O(nlogn)

message complexity:
 each router must broadcast its link state information to other n routers
 efficient (and interesting!) broadcast algorithms: O( n) link crossings to
disseminate a broadcast message from one source
 each router’s message crosses O(n) links: overall message complexity: O(n2)

Network Layer: 5-8


Dijkstra’s algorithm: oscillations possible
 when link costs depend on traffic volume, route oscillations possible
 sample scenario:
• routing to destination a, traffic entering at d, c, e with rates 1, e (<1), 1
• link costs are directional, and volume-dependent

a 2+e
a 0
a 2+e a
1 1+e 0 2+e 0
d b d 1+e 1 b d 0 0 b d 1+e 1 b
0 0
e 1 0 1
1 0
c 0 1 1
c 1+e 1 1 0 0 1
c 1 c
e e e
e
given these costs, given these costs, given these costs,
initially find new routing…. find new routing…. find new routing….
resulting in new resulting in new costs resulting in new costs
costs

Network Layer: 5-9


Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector
 intra-ISP routing: OSPF
 routing among ISPs: BGP
 SDN control plane
 Internet Control Message  network management,
Protocol configuration
• SNMP
• NETCONF/YANG

Network Layer: 5-10


Distance vector algorithm
Based on Bellman-Ford (BF) equation (dynamic programming):

Bellman-Ford equation

Let Dx(y): cost of least-cost path from x to y.


Then:
Dx(y) = minv { cx,v + Dv(y) }

v’s estimated least-cost-path cost to y


min taken over all neighbors v of x direct cost of link from x to v
Network Layer: 5-11
Bellman-Ford Example
Suppose that u’s neighboring nodes, x,v,w, know that for destination z:

Dv(z) = 5 Dw(z) = 3 Bellman-Ford equation says:


5
Du(z) = min { cu,v + Dv(z),
3 w
v 5
cu,x + Dx(z),
2
cu,w + Dw(z) }
u 2 1 z
3
1 = min {2 + 5,
2
x 1
y 1 + 3,
5 + 3} = 4
Dx(z) = 3
node achieving minimum (x) is
next hop on estimated least-
cost path to destination (z)
Network Layer: 5-12
Distance vector algorithm
key idea:
 from time-to-time, each node sends its own distance vector
estimate to neighbors
 when x receives new DV estimate from any neighbor, it updates
its own DV using B-F equation:
Dx(y) ← minv{cx,v + Dv(y)} for each node y ∊ N

 under minor, natural conditions, the estimate Dx(y) converge to


the actual least cost dx(y)

Network Layer: 5-13


Distance vector algorithm:
each node: iterative, asynchronous: each local
iteration caused by:
 local link cost change
wait for (change in local link
cost or msg from neighbor)  DV update message from
neighbor

distributed, self-stopping: each


recompute DV estimates using node notifies neighbors only
DV received from neighbor when its DV changes
 neighbors then notify their
neighbors – only if necessary
if DV to any destination has
 no notification received, no
changed, notify neighbors
actions taken!

Network Layer: 5-14


Distance vector: example
DV in a:
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
t=0 Da(d) = 1
8 1

Da(e) = ∞
 All nodes have Da(f) = ∞ 1 1
distance Da(g) = ∞
estimates to Da(h) = ∞
nearest Da(i) = ∞ A few asymmetries:
neighbors d e f  missing link
(only) 1 1
 larger cost
 All nodes send
their local
distance 1 1 1
vector to their
neighbors
g h i
1 1

Network Layer: 5-15


Distance vector example:
iteration
a b c
8 1

t=1 1 1
All nodes:
 receive
distance
vectors from d e f
neighbors 1 1
 compute their
new local
distance vector 1 1 1
 send their new
local distance
vector to
neighbors g h i
1 1

Network Layer: 5-16


Distance vector example:
iteration
a
compute compute
b compute
c
8 1

t=1 1 1
All nodes:
 receive
distance
vectors from d
compute e
compute compute
f
neighbors 1 1
 compute their
new local
distance vector 1 1 1
 send their new
local distance
vector to
neighbors g
compute h
compute i
compute
1 1

Network Layer: 5-17


Distance vector example:
iteration
a b c
8 1

t=1 1 1
All nodes:
 receive
distance
vectors from d e f
neighbors 1 1
 compute their
new local
distance vector 1 1 1
 send their new
local distance
vector to
neighbors g h i
1 1

Network Layer: 5-18


Distance vector example:
iteration
a b c
8 1

t=2 1 1
All nodes:
 receive
distance
vectors from d e f
neighbors 1 1
 compute their
new local
distance vector 1 1 1
 send their new
local distance
vector to
neighbors g h i
1 1

Network Layer: 5-19


Distance vector example:
iteration
compute
a compute
b compute
c
2 1

t=2 1 1
All nodes:
 receive
distance
vectors from d
compute compute
e compute
f
neighbors 1 1
 compute their
new local
distance vector 1 1 1
 send their new
local distance
vector to
neighbors g
compute compute
h compute
i
8 1

Network Layer: 5-20


Distance vector example:
iteration
a b c
8 1

t=2 1 1
All nodes:
 receive
distance
vectors from d e f
neighbors 1 1
 compute their
new local
distance vector 1 1 1
 send their new
local distance
vector to
neighbors g h i
1 1

Network Layer: 5-21


Distance vector example:
iteration

…. and so on

Let’s next take a look at the iterative computations at nodes

Network Layer: 5-22


DV in c:
Distance vector example: DV in b:
Dc(a) = ∞
computation Db(a) = 8 Db(f) = ∞ Dc(b) = 1
Db(c) = 1 Db(g) = ∞ Dc(c) = 0
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(d) = ∞
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(e) = ∞
Da(b) = 8 Dc(f) = ∞
Da(c) = ∞ a b c
8 1 Dc(g) = ∞
Da(d) = 1 Dc(h) = ∞
t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(i) = ∞
 b Da(g) = ∞ DV in e:
receives Da(h) = ∞ De(a) = ∞
DVs from Da(i) = ∞ De(b) = 1
a, c, e d e f
1 1 De(c) = ∞
De(d) = 1
De(e) = 0
De(f) = 1
1 1 1
De(g) = ∞
De(h) = 1
De(i) = ∞
g h i
1 1

Network Layer: 5-23


Distance vector example: DV in b:
DV in c:
Dc(a) = ∞
computation Db(a) = 8 Db(f) = ∞ Dc(b) = 1
Db(c) = 1 Db(g) = ∞ Dc(c) = 0
DV in a:
Db(d) = ∞ Db(h) = ∞ Dc(d) = ∞
Da(a)=0
Db(e) = 1 Db(i) = ∞ Dc(e) = ∞
Da(b) = 8
Da(c) = ∞ Dc(f) = ∞
a b
t=1 Da(d) = 1 8 compute 1
c Dc(g) = ∞
Dc(h) = ∞
Da(e) = ∞
Da(f) = ∞ Dc(i) = ∞
 b receives
DVs from 1 1
Da(g) = ∞ DV in e:
a, c, e,
computes: Da(h) = ∞
e De(a) = ∞
Da(i) = ∞
De(b) = 1
d e f De(c) = ∞
1
Db(a) = min{cb,a+Da(a), cb,c +Dc(a), cb,e+De(a)} = min{8,∞,∞} =8 1
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1
De(d) = 1
De(e) = 0
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2
1 (e)} = min{∞,∞,1} =
11 De(f) = 1
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +D 1
e
DV in b: De(g) = ∞
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2 De(h) = 1
Db(a) = 8 Db(f) =2
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = ∞ De(i) = ∞
g Db(c) = 1 Db(g) = ∞
h i
1 ∞, 2} = 2
Db(h) = min{cb,a+Da(h), cb,c +Dc(h), c b,e+De(h)} = min{∞, Db1(d) = 2 Db(h) = 2
Db(i) = min{cb,a+Da(i), cb,c +Dc(i), c b,e+De(i)} = min{∞, ∞, ∞} = ∞ Db(e) = 1 Db(i) = ∞
Network Layer: 5-24
Distance vector example: DV in c:
DV in b:
Dc(a) = ∞
computation Db(a) = 8 Db(f) = ∞ Dc(b) = 1
Db(c) = 1 Db(g) = ∞ Dc(c) = 0
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(d) = ∞
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(e) = ∞
Da(b) = 8
Dc(f) = ∞
Da(c) = ∞ a b c
1 Dc(g) = ∞
Da(d) = 1 8
Dc(h) = ∞
Da(e) = ∞
t=1 Da(f) = ∞
1 1
Dc(i) = ∞

 c Da(g) = ∞ DV in e:
receives Da(h) = ∞
De(a) = ∞
DVs Da(i) = ∞
from b De(b) = 1
d e f De(c) = ∞
1 1
De(d) = 1
De(e) = 0
De(f) = 1
1 1 1
De(g) = ∞
De(h) = 1
De(i) = ∞
g h i
1 1

Network Layer: 5-25


Distance vector example: DV in b: DV in c:
computation Db(a) = 8 Db(f) = ∞
Dc(a) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Dc(e) = ∞
a b c
compute Dc(f) = ∞
8 1
Dc(g) = ∞
Dc(h) = ∞
t=1 1 1 Dc(i) = ∞
 c receives DVs
from b
computes:
Dc(a) = min{cc,bd+Db(a}} = 1 + 8 = 9 e DV in c:
f
Dc(b) = min{cc,b+Db(b)} = 1 + 0 = 1 Dc(a) = 9
Dc(d) = min{cc,b+Db(d)} = 1+ ∞ = ∞ Dc(b) = 1
Dc(e) = min{cc,b+Db(e)} = 1 + 1 = 2
Dc(c) = 0
Dc(d) = 2
Dc(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞
Dc(e) = ∞
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞
Dc(f) = ∞
g+Db(h)} = 1+ ∞ = ∞
Dc(h) = min{cbc,b
h Dc(g) = ∞ i
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞ Dc(h) = ∞
Dc(i) = ∞ Network Layer: 5-26
Distance vector example: DV in
computation Db(a) =b:D (f) = ∞
b
8 Db(g) =
Db(c) = ∞ DV in
DV in 1 Db(h) = e:
d: Db(d) = ∞
De(a) =
∞ Db(i)
Dc(a) = a b c =∞ ∞
1 8 Db(e)
1 =
1 De(b) =
Dc(b) =
t=1 ∞ Q: what is new DV computed 1
De(c) =
Dc(c) = 1 in e 1at t=1?
 e receives DVs ∞
from b, d, f, h ∞ De(d) =
Dc(d) =
1
0 De(e)in=
d compute
e f DV
Dc(e) = 1 1
DV in 0
f:
1 De(f) =
h:=
Dc(f) Dc(a) =
1
DcD
∞ (a)(g)
= ∞
c 1 1 1 De(g) =
∞1
= Dc(b) =

Dc(h)
D (b) == ∞
c De(h) =

∞ Dc(c) =
1
Dc(i)
D (c)== g h i ∞
c
1 1 De(i) =

∞ Dc(d) =

Dc(d) = ∞ Network Layer: 5-27
∞ D (e) =
Distance vector: state
information diffusion
Iterative communication, computation steps diffuses information through network:

t=0 c’s state at t=0 is at c only


a b c
8 1
c’s state at t=0 has propagated to b, and
t=1 may influence distance vector
computations up to 1 hop away, i.e., at b
1 1 t=1
c’s state at t=0 may now influence t=2
t=2 distance vector computations up to 2 hops
away, i.e., at b and now at a, e as well d e f
1 1
c’s state at t=0 may influence distance
t=3 vector computations up to 3 hops away,
i.e., at b,a,e and now at c,f,h as well 1 1 1 t=3

c’s state at t=0 may influence distance


t=4 vector computations up to 4 hops away, g h i
i.e., at b,a,e, c, f, h and now at g,i as well 1 1
t=4
Distance vector: link cost changes
link cost changes: 1
 node detects local link cost change y
4 1
 updates routing info, recalculates local DV x z
50
 if DV changes, notify neighbors

t0 : y detects link-cost change, updates its DV, informs its neighbors.


“good t1 : z receives update from y, updates its table, computes new
news least cost to x , sends its neighbors its DV.
travels
fast” t2 : y receives z’s update, updates its distance table. y’s least
costs do not change, so y does not send a message to z.

Network Layer: 5-29


Distance vector: link cost changes
link cost changes: 60
 node detects local link cost change y
4 1
 “bad news travels slow” – count-to-infinity problem: x z
50
• y sees direct link to x has new cost 60, but z has said it has a path at cost of
5. So y computes “my new cost to x will be 6, via z); notifies z of new cost of
6 to x.
• z learns that path to x via y has new cost 6, so z computes “my new cost
to x will be 7 via y), notifies y of new cost of 7 to x.
• y learns that path to x via z has new cost 7, so y computes “my new
cost to x will be 8 via y), notifies z of new cost of 8 to x.
• z learns that path to x via y has new cost 8, so z computes “my new cost
to x will be 9 via y), notifies y of new cost of 9 to x.

 Distributed algorithms are tricky!
Network Layer: 5-30
Distance vector: another example
cost to cost to
Dx() x y z x y z
x 0 2 7 x 0 2 3

from
from

y ∞∞ ∞ y 2 0 1 Dx(z) = min{cx,y+ Dy(z), cx,z+ Dz(z)}


z ∞∞ ∞ z 7 1 0
= min{2+1 , 7+0} = 3
cost to y
Dy() x y z
Dx(y) = min{cx,y + Dy(y), cx,z+ Dz(y)}
2 1
x ∞ ∞ ∞ = min{2+0 , 7+1} = 2
x z
7
from

y 2 0 1
z ∞∞ ∞

cost to
Dz() x y z
x ∞∞ ∞
from

y ∞∞ ∞
z 7 1 0
time Network Layer: 5-31
Distance vector: another example
cost to cost to cost to
Dx() 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 y 2 0 1

from
z ∞∞ ∞ z 7 1 0 z 3 1 0

cost to cost to cost to y


Dy() x y z x y z x y z 2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3
x z
7
from

y 2 0 1 y 2 0 1
from
y 2 0 1

from
z ∞∞ ∞ z 7 1 0 z 3 1 0

cost to cost to cost to


Dz() x y z x y z x y z

x ∞∞ ∞ x 0 2 7 x 0 2 3
from

from
y 2 0 1 y 2 0 1
from

y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time Network Layer: 5-32
Comparison of LS and DV algorithms
message complexity robustness: what happens if
LS: n routers, O(n2) messages sent router malfunctions, or is
DV: exchange between neighbors; compromised?
convergence time varies
LS:
• router can advertise incorrect link
speed of convergence cost
• each router computes only its own
LS: O(n2) algorithm, O(n2)
table
messages
• may have oscillations DV:
DV: convergence time varies • DV router can advertise incorrect
• may have routing loops path cost (“I have a really low cost
• count-to-infinity problem path to everywhere”): black-holing
• each router’s table used by others:
error propagate thru network
Network Layer: 5-33

You might also like