DVRouting
DVRouting
ACK: Slides use some material from Scott Shenker (UC Berkeley) and Jim Kurose (UMass)
Agenda
⚫ Finish Up: Distance Vector Routing
⚫ Complexity
⚫ Count to infinity
⚫ Split horizon and Poisonous Reverse
⚫ Comparison of DV and LS
⚫ Scale and complexity
2
Recap: DV Routing (generally: links have costs)
d(x,z) represents the total cost
y over the path from x to z
2
x 7 u z
1 cost(x,y) represents the cost
w from x to a directly attached
neighbor y
Bellman-Ford equation 3
Three Node Network
to
x y z
x 0 2 7
from
y 2 0 1 y
z 7 1 0 2 1
x 7 z
4
Three Node Network
to
x y z
x 0 2 3
from
y 2 0 1 y
z 7 1 0 2 1
x 7 z
5
From Algorithm to Protocol
⚫ Algorithm:
⚫ Nodes use Bellman-Ford to compute distances
⚫ Protocol:
⚫ Nodes exchange distance vectors
⚫ Update their own routing tables
⚫ And exchange again….
⚫ Details: when to exchange, what to exchange, etc….
6
Overall Approach
⚫ Each node 𝒙 begins with an estimate 𝒅(𝒙, 𝒚) for all nodes 𝒚
⚫ An “estimate” of the cost of the least-cost path from itself to all nodes 𝒚
⚫ Why are we calling it an estimate?
⚫ It’s the cost along the currently known least-cost path – may get updated
7
Overall Approach (Cont’d)
⚫ Each node sends a copy of its distance vector to each neighbor
⚫ If node 𝑥’𝑠 distance vector changes, it sends its updated distance vector
to each of its neighbors
8
x y z
This is y’s x - - -
“distance vector” y 2 0 1
z - - -
y
2 1
x 7 z
to
x y z x y z
x 0 2 7 x - - -
from
y - - - y - - -
z - - - z 7 1 0
9
x y z
x 0 2 7
y 2 0 1
z 7 1 0
y
2 1
x 7 z
to
x y z x y z
x 0 2 7 x 0 2 7
from
y y 2 0 1
z z 7 1 0
10
x y z
x 0 2 7
y 2 0 1
z 7 1 0
y
2 1
x 7 z
to
x y z x y z
x 0 2 3 x 0 2 7
from
y 2 0 1 y 2 0 1
z 7 1 0 z 7 1 0
11
x y z
x 0 2 7
y 2 0 1
z 7 1 0
y
2 1
x 7 z
to
x y z x y z
x 0 2 3 x 0 2 7
from
y 2 0 1 y 2 0 1
z 7 1 0 z 3 1 0
12
x y z
x 0 2 3
y 2 0 1
z 3 1 0
y
2 1
x 7 z
to
x y z x y z
x 0 2 3 x 0 2 3
from
y 2 0 1 y 2 0 1
z 3 1 0 z 3 1 0
13
A More Complicated Case
⚫ The three-node network:
⚫ Everyone was neighbors with everyone else
14
x y v z Four Node Network
x - - - - x y v z
y 1 0 - 3
y - - - -
z - - - - v - - - -
y z - 3 1 0
1 3
x z
2 1
to
x y v z v
x x y v z
0 1 2 -
from
y - - - - x - - - -
v - - - - v 2 - 0 1
z - - - -
15
x y v z After first exchange
x 0 1 2 - x y v z
y 1 0 - 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z - 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 -
from
y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
Let’s find d(x,z), which
z - 3 1 0
represents the total cost over 16
y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
z - 3 1 0
17
Let’s now find d(y,v) to x y v z Recomputing Tables
update the DV of y
x 0 1 2 - x y v z
y 1 0 - 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from
y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
z - 3 1 0
18
x y v z Recomputing Tables
x 0 1 2 - x y v z
y 1 0 3 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z Finally, update the DV of v
x 0 1 2 3
from
by finding d(y,v)
y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 - 0 1
z - 3 1 0
19
x y v z Recomputing Tables
x 0 1 2 - x y v z
y 1 0 3 3
y 1 0 - 3
z - 3 1 0 v 2 - 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from
y 1 0 - 3 x 0 1 2 -
v 2 - 0 1 v 2 3 0 1
z - 3 1 0
20
x y v z Vectors distributed
x 0 1 2 3 x y v z
y 1 0 3 3
y 1 0 3 3
z 3 3 1 0 v 2 3 0 1
y z 3 3 1 0
1 3
x z
2 1
to
x y v z v
x y v z
x 0 1 2 3
from
y 1 0 3 3 x 0 1 2 3
v 2 3 0 1 v 2 3 0 1
z 3 3 1 0
21
Distance Vector Routing
23
Other Aspects of Protocol
⚫ When to send messages?
⚫ When any of your distances d(u,v) change or the link cost changes to some
neighbor
⚫ Periodically, to ensure consistency between neighbors
y 2 0 1
z 3 1 0
Failed Link 2 y
1
x 7 z
x y z
What happens now?
y 2 0 1
z 3 1 0
25
x y z
y 4 0 1
z 3 1 0 routing loop!
y
1
x 7 z
x y z
y 2 0 1
z 3 1 0
26
x y z
y 4 0 1
z 3 1 0 routing loop!
y
1
x 7 z
x y z
y 4 0 1
z 3 1 0
27
x y z
y 4 0 1
z 3 1 0 routing loop!
y
1
x 7 z
x y z
y 4 0 1
z 5 1 0
28
x y z
y 4 0 1
z 5 1 0 routing loop!
y
1
x 7 z
x y z
y 4 0 1
z 5 1 0
29
x y z
y 6 0 1
z 5 1 0 routing loop!
y
1
x 7 z
x y z
y 4 0 1
z 5 1 0
30
x y z
y 6 0 1
z 5 1 0 routing loop!
y
1
x 7 z
x y z
y 6 0 1
z 5 1 0
31
x y z
y 6 0 1
z 5 1 0 routing loop!
y
1
x 7 z
x y z
y 6 0 1
z 7 1 0
32
x y z
y 6 0 1
z 7 1 0 routing loop!
y
1
x 7 z
x y z
y 6 0 1
z 7 1 0
33
x y z
y 8 0 1
z 7 1 0 routing loop!
y
1
x 7 z
x y z
y 6 0 1
z 7 1 0
34
x y z
y 8 0 1
z 7 1 0 routing loop!
y
1
x 7 z
x y z
y 8 0 1
z 7 1 0
35
x y z
y 8 0 1
z 7 1 0 routing loop!
y
1
x 7 z
y 2 0 1 x y z
z 3 1 0
2 y
1 y 2 0 1
z 3 1 0
x 7 z 38
How can we fix this?
⚫ Solution: if a router is using a next-hop’s path, then:
⚫ OR…
⚫ Tell the other router not to use your path (by telling them cost of ∞)
⚫ Called “poisoned reverse”
⚫ A node is poisoning its route for a destination in its update message to the other
node
39
x y z
y 2 0 1
poisoned reverse z ∞ 1 0
2 y
1
x 7 z
x y z
y 2 0 1
z 3 1 0
40
x y z
y ∞ 0 1
poisoned reverse z ∞ 1 0
y
1
x 7 z
x y z
y 2 0 1
z 3 1 0
41
x y z
y ∞ 0 1
poisoned reverse z ∞ 1 0
y
1
x 7 z
x y z
y ∞ 0 1
z 3 1 0
42
x y z
y ∞ 0 1
poisoned reverse z ∞ 1 0
y
1
x 7 z
x y z
y ∞ 0 1
z 7 1 0
43
x y z
y ∞ 0 1
poisoned reverse z 7 1 0
y
1
x 7 z
x y z
y ∞ 0 1
z 7 1 0
44
x y z
y 8 0 1
z 7 1 0
y
1
x 7 z
x y z
poisoned reverse y ∞ 0 1
z 7 1 0
45
Homework Problem
46
More on Loops …
⚫ Routing loops can be alleviated by limiting the maximum number of hops
a packet can take
⚫ Customary for the packet header to include a hop-limit
⚫ Source sets this to some value larger than the number of hops it believes are
needed to get to the destination
⚫ Each switch/router decrements hop limit field by 1
⚫ If this field reaches 0, then it does not forward the packet
⚫ Message Complexity
⚫ How many messages would be exchanged
as neighbors share their distance vectors
(given e links)?
48
DV Routing Complexity
⚫ Algorithm Complexity
⚫ In the worst case, how many computations
would a router have to perform when a
distance vector is received?
⚫ O(N)
⚫ Message Complexity
⚫ How many messages would be exchanged
as neighbors share their distance vectors
(given 𝑒 links)?
⚫ At least 𝟐𝒆 messages. Why?
49
LS and DV: Key Difference
⚫ In Distance Vector Routing, each node
⚫ Shares routing information only with its directly connected neighbors
⚫ Routing information is the Distance Vector! What does that mean?
⚫ The shortest currently known distances to every node
⚫ These shortest distances may get updated when information propagates
51
Summary: LS and DV Comparison
⚫ LS vs. DV Tradeoff:
⚫ LS: Send it everywhere and be done in a predictable time
⚫ DV: Send locally, and perhaps iterate until convergence
52
What happens when routers lie?
⚫ What if router claims a 1-hop path to everywhere?
⚫ All traffic from nearby routers gets sent there
53
Q: Can we scale either distance-vector or
link-state routing to the scale of the Internet?
Problem: neither distance-vector nor link-state
routing will scale to the size of the Internet
Preview of Next Lecture
56
Questions?
57