# Q4 · OSPF operation and packets

Subject: Computer Networks

Exam: M2

Reader: https://deep-learning-study-room.vercel.app/cn/#m2/mocks/mock-b/q4

Canonical: https://deep-learning-study-room.vercel.app/read/cn/m2/mocks/mock-b--q4/

Q1(a)+Q1(b) compulsory; choose any two of Q2/Q3/Q4 · 10 marks attempted

### Question. Explain how OSPF learns the topology and selects a route. Name its five packet types. [3 practice marks]

#### Answer

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.

#### 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.

Five packet types: Hello, Database Description, Link State Request, Link State Update and Link State Acknowledgment.
