Distance Vector vs Link State Routing: Core Differences and How They Work
In IP networks, routers must routing routes using distributed algorithms. The major difference is:
- Distance-vector routing: each router exchanges only distance-to-destination information with neighbors, then computes routes using an iterative update rule (commonly derived from Bellman–Ford).
- Link-state routing: each router discovers local link states, floods them to all routers, builds a consistent topology view, then computes shortest paths using Dijkstra’s algorithm.
This difference in information exchanged drives the contrast in convergence behavior, scalability, and typical protocol design. Distance-vector protocols (e.g., RIP) focus on neighbor-to-neighbor updates; link-state protocols (e.g., OSPF) focus on topology dissemination followed by SPF computation.
Key takeaway: Distance-vector routing spreads reachability costs, while link-state routing spreads network topology (link states).
Footnotes
-
Wikipedia - Distance-vector routing https://en.wikipedia.org/wiki/Distance-vector_routing - Overview of the distance-vector model and iterative updates. ↩
-
Wikipedia - Bellman–Ford algorithm https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm - Relationship to relaxation-based shortest-path computation used in distance-vector ideas. ↩
-
Wikipedia - Link-state routing https://en.wikipedia.org/wiki/Link-state_routing - General mechanism: link-state dissemination and shortest-path computation. ↩
Routing Fundamentals: Distance Vector vs Link State (Concepts)
How distance-vector routing works (e.g., RIP-style)
In distance-vector routing, each router maintains a distance vector: for each destination network , it stores the current best known cost and the corresponding next hop. Routers periodically send this vector to immediate neighbors, and upon receiving neighbors’ vectors, a router updates its own table using a relaxation rule based on:
where is the router ’s estimated cost to destination , is the cost from to neighbor , and is neighbor ’s advertised cost to . This is the intuition behind the Bellman–Ford family of updates.
In practice, routers must manage issues like slow convergence and routing loops; distance-vector protocols use mechanisms such as split horizon, poisoned reverse, and triggered updates (implementation details vary by protocol). These mechanisms exist largely because routers only know what neighbors report, not the entire global topology.
Footnotes
-
Wikipedia - Distance-vector routing https://en.wikipedia.org/wiki/Distance-vector_routing - Overview of the distance-vector model and iterative updates. ↩
-
Wikipedia - Bellman–Ford algorithm https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm - Relationship to relaxation-based shortest-path computation used in distance-vector ideas. ↩
-
Wikipedia - Count to infinity problem https://en.wikipedia.org/wiki/Count_to_infinity - Describes routing loop/convergence pathology common in distance-vector approaches. ↩
How link-state routing works (e.g., OSPF-style)
In link-state routing, each router discovers the status/cost of its directly connected links and constructs a local description of the graph around itself. It then creates link-state advertisements (LSAs) and uses flooding so that all routers receive a consistent set of link-state data.
After flooding, routers store received LSAs in a shared local link-state database (LSDB) and compute shortest paths from themselves to every destination using SPF (often implemented with Dijkstra’s algorithm).
This workflow is:
- Detect neighbor/link changes locally
- Flood updated LSAs through the network
- Recompute shortest paths from the topology
Because every router can run SPF on the same (logically consistent) topology state, link-state routing is typically faster and more stable in many network scenarios than distance-vector routing.
Footnotes
-
Wikipedia - Bellman–Ford algorithm https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm - Relationship to relaxation-based shortest-path computation used in distance-vector ideas. ↩
-
Wikipedia - Link-state routing https://en.wikipedia.org/wiki/Link-state_routing - General mechanism: link-state dissemination and shortest-path computation. ↩
-
OSPF (Wikipedia) - OSPF uses LSAs, LSDB, and SPF/Dijkstra https://en.wikipedia.org/wiki/Open_Shortest_Path_First - Key operational concepts of OSPF. ↩
-
RFC 2328 (OSPF) - Flooding LSAs and database concept https://www.rfc-editor.org/rfc/rfc2328 - Formal specification of OSPF, including link-state advertisements and flooding behavior. ↩
Distance-Vector Routing Workflow (Conceptual)
- 1Step 1
Set cost to directly connected networks; initialize unreachable destinations as infinite.
- 2Step 2
Periodically (or triggered) advertise your current distance vector to each neighbor.
- 3Step 3
For each destination, read neighbors’ advertised costs .
- 4Step 4
Compute and update next-hop if improved.
- 5Step 5
When costs/links change, propagate new vectors (often with loop-prevention mechanisms).
Link-State Routing Workflow (Conceptual)
- 1Step 1
Measure/record costs to directly connected neighbors and links.
- 2Step 2
Generate LSAs describing the local link-state; flood them so every router learns them.
- 3Step 3
Maintain the latest link-state entries per router in the LSDB.
- 4Step 4
Using the LSDB topology, compute shortest paths from the local router to all destinations.
- 5Step 5
Translate computed paths into forwarding-table entries (next hops).
Major difference (direct statement)
Distance-vector routing distributes distance/cost vectors to destinations with neighbors and updates routes iteratively based on what neighbors report. Link-state routing distributes link-state/topology information via flooding so each router can compute shortest paths from a shared topology view.
This yields common behavioral contrasts:
- Convergence: distance-vector may converge more slowly and can suffer from transient loops/“counting to infinity,” while link-state tends to be more deterministic due to consistent topology computation.
- Scalability: link-state is designed for large networks via structured areas (in protocols like OSPF), whereas basic distance-vector scales less gracefully due to vector-size and periodic update overhead.
Footnotes
-
Wikipedia - Bellman–Ford algorithm https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm - Relationship to relaxation-based shortest-path computation used in distance-vector ideas. ↩
-
Wikipedia - Count to infinity problem https://en.wikipedia.org/wiki/Count_to_infinity - Describes routing loop/convergence pathology common in distance-vector approaches. ↩
-
OSPF (Wikipedia) - OSPF uses LSAs, LSDB, and SPF/Dijkstra https://en.wikipedia.org/wiki/Open_Shortest_Path_First - Key operational concepts of OSPF. ↩
-
RFC 2328 (OSPF) - Flooding LSAs and database concept https://www.rfc-editor.org/rfc/rfc2328 - Formal specification of OSPF, including link-state advertisements and flooding behavior. ↩
Pro Tip
If you remember only one thing: distance-vector = “neighbors tell you costs”; link-state = “routers share topology”. That single distinction explains most practical differences.
Common Pitfall
Don’t confuse the routing metric (cost) with the information exchanged. Distance-vector exchanges costs only; link-state exchanges link states (enabling global shortest-path computation).
FAQ: Quick checks on understanding
Routing Update Lifecycles (Change Propagation)
Event detected
1) Link/metric change occursRouters observe a change in directly connected link costs/states."
Vector updates sent
2) Distance-vector propagationEach router advertises updated distance vectors to neighbors; updates propagate hop-by-hop."
LSA flooding
2) Link-state propagationEach router floods LSAs; routers learn the change more directly across the network."
Relax vs SPF
3) Recompute routesDistance-vector: relax received distance estimates. Link-state: run SPF/Dijkstra over LSDB."
Routes installed
4) Forwarding table updateRouters update forwarding entries based on computed best paths."
Knowledge Check
What is the major difference in the information exchanged by distance-vector and link-state routing?