0% found this document useful (0 votes)
17 views53 pages

Lecture - 18 - Chapter 5 - 24 Oct 2024

Uploaded by

Usman Butt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views53 pages

Lecture - 18 - Chapter 5 - 24 Oct 2024

Uploaded by

Usman Butt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

National University of

Computer & Emerging Sciences


CS 3001 – COMPUTER NETWORKS

Lecture 18
Chapter 5

24th October, 2024

Nauman Moazzam Hayat


[email protected]
Office Hours: 02:00 pm till 04:30 pm (Every Tuesday & Thursday)
Chapter 5
Network Layer:
Control Plane
A note on the use of these PowerPoint slides:
We’re making these slides freely available to all (faculty, students,
readers). They’re in PowerPoint form so you see the animations; and
can add, modify, and delete slides (including this one) and slide
content to suit your needs. They obviously represent a lot of work on
our part. In return for use, we only ask the following:
▪ If you use these slides (e.g., in a class) that you mention their
source (after all, we’d like people to use our book!)
▪ If you post any slides on a www site, that you note that they are
adapted from (or perhaps identical to) our slides, and note our
copyright of this material.
Computer Networking: A
For a revision history, see the slide note for this page.
Top-Down Approach
Thanks and enjoy! JFK/KWR 8th edition
All material copyright 1996-2023
Jim Kurose, Keith Ross
J.F Kurose and K.W. Ross, All Rights Reserved Pearson, 2020
Network layer control plane: our goals

▪understand principles ▪ instantiation, implementation


behind network control in the Internet:
plane: • OSPF, BGP
• traditional routing • OpenFlow, ODL and ONOS
algorithms controllers
• SDN controllers • Internet Control Message
• network management, Protocol: ICMP
configuration • SNMP, YANG/NETCONF

Network Layer: 5-3


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 Message • SNMP
Protocol • NETCONF/YANG

Network Layer: 5-4


Network-layer functions

▪ forwarding: move packets from router’s


input to appropriate router output data plane
▪ routing: determine route taken by
packets from source to destination control plane

Two approaches to structuring network control plane:


▪ per-router control (traditional)
▪ logically centralized control (software defined networking)

Network Layer: 5-5


Per-router control plane
Individual routing algorithm components in each and every
router interact in the control plane

Routing
Algorithm
control
plane

data
plane

values in arriving
packet header
0111 1
2
3

Network Layer: 5-6


Software-Defined Networking (SDN) control plane
Remote controller computes, installs forwarding tables in routers

Remote Controller

control
plane

data
plane

CA
CA CA CA CA
values in arriving
packet header

0111 1
2
3

Network Layer: 5-7


Per-router
SDN control plane
control plane
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 Message • SNMP
Protocol • NETCONF/YANG

Network Layer: 5-9


Routing protocols
mobile network
Routing protocol goal: determine national or global ISP
“good” paths (equivalently, routes),
from sending hosts to receiving host,
through network of routers
application
▪ path: sequence of routers packets transport
network
traverse from given initial source link
host to final destination host physical
network network
link
▪ “good”: least “cost”, “fastest”, “least
link
physical physical

congested”
network
▪ routing: a “top-10” networking link
physical
network
link

challenge! physical network


link datacenter
physical network

application
transport
network
enterprise link
network physical

Network Layer: 5-10


Graph abstraction: link costs
5
ca,b: cost of direct link connecting a and b
v 3
w e.g., cw,z = 5, cu,z = ∞
2 5
u 2 1 z
3 cost defined by network operator:
1 2
x y could always be 1, or inversely related
1
to bandwidth, or inversely related to
congestion
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) }

Network Layer: 5-11


Routing algorithm classification
global: all routers have complete
topology, link cost info
• “link state” algorithms
How fast
dynamic: routes change
do routes static: routes change more quickly
change? slowly over time • periodic updates or in
response to link cost
changes
decentralized: iterative process of
computation, exchange of info with neighbors
• routers initially only know link costs to
attached neighbors
• “distance vector” algorithms
global or decentralized information? Network Layer: 5-12
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 Message • SNMP
Protocol • NETCONF/YANG

Network Layer: 5-13


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

Network Layer: 5-14


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-15
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
2
3
4
5

5 Initialization (step 0):


For all a: if a adjacent to u then D(a) = cu,a
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
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
3
4
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5
u 2 1 z
3
1 2
x 1
y
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
3
4
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5 11 update D(b) for all b adjacent to a and not in N' :
u 2 1 z D(b) = min ( D(b), D(a) + ca,b )
3
1 2 D(v) = min ( D(v), D(x) + cx,v ) = min(2, 1+2) = 2
x 1
y
D(w) = min ( D(w), D(x) + cx,w ) = min (5, 1+3) = 4
D(y) = min ( D(y), D(x) + cx,y ) = min(inf,1+1) = 2
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
3
4
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5
u 2 1 z
3
1 2
x 1
y
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
4
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5 11 update D(b) for all b adjacent to a and not in N' :
u 2 1 z D(b) = min ( D(b), D(a) + ca,b )
3
1 2
x y D(w) = min ( D(w), D(y) + cy,w ) = min (4, 2+1) = 3
1 D(z) = min ( D(z), D(y) + cy,z ) = min(inf,2+2) = 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
4
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5
u 2 1 z
3
1 2
x 1
y
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
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5 11 update D(b) for all b adjacent to a and not in N' :
u 2 1 z D(b) = min ( D(b), D(a) + ca,b )
3
1 2
x y D(w) = min ( D(w), D(v) + cv,w ) = min (3, 2+3) = 3
1
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
5
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5
u 2 1 z
3
1 2
x 1
y
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
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5 11 update D(b) for all b adjacent to a and not in N' :
u 2 1 z D(b) = min ( D(b), D(a) + ca,b )
3
1 2
x y D(z) = min ( D(z), D(w) + cw,z ) = min (4, 3+5) = 4
1
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
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5
u 2 1 z
3
1 2
x 1
y
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
8 Loop
5 9 find a not in N' such that D(a) is a minimum
v 3
w
10 add a to N'
2 5 11 update D(b) for all b adjacent to a and not in N' :
u 2 1 z D(b) = min ( D(b), D(a) + ca,b )
3
1 2
x 1
y
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:


destination outgoing link
v w
v (u,v) route from u to v directly
u z x (u,x)
y (u,x) route from u to all
x y w (u,x) other destinations
z (u,x) via x
Network Layer: 5-28
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, 11,w ∞ 8
u 3
2 uwx 6,w 11,w 14,x u w y z
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-29
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-30


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 a 2+e a
1 1+e 0 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 1 0
1 0
c c 0 1 c 1+e 1 0 1
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 costs resulting in new costs resulting in new costs

Network Layer: 5-31


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 Message • SNMP
Protocol • NETCONF/YANG

Network Layer: 5-32


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-33


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
u 2 1 z cu,w + Dw(z) }
3
1 2
= min {2 + 5,
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-34


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-35


Distance vector algorithm:

each node: iterative, asynchronous: each local


iteration caused by:
wait for (change in local link ▪ local link cost change
cost or msg from neighbor) ▪ DV update message from neighbor

recompute DV estimates using distributed, self-stopping: each


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

Network Layer: 5-36


Distance vector: example
DV in a:
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
Da(d) = 1 8 1
Da(e) = ∞
t=0 Da(f) = ∞
1 1
Da(g) = ∞
Da(h) = ∞
▪ All nodes have
Da(i) = ∞
distance
estimates to A few asymmetries:
d e f ▪ missing link
nearest 1 1
▪ larger cost
▪ neighbors (only)
All nodes send
their local
distance vector to 1 1 1
their neighbors

g h i
1 1

Network Layer: 5-37


Distance vector example: iteration

a b c
8 1

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

Network Layer: 5-38


Distance vector example: iteration

a
compute compute
b compute
c
8 1

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

Network Layer: 5-39


Distance vector example: iteration

a b c
8 1

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

Network Layer: 5-40


Distance vector example: iteration

a b c
8 1

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

Network Layer: 5-41


Distance vector example: iteration

compute
a compute
b compute
c
2 1

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

Network Layer: 5-42


Distance vector example: iteration

a b c
8 1

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

Network Layer: 5-43


Distance vector example: iteration

…. and so on

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

Network Layer: 5-44


DV in c:
Distance vector example: computation DV in b:
Db(a) = 8 Db(f) = ∞ Dc(a) =
Db(c) = 1 Db(g) = ∞ ∞
Db(d) = Db(h) = ∞ Dc(b) = 1
DV in a: Dc(c) = 0
∞ Db(i) = ∞
Da(a)=0 Db(e) = 1 Dc(d) =
Da(b) = 8

Da(c) = ∞ a b c Dc(e) =
Da(d) = 1 8 1

Da(e) = ∞
Dc(f) =
t=1 Da(f) = ∞
1 1 ∞
Da(g) = ∞
▪ b receives DVs Dc(g)
DV in=e:
Da(h) = ∞
from a, c, e ∞
Da(i) = ∞ D (a) =
Dce(h) =


d e f D (b) = 1
1 1 Dce(i) = ∞
De(c) =

De(d) = 1
1 1 1 De(e) = 0
De(f) = 1
De(g) =

g h i De(h) = 1
1 1
De(i) = ∞

Network Layer: 5-45


DV in c:
Distance vector example: computation DV in b:
Db(a) = 8 Db(f) = ∞ Dc(a) =
Db(c) = 1 Db(g) = ∞ ∞
Db(d) = Db(h) = ∞ Dc(b) = 1
DV in a: Dc(c) = 0
∞ Db(i) = ∞
Da(a)=0 Db(e) = 1 Dc(d) =
Da(b) = 8

Da(c) = ∞ a bb c Dc(e) =
Da(d) = 1 8 compute 1

Da(e) = ∞
Dc(f) =
t=1 Da(f) = ∞
1 1 ∞
Da(g) = ∞
▪ b receives DVs Dc(g)
DV in=e:
Da(h) = ∞
from a, c, e, ∞
Da(i) = ∞ e D (a) =
computes: Dce(h) =


d e f D (b) = 1
1
Db(a) = min{cb,a+Da(a), cb,c +Dc(a), cb,e+De(a)} = min{8,∞,∞} =8 1 Dce(i) = ∞
De(c) =
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1 ∞
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2 De(d) = 1
1 1 1 De(e) = 0
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +De(e)} = min{∞,∞,1} = 1
De(f) = 1
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2
DV in b:
De(g) =
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = Db(a) = 8 Db(f) =2 ∞
g D (c) = 1 Db(g)
i =∞ De(h) = 1
∞ (h) = min{c +D (h), c +D (h), c +D (h)}
D b b,a a b,c c b,e e 1 ∞, 2} = 2 h
= min{∞, 1Db(d) = 2 Db(h) = 2
b De(i) = ∞
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-46


DV in c:
Distance vector example: computation DV in b:
Db(a) = 8 Db(f) = ∞ Dc(a) =
Db(c) = 1 Db(g) = ∞ ∞
Db(d) = Db(h) = ∞ Dc(b) = 1
DV in a: Dc(c) = 0
∞ Db(i) = ∞
Da(a)=0 Db(e) = 1 Dc(d) =
Da(b) = 8

Da(c) = ∞ a b c Dc(e) =
Da(d) = 1 8 1

Da(e) = ∞
Dc(f) =
t=1 Da(f) = ∞
1 1 ∞
Da(g) = ∞
▪ c receives DVs Dc(g)
DV in=e:
Da(h) = ∞
from b ∞
Da(i) = ∞ D (a) =
Dce(h) =


d e f D (b) = 1
1 1 Dce(i) = ∞
De(c) =

De(d) = 1
1 1 1 De(e) = 0
De(f) = 1
De(g) =

g h i De(h) = 1
1 1
De(i) = ∞

Network Layer: 5-47


DV in c:
Distance vector example: computation DV in b:
Db(a) = 8 Db(f) = ∞ Dc(a) =
Db(c) = 1 Db(g) = ∞ ∞
Db(d) = Db(h) = ∞ Dc(b) = 1
∞ Db(i) = ∞ Dc(c) = 0
Db(e) = 1 Dc(d) =

a b c
compute Dc(e) =
8 1

Dc(f) =
t=1 1 1 ∞
▪ c receives DVs Dc(g) =
from b computes: ∞
Dc(h) =

Dc(a) = min{cc,bd
+Db(a}} = 1 + 8 = 9 e f
DV in c: Dc(i) = ∞
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+ ∞ = ∞ * Check out the online interactive
∞ exercises for more examples:
Dc(h) = min{cbc,bg+Db(h)} = 1+ ∞ = ∞ h Dc(f) = i http://gaia.cs.umass.edu/kurose_ross/interactive
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞ ∞ /
Dc(g) =

Dc(h) =

Dc(i) = ∞
Network Layer: 5-48
Distance vector example: computation DV in b:
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞
Db(d) = Db(h) = ∞ DV in e:
DV in d: ∞ Db(i) = ∞
De(a) =
Dc(a) = 1 Db(e) = 1

Dc(b) = a De(b) = 1
b c
∞ 8 1 De(c) =
Dc(c) = ∞
t=1 ∞
Dc(d) = 0 1
Q: what is new DV computed in e
at1t=1?
De(d) = 1
De(e) = 0
▪ e receives DVs Dc(e) = 1 De(f) = 1
from b, d, f, h Dc(f) = De(g) =
∞ Dc(g) ∞
=1 d compute f DV in =f:1
De(h)
e
Dc(h)
DV in=h: 1 1
∞ DDe(a)
c
(i) == ∞

DDcc(i)
(a)==∞ ∞
∞ Dc(b) =
Dc(b) = 1 1 1 ∞
∞ Dc(c) =
Dc(c) = ∞
∞ Dc(d) =
Dc(d) = g h i ∞
1 1
∞ Dc(e) = 1
Dc(e) = 1 Dc(f) = 0
Dc(f) = Dc(g) =
∞ ∞
Dc(g) = 1 Dc(h) =
Dc(h) = 0 ∞
Network Layer: 5-49
Dc(i) = 1 Dc(i) = 1
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
t=2
c’s state at t=0 may now influence distance
t=2 vector computations up to 2 hops away, i.e.,
d e f
at b and now at a, e as well 1 1

c’s state at t=0 may influence distance vector


t=3
computations up to 3 hops away, i.e., at d, f, h 1 1 1 t=3

c’s state at t=0 may influence distance vector


t=4 g
computations up to 4 hops away, i.e., at g, i 1
h 1
i
t=4
Distance vector: link cost changes

1
link cost changes: y
4 1
▪ node detects local link cost change x z
50
▪ updates routing info, recalculates local DV
▪ if DV changes, notify neighbors

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


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

60
link cost changes: y
4 1
▪ node detects local link cost change x z
50
▪ “bad news travels slow” – count-to-infinity
•problem:
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.

▪ see text for solutions. Distributed algorithms are tricky!
Comparison of LS and DV algorithms

message complexity robustness: what happens if router


LS: n routers, O(n2) messages sent malfunctions, or is compromised?
DV: exchange between neighbors; LS:
convergence time varies • router can advertise incorrect link cost
• each router computes only its own
speed of convergence table
LS: O(n2) algorithm, O(n2) messages DV:
• may have oscillations
• DV router can advertise incorrect path
DV: convergence time varies cost (“I have a really low-cost path to
• may have routing loops everywhere”): black-holing
• count-to-infinity problem
• each router’s DV is used by others:
error propagate thru network
Assignment # 4 (Chapter – 4)
- 4th Assignment
nd
will be uploaded on Google Classroom on
Tuesday, 22 October, 2024, in the Stream - Announcement
Section

- Due Date: Tuesday, 29th October, 2024 (Handwritten


solutions to be submitted during the lecture)

- Please read all the instructions carefully in the uploaded


Assignment document, follow & submit accordingly

Quiz # 4 (Chapter – 4)
- On: Tuesday, 29th October, 2024 (During the lecture)

- Quiz to be taken during own section class only

You might also like