- 2080 Baisakh · 6 marks
Link-state and distance vector routing
Short answer
Link-state routing floods LSPs so all routers know the topology and run Dijkstra; in the example, A's shortest paths are B via B, C via B, D via B, E via B. Distance-vector exchanges neighbour tables and uses the Bellman-Ford equation D_x(y)=min_v{c(x,v)+D_v(y)}; it converges to the same routes but slowly, with count-to-infinity.
Describe the working mechanism of link-state routing and distance vector routing with the help of Dijkstra's algorithm and Bellman-Ford algorithm.
Both are dynamic (adaptive) routing methods. In link-state routing every router learns the whole map and runs Dijkstra's algorithm; in distance-vector routing every router only exchanges distance tables with its neighbours and uses the Bellman-Ford equation.
Example network used below (link costs shown):
A
2 / \ 6
/ \
B --3-- C
| / |
7| 2/ |4
| / |
D --1-- E
Link-state routing (Dijkstra)
- Each router finds its neighbours (HELLO packets) and measures the cost of each link.
- It builds a link state packet (LSP): its ID, sequence number, age and the list of neighbours with costs.
- LSPs are flooded to all routers; each router stores them in a link-state database, so all routers have the same topology.
- Each router runs Dijkstra with itself as root:
- Put the source in the permanent set with ; set other = link cost or .
- Repeatedly make permanent the tentative node with the least , then for each neighbour update .
Dijkstra from A:
| Step | Permanent set | B | C | D | E |
|---|---|---|---|---|---|
| 1 | A | 2, A | 6, A | ∞ | ∞ |
| 2 | A, B | 2, A | 5, B | 9, B | ∞ |
| 3 | A, B, C | 5, B | 7, C | 9, C | |
| 4 | A, B, C, D | 7, C | 8, D | ||
| 5 | A, B, C, D, E | 8, D |
Routing table of A: to B via B (2), C via B (5), D via B (7), E via B (8). Used in OSPF and IS-IS.
Distance-vector routing (Bellman-Ford)
- Each router keeps a vector of its best known distance and next hop to every destination; at start it knows only its direct links.
- Periodically (e.g. every 30 s in RIP) it sends its vector to its neighbours only.
- On receiving vectors, router updates each destination using
- Repeating this, the tables converge to the shortest paths.
For A, neighbours are B (cost 2) and C (cost 6), with converged vectors and :
This is the same result as Dijkstra, reached in 3 exchange rounds (A's vector after rounds: E = 10, 9, 8).
Comparison
| Link state | Distance vector |
|---|---|
| Knows full topology | Knows only neighbours' vectors |
| Floods small LSPs to all | Sends full table to neighbours |
| Fast convergence, loop-free | Slow, count-to-infinity problem |
| More memory and CPU | Simple, less memory |
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Link-state routing as adaptive routing · Telecommunications, chapter 8
- Short note: Routing algorithm in data communication · Telecommunications, chapter 8 · asked 2×
- Strowger switching mechanism · Telecommunications, chapter 1
- Distance vector vs link state routing · Computer Networks and Security, chapter 4 · asked 5×
- Dijkstra's shortest path algorithm · Data Structure and Algorithm, chapter 10 · asked 2×
- Algorithm and flowchart help; Armstrong flowchart · Computer Programming, chapter 2
- OSPF working with routing tables · Internet and Intranet, chapter 2