OSPF Area Types: Stub, Totally Stubby and NSSA - 夜莺博客

OSPF Area Types: Stub, Totally Stubby and NSSA

OSPF scales by splitting the network into a backbone area 0 and non-backbone areas, but a plain multi-area design still floods every external and inter-area route into every router. Special area types trade routing detail for smaller LSDBs and faster convergence: stub areas block Type 5 LSAs, totally stubby areas also block Type 3 inter-area LSAs, and NSSA areas allow an ASBR inside a stub-like area. This article explains each type, what it filters, and when to use it.

Background: What Problem Area Types Actually Solve

A router inside a normal OSPF area receives everything: all intra-area topology, a Type 3 summary for every inter-area prefix, and a Type 5 LSA for every external prefix redistributed anywhere in the domain. On a small branch router with modest memory and a slow control plane, that is thousands of LSAs and routes that will never be used — the branch has exactly one or two exit points, so every one of those externals resolves to the same next hop.

Special area types replace that flood with a default route. The ABR advertises 0.0.0.0/0 into the area, interior routers install one route, and the LSDB shrinks to intra-area topology plus that default. The trade-off is equally simple to state: the area loses the ability to make independent routing decisions about anything outside itself. If that is acceptable — and for a single-homed branch it usually is — you gain memory, CPU, and convergence time.

A second and independent problem is redistribution. A plain stub area cannot contain an ASBR at all, because Type 5 LSAs are by definition forbidden. The Not-So-Stubby Area (NSSA, RFC 3101) exists precisely to break that rule: it lets an ASBR inside the area redistribute externals using Type 7 LSAs, which the NSSA ABR translates into Type 5 toward the backbone.

Prerequisites: Roles, LSAs and Design Constraints

OSPF Roles and LSA Flow

  • ABR (Area Border Router) connects an area to area 0 and summarizes between them; vendor implementations require an area-0 interface to be an ABR.
  • ASBR (Autonomous System Boundary Router) redistributes routes from other protocols into OSPF.
  • Type 3 LSAs carry inter-area routes; Type 4 advertise ASBR reachability; Type 5 carry external routes; Type 7 are the NSSA's internal form of external LSAs.

Before choosing a type, confirm these design rules:

  • Area 0 is special. The backbone can never be stub, totally stubby, NSSA or totally NSSA. Attempting it is rejected by the CLI on every major platform.
  • All routers in the area must agree. The area type is a property of the area, configured on every router with an interface in it. A mismatch prevents a FULL adjacency — typically the neighbour sticks in EXSTART/EXCHANGE or drops with a "mismatched area type" style log message.
  • Virtual links cannot transit a stub or NSSA area. A virtual link is itself a Type 3/Type 5-carrying construct; the filtering breaks it.
  • The ABR needs which types to inject. A stub area still needs a Type 3 default from the ABR; a totally stubby area needs the ABR to suppress all Type 3s except the default. In Cisco IOS this is the no-summary keyword, and it only goes on the ABR.
  • Summarisation still applies. Area types reduce what floods in; area range on the ABR reduces what floods out. The two are complementary and usually deployed together.

The Four Area Types Compared

Area type Type 3 (inter-area) Type 4/5 (external) ASBR allowed Default route
Standard Yes Yes Yes No
Stub Yes Blocked No Injected
Totally stubby Blocked (one default) Blocked No Injected
NSSA Yes Type 5 blocked, Type 7 used Yes Optional
Totally NSSA Blocked Type 7 used Yes Injected

A stub area is ideal for a small remote site with one exit: internal routers need only intra-area routes plus the default. Totally stubby areas shrink the LSDB further (good for branch routers with limited memory and CPU). NSSA is the choice when the area itself must redistribute, e.g. a branch connecting to a non-OSPF WAN: the ASBR originates Type 7 LSAs and the NSSA ABR translates them to Type 5 toward the backbone.

Two details worth writing down: in a stub area the default route arrives as a Type 3 LSA originated by the ABR, and coverage across the whole area requires the ABR to be reachable for every intra-area prefix — so a stub area with two ABRs gets two default routes and can still fail over. In an NSSA, Type 7 LSAs carry the forwarding address and the P-bit; when the P-bit is set the ABR translates the Type 7 into a Type 5. When it is clear (typical for redistributed connected or static routes on the same ASBR), no translation occurs outside the area, which is a common source of "the route exists inside but not outside" confusion.

Step-by-Step: Configuring Each Area Type (Cisco IOS)

Configuration (Cisco IOS)

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0
 network 172.16.1.0 0.0.0.255 area 1
!
! stub area: every router in area 1 needs this
router ospf 1
 area 1 stub
!
! totally stubby: only the ABR adds no-summary
router ospf 1
 area 1 stub no-summary
!
! NSSA: all area-1 routers
router ospf 1
 area 1 nssa
!
! totally NSSA: ABR adds no-summary, and optionally a default
router ospf 1
 area 1 nssa no-summary

! Optional: push an explicit default into a plain NSSA (ABR only)
router ospf 1
 area 1 nssa default-information-originate

! Optional: summarise prefixes leaving the area (ABR only)
router ospf 1
 area 1 range 10.10.0.0 255.255.0.0

! Redistributing into an NSSA (ASBR inside the area)
router ospf 1
 redistribute static subnets
 redistribute connected subnets route-map TO_OSPF

Area type configuration must match on every router in the area — a stub-area router and a standard-area router will not form a full adjacency. Area 0 itself can never be stub or NSSA, and virtual links cannot transit stub areas.

Sequence the change to avoid an outage. Bring the ABR over first is wrong — the moment the ABR is configured, the interior routers still expect Type 5s and the adjacencies will drop. The working order is: verify the alternate path or accept the planned window, configure every interior router and the ABR within the same maintenance window, and confirm the default route appears before declaring success. If two ABRs exist, change both in the same window so traffic does not black-hole between them.

Equivalent Syntax on Other Platforms

Platform Stub Totally stubby NSSA Totally NSSA
Cisco IOS area 1 stub area 1 stub no-summary area 1 nssa area 1 nssa no-summary
Junos area 0.0.0.1 stub area 0.0.0.1 stub no-summaries area 0.0.0.1 nssa area 0.0.0.1 nssa no-summaries
NX-OS area 1 stub area 1 stub no-summary area 1 nssa area 1 nssa no-summary
IOS XR area 1 stub area 1 stub no-summary area 1 nssa area 1 nssa no-summary

Verification

show ip ospf
show ip ospf database summary self-originate
show ip route ospf | begin Gateway
show ip ospf neighbor
show ip ospf database nssa-external
show ip ospf border-routers

Check that the routing table inside the special area contains the injected default route instead of a flood of Type 3/5 entries, and confirm adjacency state is FULL. When redistributing into a stub area accidentally, OSPF refuses to accept Type 5 LSAs — the log will show the area type mismatch. For the failure side of OSPF, see OSPF neighbor troubleshooting and stuck-in-init fixes, and the XR flavor in IOS XR OSPF examples, the NX-OS flavour in Cisco Nexus NX-OS OSPF configuration, and a deeper worked example in OSPF stub and NSSA area types: configuration guide.

A structured verification pass looks like this:

  • show ip ospf — confirm the area is listed with the expected stub/NSSA flag and the number of areas.
  • show ip ospf database — count Type 5 entries inside the area; in a stub or NSSA there must be none. In an NSSA you expect Type 7 entries instead.
  • show ip ospf database summary self-originate on the ABR — confirm exactly one Type 3 default is originated and that no unexpected summaries leak in.
  • show ip route ospf on an interior router — a single O*IA 0.0.0.0/0 entry should be present, and no external O E1/E2 routes.
  • show ip ospf border-routers — confirm the ABR (and any NSSA ASBR) is visible with the correct path type.

Troubleshooting and FAQ

Adjacency will not come up after the change

Almost always an area-type mismatch. Every router with an interface in the area must carry the same area type, and only the ABR carries no-summary. Check the configuration on both sides of the link and look for the mismatch log entry. Note that no-summary on a non-ABR is harmless but pointless; stub on one side and nothing on the other is fatal.

Interior routers have no default route

In a stub area the ABR originates the default only if it has an area-0 interface and is genuinely an ABR. A router with the area 1 interface but no area 0 interface will accept the configuration and never originate anything. In a plain NSSA (without no-summary) the default is not automatically injected — add default-information-originate on the ABR, or rely on a static route.

The redistributed route is visible inside the NSSA but not outside

The P-bit in the Type 7 LSA is clear, so the ABR does not translate it to Type 5. This normally happens when the next hop of the redistributed route is reachable inside the NSSA itself. Either advertise the external with a next hop that the ABR can reach from area 0, or accept that the route is area-local by design.

Can two ABRs serve the same stub area?

Yes, and you should for redundancy — but both must be configured identically, and both will inject a default. Interior routers will prefer one and fall back to the other, which gives you ABR-level resilience without any routing protocol tricks.

Do stub areas break redistribution from BGP or EIGRP?

You cannot redistribute external routes into a stub or totally stubby area at all — that is the definition of the area. Use NSSA (or totally NSSA) if the area needs to inject external reachability, and expect the ASBR inside the area to originate Type 7 LSAs.

Does an area type reduce convergence time?

Indirectly, and significantly on constrained hardware. A smaller LSDB means faster SPF computation and less memory pressure, so a branch router that previously took seconds to converge can respond in a few hundred milliseconds. The area type does not add a fast-reroute mechanism by itself.

原文链接:https://www.computernetworkingnotes.com/ccna-study-guide/ospf-stub-area-totally-stub-area-nssa-and-totally-nssa.html