# Q7(c) · Distance vector versus link state

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/papers/paper-2024-final/q7c

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/papers/paper-2024-final--q7c/

Actual paper; 100 marks attempted. Current-syllabus alignment is stated per question.

### Q7(c). Compare and contrast distance vector and link state routing. Any 5 points each. [5 marks]

### Answer

**Definition.** RIP and OSPF are routing protocols; Bellman–Ford and Dijkstra are algorithms underlying different route-computation approaches.

**Simple meaning.** Protocol message bhejta hai; algorithm route calculate karta hai.

## Understand it step by step

1. RIP uses distance-vector information and a bounded hop metric. OSPF distributes link-state information and computes paths using additive costs.
2. A generic Bellman–Ford graph exercise can contain negative weights; RIP’s ordinary hop-count metric does not.
3. Dijkstra assumes nonnegative edge weights. Do not select it for the negative-weight re-exam graph simply because the question says “routing”.
4. State whether a drawn graph is directed or undirected before solving. Both algorithms can be applied to appropriate directed graphs.

#### Practical example

The December paper explicitly gives positive directed edges and asks for Dijkstra. The February paper includes negative directed edges and asks for Bellman–Ford.

| Feature | RIP | OSPF |
| --- | --- | --- |
| Family | Distance vector | Link state |
| Typical metric | Hop count; 16 unreachable | Sum of configured link costs |
| Knowledge exchanged | Destination distances via neighbours | Link-state information |
| Algorithm connection | Distributed Bellman–Ford idea | Dijkstra shortest paths |
| Scale design | Small/simple networks; limited diameter | Area-based scalable design |

**Yaad rakho:** Distance vector → RIP; link state → OSPF.

### Distance vector versus link state: five direct comparisons

| Point | Distance vector | Link state |
| --- | --- | --- |
| Information exchanged | Destination-distance estimates and route information | Descriptions of local links, neighbours and link costs |
| Recipient / distribution | Neighbour-to-neighbour exchange | Flooding across the routing domain or area |
| Topology knowledge | Ordinarily no complete topology map; relies on neighbours' advertised distances | Builds a link-state database representing the area topology |
| Computation | Distributed Bellman–Ford style minimum via neighbours | Dijkstra shortest-path tree from the router itself |
| Convergence / resource tradeoff | Simple advertisements, but failures can cause count-to-infinity and transient loops | More database/computation and flooding overhead; topology changes can be propagated promptly |

RIP and OSPF illustrate these families, respectively. Exact convergence time depends on timers, topology and implementation, so neither family has one universal time bound.
