You are on page 1of 97

Lecture 4

Chapter 2
Network Layer: Control Plane
Network layer control plane: our goals
 understand principles  instantiation, implementation
behind network control in the Internet:
plane: • OSPF, BGP
• traditional routing algorithms

Network Layer: 5-2


Network layer: “control plane” roadmap
 introduction
 routing protocols
 link state
 distance vector
 intra-ISP routing: OSPF
 routing among ISPs: BGP

Network Layer: 5-3


Routing protocols mobile network
national or global ISP
Routing protocol goal: determine “good”
paths (equivalently, routes), from sending application
transport
hosts to receiving host, through network of network
link

routers
physical
network network
link link
physical physical

 Path: Sequence of routers packets traverse network

from given initial source host to final


link network
physical link
physical network
link datacenter
destination host physical network

 “Good”: least “cost”, “fastest”, “least application


transport
network

congested” enterprise
network
link
physical

 Routing: a “top-10” networking challenge!


Network Layer: 5-4
Routing protocols
• Intra domain routing protocols: Transfer data within a autonomous
network system.
– Distance vector (RIP)
– Link state (OSPF)

• Inter domain routing protocols: Transfer data between two or more


autonomous network system.
– Path vector (BGP)

Network Layer: 5-5


Graph abstraction: link costs
5 ca,b: cost of direct link connecting a and b
3 e.g., cw,z = 5, cu,z = ∞
v w
2 5

u 2 1 z cost defined by network operator: could always


3 be 1, or inversely related to bandwidth, or
1
x y
2 inversely related to congestion
1

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-6
Graph abstraction: link costs
5 c(x,x’) = cost of link (x,x’)
e.g., c(w,z) = 5
3
v w
5
2 Cost could always be 1, or inversely related to
u 2 1 z bandwidth, or inversely related to congestion
3
1
2
x y
1

cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

key question: what is the least-cost path between u and z ?


routing algorithm: algorithm that finds that least cost path
Network Layer: 5-7
Routing algorithm classification
global: all routers have complete
topology, link cost info
• “link state” algorithms
How fast to
dynamic: routes change
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-8
Distance Vector Routing (DVR)
N1
1

N5 N2
3

4 6

2
N4 N3

Network Layer: 5-9


Distance Vector Routing (DVR)
Key idea:
• From time-to-time, each node sends its own distance vector estimate
to neighbors
• when x receives new DV estimate from neighbor, it updates its own
DV using B-F equation:

Dx(y) ← minv{c(x,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-10


Dest. Dist. Next

DVR: Example 1 N1
N1
N2
Dest. Dist. Next N3
Updating table using neighborship 1 N4
N1
N2 N5 N2 Dest. Dist. Next N5
N3 3
N1
N4 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-11
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0 N1

Dest. Dist. Next N3


Updating table using neighborship 1 N4
N1
N2 N5 N2 Dest. Dist. Next N5
N3 3
N1
N4 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-12
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3
Updating table using neighborship 1 N4
N1
N2 N5 N2 Dest. Dist. Next N5
N3 3
N1
N4 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-13
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4
N1
N2 N5 N2 Dest. Dist. Next N5
N3 3
N1
N4 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-14
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1
N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 3
N1
N4 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-15
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1
N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 3
N1 1 N1
N4 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-16
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1
N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 3
N1 1 N1
N4 N2 0 N2
N5 4 6
N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-17
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1
N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 3
N1 1 N1
N4 N2 0 N2
N5 4 6
N3 6 N3
N4
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-18
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1
N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 3
N1 1 N1
N4 N2 0 N2
N5 4 6
N3 6 N3
N4 ∞ --
2 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-19
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1
N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 3
N1 1 N1
N4 N2 0 N2
N5 4 6
N3 6 N3
N4 ∞ --
2 N5 3 N5
Dest. Dist. Next N4 N3
N1 Dest. Dist. Next
N2 N1
N3 N2
N4 N3
N5 N4
N5
Network Layer: 5-20
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next N3 ∞ --
Updating table using neighborship 1 N4 ∞ --
N1 ? ?
N2 ? ? N5 N2 Dest. Dist. Next N5 ∞ --
N3 ? ? 3
N1 1 N1
N4 ? ? N2 0 N2
N5 ? ? 4 6
N3 6 N3
N4 ∞ --
2 N5 3 N5
Dest. Dist. Next N4 N3
N1 ? ? Dest. Dist. Next
N2 ? ? N1 ? ?
N3 ? ? N2 ? ?
N4 ? ? N3 ? ?
N5 ? ? N4 ? ?
N5 ? ?
Network Layer: 5-21
Dest. Dist. Next

DVR: Example 1 N1
N1
N2
0
1
N1
N2
Dest. Dist. Next End of table generation 1
N3 ∞ --
N1 ∞ -- using neighborship N4 ∞ --
N2 3 N2 N5 N2 Dest. Dist. Next N5 ∞ --
N3 ∞ -- 3
N1 1 N1
N4 4 N4
N2 0 N2
N5 0 N5 4 6
N3 6 N3
N4 ∞ --
2 N5 3 N5
Dest. Dist. Next N4 N3
N1 ∞ -- Dest. Dist. Next
N2 ∞ -- N1 ∞ --
N3 2 N3 N2 6 N2
N4 0 N4 N3 0 N3
N5 4 N5 N4 2 N4
N5 ∞ --
Network Layer: 5-22
DVR: Example 1 N1 N2 N3
0 1 ∞
1 0 6
1) Sharing with only neighbor ∞ 6 0
2) Sharing only distance vector ∞ ∞ 2
∞ 3 ∞
 At N1 neighbors are only N2
N4 N5
 At N2 neighbors are only N1, N3, N5 ∞ ∞
 At N3 neighbors are only N2, N4 ∞ 3
 At N4 neighbors are only N3,N5 2 ∞
 At N5 neighbors are only N2, N4 0 4
4 0

Network Layer: 5-23


DVR: Example 1
Start of first pass N1

1
At N1 new routing table
N5 N2 N Dest. Dist. Next
3 2
1 N1
4 6 0 N2

6 N3
∞ N4
2
N4 N3 3 N5

Network Layer: 5-24


DVR: Example 1
1) N1  N1
Start of first pass N1

1
At N1 new routing table
N5 N2 N Dest. Dist. Next
3 2
1 N1 0 N1
4 6 0 N2

6 N3
∞ N4
2
N4 N3 3 N5

Network Layer: 5-25


DVR: Example 1
1) N1  N1
Start of first pass N1

1
2) N1  N2 At N1 new routing table
= N1  N2 and N2  N2
=1+0=1 N5 N2 N Dest. Dist. Next
3 2
1 N1 0 N1
4 6 0 N2 1 N2

6 N3
∞ N4
2
N4 N3 3 N5

Network Layer: 5-26


DVR: Example 1
1) N1  N1
Start of first pass N1

1
2) N1  N2 At N1 new routing table
= N1  N2 and N2  N2
=1+0=1 N5 N2 N Dest. Dist. Next
3 2
3) N1  N3 1 N1 0 N1
= N1  N2 and N2  N3 4 6 0 N2 1 N2
=1+6=7
6 N3 7 N2
∞ N4
2
N4 N3 3 N5

Network Layer: 5-27


DVR: Example 1
1) N1  N1
Start of first pass N1

1
2) N1  N2 At N1 new routing table
= N1  N2 and N2  N2
=1+0=1 N5 N2 N Dest. Dist. Next
3 2
3) N1  N3 1 N1 0 N1
= N1  N2 and N2  N3 4 6 0 N2 1 N2
=1+6=7
6 N3 7 N2
4) N1  N4 ∞ N4 ∞ --
2
= N1  N2 and N2  N4 N4 N3 3 N5
=1+∞=∞

Network Layer: 5-28


DVR: Example 1
1) N1  N1
Start of first pass N1

1
2) N1  N2 At N1 new routing table
= N1  N2 and N2  N2
=1+0=1 N5 N2 N Dest. Dist. Next
3 2
3) N1  N3 1 N1 0 N1
= N1  N2 and N2  N3 4 6 0 N2 1 N2
=1+6=7
6 N3 7 N2
4) N1  N4 ∞ N4 ∞ --
2
= N1  N2 and N2  N4 N4 N3 3 N5 4 N2
=1+∞=∞

5) N1  N5
= N1  N2 and N2  N5
=1+3=4
Network Layer: 5-29
DVR: Example 1
Start of first pass N1

1
At N5 new routing table
N5 N2 N N Dest. Dist. Next
3 2 4
1 ∞ N1
0 ∞ N2
4 6
6 2 N3
∞ 0 N4
2 3 4 N5
N4 N3

Network Layer: 5-30


DVR: Example 1
1) N5  N1
either, N5 N2 and N2  N1 Start of first pass N1
=3+1=4 1
Or, N5 N4 and N4  N1 At N5 new routing table
=4+∞=∞ N5 N2 N N Dest. Dist. Next
Select minimum 3 2 4
cost/distance 1 ∞ N1 4 N1
0 ∞ N2
4 6
6 2 N3
∞ 0 N4
2 3 4 N5
N4 N3

Network Layer: 5-31


DVR: Example 1
1) N5  N1
either, N5 N2 and N2  N1
=3+1=4
Start of first pass N1

1
Or, N5 N4 and N4  N1 At N5 new routing table
=4+∞=∞
Select minimum cost/distance N5 N2 N N Dest. Dist. Next
3 2 4
2) N5  N2 1 ∞ N1 4 N1
either, N5  N2 and N2  0 ∞ N2 3 N2
4 6
N2 N3
6 2
=3+0=3
∞ 0 N4
Or, N5 N4 and N4  N2
=4+∞=∞ 2 3 4 N5
N4 N3
Select minimum
cost/distance

Network Layer: 5-32


DVR: Example 1
1) N5  N1
either, N5 N2 and N2  N1
=3+1=4
Start of first pass N1

1
Or, N5 N4 and N4  N1 At N5 new routing table
=4+∞=∞
Select minimum cost/distance N5 N2 N N Dest. Dist. Next
3 2 4
2) N5  N2 1 ∞ N1 4 N1
either, N5  N2 and N2  N2 N2 3 N2
4 6 0 ∞
=3+0=3
Or, N5 N4 and N4  N2 6 2 N3 6 N4
=4+∞=∞ ∞ 0 N4
Select minimum cost/distance
2 3 4 N5
N4 N3
3) N5  N3
either, N5  N2 and N2  N3 = 3 + 6 = 9

Or, N5 N4 and N4  N3 = 4 + 2 = 6


Select minimum cost/distance Network Layer: 5-33
DVR: Example 1
1) N5  N1
either, N5 N2 and N2  N1
=3+1=4
Start of first pass N1

1
Or, N5 N4 and N4  N1 At N5 new routing table
=4+∞=∞
Select minimum cost/distance N5 N2 N N Dest. Dist. Next
3 2 4
2) N5  N2 1 ∞ N1 4 N1
either, N5  N2 and N2  N2 N2 3 N2
4 6 0 ∞
=3+0=3
Or, N5 N4 and N4  N2 6 2 N3 6 N4
=4+∞=∞ ∞ 0 N4 4 N4
Select minimum cost/distance
2 3 4 N5
N4 N3
3) N5  N3
either, N5  N2 and N2  N3 4) N5  N4
=3+6=9 either, N5  N2 and N2  N4 = 3 + ∞ = ∞
Or, N5 N4 and N4  N3
=4+2=6 Or, N5 N4 and N4  N4 = 4 + 0 = 4
Select minimum cost/distance
Select minimum cost/distance Network Layer: 5-34
DVR: Example 1
1) N5  N1
either, N5 N2 and N2  N1
=3+1=4
Start of first pass N1

1
Or, N5 N4 and N4  N1 At N5 new routing table
=4+∞=∞
Select minimum cost/distance N5 N2 N N Dest. Dist. Next
3 2 4
2) N5  N2 1 ∞ N1 4 N1
either, N5  N2 and N2  N2 N2 3 N2
4 6 0 ∞
=3+0=3
Or, N5 N4 and N4  N2 6 2 N3 6 N4
=4+∞=∞ ∞ 0 N4 4 N4
Select minimum cost/distance
2 3 4 N5 0 N5
N4 N3
3) N5  N3
either, N5  N2 and N2  N3 4) N5  N4
=3+6=9 either, N5  N2 and N2  N4 5) N5  N5
Or, N5 N4 and N4  N3 =3+∞=∞ =0
=4+2=6 Or, N5 N4 and N4  N4
Select minimum cost/distance =4+0=4 Network Layer: 5-35
Select minimum cost/distance
DVR: Example 1
N1
Start of first pass 1

N5 N2
At N2 new routing table
3
N N N Dest. Dist. Next
1 3 5
4 6 0 ∞ ∞ N1 ? ?
1 6 3 N2 ? ?
∞ 0 ∞ N3 ? ?
2 N4 ? ?
N4 N3 ∞ 2 4
∞ ∞ 0 N5 ? ?

Network Layer: 5-36


DVR: Example 1
N1
Start of first pass 1

N5 N2
At N2 new routing table
3
N N N Dest. Dist. Next
1 3 5
4 6 0 ∞ ∞ N1 1 N1

1 6 3 N2 0 N2

∞ 0 ∞ N3 6 N3
2 N4 7 N5
N4 N3 ∞ 2 4
∞ ∞ 0 N5 3 N5

Network Layer: 5-37


Dest. Dist. Next
DVR: Example 1 N1 0 N1
N1 N2 1 N2
Dest. Dist. Next End of first pass 1
N3 7 N2
N1 4 N2 N4 ∞ --
N5 N2 Dest. Dist. Next
N2 3 N2 3 N5 4 N5
N3 6 N4 N1 1 N1

N4 4 N4 N2 0 N2
4 6 N3 6 N3
N5 0 N5
N4 7 N5
N5 3 N5
2
Dest. Dist. Next N4 N3
Dest. Dist. Next
N1 ∞ --
N1 7 N2
N2 7 N5
N2 6 N2
N3 2 N3
N3 0 N3
N4 0 N4
N4 2 N4
N5 4 N5
N5 6 N4 Network Layer: 5-38
Dest. Dist. Next
DVR: Example 1 N1 0 N1
N1 N2 1 N2
Dest. Dist. Next
End of second pass 1
N3 7 N2
N1 4 N2 N4 8 N2
N5 N2 Dest. Dist. Next
N2 3 N2 3 N5 4 N5
N3 6 N4 N1 1 N1

N4 4 N4 N2 0 N2
4 6 N3 6 N3
N5 0 N5
N4 7 N5
N5 3 N5
2
Dest. Dist. Next N4 N3
Dest. Dist. Next
N1 8 N5
N1 7 N2
N2 7 N5
N2 6 N2
N3 2 N3
N3 0 N3
N4 0 N4
N4 2 N4
N5 4 N5
N5 6 N4 Network Layer: 5-39
Dest. Dist. Next
DVR: Example 1 N1 0 N1
N1 N2 1 N2
End of final pass 1
Dest. Dist. Next N3 7 N2
N1 4 N2 N4 8 N2
N5 N2 Dest. Dist. Next
N2 3 N2 3 N5 4 N5
N3 6 N4 N1 1 N1

N4 4 N4 N2 0 N2
4 6 N3 6 N3
N5 0 N5
N4 7 N5
N5 3 N5
2
Dest. Dist. Next N4 N3
Dest. Dist. Next
N1 8 N5
N1 7 N2
N2 7 N5
N2 6 N2
N3 2 N3
N3 0 N3
N4 0 N4
N4 2 N4
N5 4 N5
N5 6 N4 Network Layer: 5-40
DVR: Exercise 1
Solve yourself up to 2nd pass

6
N3 N4
7 4

2
N1 1 N6
9 8

4 2
N2 N5
10

Network Layer: 5-41


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-42
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-43
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-44


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

distributed, self-stopping: each


recompute DV estimates using 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-45


DVR: Example 2
DV in a:
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
8 1
Da(d) = 1

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

g h i
1 1

Network Layer: 5-46


DVR Example 2: 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 local 1 1 1
distance vector to
neighbors

g h i
1 1

Network Layer: 5-47


DVR Example 2: iteration

a
compute compute
b compute
c
8 1

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

g
compute h
compute i
compute
1 1

Network Layer: 5-48


DVR Example 2: 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 local 1 1 1
distance vector to
neighbors

g h i
1 1

Network Layer: 5-49


DVR Example 2: 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 local 1 1 1
distance vector to
neighbors

g h i
1 1

Network Layer: 5-50


DVR Example 2: iteration

compute
a compute
b compute
c
2 1

t=2 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 local 1 1 1
distance vector to
neighbors

g
compute compute
h compute
i
8 1

Network Layer: 5-51


DVR Example 2: 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 local 1 1 1
distance vector to
neighbors

g h i
1 1

Network Layer: 5-52


DVR Example 2: iteration

…. and so on

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

Network Layer: 5-53


DVR Example 2: computation DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 1
Da(d) = 1 Dc(g) = ∞
Dc(h) = ∞
t=1 Da(e) = ∞
Da(f) = ∞ 1 1 Dc(i) = ∞
 b receives DVs Da(g) = ∞ DV in e:
from a, c, e Da(h) = ∞ De(a) = ∞
Da(i) = ∞ 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-54


DVR Example 2: computation DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 compute 1
Da(d) = 1 Dc(g) = ∞
Da(e) = ∞ Dc(h) = ∞
t=1 Da(f) = ∞
1 1 Dc(i) = ∞
 b receives DVs Da(g) = ∞ DV in e:
from a, c, e, Da(h) = ∞ De(a) = ∞
computes: e
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
De(d) = 1
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1
De(e) = 0
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2 De(f) = 1
1 1 1
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +De(e)} = min{∞,∞,1} = 1 De(g) = ∞
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2
DV in b: De(h) = 1
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = ∞ Db(a) = 8 Db(f) =2 De(i) = ∞
g h 1Db(c) = 1 i =∞
Db(g)
1 ∞, 2} = 2
Db(h) = min{cb,a+Da(h), cb,c +Dc(h), c b,e+De(h)} = min{∞,
Db(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-55
DVR Example 2: computation DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 1
Da(d) = 1 Dc(g) = ∞
Dc(h) = ∞
t=1 Da(e) = ∞
Da(f) = ∞ 1 1 Dc(i) = ∞
 c receives DVs Da(g) = ∞ DV in e:
from b Da(h) = ∞ De(a) = ∞
Da(i) = ∞ 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-56


DVR Example 2: computation DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
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 f
DV in c:
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(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞ Dc(d) = 2
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞ Dc(e) = ∞
Dc(h) = min{cbc,bg+Db(h)} = 1+ ∞ = ∞ Dc(f) = ∞
h i
Dc(g) = ∞
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞
Dc(h) = ∞
Network Layer: 5-57
Dc(i) = ∞
DVR Example 2: 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(e) = 1 Db(i) = ∞ De(a) = ∞
Dc(a) = 1
De(b) = 1
Dc(b) = ∞ a b c De(c) = ∞
Dc(c) = ∞ 8 1
De(d) = 1
Dc(d) = 0
t=1 Dc(e) = 1
1
Q: what is new DV computed in e at
1t=1?
De(e) = 0
De(f) = 1
 e receives DVs Dc(f) = ∞
De(g) = ∞
from b, d, f, h Dc(g) = 1
De(h) = 1
Dc(h) = ∞
De(i) = ∞
Dc(i) = ∞ d compute
e f DV in f:
1 1
DV in h: Dc(a) = ∞
Dc(a) = ∞ Dc(b) = ∞
Dc(b) = ∞ Dc(c) = ∞
Dc(c) = ∞ 1 1 1
Dc(d) = ∞
Dc(d) = ∞ Dc(e) = 1
Dc(e) = 1 Dc(f) = 0
Dc(f) = ∞ g h i Dc(g) = ∞
1 1
Dc(g) = 1 Dc(h) = ∞
Dc(h) = 0 Dc(i) = 1 Network Layer: 5-58
DVR Example 2 : 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 may
t=1 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 b,a,e
1 1 1 t=3
and now at c,f,h as well
c’s state at t=0 may influence distance vector
t=4 computations up to 4 hops away, i.e., at b,a,e, g h i
c, f, h and now at g,i as well 1 1
t=4
DVR Example 3
cost to cost to
Dx() x y z x y z
x 0 2 7 x 0 2 3

from
y ∞∞ ∞ y 2 0 1
from

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
y 2 0 1
from

z ∞∞ ∞

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

y ∞∞ ∞
z 7 1 0
time Network Layer: 5-60
DVR Example 3
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
y ∞∞ ∞ 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 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
y 2 0 1 y 2 0 1
from

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

y 2 0 1 y 2 0 1
from
from

y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time Network Layer: 5-61
Distance vector: link cost changes
link cost changes: 1
y
4 1
 node detects local link cost change x z
 updates routing info, recalculates local DV 50

 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 table, computes new least
travels fast”
cost to x , sends its neighbors its DV.
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-62


Distance vector: link cost changes
link cost changes: 60
y
 node detects local link cost change 4 1
 “bad news travels slow” – count-to-infinity problem: x
50
z

• 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.
Network Layer: 5-63
Count to Infinity Problem
1 1 1
D C B A

Network Layer: 5-64


Count to Infinity Problem
1 1 1
D C B A

∞ ∞ 1 Pass 1

Network Layer: 5-65


Count to Infinity Problem
1 1 1
D C B A

∞ ∞ 1 Pass 1

∞ 2 1 Pass 2

Network Layer: 5-66


Count to Infinity Problem
1 1 1
D C B A

∞ ∞ 1 Pass 1

∞ 2 1 Pass 2

3 2 1 Pass 3

Network Layer: 5-67


Count to Infinity Problem

Network Layer: 5-68


Count to Infinity Problem
1 1 1
D C B A

∞ ∞ 1 Pass 1

∞ 2 1 Pass 2

3 2 1 Pass 3

3 2 1 Pass 4

Network Layer: 5-69


Count to Infinity Problem
1 1 1
D C B A

∞ ∞ 1 Pass 1

∞ 2 1 Pass 2

3 2 1 Pass 3

3 2 1 Pass 4
• • • •
• • • •
• • • •
3 2 1 Pass n

Network Layer: 5-70


Count to Infinity Problem
1 1 1
D C B A

∞ ∞ 1 Pass 1

∞ 2 1 Pass 2

3 2 1 Pass 3

3 2 1 Pass 4
• • • •
• • • •
• • • •
3 2 1 Pass n

Network Layer: 5-71


Count to Infinity Problem
Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-72


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-73


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-74


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

4 Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-75


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

4 Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-76


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-77


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-78


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-79


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

Pass 9

Pass 10

Pass 11

Network Layer: 5-80


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

4 Pass 9

Pass 10

Pass 11

Network Layer: 5-81


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

4 Pass 9

Pass 10

Pass 11

Network Layer: 5-82


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 Pass 9

Pass 10

Pass 11

Network Layer: 5-83


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 Pass 9

Pass 10

Pass 11

Network Layer: 5-84


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

Pass 10

Pass 11

Network Layer: 5-85


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

Pass 10

Pass 11

Network Layer: 5-86


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

6 Pass 10

Pass 11

Network Layer: 5-87


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 Pass 10

Pass 11

Network Layer: 5-88


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 Pass 10

Pass 11

Network Layer: 5-89


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

Pass 11

Network Layer: 5-90


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

6 Pass 11

Network Layer: 5-91


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

6 Pass 11

Network Layer: 5-92


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

7 6 Pass 11

Network Layer: 5-93


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

7 6 Pass 11

Network Layer: 5-94


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

7 6 7 Pass 11

Network Layer: 5-95


Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

7 6 7 Pass 11
• • • •
• • • •
• • • •
Pass n
Network Layer: 5-96
Count to Infinity Problem
1 1 1
D C B A

3 2 1 Pass 6

3 2 ∞ Pass 7

3 4 3 Pass 8

5 4 5 Pass 9

5 6 5 Pass 10

7 6 7 Pass 11
• • • •
• • • •
• • • •
Pass n
Network Layer: 5-97

You might also like