OSPF Overview: Characteristics, Areas, LSAs and SPF Routing
Open Shortest Path First (OSPF) is an open-standard link-state Interior Gateway Protocol that builds a topology database, floods LSAs inside areas, and uses the SPF algorithm to calculate loop-free routes for enterprise networks.
OSPF at a Glance
OSPF is a classless, hierarchical routing protocol for IP networks. It uses LSAs to describe topology, stores those LSAs in a link-state database, calculates the shortest path with SPF, and installs routes based on interface cost. OSPF supports IPv4 with OSPFv2 and IPv6 with OSPFv3.
In This Lesson
1. OSPF Characteristics Summary
This is the fast revision view of OSPF behavior. Use it before configuration practice, interview prep, or CCNP ENARSI troubleshooting labs.
| Category | OSPF Characteristic |
|---|---|
| Protocol model | Link-state routing protocol, Interior Gateway Protocol (IGP), open standard, classless routing, hierarchical topology, scalable to large enterprise domains. |
| IP support | IP-only routing with IPv6 support through OSPFv3. |
| Transport behavior | Layer 3 protocol using IP protocol 89. OSPF does not use TCP or UDP. |
| Administrative distance | 110. |
| Metric | Interface cost based on bandwidth. Default reference bandwidth is 100 Mbps. |
| Topology database | Maintains a global database topology table known as the link-state database (LSDB), built from LSAs. |
| Path calculation | Uses the SPF algorithm. The shortest path to each destination is calculated from the LSA table. |
| Updates | Event-triggered routing updates, plus LSA refresh every 30 minutes. |
| Hop count | Unlimited. OSPF is not constrained by a 15-hop limit like RIP. |
| Loop prevention | Native loop prevention through SPF calculation and consistent link-state topology. |
| Network statements | Uses wildcard masks in classic Cisco IOS network statements. |
| Authentication | Supports none, text password, and MD5 authentication, depending on platform and configuration. |
| Summarization | Route auto-summarization is not supported. Summarization is configured manually at ABRs and ASBRs. |
| Load balancing | Supports equal-cost load balancing. Cisco default is 4 equal-cost paths. |
2. Protocol Architecture
OSPF routers discover neighbors with Hello packets. If key values match, neighbors form adjacencies and exchange database description packets, link-state requests, link-state updates, and link-state acknowledgements. The shared result is the LSDB for that area.
- LSDB: The link-state database stores LSAs that describe routers, links, networks, summaries, external routes, and NSSA routes.
- SPF: Dijkstra's Shortest Path First algorithm calculates the best path tree from the local router's perspective.
- Cost: Interface bandwidth controls cost by default, so higher-speed links usually become more preferred.
3. Router Types and Area Types
OSPF scales by splitting the topology into areas. Area 0 is the backbone, and other areas exchange inter-area reachability through Area Border Routers.
| Type | Values | Meaning |
|---|---|---|
| Router types | Normal, Backbone, ABR, ASBR | Identifies where the router sits in the OSPF domain and whether it connects areas or redistributes external routes. |
| Area types | Normal, Backbone, Stub, Totally Stubby, NSSA, Totally NSSA | Controls which LSAs are allowed into an area and how default routing is provided. |
4. Route Types and LSA Types
Understanding OSPF route codes and LSA types is essential for troubleshooting. A missing route often means the router never learned the correct LSA, filtered it, summarized it, or rejected it because of area rules.
| Category | Types |
|---|---|
| Route types | Intra-Area (O), Inter-Area (IA), NSSA Type 1 (N1), NSSA Type 2 (N2), External Type 1 (E1), External Type 2 (E2). |
| LSA types | Router (Type 1), Network (Type 2), Summary (Type 3), Summary ASBR (Type 4), External (Type 5), NSSA (Type 7). |
5. Timers, Multicast Addresses and Network Types
OSPF neighbor formation is strict. Timers, area ID, authentication, network type, subnet mask, and MTU behavior must align for stable adjacency.
| Item | OSPF Value |
|---|---|
| All OSPF routers | 224.0.0.5. |
| DR/BDR multicast | 224.0.0.6 for updates sent to the designated router and backup designated router. |
| Network types | Broadcast, non-broadcast, point-to-point, point-to-multipoint, and point-to-multipoint non-broadcast. |
| Broadcast and point-to-point timers | Hello timer 10 seconds, dead timer 40 seconds. |
| Non-broadcast and point-to-multipoint timers | Hello timer 30 seconds, dead timer 120 seconds. |
6. Design and Troubleshooting Notes
- Router ID: Set a stable router ID so LSAs and neighbor relationships remain predictable after reloads.
- Area 0: Keep the backbone healthy because inter-area traffic depends on the backbone design.
- Cost control: Review reference bandwidth before trusting defaults on high-speed links.
- Authentication: Use OSPF authentication on shared or sensitive segments to reduce unauthorized route injection risk.
- Verification: Start with
show ip ospf neighbor,show ip ospf interface,show ip ospf database, andshow ip route ospf.
7. Verification Workflow
Check OSPF in the same order every time. First confirm the neighbor relationship. Then inspect the interface, the database, and the installed routes. This order helps you find the failed stage quickly.
1. Neighbor and Interface
R1# show ip ospf neighbor
Neighbor ID State Interface
2.2.2.2 FULL/DR Gi0/0
R1# show ip ospf interface brief
Interface PID Area Cost State
Gi0/0 1 0 1 BDR
2. Database and Routes
R1# show ip ospf database
OSPF Router with ID (1.1.1.1)
Router Link States (Area 0)
R1# show ip route ospf
O 10.2.0.0/24 [110/2] via 192.168.12.2
- Neighbor:
FULLmeans the routers completed database exchange. On a broadcast link, two DROTHER routers can normally remain in2-WAYwith each other. - Interface: Confirm the correct process ID, area, cost, network type, timers, and authentication mode.
- Database: Look for the expected router and network LSAs before blaming the routing table.
- Route: An OSPF route begins with
O,O IA,O E1,O E2,O N1, orO N2.
8. Guided Practice Lab
Use two routers connected through one Ethernet segment. Give R1 the address 192.168.12.1/24 and R2 the address 192.168.12.2/24. Complete one task at a time and verify the result before moving on.
Task 1: Form an Area 0 Neighbor Relationship
- Configure the two interface addresses and enable the interfaces.
- Start OSPF process 1 on each router.
- Place the connected interfaces in Area 0.
- Run
show ip ospf neighboron both routers.
Expected result: Each router sees the other router in the FULL state.
Task 2: Prove How OSPF Learns a Route
- Add loopback
10.1.1.1/32to R1 and10.2.2.2/32to R2. - Advertise both loopbacks in Area 0.
- Find the new router LSAs with
show ip ospf database router. - Confirm the remote loopback with
show ip route ospf.
Expected result: The remote loopback appears in the LSDB first and then as an OSPF route.
Task 3: Create a Safe Failure
- In an isolated lab, change the Area ID on R2's connected interface.
- Watch the neighbor disappear.
- Compare
show ip ospf interface briefon both routers. - Restore Area 0 and confirm that the neighbor returns.
Expected result: You can identify an area mismatch from interface output and prove the repair with the neighbor table.
9. Frequently Asked Questions
What type of routing protocol is OSPF?
OSPF is an open-standard link-state Interior Gateway Protocol. It runs directly over IP protocol 89 and uses SPF to calculate the best paths inside an organization.
What is the administrative distance and metric for OSPF?
OSPF has an administrative distance of 110. Its metric is cost. On Cisco routers, cost is based on interface bandwidth and the configured reference bandwidth.
Which multicast addresses does OSPF use?
OSPFv2 uses 224.0.0.5 for all OSPF routers and 224.0.0.6 for the designated router and backup designated router on multi-access networks.
Do OSPF process IDs need to match between neighbors?
No. The process ID is local to each router. The area, timers, subnet, network type, authentication settings, and other neighbor requirements must be compatible.
What is the difference between the LSDB and the routing table?
The LSDB is OSPF's complete topology map for an area. The routing table contains only the best usable paths selected for packet forwarding.