Distance Vector
Local Signpost Direction Distance
Routing Table For each destination list: Next Node dest next dist Distance
Table Synthesis Neighbors exchange table entries Determine current best next hop Inform neighbors
Periodically After changes
Shortest Path to SJ
Focus on how nodes find their shortest path to a given destination node, i.e. SJ
San Jose
Dj
Cij
i
Di
If Di is the shortest distance to SJ from i and if j is a neighbor on the shortest path, then Di = Cij + Dj
But we dont know the shortest paths
i only has local info from neighbors Dj'
San Jose
Dj
Pick current shortest path
j'
Cij'
i
Di
Cij
Cij
j j"
Dj"
Why Distance Vector WorksSJ sends
accurate info
3 Hops From SJ
2 Hops From SJ
1 Hop From SJ
San Jose
Accurate info about SJ ripples across network, Shortest Path Converges
Hop-1 nodes calculate current (next hop, dist), & send to neighbors
Bellman-Ford Algorithm
Consider computations for one destination d Initialization Each node table has 1 row for destination d Distance of node d to itself is zero: Dd=0 Distance of other node j to d is infinite: Dj=, for j d Next hop node nj = -1 to indicate not yet defined for j d Send Step Send new distance vector to immediate neighbors across local link Receive Step At node j, find the next hop that gives the minimum distance to d,
Minj { Cij + Dj }
Replace old (nj, Dj(d)) by new (nj*, Dj*(d)) if new next node or distance
Go to send step
Bellman-Ford Algorithm
Now consider parallel computations for all destinations d Initialization Each node has 1 row for each destination d Distance of node d to itself is zero: Dd(d)=0 Distance of other node j to d is infinite: Dj(d)= , for j d Next node nj = -1 since not yet defined Send Step Send new distance vector to immediate neighbors across local link Receive Step For each destination d, find the next hop that gives the minimum distance to d,
Minj { Cij+ Dj(d) }
Replace old (nj, Di(d)) by new (nj*, Dj*(d)) if new next node or distance found
Go to send step
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial 1 2 3
(-1, )
(-1, )
(-1, )
(-1, )
(-1, )
Table entry @ node 1 for dest SJ
2
Table entry @ node 3 for dest SJ
3
2 1
1
5
4
3 1 3
San Jose
6
2
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial
1 2 3
(-1, )
(-1, )
(-1, )
(-1, )
(-1, )
(6,1)
(-1, )
(-1, )
(-1, )
(6,2)
D3=D6+1 n3=6
2
3 1
2 1
D6=0
1
5
4
3 1 3
0
6
5
2
San Jose
2
4
2
D6=0
D5=D6+2 n5=6
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial
1 2 3
(-1, )
(-1, ) (3,3)
(-1, )
(-1, ) (5,6)
(-1, )
(6, 1) (6, 1)
(-1, )
(-1, ) (3,3)
(-1, )
(6,2) (6,2)
3
1
5 3 1
1
3
3
4
2 3
0
6
5
2
San Jose
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial 1 2 3
(-1, ) (-1, ) (3,3) (3,3)
(-1, ) (-1, ) (5,6) (4,4)
(-1, ) (6, 1) (6, 1) (6, 1)
(-1, ) (-1, ) (3,3) (3,3)
(-1, ) (6,2) (6,2) (6,2)
3
1
5 3 1
1
2
3
4
2 3
0
6
5
2
San Jose
6 4
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial 1
(3,3) (3,3)
(4,4) (4,4)
(6, 1) (4, 5)
(3,3) (3,3)
(6,2) (6,2)
2
3
1 5 3
1
5 3 1 2
3
2 3 1
3
4
0
6 5
2
San Jose
Network disconnected; Loop created between nodes 3 and 4
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial 1
2 3
(3,3) (3,3)
(3,7)
(4,4) (4,4)
(4,4)
(6, 1) (4, 5)
(4, 5)
(3,3) (3,3)
(5,5)
(6,2) (6,2)
(6,2)
37
1
5 3 1
5
2
3
2 3 1
53
4
0
6 5
2
San Jose
Node 4 could have chosen 2 as next node because of tie
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
Initial 1
2 3
(3,3) (3,3)
(3,7) (3,7)
(4,4) (4,4)
(4,4) (4,6)
(6, 1) (4, 5)
(4, 5) (4, 7)
(3,3) (3,3)
(5,5) (5,5)
(6,2) (6,2)
(6,2) (6,2)
7
1
5 3 1
5 7
2
2 3
0
6 5
2
San Jose
2
4
46
Node 2 could have chosen 5 as next node because of tie
Iteration
Node 1
Node 2
Node 3
Node 4
Node 5
1 2 3 4
(3,3) (3,7) (3,7) (2,9)
(4,4) (4,4) (4,6) (4,6)
(4, 5) (4, 5) (4, 7) (4, 7)
(3,3) (2,5) (5,5) (5,5)
(6,2) (6,2) (6,2) (6,2)
79
1
5 3 1
7
1
5
4
2 3
0
6 5
2
San Jose
Node 1 could have chose 3 as next node because of tie
Counting to Infinity Problem
(a)
(b)
1
Update
1
Node 1
4
Node 2
Nodes believe best path is through each other (Destination is node 4)
Node 3
Before break
After break
(2,3)
(2,3) (2,3)
(3,2)
(3,2) (3,4)
(4, 1)
(2,3) (2,3)
2
3 4 5
(2,5)
(2,5) (2,7) (2,7)
(3,4)
(3,6) (3,6) (3,8)
(2,5)
(2,5) (2,7) (2,7)
Problem: Bad News Travels Slowly
Remedies Split Horizon
Do not report route to a destination to the neighbor from which route was learned Report route to a destination to the neighbor from which route was learned, but with infinite distance Breaks erroneous direct loops immediately Does not work on some indirect loops
Poisoned Reverse
Split Horizon with Poison Reverse
(a)
(b)
Nodes believe best path is through each other
Update
Node 1 Node 2
Node 3
Before break
After break 1 2
(2, 3)
(2, 3) (2, 3) (-1, )
(3, 2)
(3, 2) (-1, ) (-1, )
(4, 1)
(-1, ) (-1, ) (-1, )
Node 2 advertizes its route to 4 to node 3 as having distance infinity; node 3 finds there is no route to 4 Node 1 advertizes its route to 4 to node 2 as having distance infinity; node 2 finds there is no route to 4 Node 1 finds there is no route to 4