# Q3(c) · OSPF routing

Subject: Computer Networks

Exam: TEE

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

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

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

### Q3(c). Explain briefly OSPF routing algorithm. [5 marks]

### Answer

**Definition.** Open Shortest Path First (OSPF) is an interior link-state routing protocol that selects routes using shortest-path calculations and additive link costs.

**Simple meaning.** OSPF = link-state map + Dijkstra + summed costs.

## Understand it step by step

1. Routers discover and maintain neighbour relationships using Hello packets and exchange link-state information.
2. Routers calculate shortest paths from their own position in the topology. A path cost is the sum of its outgoing-link costs, not necessarily the fewest hops.
3. The network can be divided into areas. In normal OSPF hierarchy, Area 0 is the backbone used to interconnect other areas via area border routers.
4. OSPFv2 is the IPv4 protocol in the supplied paper; it is carried directly in IP protocol number 89, not TCP/UDP port 89.
5. A common vendor default derives interface cost from reference bandwidth/interface bandwidth, but actual configured costs and reference bandwidth matter. Use the given costs in an exam graph.

#### Practical example

Route A→B→D costs 10+10=20 while A→C→D costs 5+8=13. OSPF’s cost comparison prefers the latter even though both have two links.

OSPF exchanges and maintains link-state information, builds a topology database and runs Dijkstra’s shortest-path computation rooted at the local router. It chooses a path with the lowest sum of link costs and installs the corresponding next hop. Equal-cost paths may be supported.

**Yaad rakho:** OSPF cost add karo; sirf hops nahi.
