Back to OSPF Guide OSPF fundamentals

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.

Link-State Protocol 89 AD 110 LSDB SPF

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.

Protocol type Link-state IGP
Administrative distance 110
IP transport Protocol 89
Metric Interface cost

In This Lesson

  1. OSPF Characteristics Summary
  2. Protocol Architecture
  3. Router Types and Area Types
  4. Route Types and LSA Types
  5. Timers, Multicast and Network Types
  6. Design and Troubleshooting Notes
  7. Verification Workflow
  8. Guided Practice Lab
  9. Frequently Asked Questions

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.

Core idea: OSPF does not simply accept a neighbor's best route. Each router learns the topology, builds the LSDB, runs SPF locally, and then installs the best routes in the routing table.
  • 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.
The LSDB is the topology map. The routing table is the smaller list of paths the router actually uses to forward traffic.

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).
External route note: E1 adds internal OSPF cost to the external cost. E2 uses the external cost as the primary metric and is common as the default external type.

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, and show 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: FULL means the routers completed database exchange. On a broadcast link, two DROTHER routers can normally remain in 2-WAY with 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, or O 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

  1. Configure the two interface addresses and enable the interfaces.
  2. Start OSPF process 1 on each router.
  3. Place the connected interfaces in Area 0.
  4. Run show ip ospf neighbor on both routers.

Expected result: Each router sees the other router in the FULL state.

Task 2: Prove How OSPF Learns a Route

  1. Add loopback 10.1.1.1/32 to R1 and 10.2.2.2/32 to R2.
  2. Advertise both loopbacks in Area 0.
  3. Find the new router LSAs with show ip ospf database router.
  4. 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

  1. In an isolated lab, change the Area ID on R2's connected interface.
  2. Watch the neighbor disappear.
  3. Compare show ip ospf interface brief on both routers.
  4. 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.