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.
| Mechanism | What is advertised back towards the learned next hop? | Limitation |
|---|---|---|
| Plain distance vector | Current estimate | Can reinforce a loop |
| Split horizon | Route is omitted | Does not eliminate every multirouter loop |
| Poisoned reverse | Unreachable/infinite metric | Stops the simple two-router mutual dependency; not all larger loops |
| Route poisoning | Failed route advertised as unreachable | Delivery/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.
5.3 Link-state database and route computation
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 routers and links, an array implementation takes time; a binary heap takes . A topology database needs 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.