OSPF area types

All routers in an area need the same LSDB, so the only place to filter LSAs is the ABR, where they enter the area. A stub area keeps out types 4 and 5 and gets a default instead; a totally stubby area also keeps out type 3s. An NSSA lets an ASBR inside redistribute, as type 7 LSAs, but its ABR does not send a default unless told to.

In Daveth Pro (Network)12 min video · lab: OSPF v2/v3

By , founder of Daveth · Updated

Opening frame of the video walkthrough of OSPF area types

Watch this lesson

12 min · Video walkthrough

In Daveth Pro (Network)

The full 12 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab R3: OSPF v2/v3

What the lab covers

What this page answers

What is a totally stubby area?

An area whose ABR keeps out type 3, 4 and 5 LSAs and advertises a default route in their place, so the area's routers hold only their own area's routes and the default. Read it in “Second notch: totally stubby”

Why does an NSSA lose its default route?

Unlike a stub area's ABR, an NSSA's ABR does not advertise a default on its own. Append default-information-originate to the area nssa command if the NSSA needs one. Read it in “The notch that forgets the default”

What is the difference between a stub area and an NSSA?

A stub area forbids redistributing external routes into it. An NSSA still keeps type 5 LSAs out at the ABR but allows an ASBR inside to redistribute, as type 7 LSAs that the ABR converts into type 5s. Read it in “A branch with its own external: NSSA”

Area 10 knows about everything

The last lesson ended on a question. Area 10 holds a type 5 for every external route in the company and a type 4 for every ASBR, and every one of them leads out through R-ABR1 anyway. R-B10 has one way out. Why should it carry the map of everything beyond that way out?

Start with what you can't change. All routers in an area need the same LSDB, so you can't manipulate the LSAs within an area. What you can manipulate are the LSAs flowing between areas, with OSPF's stub and NSSA features. So every decision in this lesson is made at one door: the ABR, where LSAs enter the area.

The tool is the stubby area. Stubby areas give you a way to filter out external routes, with the option to block inter-area routes as well. There are four kinds:

  • stub areas;
  • totally stubby areas;
  • not-so-stubby areas, NSSAs;
  • totally NSSAs.

Two of those aren't in RFC 2328 at all. Totally stubby areas and totally NSSAs aren't defined by the RFC, but they're compliant with it and commonly implemented by Cisco and other vendors.

One rule now, because it bites later. A stubby area is identified by the area flag in the OSPF hello, so every router in a stubby area has to be configured as a stub, or the routers can't establish or keep their adjacencies.

Here's the plan: one branch area, one setting, turned a notch at a time. At each notch, write down what the branch router loses and what it gets back before the output shows you.

The names you already have: backbone, normal, transit

The blueprint lists six area types. Three of them aren't filters at all.

  • Backbone. In a multi-area OSPF network a backbone area, numbered area 0, must exist, and every other area must connect to it. That's the two-tier rule from the LSDB lesson: routes between areas pass through area 0.
  • Normal. The default OSPF area type is a normal area. Nearly every area you've met so far was normal (area 56 had a turn as an NSSA in the LSDB lesson): it takes whatever LSA types its ABR has to offer. You convert a normal area into a stub area or an NSSA to control the types of LSA the ABR sends into it.
  • Transit. A role an area plays, not a keyword you type. A virtual link is built between two routers in the same area, and the area where its endpoints sit is the transit area: it carries LSAs between area 0 and an area that isn't attached to it, or from one part of area 0 to another. One rule from there belongs here: virtual links can't be formed on any OSPF stubby area, so a transit area can't be a stub of any kind. Why you'd build a virtual link, and how, comes later.

First notch: stub

The network for this lesson:

Network drawing: area 12, area 0, area 34, 10.12.1.0/24, 10.23.1.0/24, 10.34.1.0/24, .2, .3, .4, 172.16.1.0/24 (external), 172.31.4.0/24 (partner, later), outside OSPF, R1 (ASBR), R2 (ABR), R3 (ABR), R4, partner

Three areas, four routers. R2 and R3 are the area border routers; R1 redistributes 172.16.1.0/24. Router IDs are 192.168.N.N. The terminals on this page come from these routers; outputs from another network say so.

R1 sits in area 12 and redistributes a connected network, 172.16.1.0/24; R2 joins area 12 to area 0; R3 joins area 0 to area 34; R4 sits alone in area 34. Before anything changes, the external 172.16.1.0/24 that R1 redistributed is visible on R3 and R4. Here's R4's view, the routes cut to the left of the timers:

R4# show ip route ospf | begin Gateway
Gateway of last resort is not set
     10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA     10.12.1.0/24 [110/3] via 10.34.1.3
O IA     10.23.1.0/24 [110/2] via 10.34.1.3
     172.16.0.0/24 is subnetted, 1 subnets
O E1     172.16.1.0 [110/23] via 10.34.1.3
O IA     192.168.1.1 [110/4] via 10.34.1.3
O IA     192.168.2.2 [110/3] via 10.34.1.3
O IA     192.168.3.3 [110/2] via 10.34.1.3

R3 has the same external at [110/22]. Now make area 34 a stub. Before you read on, write down R4's table: what goes, what stays, and what arrives?

The rule. A stub area prohibits type 5 LSAs (the externals) and type 4 LSAs (the ASBR summaries) from entering the area at the ABR. Why the type 4 as well? With no type 5 in the area, nobody needs to find an ASBR, so the type 4 has no job left. A stub area blocks the type 5s, puts a default route in, and blocks the type 4s because they aren't needed.

In their place the ABR sends a default route. There are two descriptions of when. Under RFC 2328, the ABR of a stub area generates a default for the stub, as a type 3, when a type 5 reaches it. A Cisco ABR generates the default when the area is configured as a stub and the ABR has an OSPF-enabled interface in area 0.

The configuration is one process command, area <area-id> stub, and it goes on every router in the area: all routers in the stub area must be configured as stubs (the hello flag again). Here's R3's; R4 gets the same line:

R3# show running-config | section router ospf
router ospf 1
 router-id 192.168.3.3
 area 34 stub   ! the area type, under the process
 network 10.23.1.0 0.0.0.255 area 0
 network 10.34.1.0 0.0.0.255 area 34
 network 192.168.3.3 0.0.0.0 area 0
R3#

And R4 afterwards:

R4# show ip route ospf | begin Gateway
Gateway of last resort is 10.34.1.3 to network 0.0.0.0

O*IA  0.0.0.0/0 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
! the default, from R3
! subnet header lines omitted
O IA     10.12.1.0 [110/3] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     10.23.1.0 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.1.1 [110/4] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.2.2 [110/3] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.3.3 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
! every inter-area route stays
R4#

Check it against what you wrote:

  • Gone: the O E1 for 172.16.1.0/24. R4 doesn't see that route in its routing table any more, but it still has connectivity to that network, through the default route.
  • Arrived: O*IA 0.0.0.0/0, and the gateway of last resort is now R3, 10.34.1.3. When the type 5 for 172.16.1.0/24 reached the ABR, R3 generated a default route by using a type 3 LSA. IA in the code is that type 3. That's the RFC's trigger; by the Cisco rule, R3's area 0 interface was enough on its own. Either way the default is a type 3.
  • Kept: every O IA route. Inter-area routes are allowed in area 34.
  • R3: unchanged. R3 still receives the type 4 and type 5 LSAs from area 0, so its routing table isn't modified.

Why carry the default in a type 3 rather than a type 5? Because stub areas don't allow type 5 LSAs inside them. It fits a wider rule: an OSPF-advertised default always appears as an external route, except when OSPF stub areas are used. And the type 3 brings one more benefit: it can't be advertised from a nonbackbone area into the backbone, which matters for discontiguous networks, a later lesson's problem.

Second notch: totally stubby

R4 still carries a route for every network in every other area, and every one of those goes through R3 too. New requirement: the branch should hold its own area's routes and nothing else it can't use. Predict R4's table, and predict which router needs the new keyword.

A totally stubby area prohibits type 3 (inter-area), type 4 (ASBR summary) and type 5 (external) LSAs from entering the area at the ABR. Again the ABR generates a default in their place. When? On receiving a type 3 or a type 5. The sharper version: the ABR advertises the default into the totally stubby area the moment one of its interfaces goes into area 0, and that assignment is what triggers the type 3 behind the default. What's left inside the area? Only intra-area routes and the default should exist in a totally stubby area: R3 now stops the type 3s as well, and the default goes on into area 34.

The configuration has a twist. Member routers of a totally stubby area, the ones that aren't ABRs, are configured exactly as in a stub area. The ABR gets no-summary appended: area <area-id> stub no-summary under the OSPF process. The keyword does what it says. It blocks all type 3 (summary) LSAs going into the stub area, which is what makes it totally stubby.

R3# show running-config | section router ospf
router ospf 1
 router-id 192.168.3.3
 area 34 stub no-summary   ! only the ABR carries it
 network 10.23.1.0 0.0.0.255 area 0
 network 10.34.1.0 0.0.0.255 area 34
 network 192.168.3.3 0.0.0.0 area 0
R3#
R4# show running-config | section router ospf
router ospf 1
 router-id 192.168.4.4
 area 34 stub   ! the member: plain stub
 network 10.34.1.0 0.0.0.255 area 34
 network 192.168.4.4 0.0.0.0 area 34
R4#

And R4 afterwards. Only the default route exists on R4:

R4# show ip route ospf | begin Gateway
Gateway of last resort is 10.34.1.3 to network 0.0.0.0

O*IA  0.0.0.0/0 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
! the whole table
R4#

One line. Tidy, and R4 now depends on R3 for every destination outside area 34. R3's routing table, meanwhile, hasn't been touched at all. And R3's loopback isn't an exception: it's a member of area 0, and if it were a member of area 34 it would show on R4 as an intra-area route.

Look at what the two configurations disagree on. R3 says stub no-summary, R4 says stub, and they're still adjacent: R4's default comes from R3. So whatever the hello's area flag carries, it isn't no-summary. Hold that thought; it comes back near the end.

A branch with its own external: NSSA

Next, R4 gets a link to a partner, 172.31.4.0/24, and has to redistribute it into OSPF. Can area 34 stay a stub? Decide before you read on.

It can't. A stub area prohibits type 5 and type 4 LSAs from entering at the ABR, and it prohibits redistributing external routes into the stub area too. A not-so-stubby area, the NSSA, still keeps type 5 LSAs out at the ABR, but it allows external routes to be redistributed into the NSSA. The ASBR inside it advertises its route in a type 7 LSA instead of a type 5, and when the type 7 reaches the ABR, the ABR converts it into a type 5. You followed that conversion in the LSDB lesson, signatures and all. What's new is the trade: the branch's own external gets out, and the company's externals still don't get in.

So at R3 it works both ways: type 5s stop on the way in, and type 7 turns into type 5 on the way out. The default route into the NSSA is optional, depending on the configuration.

Before the change, with area 34 normal and R4 already redistributing, R1 and R4 have each other's externals: R1 holds O E1 172.31.4.0 [110/23], R3 holds both externals as O E1, and R4 holds O E1 172.16.1.0 [110/23].

The configuration: area <area-id> nssa [default-information-originate], under the OSPF process on the ABR. And not only there. All routers in an NSSA must be configured with the nssa option, for the same hello-flag reason. Here R3 carries the optional default-information-originate, to inject a default route into area 34, and R4 is allowed to redistribute into the NSSA:

R3# show run | section router ospf
router ospf 1
 router-id 192.168.3.3
 area 34 nssa default-information-originate
 network 10.23.1.0 0.0.0.255 area 0
 network 10.34.1.0 0.0.0.255 area 34
 network 192.168.3.3 0.0.0.0 area 0
R4# show run | section router ospf
router ospf 1
 router-id 192.168.4.4
 area 34 nssa
 redistribute connected metric-type 1 subnets
 network 10.34.1.0 0.0.0.255 area 34
 network 192.168.4.4 0.0.0.0 area 34

So the NSSA line sits on both routers, and only the ABR's carries the default keyword. R4's redistribute line belongs to the redistribution lessons. Afterwards, R3:

R3# show ip route ospf | begin Gateway
! the O IA and O lines are omitted here
O E1     172.16.1.0 [110/22] via 10.23.1.2
O N1     172.31.4.0 [110/22] via 10.34.1.4
R4# show ip route ospf | begin Gateway
Gateway of last resort is 10.34.1.3 to network 0.0.0.0

O*N2  0.0.0.0/0 [110/1] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
! the default: an NSSA external
! subnet header lines omitted
O IA     10.12.1.0 [110/3] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     10.23.1.0 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.1.1 [110/4] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.2.2 [110/3] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.3.3 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
R4#

Read it:

  • On R3, R1's external is still O E1, and R4's external is now O N1, an NSSA external type 1.
  • On R4, R1's external route is no longer there.
  • R3's default arrives on R4 as O N2, an NSSA external type 2. N1 and N2 routes are how a type 7 shows in the routing table, and a type 7 exists only inside an NSSA.
  • R4 kept every O IA route. An NSSA keeps out the company's externals, not the other areas' summaries.

The notch that forgets the default

Now the change that catches people. Last month area 34 was a stub, and R4's default came free with it. This month R4 needs to redistribute, so someone replaces area 34 stub with area 34 nssa on both routers, and stops there: no keyword. Predict R4's table. What does R4 lose?

The free default. An NSSA's ABR doesn't advertise a default route on its own when it blocks type 5 or type 7 LSAs: default-information-originate is the keyword you append if the NSSA needs one. Here's R4:

R4# show ip route ospf | begin Gateway
Gateway of last resort is not set   ! no default this time

! subnet header lines omitted
O IA     10.12.1.0 [110/3] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     10.23.1.0 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.1.1 [110/4] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.2.2 [110/3] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
O IA     192.168.3.3 [110/2] via 10.34.1.3, 00:01:30, GigabitEthernet0/3
R4#

R4 still holds its O IA routes, and the O E1 for 172.16.1.0/24 is gone, exactly as in the stub. But this time nothing arrives in its place, so R4 has no route to 172.16.1.0/24 at all. The NSSA, the type built for branches with outside connections, is the only one of the four that loses the company's externals and gives nothing back unless asked. A stub area, a totally stubby area and, as the next section shows, a totally NSSA all hand in a default on their own.

The way back is that keyword: it gives the branch a route toward everything the blocked LSAs described. It isn't the only way to give the branch two-way connectivity, but it's the one built into the NSSA configuration, and the one this lesson uses.

And notice what that option produces. With default-information-originate, R4's default was O*N2: an NSSA external, so a type 7. The stub area's default was O*IA, a type 3. Same purpose, a different LSA. Which of the two codes OSPF would prefer, if both ever met, is the next lesson's question.