Interconnection · Lesson 07

How does OSPF find paths inside a network?

OSPF (Open Shortest Path First) is a link-state routing protocol that builds a shared topology view inside an autonomous system.

A shared topology

Routers describe links, then calculate locally.

OSPF routers advertise the state and cost of their links. Each router builds a link-state database that represents the area, then runs a shortest-path calculation from itself to choose forwarding entries.

OSPF distributes topology, not a single route table.Every router can calculate its own next hops from the shared link-state information.

Build the model

Four OSPF ideas

01

Link state

Describes which neighbours and links are present.

02

Cost

Weights links for path calculation.

03

LSDB

Stores the shared link-state database.

04

SPF

Computes shortest paths from the local router.

The OSPF cycle

An LSA becomes a route through three steps.

First, a router creates a link-state advertisement (LSA) describing its links, neighbours, and relevant costs. Routers flood that information through the OSPF area so other routers can learn the same topology facts.

Each router stores the received LSAs in its link-state database (LSDB). The LSDB is the local topology graph, not the forwarding table itself. The router then runs shortest path first (SPF) from its own position through that graph and installs the resulting next hops in its forwarding table.

LSA describes, LSDB collects, SPF calculates.When a link changes, the cycle repeats: new information updates the database, SPF recalculates, and forwarding entries converge toward the new topology.

Mini experiment

Choose a topology change

Observe how a link-state update affects the local calculation.

OSPF EVENTLowest total cost

The router selects the path whose link costs add up to the smallest total.

OSPF prefers the lowest calculated cost, not necessarily the fewest physical hops.

Knowledge check

Test your OSPF model

Answer five questions.

0 / 5