Distance Vector Routing: Detailed Explanation of the Example
Distance vector routing is a distributed routing method where each router maintains a routing table containing, for every destination, an estimated path cost (the “distance”) and the next hop that provides that best cost. Routers periodically exchange their distance vectors with neighbors, and then recompute best routes using the Bellman-Ford update rule.
In this course section, we explain how the algorithm works on the provided diagram by walking through the neighbor-to-neighbor distance-vector exchanges and the resulting updates. The key conceptual pipeline is:
Key definitions used throughout
- distance vector
- next hop
- count-to-infinity
- split horizon
- poison reverse
Distance Vector Routing (Concepts + Updates)
1) How distance vector computes routes
Assume routers exchange their distance vectors. Let router estimate its cost to destination as . If router has neighbor with link cost , then router can propose a route to through with cost:
Router then chooses the minimum proposed cost over all neighbors :
This is the distributed version of the Bellman-Ford relaxation step. Distances improve as updated information “propagates” through the network over time.
Callout:
- Routers do not compute globally shortest paths in one shot.
- They gradually converge by repeatedly relaxing estimates when new neighbor vectors arrive.
Footnotes
-
Distance vector routing - Wikipedia - Overview of DV routing, neighbor exchanges, and concepts like loops. ↩
-
Bellman–Ford algorithm - Wikipedia - Shows the shortest-path dynamic programming/relaxation rule used conceptually by DV. ↩
Step-by-step walkthrough of the example (distance-vector iteration)
- 1Step 1
Identify the routers (nodes) and the bidirectional or directed links (edges), along with their link costs. For each node , list its immediate neighbors and the corresponding values.
- 2Step 2
For each router : set . For each directly connected neighbor , set . For all other destinations , initialize (unknown/unreachable).
- 3Step 3
Every router sends its current vector to each neighbor.
- 4Step 4
When router receives neighbor ’s vector, compute candidate costs for every destination : . Repeat for all neighbors .
- 5Step 5
For each destination , set to the smallest candidate cost. Record the next hop as the neighbor that achieved the minimum.
- 6Step 6
Continue exchanging and relaxing. Convergence occurs when no routing table entries change between successive rounds.
- 7Step 7
"If the example demonstrates a link failure or change, observe transient behavior and (optionally) how techniques like split horizon and poison reverse mitigate count-to-infinity."
Note: The exact numeric values depend on the link costs and node labels shown in your diagram. The method above is the universal procedure for producing the distance-vector tables for that specific topology.
2) Turning the diagram into distance-vector tables
In a typical distance-vector classroom example, we create a table per iteration showing (cost from to ). In each iteration:
- router uses its neighbors’ advertised costs to infer better paths;
- the best path cost decreases (or stays the same) as information improves;
- next-hop fields update to reflect which neighbor provided the minimum.
A compact way to represent this is with a matrix-like layout:
| Iteration | Router | Destination A | Destination B | … |
|---|---|---|---|---|
| X | … | |||
| X | … | |||
| X | … |
And the update rule for each entry is always the same min-plus expression:
Footnotes
-
Bellman–Ford algorithm - Wikipedia - Shows the shortest-path dynamic programming/relaxation rule used conceptually by DV. ↩
-
Routing Information Protocol (RIP) - Wikipedia - RIP is a classic distance-vector protocol; includes exchange/update behavior. ↩
Pro Tip: how to do the example quickly by hand
Write one row per router per destination, but compute updates destination-by-destination: for a fixed destination , list the neighbors of and evaluate , then pick the smallest.
3) Why distance vector eventually converges (and when it doesn’t behave well)
Distance vector converges because each router repeatedly applies a relaxation that improves estimates until they match the true shortest-path distances (under stable link costs and connectivity). This is closely related to the convergence behavior of Bellman-Ford.
However, distance vector can experience:
- Slow convergence after topology changes (bad news takes time to propagate).
- Routing loops, especially during failures, where nodes keep believing outdated routes.
A famous symptom is the count-to-infinity problem: when a route becomes invalid, routers may continue increasing the reported cost rather than immediately switching to an alternative.
Footnotes
-
Distance vector routing - Wikipedia - Overview of DV routing, neighbor exchanges, and concepts like loops. ↩
-
Count to infinity problem - Wikipedia - Explains slow convergence and routing loops in distance-vector protocols. ↩
Pro Tip / Warning: Count-to-infinity and mitigation
During a failure, DV may loop and increment distances slowly (count-to-infinity). Common mitigations are split horizon and poison reverse to reduce the chance of advertising routes back to the interface they came from.
Typical DV lifecycle over iterations
Initialize
t=0Set , direct neighbors to link cost, and others to ."
Exchange vectors
t=1..kNeighbors share their current distance vectors."
Update routing tables
Relaxation roundsFor each destination, compute and take the min."
Stable shortest paths
ConvergedRouting-table entries stop changing (if link costs are stable)."
Transient instability
Change occurs (optional)May trigger temporary loops and count-to-infinity unless mitigated."
Distance-vector update intuition (example of candidate costs)
For a fixed router X and destination d, the algorithm compares candidate costs via each neighbor y.
Common pitfalls when explaining an example DV diagram
Knowledge Check
In distance vector routing, router X computes its estimate to destination d using which rule?