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.

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.

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.

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

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.

Verification

show ip ospf
show ip ospf database summary self-originate
show ip route ospf | begin Gateway

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.

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