Sub topic 18
Stub, Totally Stubby, and NSSA Areas
This chapter assumes you know LSA types 1 to 5, the roles of the ABR and ASBR, and the difference between intra-area, inter-area, and external routes. It also assumes you can read a basic OSPF configuration.
Why restrict an area
In a normal area, every router holds a full copy of the link-state database. That includes Type 3 summary LSAs for other areas and Type 5 external LSAs for routes redistributed from outside OSPF. In a branch office with one exit toward the core, most of that information is wasted. Every router stores it, and every change forces a new SPF run, yet every router sends all of that traffic to the same ABR.
Special area types filter the LSAs that may enter an area and replace them with a default route. This shrinks the database and the routing table, and it keeps instability elsewhere in the network from triggering SPF runs in the branch.
Stub areas
A stub area blocks Type 4 and Type 5 LSAs. Without Type 5 LSAs there is no use for Type 4 LSAs, which only locate an ASBR. Routers in the area still receive Type 1, 2, and 3 LSAs, so they keep specific routes to other areas.
The ABR injects a default route into the stub area as a Type 3 LSA. It shows up on internal routers as an inter-area route, usually O*IA 0.0.0.0/0. External destinations are reached through that default.
Every router in the area must be configured as a stub, because the stub flag is carried in the E-bit of the Hello options field. A router that disagrees about the flag will not form an adjacency.
router ospf 1
area 1 stub
!
! On the ABR only, to make area 1 totally stubby:
router ospf 1
area 1 stub no-summaryTotally stubby areas
A totally stubby area is a Cisco-specific extension that goes one step further. It also blocks Type 3 LSAs, except the single default route the ABR injects. Internal routers then know only their own area's routes plus 0.0.0.0/0.
You add the no-summary keyword on the ABR only. Internal routers keep the plain area 1 stub command. This is the smallest routing table you can get with OSPF.
The cost is lost path choice. If an area has two ABRs, an internal router sees only two default routes and picks the one with the lowest cost to the ABR. That may not be the best path to the destination. In a stub area, which still has Type 3 routes, this problem is smaller.
NSSA: a stub area with an ASBR
A stub area cannot contain an ASBR, because external routes cannot be originated where Type 5 LSAs are banned. Suppose a branch office needs to redistribute a static route or a connection to a partner network. A not-so-stubby area (NSSA) solves this.
In an NSSA, the ASBR originates external routes as Type 7 LSAs. These flood only inside the NSSA. The ABR then translates Type 7 LSAs into Type 5 LSAs and floods them into the rest of the OSPF domain. If the NSSA has several ABRs, the one with the highest router ID performs the translation.
Routes learned from Type 7 LSAs appear in the routing table as N1 or N2, which parallel the E1 and E2 external route types. Like E2, N2 is the default and keeps the external cost unchanged. N1 adds the internal cost to reach the ASBR.
An NSSA does not get a default route automatically. By default it blocks Type 5 but receives no default. Add one on the ABR:
router ospf 1
area 2 nssa default-information-originate
!
! Totally NSSA: also block Type 3 and inject a default
router ospf 1
area 2 nssa no-summaryAll routers in the NSSA must carry the nssa flag. The NSSA is signalled by the N-bit in Hello options, and a mismatch prevents adjacency, just as with stub.
Comparing the area types
| Area type | Type 3 allowed | Type 4/5 allowed | Type 7 allowed | ASBR allowed | Default route from ABR |
|---|---|---|---|---|---|
| Normal | Yes | Yes | No | Yes | No |
| Stub | Yes | No | No | No | Yes, automatic |
| Totally stubby | Only the default | No | No | No | Yes, automatic |
| NSSA | Yes | No | Yes | Yes | Only if configured |
| Totally NSSA | Only the default | No | Yes | Yes | Yes, with `no-summary` |
Rules and limits
- Area 0 cannot be a stub or an NSSA. The backbone must carry full routing information.
- A virtual link cannot cross a stub area or an NSSA.
- Every router in the area must agree on the flag. Check
show ip ospfon each router to see whether the area is listed as a stub or NSSA. - The ABR's default route has a configurable cost:
area 1 default-cost 50. - Redistribution on a router inside a stub area is rejected, since there is no way to flood the result.
Checking the result
On an internal router of a stub area, verify the database and the routing table:
show ip ospf database
show ip route ospfYou should see no Type 5 entries in the database. The routing table should show the O*IA 0.0.0.0/0 default. In a totally stubby area, the only inter-area route should be that default. In an NSSA, look for Type 7 entries in the database and O N2 routes on the NSSA routers, and O E2 routes outside the NSSA after translation.
Exercise
Area 3 is a branch with one ABR. It needs a small routing table, but a router in it redistributes a static route to a partner network. Which area type fits, and which command on the ABR gives the smallest table and a default route?
Show answer
An NSSA, because stub and totally stubby areas cannot contain an ASBR. Use area 3 nssa no-summary on the ABR (a totally NSSA). This blocks Type 3 LSAs apart from the injected default, allows Type 7 LSAs from the branch ASBR, and the ABR translates them to Type 5 for the rest of the network. All routers in area 3 must also be configured with area 3 nssa.
Exercise
You configure area 1 stub on the ABR and on two of three internal routers. The third router has a normal area 1 configuration. What happens?
Show answer
The third router will not form an adjacency with its neighbors. The E-bit in its Hello packets does not match the stub setting on the others, so the Hellos are rejected. The fix is to configure area 1 stub on that router as well.