Skip to content
FALCON CORETECHNOLOGIES

// Lesson 30 of 49 · IP routing

OSPF concepts

Link-state routing, router IDs, neighbour states, DR/BDR election, areas, LSAs and cost.
3 min read#ospf#link-state

OSPF (Open Shortest Path First) is the most common interior routing protocol in enterprise networks. It is an open standard (OSPFv2 for IPv4, OSPFv3 for IPv6).

Every OSPF router describes its own links in LSAs (link-state advertisements) and floods them to all routers in the area. Each router builds the same link-state database (LSDB) — a map of the area — and runs the SPF (Dijkstra) algorithm to calculate the shortest path to every network. Changes are flooded immediately, so convergence is fast.

OSPF single area with a DR and BDR on a shared segment

Router ID

Every OSPF router needs a unique 32-bit router ID (RID), chosen in this order:

  1. Configured with router-id.
  2. Highest IP address on a loopback interface.
  3. Highest IP address on any active interface.

Always configure it explicitly — it makes troubleshooting much easier. A changed router ID takes effect only after clear ip ospf process.

Neighbours and adjacency

Routers discover each other with Hello packets sent to 224.0.0.5. To become neighbours, these must match:

  • Area ID
  • Subnet and mask on the shared link
  • Hello and dead intervals (defaults 10 s / 40 s on Ethernet)
  • Authentication (if used)
  • Stub area flags
  • MTU (otherwise they get stuck in EXSTART/EXCHANGE)

Router IDs must be different.

Neighbour states: Down → Init → 2-Way → ExStart → Exchange → Loading → Full. FULL means the databases are synchronised.

DR and BDR

On multi-access networks such as Ethernet segments, every router becoming fully adjacent with every other would create a lot of flooding. Instead, OSPF elects a Designated Router (DR) and a Backup DR (BDR):

  • All routers form FULL adjacencies only with the DR and BDR (with each other they stay 2-WAY, called DROTHERs).
  • Updates go to the DR/BDR on 224.0.0.6; the DR refloods them to 224.0.0.5.
  • Election: highest interface priority (default 1; 0 = never DR), then highest router ID.
  • The election is not pre-emptive: a better router joining later does not take over until the DR fails or OSPF restarts.

On point-to-point links (and links configured as ip ospf network point-to-point) there is no DR/BDR — a sensible choice for links between two routers.

Areas

Large OSPF networks are split into areas to limit flooding. Area 0 (backbone) connects all other areas; routers linking areas are ABRs, routers connecting to other routing domains are ASBRs. The CCNA focuses on single-area OSPF; multi-area designs and LSA types are covered in CCNP.

Cost

OSPF's metric is cost = reference bandwidth ÷ interface bandwidth. The default reference bandwidth is 100 Mbps, so FastEthernet, Gigabit and 10 Gigabit all get cost 1 — not useful today. Set the same higher reference on every router:

R1(config-router)# auto-cost reference-bandwidth 100000     ! in Mbps = 100 Gbps

The route's total cost is the sum of the outgoing interface costs along the path.

Key points

  • Link-state: LSAs → identical LSDB → SPF per router.
  • Neighbours need matching area, subnet, timers, authentication and MTU; different router IDs.
  • DR/BDR on multi-access links; priority then router ID; not pre-emptive.
  • Cost = reference bandwidth / interface bandwidth; raise the reference bandwidth everywhere.

Sign in to save your lesson progress across devices. You can read every published lesson without an account.