Stubby Areas

Stubby Areas
OSPF can further reduce overhead by treating each area with one of several variations of rules,
based on a concept called a stubby area. Stubby areas take advantage of the fact that to reach
subnets in other areas, routers in an area must forward the packets to some ABR. Without stubby
areas, ABRs must advertise all the subnets into the area, so that the routers know about the subnets.
With stubby areas, ABRs quit advertising type 5 (external) LSAs into the stubby area, but instead
ABRs create and advertise default routes into the stubby area. As a result, internal routers use
default routing to forward packets to the ABR anyway. However, the internal routers now have
sparser LSDBs inside the area.
The classic case for a stubby area is an area with one ABR, but stubby areas can work well for
areas with multiple ABRs as well. For example, the only way out of area 3 in Figure 9-6 is through
the only ABR, R1. So, R1 could advertise a default route into area 3 instead of advertising any
external type 5 LSAs.
Also in Figure 9-6, area 5 has two ABRs. If area 5 were a stubby area, both ABRs would inject
default routes into the area. This configuration would work, but it may result in suboptimal routing.
OSPF defines several different types of stubby areas. By definition, all stubby areas stop type 5
(external) LSAs from being injected into them by the ABRs. However, depending on the variation,
a stubby area may also prevent type 3 LSAs from being injected. The other variation includes
whether a router inside the stubby area can redistribute routes into OSPF, thereby injecting an
external route. Table 9-5 lists the variations on stubby areas, and their names.
Note in Table 9-5 that all four stub area types stop type 5 LSAs from entering the area. When the
name includes “totally,” type 3 LSAs are also not passed into the area, significantly reducing the size
of the LSDB. If the name includes “NSSA,” it means that external routes can be redistributed into
OSPF by routers inside the stubby area; note that the LSAs for these external routes would be type 7.
NOTE Before moving on, a comment is in order about the relative use of the word
“summary” in OSPF. The typical uses within OSPF include the following:
■ Type 3 LSAs are called summary LSAs in the OSPF RFCs.
■ Type 5 and 7 external LSAs are sometimes called summary LSAs, because the LSAs
cannot represent detailed topology information.
■ The term LSA summary refers to the LSA headers that summarize LSAs and are sent inside
DD packets.
■ The term summary can also be used to refer to summary routes created with the area range
and summary-address commands.
270 Chapter 9: OSPF
Configuring a stub area is pretty simple—all routers in the area need the same stub settings, as
configured in the area stub command. Table 9-6 lists the options.
Example 9-7, based on Figure 9-6, shows the results of the following configuration:
■ Area 3 is configured as a totally NSSA area.
■ R3 will inject an external route to 192.168.21.0/24 as a type 7 LSA.
■ Area 4 is configured as a totally stubby area.
■ Area 5 is configured as simply stubby.
Table 9-5 OSPF Stubby Area Types
Area Type
Stops Injection of
Type 5 LSAs?
Stops Injection of
Type 3 LSAs?
Allows Creation of
Type 7 LSAs Inside
the Area?
Stub Yes No No
Totally stubby Yes Yes No
Not-so-stubby area
(NSSA)
Yes No Yes
Totally NSSA Yes Yes Yes
Table 9-6 Stub Area Configuration Options
Stub Type Router OSPF Subcommand
NSSA area area-id nssa
Totally NSSA area area-id nssa no-summary
Stub area area-id stub
Totally stubby area area-id stub no-summary
Example 9-7 Stub Area Example
! R3, in a totally NSSA area, knows intra-area routes (denoted with an “IA”
! near the front of the output line from show ip route), but the only
! inter-area route is the default route created and sent by R1, the ABR.
R3# show ip route ospf
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.3.2.0/23 [110/11] via 10.3.1.33, 00:00:00, Ethernet0/0
O*IA 0.0.0.0/0 [110/65] via 10.3.13.1, 00:00:00, Serial0/0.1
! Still on R3, the LSA type 3 summary, created by ABR R1, is shown first.
! Next, the External NSSA LSA type 7 LSA created by R3 is listed.
OSPF Design and LSAs 271
R3# show ip ospf database | begin Summary
Summary Net Link States (Area 3)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 1.1.1.1 704 0x80000004 0x00151A
Type-7 AS External Link States (Area 3)
Link ID ADV Router Age Seq# Checksum Tag
192.168.21.0 3.3.3.3 17 0x80000003 0x00C12B 0
! R1, because it is attached to area 3, also has the R3-generated NSSA external
! LSA. Note the advertising router is R3, and it is an E2 external route.
R1# show ip ospf database nssa-external
OSPF Router with ID (1.1.1.1) (Process ID 1)
Type-7 AS External Link States (Area 3)
Routing Bit Set on this LSA
LS age: 188
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 192.168.21.0 (External Network Number )
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0xC12B
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 10.3.13.3
External Route Tag: 0
! Below, the same command on R2, not in area 3, shows no type 7 LSAs. ABRs
! convert type 7 LSAs to type 5 LSAs before forwarding them into another area.
R2# show ip ospf database nssa-external
OSPF Router with ID (2.2.2.2) (Process ID 2)
! Next, R2 does have a type 5 LSA for the subnet; R1 converts the type 7 to a type
! 5 before flooding it into other areas.
R2# show ip ospf database | begin Type-5
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
192.168.1.0 7.7.7.7 521 0x80000050 0x003615 0
192.168.2.0 7.7.7.7 521 0x8000004D 0x00B418 0
192.168.21.0 1.1.1.1 1778 0x80000019 0x006682 0
continues
Example 9-7 Stub Area Example (Continued)
272 Chapter 9: OSPF
The legend in the top of the output of a show ip route command lists several identifiers that pertain
to OSPF. For example, the acronym “IA” refers to interarea OSPF routes, E1 refers to external
type 1 routes, and E2 refers to external type 2 routes.
Graceful Restart
In steady-state operation, OSPF can react to changes in the routing domain and reconverge
quickly. This is one of OSPF’s strengths as an IGP. However, what happens when something goes
really wrong is just as important as how things work under relatively stable conditions.
! Below, R4 is in a totally stubby area, with only one inter-area route.
R4# show ip route ospf
O*IA 0.0.0.0/0 [110/1563] via 10.4.14.1, 00:11:59, Serial0/0.1
! R5, in a stubby area, has several inter-area routes, but none of the
! external routes (e.g. 192.168.1.0). R5’s default points to R2.
R5# show ip route ospf
10.0.0.0/8 is variably subnetted, 7 subnets, 3 masks
O IA 10.3.13.0/24 [110/115] via 10.5.25.2, 13:45:49, Serial0.2
O IA 10.3.0.0/23 [110/125] via 10.5.25.2, 13:37:55, Serial0.2
O IA 10.1.1.0/24 [110/51] via 10.5.25.2, 13:45:49, Serial0.2
O IA 10.4.0.0/16 [110/1613] via 10.5.25.2, 13:45:49, Serial0.2
O*IA 0.0.0.0/0 [110/51] via 10.5.25.2, 13:45:49, Serial0.2
! Below, R5’s costs on its two interfaces to R1 and R2 are highlighted. Note that
! the default route’s metric (51) comes from the 50 below, plus an advertised
! cost of 1 in the summary (type 3) for default 0.0.0.0/0 generated by R2. R5
! simply chose to use the default route with the lower metric.
R5# sh ip ospf int brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Se0.1 1 5 10.5.15.5/24 64 P2P 1/1
Se0.2 1 5 10.5.25.5/24 50 P2P 1/1
Et0 1 5 10.5.1.5/24 10 DR 0/0
! Next, R2 changes the cost of its advertised summary from 1 to 15.
R2# conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)# router ospf 2
R2(config-router)# area 5 default-cost 15
! Below, R5’s metrics to both R1’s and R2’s default routes tie,
! so both are now in the routing table.
R5# show ip route ospf
! lines omitted for brevity
O*IA 0.0.0.0/0 [110/65] via 10.5.25.2, 00:00:44, Serial0.2
[110/65] via 10.5.15.1, 00:00:44, Serial0.1
Example 9-7 Stub Area Example (Continued)