OSPF Explained: Areas, LSA Types and Neighbour States

CCNA 9 min readPublished 5 September 2026

Quick answer

Learn how OSPF areas, LSA types and neighbour states work. Follow a practical Cisco IOS lab with verification commands and troubleshooting steps.

OSPF is a link-state routing protocol used to exchange routes within an autonomous system. This guide has OSPF explained through its core building blocks: areas, Link-State Advertisements (LSAs), neighbour formation, route calculation and Cisco IOS configuration.

Before practising OSPF, you should be comfortable with IPv4 networks, subnet masks and wildcard masks. Review how IP addressing and CIDR work if you need to strengthen those foundations.

What is OSPF and how does it work?

Open Shortest Path First, or OSPF, is an open-standard Interior Gateway Protocol that uses link-state information to calculate the best path. Routers build a shared Link-State Database and run the Shortest Path First algorithm to install routes in the routing table.

OSPF operation can be understood as a sequence:

  1. Routers send Hello packets to discover neighbours.
  2. Compatible neighbours form adjacencies.
  3. Adjacent routers exchange LSAs.
  4. Each router builds a Link-State Database, or LSDB.
  5. The router runs the SPF algorithm with itself as the root.
  6. The best routes are installed in the routing table.

OSPF uses IP protocol number 89; it does not use TCP or UDP. OSPFv2, used for IPv4, commonly sends packets to multicast addresses 224.0.0.5 for all OSPF routers and 224.0.0.6 for designated routers on supported network types.

The default OSPF administrative distance on Cisco IOS is 110. Path selection uses cost, which is commonly calculated as:

OSPF cost = reference bandwidth / interface bandwidth

Cisco IOS traditionally uses a reference bandwidth of 100 Mbps. This makes many modern high-speed interfaces appear with the same cost, so production networks often set a higher reference bandwidth consistently on every OSPF router.

router ospf 10
 auto-cost reference-bandwidth 10000

The value is in Mbps. In this example, 10000 represents 10 Gbps.

How do OSPF areas work?

OSPF areas divide a routing domain into smaller link-state databases, reducing the amount of flooding and SPF processing required on every router. Area 0 is the backbone, and normal inter-area traffic must pass through it.

A router with all OSPF interfaces in one area is an internal router. A router connecting Area 0 to another area is an Area Border Router, or ABR. A router redistributing routes from another routing protocol or source is an Autonomous System Boundary Router, or ASBR.

Diagram in words

Imagine the following topology from left to right:

LAN A -- R1 -- Area 0 -- R2 -- Area 10 -- R3 -- LAN B
                         |
                         R2 is the ABR

R1 has interfaces only in Area 0. R3 has interfaces only in Area 10. R2 has one interface in Area 0 and another in Area 10, so it maintains a separate LSDB for each area and advertises inter-area reachability.

Common OSPF area types

Area typeExternal Type 5 LSAsTypical purpose
Backbone Area 0AllowedConnects other OSPF areas
Standard areaAllowedNormal OSPF operation
Stub areaBlockedReduces external routing information; ABR supplies a default route
Totally stubby areaBlockedCisco extension that also suppresses most inter-area summary routes
NSSAReplaced by Type 7 inside the areaAllows limited redistribution within a stub-like area
Totally NSSAType 7 allowed locallyCombines NSSA redistribution with stronger summary suppression

All routers sharing an OSPF link must agree on the area ID and relevant area options. A stub-area mismatch, for example, prevents neighbour formation.

For CCNA-level labs covering OSPF configuration and verification, see the CCNA course. Multi-area design, route filtering and advanced OSPF behaviour are developed further in the CCNP Enterprise course.

What are OSPF LSA types?

An LSA is a structured description of a router, network or reachable prefix that OSPF floods through the routing domain. Different LSA types have different creators, contents and flooding scopes.

The LSDB is not the same as the routing table. The LSDB contains topology information, while the routing table contains the best routes calculated from that information.

LSA typeNameGenerated byMain purpose
1Router LSAEvery OSPF routerDescribes the router's links within one area
2Network LSADR on a multi-access networkLists routers attached to the shared segment
3Summary LSAABRAdvertises networks from one area into another
4ASBR Summary LSAABRTells other areas how to reach an ASBR
5AS External LSAASBRAdvertises routes redistributed into OSPF
7NSSA External LSAASBR inside an NSSACarries external routes through an NSSA

Type 1 and Type 2 LSAs

Every OSPF router creates a Type 1 Router LSA for each area to which it belongs. This LSA describes links, costs and neighbour relationships but does not leave its area.

A Designated Router creates a Type 2 Network LSA for a broadcast or non-broadcast multi-access segment when applicable. It describes the segment as a shared network and lists the attached OSPF routers.

Type 3 and Type 4 LSAs

An ABR creates Type 3 Summary LSAs to advertise prefixes between areas. Despite the name, summarisation does not happen automatically; the LSA carries inter-area reachability whether or not manual summarisation is configured.

A Type 4 LSA describes how to reach an ASBR located in another area. Other routers need this information before they can use external routes originated by that ASBR.

Type 5 and Type 7 LSAs

An ASBR creates Type 5 LSAs when routes are redistributed into a normal OSPF area. These LSAs are flooded through the OSPF domain except into stub areas.

An ASBR inside an NSSA uses Type 7 LSAs instead. An NSSA ABR normally translates eligible Type 7 LSAs into Type 5 LSAs before advertising them to the rest of the OSPF domain.

Cisco route tables identify OSPF route sources with codes such as O for intra-area, O IA for inter-area, O E1 or O E2 for external routes, and O N1 or O N2 for NSSA external routes.

What are the OSPF neighbour states?

OSPF neighbour states show the progress from initial discovery to a fully synchronised LSDB. The normal sequence is Down, Init, 2-Way, ExStart, Exchange, Loading and Full, with Attempt appearing mainly on manually configured NBMA networks.

StateMeaning
DownNo recent Hello packet has been received
AttemptRouter is actively contacting a manually configured NBMA neighbour
InitA Hello was received, but the local router ID was not listed in it
2-WayBidirectional Hello communication is confirmed
ExStartRouters negotiate master/slave roles and database sequence numbers
ExchangeDatabase Description packets summarise each router's LSDB
LoadingMissing LSAs are requested and received
FullThe neighbours' LSDBs are synchronised

A neighbour remaining in 2-Way is not always a fault. On an Ethernet broadcast network, DROTHER routers normally form full adjacencies with the Designated Router and Backup Designated Router but remain 2-Way with other DROTHER routers.

DR and BDR election

Broadcast networks elect a Designated Router and Backup Designated Router to reduce the number of adjacencies. The election first uses OSPF interface priority, followed by the router ID as a tie-breaker.

interface GigabitEthernet0/0
 ip ospf priority 100

A priority of 0 prevents the interface from becoming DR or BDR. Elections are non-preemptive, so adding a router with a higher priority does not automatically replace the existing DR.

How do you configure multi-area OSPF on Cisco IOS?

A basic multi-area configuration assigns interfaces to Area 0 and a non-backbone area, then verifies that neighbour relationships reach the expected state. The OSPF process ID is locally significant and does not need to match between routers.

Use this addressing plan:

RouterInterfaceAddressArea
R1G0/010.0.12.1/300
R1Loopback01.1.1.1/320
R2G0/010.0.12.2/300
R2G0/110.0.23.1/3010
R3G0/010.0.23.2/3010
R3Loopback03.3.3.3/3210

R1 configuration

router ospf 10
 router-id 1.1.1.1
 passive-interface default
 no passive-interface GigabitEthernet0/0
 network 10.0.12.0 0.0.0.3 area 0
 network 1.1.1.1 0.0.0.0 area 0

R2 configuration

router ospf 10
 router-id 2.2.2.2
 passive-interface default
 no passive-interface GigabitEthernet0/0
 no passive-interface GigabitEthernet0/1
 network 10.0.12.0 0.0.0.3 area 0
 network 10.0.23.0 0.0.0.3 area 10

R3 configuration

router ospf 10
 router-id 3.3.3.3
 passive-interface default
 no passive-interface GigabitEthernet0/0
 network 10.0.23.0 0.0.0.3 area 10
 network 3.3.3.3 0.0.0.0 area 10

passive-interface stops OSPF Hello packets on an interface while still advertising its connected network. It is appropriate for loopbacks and user-facing LAN interfaces where no OSPF neighbour should exist.

How do you verify OSPF operation?

Start verification with neighbour status, interface settings, the LSDB and the routing table. A Full adjacency alone does not prove that every intended prefix has been advertised or installed.

Check neighbours:

R2# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address      Interface
1.1.1.1           1   FULL/BDR        00:00:34    10.0.12.1   Gi0/0
3.3.3.3           1   FULL/DR         00:00:31    10.0.23.2   Gi0/1

FULL/BDR means the LSDB is synchronised and the neighbour currently has the BDR role. Actual DR and BDR results depend on priority, router ID and election timing.

Inspect the LSDB:

show ip ospf database
show ip ospf database router
show ip ospf database summary

On R1, R3's loopback should appear as an inter-area route because it originates in Area 10:

R1# show ip route ospf
O IA  3.3.3.3/32 [110/3] via 10.0.12.2, GigabitEthernet0/0

The value 110 is the administrative distance, while 3 is the accumulated OSPF cost in this example.

Other useful commands include:

show ip protocols
show ip ospf
show ip ospf interface brief
show ip ospf interface GigabitEthernet0/0
show ip ospf border-routers

How do you troubleshoot OSPF neighbour problems?

Troubleshoot from the interface and Hello parameters toward database exchange rather than changing random settings. The neighbour state usually indicates which stage is failing and which checks should come next.

1. Confirm interface and IP connectivity

show ip interface brief
show interfaces GigabitEthernet0/0
ping 10.0.12.2

The interface must be up/up, and both addresses must belong to the correct connected subnet.

2. Confirm that OSPF is enabled on the interface

show ip ospf interface brief
show running-config | section router ospf

A wrong wildcard mask may prevent the network statement from matching the interface. You can also enable OSPF directly under an interface with ip ospf 10 area 0.

3. Compare neighbour parameters

The routers must agree on the area ID, Hello and Dead timers, authentication settings and compatible area type. Router IDs must be unique.

show ip ospf interface GigabitEthernet0/0

On Ethernet broadcast links, default Hello and Dead intervals are commonly 10 and 40 seconds. Do not assume these values on every OSPF network type.

4. Investigate a 2-Way state correctly

If both routers are DROTHER devices on a multi-access segment, 2-Way may be normal. If one side should be DR or BDR, inspect interface priorities, network type and election results.

5. Investigate ExStart or Exchange failures

An MTU mismatch is a common cause of neighbours becoming stuck in ExStart or Exchange. Compare interface MTUs on both sides:

show interfaces GigabitEthernet0/0 | include MTU

Correcting the MTU is preferable. The command ip ospf mtu-ignore can bypass OSPF's MTU check, but it should be used only when the underlying design is understood.

6. Use debugging carefully

debug ip ospf adj
undebug all

Debugging can produce substantial output, so use it carefully on production equipment. Read the messages for area mismatches, duplicate router IDs, authentication failures or sequence negotiation problems.

Summary

OSPF uses Hello packets to form neighbours, LSAs to describe topology and SPF calculations to select routes. Areas control flooding scope, Area 0 connects the design, and neighbour states reveal the progress of adjacency formation.

A strong lab routine is to configure the topology, predict neighbour states and LSA types, and then confirm the result with show ip ospf neighbor, show ip ospf database and show ip route ospf.

To practise OSPF with guided Cisco labs and troubleshooting exercises, enquire about upcoming batch details for the Network Rhinos CCNA course.

Reviewed by Network Rhinos networking trainers.

Related reading: Spanning Tree Protocol Explained: Root Bridge and Port States

Frequently asked questions

What is OSPF in simple terms?

OSPF is a link-state routing protocol that helps routers learn network paths dynamically. Routers exchange topology information, build a Link-State Database and calculate the lowest-cost routes with the SPF algorithm.

Why does OSPF require Area 0?

Area 0 is the OSPF backbone and connects other areas in a normal multi-area design. Traffic and routing information moving between non-backbone areas normally pass through an Area Border Router connected to Area 0.

What are the main OSPF LSA types for CCNA?

The main types are Type 1 Router, Type 2 Network, Type 3 Summary, Type 4 ASBR Summary, Type 5 External and Type 7 NSSA External LSAs. Each type describes a different part of the OSPF topology or external reachability.

Why is an OSPF neighbour stuck in the 2-Way state?

On a broadcast network, two DROTHER routers normally remain in the 2-Way state and form full adjacencies only with the DR and BDR. If a full adjacency is expected, check interface priority, network type and DR/BDR election results.

What causes OSPF neighbours to remain in ExStart?

An interface MTU mismatch is a common cause of an ExStart or Exchange problem. Also check duplicate router IDs, unstable connectivity and database sequence negotiation messages with `debug ip ospf adj`.

Does the OSPF process ID need to match between routers?

No. The OSPF process ID in commands such as `router ospf 10` is locally significant, so neighbouring routers may use different process IDs. Area IDs and required Hello parameters must match across the link.

Related articles

Train with Network Rhinos

Hands-on CCNA, CCNP, AWS, Azure, DevOps and cybersecurity training in Chennai & Bangalore, with placement support. Talk to our team or attend a free demo class.