36-Routing Protocol-Distance Vector-Bellman Ford Algorithm-26-10-2023
36-Routing Protocol-Distance Vector-Bellman Ford Algorithm-26-10-2023
Essential
4
3 1 3 6
2
2 5
4
Shortest Path Approaches
Dj
Cij
j
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 don’t know the shortest paths
i only has local info
from neighbors San
Dj' Jose
j'
Cij'
Dj
Cij j
i
Cij” Pick current
Di j"
Dj" shortest path
Bellman-Ford Algorithm-Minimum cost
• To find the minimum cost from each node to the destination node
(node 6 ).
• Each node ‘i’ maintains an entry (n,𝐷𝑖 ),
• where ‘n’ is the next node and
• Di is the current minimum cost from node ‘i’ to the
destination.
Steps involved
2 3
1 1
5 2
4
3 1 3 6
2
2 5
4
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
2
2 5
4
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
D3=D6+1
n3=6
D6=0
2 3 1
1 1
5 2
0
4 San
3 6
1 3
Jose
2 5 2
4
2
D5=D6+2 D6=0
n5=6
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
3 1
2 3
1 1
5 2
3 0
4 San
3 6
1 3
Jose
2 2
5
4
6 2
Iteration Node 1 Node 2 Node 3 Node 4 Node 5
1
3 2 3
1 1
5 2
3 0
4 San
3 6
1 3
Jose
2
2 5
4
6 4 2
Shortest path tree to node 6
2 3
1 1
2
4
1 6
2
2 5