Chapter 5

Distance vector and link state

Routing builds a forwarding table; forwarding uses that table on each packet. A router may use static entries without running a dynamic routing protocol. Both retained routing families seek low-cost paths, but they exchange different information.

5.1 Distance-vector updates

Past papers · CS 2014–2026 (23 papers): 1 question, 2 marks

A router knows its incident link costs and receives neighbours' distance estimates. It chooses a next hop for each destination. The estimate through a neighbour is the cost to that neighbour plus that neighbour's advertised remaining cost.

5.2 Loops and convergence

Past papers · CS 2014–2026 (23 papers): 2 questions, 3 marks

After a link failure, neighbours can mistake each other's stale route for an independent surviving path. Their metric then rises in repeated updates: count to infinity. Bad news can propagate slowly. A triggered update reports changes promptly, but stale advertisements can still race.

MechanismWhat is advertised back towards the learned next hop?Limitation
Plain distance vectorCurrent estimateCan reinforce a loop
Split horizonRoute is omittedDoes not eliminate every multirouter loop
Poisoned reverseUnreachable/infinite metricStops the simple two-router mutual dependency; not all larger loops
Route poisoningFailed route advertised as unreachableDelivery/order of updates still matters

RIP is a distance-vector interior routing protocol. Its usable hop counts extend to 15; 16 means unreachable. RIP uses UDP port 520. That is an encapsulation fact for the routing protocol, not a treatment of UDP. The port is specified in RFC 2453.

For an update-order probability, enumerate the possible first advertisements that can change a route. With two independent exponential clocks of equal rate, each wins with probability one-half. Equal average update rates alone do not specify arbitrary renewal distributions; use the random-order model stated or intended in the question.

Past papers · CS 2014–2026 (23 papers): 4 questions, 4 marks

Each router originates information about its own links and costs. Reliable dissemination gives routers a topology database; sequence numbers and age distinguish fresh advertisements from stale ones. Each router computes its own shortest-path tree. Do not confuse dissemination of link-state control messages with forwarding every data packet by flooding.

For VV routers and EE links, an array implementation takes O(V2)O(V^2) time; a binary heap takes O((V+E)log⁡2V)O((V+E)\log_2 V). A topology database needs O(V+E)O(V+E) storage. In the usual textbook comparison, computing routes from the full topology is more computationally demanding than one distance-vector update from neighbours. This is a comparison of work per calculation, not an unconditional bound on total convergence work or routing-message bandwidth.

OSPF uses link state and Dijkstra inside an autonomous system; it supports areas and a backbone. It is not an inter-domain distance-vector protocol. OSPF is carried directly by IP (protocol 89), rather than over TCP. Distance vector shares destination estimates with neighbours; link state disseminates local link information throughout its routing scope.

Last-minute recall

  • Routing computes paths; forwarding applies the installed table.
  • Distance-vector candidates include the first-hop cost.
  • Keep synchronous and asynchronous update rules separate.
  • Split horizon is not a proof that all loops are impossible.
  • RIP uses distance vector; OSPF uses link state.
  • OSPF is an interior protocol with hierarchical areas.
  • Link-state shortest paths require nonnegative link costs for Dijkstra.
  • Freshness and update timing matter even when the final shortest paths are correct.

Revise offline: the whole Computer Networks handbook as one PDF

47 pages · 2.1 MBFree to read online. Sign in to download the PDF.We save the handbook, version and request time in My downloads. Privacy policy

All chapters · Corrections