All topic guides
Routing

OSPF Fundamentals

Link-state behavior, LSAs and LSDB, SPF, packet types, timers, Router ID, and single-area configuration.

How the sources were combined

Chris Bryant Bootcamp OSPF Notes 1 and jdepew88 OSPF.md supply the lab-style depth. This page keeps CCNA fundamentals only — neighbors, DR/BDR, and areas move to the follow-on guide; OSPFv3 has its own page.

Overview

Open Shortest Path First (OSPF) is the primary CCNA link-state IGP. Unlike distance-vector protocols that periodically advertise whole routing tables, OSPF routers exchange link-state advertisements (LSAs) bundled in link-state updates (LSUs), build a shared link-state database (LSDB), and run Shortest Path First (SPF / Dijkstra) locally to choose best paths.

This guide covers OSPF mechanics and single-area configuration. For neighbor states, DR/BDR, cost tuning, and multi-area design, continue to OSPF Neighbors, DR/BDR, Cost, and Areas. For IPv6, see OSPFv3 for IPv6.

Link-state vs distance vector

BehaviorDistance vector (RIP)Link state (OSPF)
What is exchangedFull/partial route tables to neighborsLSAs describing local links
Topology viewNext-hop rumor from neighborsFull area topology in the LSDB
ConvergencePeriodic updates; loops possible during changeSPF recalculates quickly on change
MetricHop countCost (bandwidth-based)
Info

Link = router interface. Link state = description of that interface and its relationship to neighbors. All link states in an area form the LSDB — the input to SPF.

LSAs, LSUs, LSDB, and SPF

  1. Routers discover neighbors with Hello packets (covered in detail on the neighbors guide).
  2. After adjacency, routers exchange DBD, LSR, and LSU packets to synchronize the LSDB.
  3. Each router runs SPF (Dijkstra) against the LSDB to populate the routing table.

OSPF does not periodically flood entire routing tables like RIP. After the initial exchange, updates are event-driven (topology change), with LSAs refreshed on a 30-minute timer in production networks.

OSPF Topo Simple

Simple OSPF topology — each router builds the same area LSDB, then runs SPF independently.

From study charts · jdepew88 CCNA notes

OSPF Packet Anatomy - 24 Octets

OSPF 24-byte common header — every OSPF packet shares this structure.

From study charts · jdepew88 CCNA notes

OSPF packet types

TypeNamePurpose
1HelloDiscover/maintain neighbors; carry timer, area, auth, and stub flags
2DBD (Database Description)Summary of LSAs in the local LSDB
3LSR (Link State Request)Request full details for missing LSAs
4LSU (Link State Update)Carries one or more LSAs
5LSAckAcknowledges received LSUs

Hello and dead timers

Hello packets are the heartbeat of OSPF. Hello and dead intervals must match between neighbors on the same segment.

Network typeHello (default)Dead (default)
Broadcast / Point-to-Point10 sec40 sec
NBMA / Point-to-Multipoint30 sec120 sec

Dead interval is normally 4 × hello. When you change hello on an interface, IOS typically adjusts dead automatically.

Hellos are sent to 224.0.0.5 (All OSPF routers). OSPF uses IP protocol 89 — not TCP or UDP.

Router ID and process ID

Router ID (RID): 32-bit dotted-decimal identity for the router in OSPF.

Selection order when OSPF starts:

  1. Manually configured router-id
  2. Highest loopback IP address (if any)
  3. Highest active physical interface IP

Best practice: set a loopback or manual RID so an interface flap does not change OSPF identity. After changing RID, run clear ip ospf process or reload the router.

Process ID: 1–65535, locally significant only — it does not need to match neighbors. It lets you run multiple OSPF processes on one router (uncommon at CCNA).

Enabling OSPF: network statement vs interface

Classic single-area config uses a wildcard mask in the network statement:

Single-area OSPF with network statement

router ospf 1 router-id 1.1.1.1 network 10.0.0.0 0.255.255.255 area 0

Wildcard mask in network statement

OSPF network uses a wildcard mask, not a subnet mask. network 192.168.1.0 0.0.0.255 area 0 enables OSPF on interfaces in 192.168.1.0/24.

Modern interface-level config is explicit and common in labs:

interface GigabitEthernet0/0
 ip address 10.1.1.1 255.255.255.0
 ip ospf 1 area 0

Both approaches can coexist — pick one style per lab for clarity. Area 0 is the OSPF backbone; CCNA single-area labs place every router in Area 0.

LSA types (CCNA awareness)

TypeNameGenerated by
1Router LSAEvery router — links in the area
2Network LSADR on multi-access segments
3Summary LSAABR — routes between areas
4ASBR SummaryABR — path to ASBR
5External LSAASBR — routes from outside OSPF

Single-area CCNA labs focus on Type 1 and Type 2. Inter-area and external types appear when you read show ip route ospf on multi-area topologies — see the neighbors and design guide.

OSPF Areas LSA Summary

LSA types by area role — awareness for reading the OSPF database.

From study charts · jdepew88 CCNA notes

Core verification commands

For a lab submission workflow with grouped show commands and an x-remote YAML playbook, see OSPF CLI Verification.

OSPF fundamentals verification

show ip ospf show ip ospf interface brief show ip ospf interface show ip ospf database show ip ospf neighbor show ip route ospf show ip protocols

CommandWhat it tells you
show ip ospf neighborAdjacency state — target FULL for synchronized LSDB
show ip ospf databaseLSDB contents for the area
show ip protocolsProcess ID, RID, networks, and passive interfaces
show ip route ospfRoutes learned via OSPF

Exam checklist

Info

OSPF is link-state: LSAs → LSDB → SPF → routing table. It does not behave like RIP's periodic full-table updates.

Tip

Process numbers are locally significant. Hello/dead timers, area ID, and subnet must match — process ID does not.

Area 0 is the backbone

Even in "single-area" OSPF, that area is Area 0. Multi-area designs require inter-area traffic to transit the backbone — covered on the neighbors and design guide.

Quick review

  • OSPF floods LSAs/LSUs, builds an LSDB, and runs SPF — not periodic full routing tables
  • Protocol 89; Hellos to 224.0.0.5
  • Hello/dead must match; broadcast default 10/40
  • Process ID is local; Router ID must be unique
  • Enable with network … area 0 or ip ospf 1 area 0
  • Verify with show ip ospf neighbor and show ip route ospf

Related lessons on this site

Continue in this domain

Routing · guide 2 of 6

Sources & further reading

jdepew88 CCNA Notes (markdown)

psaumur CCNA Course Notes

This page is an amalgamated study guide synthesized from the markdown sources above, cross-checked against Cisco's official CCNA exam topics. Verify scope before your exam date.