OSPF Areas and LSA Types, Explained
Introduction¶
OSPF is a link-state protocol: every router builds an identical map of the topology (the link-state database) and runs Dijkstra's algorithm on it to pick shortest paths. That works beautifully until the topology gets large — the database grows, SPF runs get expensive, and a single flapping link churns every router. Areas are how OSPF keeps that in check.
Areas and the backbone¶
An OSPF domain is divided into areas identified by a 32-bit number written like
an IP (area 0, area 0.0.0.0, area 51). Rules:
- Area 0 is the backbone. Every other area must connect to it, directly or through a virtual link.
- Routers with all interfaces in one area are internal routers.
- A router with interfaces in two or more areas is an Area Border Router (ABR). ABRs sit on the area 0 boundary and summarise routes between areas.
- A router that injects routes from another protocol (BGP, static, a different OSPF domain) is an Autonomous System Boundary Router (ASBR).
Inside an area, every router has the full link-state database for that area. Across an area boundary, the ABR passes only summary information (prefixes and costs), not the raw topology. So a link flap in area 10 triggers a full SPF in area 10, but only a distance-vector-style update in area 0 and beyond.
The LSA types you'll see¶
| Type | Name | Originated by | Scope | Carries |
|---|---|---|---|---|
| 1 | Router LSA | every router | within the area | the router's own links, their cost and state |
| 2 | Network LSA | the DR on a multi-access segment | within the area | which routers are on this segment |
| 3 | Summary LSA | ABR | into an area | inter-area prefixes (a network in another area) |
| 4 | ASBR Summary | ABR | into an area | how to reach an ASBR in another area |
| 5 | External LSA | ASBR | whole domain (except stub areas) | routes redistributed from outside OSPF |
| 7 | NSSA External | ASBR in an NSSA | within the NSSA, converted to type 5 by the ABR | external routes where type 5 isn't allowed |
Type 6 (multicast OSPF) is effectively dead. Types 1 and 2 describe topology inside an area; 3 and 4 are the ABR telling one area about another; 5 and 7 are about routes learned from outside OSPF entirely.
Type 1 and 2 in practice¶
On a point-to-point link, each router's Type 1 LSA lists the neighbour and cost — no Type 2 needed. On a broadcast segment (Ethernet with 3+ OSPF routers), a Designated Router (DR) is elected; it originates one Type 2 LSA representing the segment, and every router forms a full adjacency only with the DR and BDR. This cuts adjacencies from O(n²) to O(n).
Area types — controlling the flood¶
Stub area variants exist to keep Type 5 externals (which can number in the tens of thousands, e.g. a full BGP table redistributed) out of areas that don't need them:
- Normal area — sees everything: Types 1–5.
- Stub area — no Type 5. The ABR injects a default route (
0.0.0.0/0as a Type 3) instead. No ASBRs allowed inside. - Totally stubby area (Cisco) — no Type 5 and no Type 3. Only intra-area routes plus a single default. Smallest possible database.
- NSSA (Not-So-Stubby Area) — like stub, but does allow a local ASBR. That ASBR originates Type 7 LSAs, which the ABR translates to Type 5 when flooding into the backbone. Used when a branch has its own external connection.
Every router in an area must agree on the area type, or adjacencies won't form.
Hands-on (Cisco-style config)¶
router ospf 1
router-id 10.0.0.1
network 10.1.1.0 0.0.0.255 area 0
network 10.2.2.0 0.0.0.255 area 10
area 10 stub
!
! On the ABR, make area 10 totally stubby:
area 10 stub no-summary
# Verify
show ip ospf neighbor # adjacencies: state should be FULL (or 2-WAY to non-DR)
show ip ospf database # the LSDB, grouped by LSA type
show ip ospf border-routers # known ABRs/ASBRs
show ip route ospf # O = intra-area, O IA = inter-area, O E2 = external
FRR / Bird / Quagga use similar syntax (area 0.0.0.10 stub in FRR's ospfd).
Verification and troubleshooting¶
- Neighbours stuck in
EXSTART/EXCHANGE— MTU mismatch on the link. OSPF checks MTU in DBD packets. Match MTU or setip ospf mtu-ignore. - Neighbours stuck in
2-WAYand never go FULL — that's correct between two non-DR routers on a broadcast segment. Only DR/BDR relationships reach FULL. - Adjacency won't form at all — mismatched hello/dead timers, area number,
area type (stub flag), authentication, or subnet mask on the segment.
show ip ospf interfaceshows all of these side by side. - External routes missing in a stub area — by design. Check the ABR is
injecting the default:
show ip route 0.0.0.0. - Suboptimal inter-area path — all inter-area traffic goes via area 0. If two areas are "adjacent" geographically but both only touch the backbone at a distant ABR, traffic hairpins. That's OSPF working as designed; fix it with topology, not config.
O E1vsO E2routes — E2 (the default for redistribution) ignores internal cost to the ASBR; E1 adds it. If two ASBRs advertise the same external prefix and traffic picks the "wrong" one, switch to E1.
Related tools and reading¶
- On-site: Subnet Calculator, IP address lookup, Ping test.
- Related posts: BGP for sysadmins, How NAT actually works.
Stuck on something this site can't fix?Reach out to Prabath directly on LinkedIn.More in Network Protocols
DHCP DORA: How a Host Gets Its Address
The four DHCP packets, the renewal timers, why relays exist, and the tcpdump filter to watch it happen.
October 24, 2026SMB Versions and Signing, Demystified
SMB1 is a security liability, SMB3 encrypts and signs. Here's how dialect negotiation works and how to tell which one a connection actually used.
October 24, 2026DNS over TLS and DNS over HTTPS
Plain DNS is unencrypted and unauthenticated. DoT and DoH fix the transport — here's how each works, and the trade-off between privacy and network visibility.
October 24, 2026