OSPF · Topic 3 of 5

Area and Router Types, LSA Types and OSPF Realms

Learn OSPF area types (backbone, stub, NSSA), router roles, LSA types 1 to 7, and OSPFv3 realms, with the matching Junos configuration for JN0-352.

  • 6 min
  • Includes a diagram
In a nutshell
  • Area 0.0.0.0 is the backbone; all other areas connect to it, directly or by a virtual link.
  • ABR joins areas; ASBR injects external routes.
  • Stub blocks types 4 and 5; totally stubby also blocks type 3; NSSA uses type 7 and the ABR translates it to type 5.

What it is

OSPF divides a large network into areas to keep each router's database small and to limit the effect of a change. Area 0.0.0.0 is the backbone, and every other area must connect to it.

The LSA type says what an advertisement describes and how far it is flooded. The area type decides which LSA types are allowed in. A realm is an OSPFv3 address family: the separate OSPFv3 instance used for IPv4 or multicast routes instead of the default IPv6 unicast routes.

Area 1internal routersABR|type 3 summariesArea 0backboneABR|type 3 summariesArea 2internal routersArea 0ASBR|type 5 externalsExternal network

How it works

Router types

RouterDefinition
Internal routerAll interfaces are in one area
Backbone routerAt least one interface is in area 0
Area border router (ABR)Interfaces in more than one area, one of them area 0; keeps a separate LSDB per area
AS boundary router (ASBR)Injects routes learned from outside OSPF (static, direct, BGP) into OSPF

Area types

An ASBR in area 0 redistributes external networks as type 5 LSAs. The ABR between area 0 and stub area 1 does not flood type 4 or type 5 LSAs into area 1 and, with stub default-metric 10, sends the internal router a default route instead.

Area typeAllowsBlocksJunos configuration
NormalTypes 1, 2, 3, 4, 5Nothingarea 0.0.0.1
StubTypes 1, 2, 3Types 4 and 5area 0.0.0.1 stub
Totally stubbyTypes 1, 2 and one default type 3Types 3 (except the default), 4, 5stub no-summaries on the ABR
NSSATypes 1, 2, 3, 7Types 4 and 5area 0.0.0.1 nssa
Totally stubby NSSATypes 1, 2, 7 and a defaultTypes 3, 4, 5nssa no-summaries on the ABR

The routers in a stub area replace external routes with a default route from the ABR. In Junos OS the ABR does not originate that default route unless you give it a metric:

user@abr# set protocols ospf area 0.0.0.1 stub default-metric 10
user@abr# set protocols ospf area 0.0.0.1 stub no-summaries
user@internal# set protocols ospf area 0.0.0.1 stub

All routers in the area must agree on the stub flag, or the neighbors will not form. no-summaries is configured only on the ABR.

An NSSA is a stub area that still needs an ASBR inside it. That ASBR originates type 7 LSAs. The ABR translates them into type 5 LSAs before flooding them into the rest of the network.

ASBR in NSSAtype 7flooded in areaABRtranslates toType 5into backbone

Virtual links and area ranges

An area with no physical link to area 0 can connect through a virtual link across another area:

user@router# set protocols ospf area 0.0.0.0 virtual-link neighbor-id 10.255.0.2 transit-area 0.0.0.1

On an ABR, area-range summarizes the prefixes of an area into one type 3 LSA for the other areas:

user@abr# set protocols ospf area 0.0.0.1 area-range 10.1.0.0/16

LSA types

TypeJunos showsNameOriginated byFlooded
1RouterRouter LSAEvery routerWithin the area
2NetworkNetwork LSAThe DRWithin the area
3SummaryNetwork summaryABRInto other areas
4ASBRSumASBR summaryABRInto other areas, tells how to reach the ASBR
5ExternAS externalASBRThe whole AS except stub areas
7NSSANSSA externalASBR in an NSSAWithin the NSSA only

In OSPFv2, types 9, 10 and 11 are opaque LSAs, with link, area and AS flooding scope. They carry extra data such as traffic engineering information.

External routes have two metric types. Type 2 (E2, the default) keeps the external cost unchanged all through OSPF. Type 1 (E1) adds the internal cost to reach the ASBR. Junos gives OSPF internal routes preference 10 and external routes preference 150.

To look at one type, add it to the command, for example show ospf database netsummary.

OSPF realms

OSPFv2 carries IPv4 only. OSPFv3 was written for IPv6, and it can carry other address families as separate instances called realms. In Junos the default OSPFv3 realm is IPv6 unicast. The realm statement under protocols ospf3 chooses one of the other realms, ipv4-unicast, ipv4-multicast or ipv6-multicast:

user@router# set protocols ospf3 area 0.0.0.0 interface ge-0/0/1.0
user@router# set protocols ospf3 realm ipv4-unicast area 0.0.0.0 interface ge-0/0/1.0

The first line runs the IPv6 unicast realm. The second runs a separate OSPFv3 instance for IPv4 unicast routes. Each realm has its own neighbors, LSDB and routes.

OSPFv2OSPFv3
Address familyIPv4IPv6 by default, other realms by configuration
Hierarchyprotocols ospfprotocols ospf3
Multicast groups224.0.0.5, 224.0.0.6ff02::5, ff02::6
AuthenticationIn the OSPF packetUses IPsec
Router ID32 bits32 bits, must be configured on an IPv6 only router

OSPFv3 renames the LSAs and adds two types: type 8 (link LSA, link local scope) and type 9 (intra-area prefix LSA, area scope), because prefixes are no longer in router and network LSAs.

Common mistakes

Putting stub on only one side. The stub flag is in the Hellos. A mismatch keeps the routers from becoming neighbors.

Expecting a default route into a stub area with no extra configuration. On Junos the ABR needs default-metric.

Placing an ASBR inside a stub area. A stub area cannot contain an ASBR; use NSSA.

Watch out

Type 5 LSAs are not flooded into stub areas, and a virtual link cannot be configured through a stub area. These two facts show up often as wrong answer options.

What to remember for the exam

  • Area 0.0.0.0 is the backbone; all other areas connect to it, directly or by a virtual link.
  • ABR joins areas; ASBR injects external routes.
  • Stub blocks types 4 and 5; totally stubby also blocks type 3; NSSA uses type 7 and the ABR translates it to type 5.
  • On Junos the stub ABR needs default-metric to inject the default route.
  • LSA types: 1 Router, 2 Network, 3 Summary, 4 ASBR summary, 5 External, 7 NSSA, 9 to 11 opaque.
  • OSPFv3 realms: ipv4-unicast, ipv4-multicast, ipv6-multicast; IPv6 unicast is the default.

Check yourself

  • Which LSA type is blocked from a stub area but allowed into an NSSA?

    Type 5 is blocked in both, but an NSSA gets its own external routes as type 7 LSAs, which the ABR translates to type 5.

  • Who originates the network LSA (type 2)?

    The designated router, for its broadcast or NBMA segment.

  • What is an OSPFv3 realm?

    A separate OSPFv3 instance for an address family, such as ipv4-unicast, selected with the realm statement; IPv6 unicast is the default.

Topic 3 of 5 in OSPF

Test yourself on OSPF

The full Juniper JNCIS-ENT JN0-352 question bank has 846 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.