Computer Networks · Distance Vector and Link State Routing
Distance Vector Routing: Working and Example Setup
Overview
Distance Vector Routing (DVR) is a dynamic routing algorithm in which each router determines the shortest path to every other router, and hence to every network attached to those routers.
It was the original routing algorithm, popular and efficient in the 1980s, and remains foundational alongside Link State Routing (LSR). Both are standard dynamic routing algorithms and are heavily tested in GATE.
Key concepts
- Dynamic routing algorithms: Algorithms whose routing decisions change depending on traffic and topology; these are the algorithms generally used in the Internet.
- DVR (Distance Vector Routing): A routing algorithm used since the invention of routers; very popular and efficient in the 1980s and the original routing algorithm.
- LSR (Link State Routing): The second of the two most popular dynamic routing algorithms, alongside DVR.
- Graph model: Routers are the nodes (vertices) and the connections between them are the edges (links).
- Edge weight: A number on each edge representing cost, distance, traffic, queuing delay, propagation delay at the node, or any similar quantity; the interpretation depends on the design, but the algorithm only needs a number to minimize.
- Goal: Minimize the total distance between every pair of vertices — at every node, determine how it can reach every other node using the shortest path.
How it works
- Focus only on routers: Although a packet ultimately travels host-to-host, the problem is reduced to finding the shortest path from one router to another.
If a router is reached in the shortest way, all networks connected to that router are also reached in the shortest way, because every network is connected to some router.
So all networks are "pulled out" and only routers are kept in the graph. - Model the network as a graph: Routers become nodes/vertices and the connections between them become edges (links). For example, four routers A, B, C, D connected by links.
- Assign edge weights: Each edge carries a number representing cost, distance, traffic, queuing delay, propagation delay at the node, or a similar quantity.
- Interpret a weight: A weight of 2 on the edge A–B means the distance (or cost, or propagation delay, or queuing delay at B) from A to B is 2.
- Minimize: At every node, find the path to every other node with the minimum total weight.
Formulas
- means the distance (or cost, or propagation delay, or queuing delay at B) from A to B is 2.
- Objective: minimize the total distance between every pair of vertices.
Revision summary
- DVR and LSR are the two standard dynamic routing algorithms; both are very important for GATE.
- DVR is the original routing algorithm, popular and efficient in the 1980s.
- In routing analysis, consider only routers as nodes; links are edges with weights.
- Edge weights may represent cost, distance, traffic, queuing delay, or propagation delay — the algorithm minimizes the total weight of the path.
- Reaching a router by the shortest path also reaches all networks attached to that router by the shortest path.
Previous-year exam insights
- Distance Vector Routing is the Bellman-Ford (distributed) algorithm: each router keeps a distance vector of (destination, cost, next hop), periodically sends its whole vector only to its direct neighbours, and updates via D(i,j) = min over neighbours k of [c(i,k) + D(k,j)].
Link State Routing floods link-state packets to all routers, each builds the full topology and runs Dijkstra locally.
Asked inGATE 2014GATE 2017ISRO 2017 - Count-to-infinity / slow convergence and the routing-loop problem are specific to distance vector routing; remedies are split horizon, poison reverse, split horizon with poison reverse, and triggered updates.
Link state routing does not suffer count-to-infinity.
Asked inGATE 2005UGC NET 2013GATE 2014 - Protocol mapping: RIP is a distance vector interior gateway protocol using hop count (max 15, 16 = infinity) and is carried over UDP;
OSPF is a link-state interior gateway protocol carried directly over IP (protocol number 89, not TCP/UDP);
BGP is the exterior gateway protocol (path vector, over TCP).
Asked inGATE 2017ISRO 2017 - Comparison for large networks: link state has higher computational overhead (Dijkstra at every node over the full topology) and larger per-node memory, but converges faster after topology changes; distance vector has lower computation/memory per node but slower, iterative convergence and larger message exchange with neighbours.
Asked inGATE 2014 - In distance vector convergence problems, a link is 'used' if it lies on some router's shortest-path tree (i.e., appears as a next hop in some routing table); after stabilization, count links that are on no shortest path as unused.
Asked inGATE 2010 - Routing loops after a link failure arise because neighbours may still advertise stale routes through each other; the probability of a loop depends on the order/timing of updates from the two ends of the failed link (e.g., if the router still holding the old route updates first, the other adopts the longer route through it).
Asked inGATE 2022GATE 2005