Open Shortest Path First (OSPF) is a link-state routing protocol widely used in enterprise IP networks for its efficiency and scalability. Unlike distance-vector protocols like RIP, OSPF uses a hierarchical design, segmenting networks into areas to optimize routing. Each area consists of routers sharing identical Link-State Databases (LSDBs), containing topology information. For CCNA and CCNP students, mastering OSPF is critical for both certification exams and real-world network design.
OSPF can be implemented in two primary ways: Single-Area OSPF and Multi-Area OSPF. This article explores both, their advantages, Cisco IOS configurations, verification commands, and best practices for CCNA exam preparation and network engineering.
OSPF Basics: How It Works
OSPF operates by exchanging Link-State Advertisements (LSAs) to build a complete topology map of the network. Routers use the Shortest Path First (SPF) algorithm — Dijkstra’s algorithm — to calculate the best paths to every destination based on cost.
OSPF cost formula:
Cost = Reference Bandwidth / Interface Bandwidth
The default Reference Bandwidth is 100 Mbps. Key cost values:
| Interface | Speed | Cost Calculation | Resulting Cost |
|---|---|---|---|
| Serial | 1.544 Mbps | 100 / 1.544 | 64 |
| FastEthernet | 100 Mbps | 100 / 100 | 1 |
| GigabitEthernet | 1000 Mbps | 100 / 1000 | 0.1 → 1 (minimum) |
| 10 Gigabit | 10,000 Mbps | 100 / 10,000 | 0.01 → 1 (minimum) |
Important: Cisco IOS uses integer math and enforces a minimum cost of 1. This means any interface faster than FastEthernet gets cost 1 by default — GigabitEthernet, 10G, and 40G all have the same default cost of 1, which makes OSPF unable to differentiate between them. To fix this, always adjust the reference bandwidth to match the fastest link in the network:
Router(config-router)# auto-cost reference-bandwidth 1000
This sets the reference to 1000 Mbps (1 Gbps), giving GigabitEthernet a cost of 1 and FastEthernet a cost of 10 — more meaningful for modern networks.
Key OSPF components:
- Hello Packets — establish and maintain neighbor adjacencies. Default hello interval: 10 seconds on broadcast links, 30 seconds on NBMA links.
- LSDB — stores all LSAs, representing the complete network topology within an area.
- SPF Algorithm — computes shortest paths to all destinations using the cost metric.
- Router Roles — Designated Router (DR), Backup Designated Router (BDR), Area Border Router (ABR), Autonomous System Boundary Router (ASBR).
For CCNA, focus on understanding hello packets and basic configurations. CCNP requires deeper knowledge of LSA types, area configurations, and troubleshooting.
Single-Area OSPF (Area 0)
Overview
Single-Area OSPF uses only Area 0, also known as the backbone area, which serves as the core of any OSPF network. It is ideal for smaller networks with a few routers and straightforward topologies where managing multiple areas is unnecessary. All routers in Area 0 share the same LSDB and run the SPF algorithm on the full topology.
Challenges in Large Single-Area Networks
As the network grows, single-area OSPF faces scalability issues:
- Large Routing Tables — all routes are stored without summarization
- Extensive LSDB — every router maintains a complete topology map of the entire network
- Frequent SPF Calculations — any topology change (link failure, link recovery) triggers SPF recalculation on all routers in the area, increasing CPU load
In a network with 100 routers, a single link flap causes all 100 routers to rerun the SPF algorithm simultaneously — a significant CPU and convergence impact.
Single-Area OSPF Configuration
Topology: Three routers (R1, R2, R3) all in Area 0.
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.0.0 0.0.0.255 area 0
R1(config-router)# network 192.168.1.0 0.0.0.255 area 0
R1(config-router)# auto-cost reference-bandwidth 1000
R1(config-router)# exit
R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 192.168.1.0 0.0.0.255 area 0
R2(config-router)# network 192.168.2.0 0.0.0.255 area 0
R2(config-router)# auto-cost reference-bandwidth 1000
R2(config-router)# exit
R3(config)# router ospf 1
R3(config-router)# router-id 3.3.3.3
R3(config-router)# network 192.168.2.0 0.0.0.255 area 0
R3(config-router)# network 192.168.3.0 0.0.0.255 area 0
R3(config-router)# auto-cost reference-bandwidth 1000
R3(config-router)# exit
Key commands:
router ospf 1— starts OSPF process 1 (the process ID is local only; it does not need to match between routers)router-id— manually sets the Router ID (recommended over relying on automatic selection)network [address] [wildcard-mask] area [area-id]— advertises the matching interfaces into the specified OSPF areaauto-cost reference-bandwidth 1000— adjusts the reference bandwidth to 1 Gbps for accurate cost calculation
Pros and Cons of Single-Area OSPF
Pros: Simple to configure, no area management overhead, suitable for small deployments (5–20 routers), all routers have complete topology visibility.
Cons: Poor scalability in larger networks, large LSDB on every router, frequent network-wide SPF recalculations when topology changes occur.
Multi-Area OSPF
Overview
Multi-Area OSPF divides a large OSPF domain into smaller areas all connected to Area 0 — the backbone. This hierarchical design enhances scalability by isolating topology changes and reducing resource demands. Area Border Routers (ABRs) connect non-backbone areas to the backbone, maintaining separate LSDBs for each area and summarizing inter-area routes. Autonomous System Boundary Routers (ASBRs) redistribute external routes (e.g., from BGP or EIGRP) into OSPF.
A topology change in Area 10 triggers SPF only within Area 10. The ABR sends a summarized Type 3 LSA update to other areas — not the full topology detail — sparing all other routers from SPF recalculation.
Advantages of Multi-Area OSPF
- Smaller Routing Tables — ABRs summarize routes at area boundaries, reducing the number of prefixes each router must store
- Reduced LSA Overhead — LSA flooding is contained within each area; it does not propagate across the entire OSPF domain
- Fewer SPF Calculations — topology changes are confined to the affected area; other areas receive only a summary update
- Smaller LSDB per Router — each router maintains only its own area’s LSDB plus summary information for other areas
- Improved Convergence — faster recovery from failures because only the affected area runs a full SPF recalculation
Multi-Area OSPF Configuration
Topology: R1 and R2 in Area 0 (backbone); R3 and R4 in Area 5; R5 and R6 in Area 10. R2 is the ABR connecting Area 5; R1 is the ABR connecting Area 10.
R1 — ABR for Area 0 and Area 10:
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.0.0 0.0.0.255 area 0
R1(config-router)# network 10.10.10.0 0.0.0.255 area 10
R1(config-router)# area 10 range 10.10.10.0 255.255.255.0
R1(config-router)# auto-cost reference-bandwidth 1000
R1(config-router)# exit
R2 — ABR for Area 0 and Area 5:
R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 192.168.0.0 0.0.0.255 area 0
R2(config-router)# network 10.10.5.0 0.0.0.255 area 5
R2(config-router)# area 5 range 10.10.5.0 255.255.255.0
R2(config-router)# auto-cost reference-bandwidth 1000
R2(config-router)# exit
R3 — Internal router in Area 5:
R3(config)# router ospf 1
R3(config-router)# router-id 3.3.3.3
R3(config-router)# network 10.10.5.0 0.0.0.255 area 5
R3(config-router)# auto-cost reference-bandwidth 1000
R3(config-router)# exit
Key multi-area commands:
network [address] [wildcard] area [id]— assigns the interface to the specified areaarea [id] range [address] [mask]— configures route summarization at the ABR, summarizing all routes in the area into a single prefix advertised to Area 0
Configuring a Stub Area
A stub area blocks Type 5 (external) LSAs from entering, replacing them with a default route from the ABR. This reduces LSDB size in areas that don’t need full external routing information — ideal for branch offices.
On all routers in the stub area (including the ABR):
R2(config-router)# area 5 stub
R3(config-router)# area 5 stub
For a Totally Stubby Area (also blocks Type 3 inter-area LSAs — Cisco proprietary):
R2(config-router)# area 5 stub no-summary ← ABR only
R3(config-router)# area 5 stub ← internal routers
The no-summary keyword is configured only on the ABR, not on internal area routers.
Comparison: Single-Area vs. Multi-Area OSPF
| Aspect | Single-Area OSPF | Multi-Area OSPF |
|---|---|---|
| Scalability | Low (small networks, <20 routers) | High (enterprise networks, 50+ routers) |
| LSDB Size | Large, shared by all routers | Smaller, per-area databases |
| SPF Calculations | Frequent, entire network | Isolated to affected area |
| Route Summarization | Limited — no inter-area summarization | Extensive at ABRs |
| Complexity | Simple configuration | Requires area planning |
| Convergence Speed | Slower in large topologies | Faster — changes are area-local |
OSPF Two-Layer Area Hierarchy
Multi-area OSPF uses a two-layer hierarchy:
Backbone (Transit) Area — Area 0: Facilitates fast IP packet transit and interconnects all non-backbone areas. All inter-area traffic must pass through Area 0. End users are rarely present here — it is a transit infrastructure.
Regular (Non-Backbone) Areas: Connect users and resources, organized by function (e.g., sales department) or geography (e.g., regional office). Traffic between two non-backbone areas must traverse Area 0 — direct non-backbone-to-non-backbone routing is not permitted in OSPF.
Area Subtypes

Regular areas can be configured as special types to optimize performance:
- Standard Area — supports all LSA types; used in core and distribution networks
- Stub Area — blocks Type 5 (external) LSAs; ABR injects a default route instead; ideal for branch offices with no external routing needs
- Totally Stubby Area — blocks Type 3 (inter-area summary) and Type 5 LSAs; the most aggressive LSDB reduction; Cisco proprietary extension
- Not-So-Stubby Area (NSSA) — allows external routes via Type 7 LSAs while still blocking regular Type 5 LSAs; used when an area has its own external connections (e.g., a branch connected to a separate ISP)
Cisco Design Best Practices
- Routers per area: 50–100 depending on router CPU and memory capabilities
- Areas per ABR: 2–3 areas (an ABR maintains a separate LSDB per area; too many areas increases memory overhead)
- Neighbors per router: Up to 60–100 depending on platform (e.g., Cisco ISR 4000 series)
- Always configure explicit Router IDs using loopback interfaces for stability — a router without a loopback may change its Router ID when an interface goes down, causing unnecessary OSPF reconvergence
OSPF LSA Types
LSAs are the building blocks of OSPF’s LSDB. Understanding them is essential for CCNA and CCNP exams:
| LSA Type | Name | Generated By | Scope |
|---|---|---|---|
| Type 1 | Router LSA | Every OSPF router | Intra-area only |
| Type 2 | Network LSA | DR on multi-access segments | Intra-area only |
| Type 3 | Summary LSA | ABR | Inter-area (Area 0 ↔ non-backbone) |
| Type 4 | ASBR Summary LSA | ABR | Inter-area — locates the ASBR |
| Type 5 | External LSA | ASBR | AS-wide (all areas except stubs) |
| Type 7 | NSSA External LSA | ASBR in NSSA | NSSA area only — converted to Type 5 at ABR |
For CCNA, focus on Types 1, 2, and 3. CCNP requires mastery of all types, especially Type 7 and the behavior of stub/NSSA areas in blocking specific LSA types.
Verifying OSPF Configuration
Always verify OSPF configuration after changes using these standard commands:
show ip ospf neighbor
R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:38 192.168.0.2 Gig0/0
3.3.3.3 0 FULL/DROTHER 00:00:33 192.168.0.3 Gig0/0
Confirms neighbor adjacencies and their DR/BDR roles. All neighbors should show FULL state for a healthy adjacency.
show ip ospf
R1# show ip ospf
Routing Process "ospf 1" with ID 1.1.1.1
Supports only single TOS(TOS0) routes
Reference bandwidth unit is 1000 mbps
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Confirms the Router ID, reference bandwidth setting, and number of areas configured on this router.
show ip route ospf
R1# show ip route ospf
O 10.10.5.0/24 [110/2] via 192.168.0.2, 00:12:44, GigabitEthernet0/0
O IA 10.10.10.0/24 [110/3] via 192.168.0.2, 00:08:21, GigabitEthernet0/0
O = intra-area OSPF route; O IA = inter-area OSPF route (from a Type 3 Summary LSA). Confirms routes are being learned from OSPF neighbors.
show ip ospf interface
R1# show ip ospf interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.0.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Timer intervals configured, Hello 10, Dead 40
Neighbor Count is 2, Adjacent neighbor count is 2
Confirms area assignment, OSPF cost, hello/dead timers, and neighbor count per interface.
Brief Note on OSPFv3 (IPv6 OSPF)
OSPFv3 is the IPv6-capable version of OSPF, defined in RFC 5340. The area hierarchy, LSA types, DR/BDR election, and SPF algorithm work identically to OSPFv2. The primary differences are:
- OSPFv3 uses IPv6 link-local addresses for neighbor communication (not IPv4 addresses)
- OSPFv3 is configured per interface rather than per network statement
- Separate OSPFv3 process from OSPFv2 — both can run simultaneously on the same router
Basic OSPFv3 interface configuration:
R1(config)# ipv6 router ospf 1
R1(config-rtr)# router-id 1.1.1.1
R1(config-rtr)# exit
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ipv6 ospf 1 area 0
Real-World Case Study: Migrating to Multi-Area OSPF
Consider a medium-sized enterprise with 80 routers in a single-area OSPF configuration experiencing frequent SPF recalculations and slow convergence after link failures.
Migration plan:
- Design the area structure: Area 0 (core — 10 routers), Area 1 (headquarters — 30 routers), Area 2 (branches — 40 routers, configured as stub)
- Identify ABRs: Two routers connecting Area 0 to Area 1, two connecting Area 0 to Area 2
- Configure route summarization on ABRs:
ABR(config-router)# area 1 range 172.16.0.0 255.255.0.0
ABR(config-router)# area 2 range 10.0.0.0 255.0.0.0
ABR(config-router)# area 2 stub no-summary
- Configure stub on all Area 2 routers:
Branch-Router(config-router)# area 2 stub
Results: 40% reduction in LSDB size across the network, 60% fewer SPF calculations during peak failure periods, and significantly faster convergence — changes in branch Area 2 no longer affect headquarters Area 1 or the core Area 0.
CCNA Exam Pointers
- Single-Area OSPF = all routers in Area 0; simple but not scalable
- Multi-Area OSPF = Area 0 backbone + non-backbone areas; ABRs connect them
- All inter-area traffic must transit Area 0 — no direct non-backbone-to-non-backbone routing
- OSPF cost = Reference BW / Interface BW; default reference = 100 Mbps; minimum cost = 1
- Fix cost on modern networks:
auto-cost reference-bandwidth 1000on every router - ABR = connects two or more areas; maintains separate LSDB per area; summarizes routes
- ASBR = redistributes external routes into OSPF; generates Type 5 LSAs
- LSA Types for CCNA: Type 1 (intra-area), Type 2 (DR, intra-area), Type 3 (ABR, inter-area)
- Stub area blocks Type 5 LSAs; ABR injects default route (
area X stubon all area routers) - Totally Stubby blocks Type 3 and Type 5 (
area X stub no-summaryon ABR only) show ip ospf neighbor— all neighbors should be FULL for healthy adjacencyshow ip route ospf—O= intra-area,O IA= inter-areaprocess-idinrouter ospf [id]is locally significant — does not need to match between routers- Router ID selection order: manual config > highest loopback IP > highest active interface IP
Conclusion
Single-area OSPF suits small networks but struggles with scale. Multi-Area OSPF, with its hierarchical design, excels in large enterprises by reducing routing table size, LSA overhead, and SPF calculations. For CCNA students, focus on basic configurations, Area 0 fundamentals, and the core LSA types (1, 2, 3). CCNP students should master LSA types, special areas, route summarization, and troubleshooting with the verification commands covered above.
Understanding the cost formula, configuring the reference bandwidth correctly, and knowing when to use stub versus totally stubby areas are the practical skills that differentiate candidates who understand OSPF from those who have only memorized its concepts.
FAQs
What is the main difference between Single-Area and Multi-Area OSPF?
Single-Area OSPF places all routers in Area 0, with every router sharing a single large LSDB and running the SPF algorithm on the complete network topology. Multi-Area OSPF divides the network into multiple areas connected to Area 0 through ABRs, each area maintaining its own smaller LSDB. Topology changes in one area trigger SPF recalculation only within that area — other areas receive only a summarized update from the ABR. For networks up to approximately 20 routers, single-area OSPF is simpler and perfectly adequate. For larger networks, multi-area is essential for scalability.
Why is Area 0 important in OSPF networks?
Area 0 — the backbone area — is the mandatory transit area for all inter-area OSPF traffic. When a packet needs to travel from a router in Area 5 to a router in Area 10, it must pass through Area 0 first — direct routing between two non-backbone areas is not permitted in OSPF’s design. This constraint enforces a clean hierarchical structure that prevents routing loops and ensures consistent SPF calculations. In a multi-area deployment, every area must have at least one ABR directly connected to Area 0, or a virtual link must be configured to create a logical connection to the backbone.
How does Multi-Area OSPF improve network performance?
Multi-Area OSPF improves performance in three specific ways. First, it reduces LSDB size — each router only stores its own area’s full topology plus summary information for other areas, rather than maintaining a complete map of the entire network. Second, it reduces SPF calculation frequency — a link failure in Area 10 causes SPF to run only on Area 10’s routers; routers in Area 0 and Area 5 receive only a brief Type 3 summary update, not a full SPF trigger. Third, ABR route summarization reduces the number of routing table entries each router must maintain, lowering memory consumption and accelerating longest-prefix-match lookups on high-traffic routers.
What are the challenges of using Single-Area OSPF in large networks?
In large routing tables with many prefixes, single-area OSPF creates three compounding problems. Every router must store the complete topology in its LSDB — as the network grows, this consumes increasing memory and processing power. Every topology change — even a brief interface flap on a remote router — triggers a full network-wide SPF recalculation on all routers simultaneously, causing CPU spikes and temporary routing instability. Without area boundaries, there is no mechanism for route summarization — every specific prefix must be propagated to every router, growing the routing table proportionally with the network. Cisco’s general guideline is that single-area OSPF becomes problematic beyond approximately 50–100 routers in a single area.