Experiment:
Distance Vector Routing using Bellman-Ford Algorithm
Aim:
To study and implement the Distance Vector Routing Algorithm using Bellman-
Ford Algorithm to find the shortest path between nodes in a network.
Theory:
Distance Vector Routing is a dynamic routing technique in which each router
calculates the shortest path to all other nodes using the Bellman-Ford algorithm.
In this method, every router maintains a routing table (distance vector) that
contains:
Destination node
Distance (cost) to the destination
Next hop
Routers exchange their routing tables with their immediate neighbors periodically.
After receiving the neighbor’s routing table, each router updates its own table by
applying the Bellman-Ford equation.
Bellman-Ford Equation:
D_x(y)=\min_{v}{c(x,v)+D_v(y)}
Where:
D_x(y) = Shortest distance from node x to node y
c(x,v) = Cost from node x to neighbor v
D_v(y) = Distance from neighbor v to destination y
Working:
Initially, each node knows only the distance to its immediate neighbors.
Nodes exchange routing tables with neighbors.
Using the Bellman-Ford formula, each node updates its shortest path.
This process repeats until all routing tables become stable (convergence).
Features:
Simple and distributed algorithm
Each router works independently
Suitable for small networks
Limitations:
Slow convergence
Routing loops may occur
Count-to-infinity problem
Algorithm:
Distance Vector Routing using Bellman-Ford
Initialization
For each node x:
Set distance to itself = 0
Set distance to all other nodes = ∞
Initialize routing table
Exchange Routing Tables
Each node sends its distance vector to all neighboring nodes
Apply Bellman-Ford Update
For each destination y and neighbor v:
Compute:
New Distance = c(x,v) + Dᵥ(y)
Update Table
If New Distance < Current Distance:
Update distance
Update next hop
Repeat
Continue exchanging and updating tables periodically
Convergence
Stop when no further updates occur
Result:
Thus, the Distance Vector Routing using Bellman-Ford Algorithm is studied and
the shortest path between nodes is obtained successfully.