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
- 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.
How it works
Router types
| Router | Definition |
|---|---|
| Internal router | All interfaces are in one area |
| Backbone router | At 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

| Area type | Allows | Blocks | Junos configuration |
|---|---|---|---|
| Normal | Types 1, 2, 3, 4, 5 | Nothing | area 0.0.0.1 |
| Stub | Types 1, 2, 3 | Types 4 and 5 | area 0.0.0.1 stub |
| Totally stubby | Types 1, 2 and one default type 3 | Types 3 (except the default), 4, 5 | stub no-summaries on the ABR |
| NSSA | Types 1, 2, 3, 7 | Types 4 and 5 | area 0.0.0.1 nssa |
| Totally stubby NSSA | Types 1, 2, 7 and a default | Types 3, 4, 5 | nssa 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.
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
| Type | Junos shows | Name | Originated by | Flooded |
|---|---|---|---|---|
| 1 | Router | Router LSA | Every router | Within the area |
| 2 | Network | Network LSA | The DR | Within the area |
| 3 | Summary | Network summary | ABR | Into other areas |
| 4 | ASBRSum | ASBR summary | ABR | Into other areas, tells how to reach the ASBR |
| 5 | Extern | AS external | ASBR | The whole AS except stub areas |
| 7 | NSSA | NSSA external | ASBR in an NSSA | Within 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.
| OSPFv2 | OSPFv3 | |
|---|---|---|
| Address family | IPv4 | IPv6 by default, other realms by configuration |
| Hierarchy | protocols ospf | protocols ospf3 |
| Multicast groups | 224.0.0.5, 224.0.0.6 | ff02::5, ff02::6 |
| Authentication | In the OSPF packet | Uses IPsec |
| Router ID | 32 bits | 32 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.
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-metricto 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 therealmstatement; 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.