# Q3B · OSPF

Subject: Computer Networks

Exam: TEE

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

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

TEE · 100 attempted marks · solutions for every choice · current syllabus 702AI0C023

### TEE practice mock · Q3B. Summarize how OSPF determines the best path to a destination network. [5 mock marks]

#### Answer

Swipe across the diagram to read its labels ↔

![Link-state routing: from local links to a shortest-path tree](https://deep-learning-study-room.vercel.app/cn/fig/link-state.bbee3173ec.svg)

Diagram: Link-state routing: from local links to a shortest-path tree. Labels: Link-state routing: from local links to a shortest-path tree | Link-state routing: from local links to a shortest-path tree | 1. Discover neighbours and costs | Each router measures or configures its local link information. | 2. Flood link-state information | Routers share topology information within the routing scope. | 3. Maintain the topology database | New information updates the shared view after convergence. | 4. Run Dijkstra from this router | Add link costs; install the resulting next hops.

Build the topology, then calculate the route.

1. Discover/maintain neighbours and determine local link costs.
2. Exchange link-state information and synchronize the database within the appropriate area.
3. Run Dijkstra’s shortest-path algorithm with the current router as the root.
4. Add outgoing link costs along candidate paths and select minimum-cost routes.
5. Install next-hop information; recalculate when relevant topology information changes.

#### Practical example

Path A→B→D costs 10+10=20, whereas A→C→D costs 5+8=13. The latter is preferred under those metrics. OSPF can support equal-cost alternatives.
