Interior Gateway Protocols · Topic 1 of 3
IGP Concepts and OSPFv2
JN0-650 study page on IGP concepts and OSPFv2 on Junos: link state operation, LSA types, stub and NSSA areas, virtual links, costs and key configuration.
- 6 min
- Includes a diagram
- Link state IGPs flood LSAs, then every router runs SPF on the same area database.
- LSA 1 and 2 stay in the area, 3 and 4 are created by the ABR, 5 spans the AS, and 7 lives only in an NSSA.
- Stub blocks type 5, totally stubby also blocks type 3, and an NSSA allows type 7 and translates it to type 5 at the ABR.
What it is
An interior gateway protocol (IGP) distributes routes inside one autonomous system. Its job is to give every router a loop-free path to every internal prefix and to find the next best path when a link fails. BGP then carries routes between autonomous systems.
IGPs fall in two families. Distance vector protocols such as RIP exchange routing tables with neighbors. Link state protocols such as OSPF and IS-IS flood a description of each router's links, and every router runs the shortest path first (SPF) algorithm on the same database.
OSPFv2 is the link state IGP for IPv4. At the professional level the questions are about area design, which LSA type appears where, and how the router decides cost and preference.
How it works
Areas, routers and LSA types
OSPF limits the size of the database with areas. Area 0 (the backbone) connects every other area, directly or through a virtual link. An area border router (ABR) has interfaces in more than one area, and an autonomous system boundary router (ASBR) imports routes from outside OSPF.
| LSA type | Name | Originated by | Flooded in |
|---|---|---|---|
| 1 | Router | Every router | One area |
| 2 | Network | The DR | One area |
| 3 | Network summary | ABR | Into the other areas |
| 4 | ASBR summary | ABR | Into the other areas |
| 5 | AS external | ASBR | The whole AS, except stub areas |
| 7 | NSSA external | ASBR inside an NSSA | One NSSA |
Area types
A stub area blocks type 5 LSAs and receives a default route from the ABR instead. A totally stubby area also blocks type 3 summaries, so the ABR injects only a default route. An NSSA blocks type 5 but allows an ASBR inside the area to originate type 7 LSAs, which the ABR translates into type 5 for the rest of the AS.
| Area type | Type 3 | Type 5 | Type 7 | Default route |
|---|---|---|---|---|
| Normal | Yes | Yes | No | No |
| Stub | Yes | No | No | From the ABR |
| Totally stubby | No (default only) | No | No | From the ABR |
| NSSA | Yes | No | Yes | Optional, configured |
set protocols ospf area 0.0.0.1 stub default-metric 10 no-summaries
set protocols ospf area 0.0.0.2 nssa default-lsa default-metric 10 metric-type 1
The first line makes area 1 totally stubby (no-summaries is set on the ABR only). The second makes area 2 an NSSA and has the ABR originate a default LSA. Every router in a stub or NSSA area must carry the same stub flag in its Hellos.
A stub area cannot contain an ASBR, and a virtual link cannot cross a stub area. Use an NSSA when you need external routes originated inside the area.
Cost and route preference
OSPF cost is derived from the interface bandwidth against a reference bandwidth. The Junos default reference bandwidth is 100 Mbps, so any link of 100 Mbps or faster gets cost 1 unless you change it.
set protocols ospf reference-bandwidth 10g
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 metric 20
External routes carry a type: type 1 adds the internal cost to the ASBR, and type 2 (the default) keeps only the external metric. The Junos route preference for OSPF internal routes is 10 and for OSPF external routes is 150, compared with 0 for direct, 5 for static and 170 for BGP.
Basic OSPFv2 configuration
set routing-options router-id 10.255.0.1
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 authentication md5 1 key "secret"
set protocols ospf area 0.0.0.0 area-range 10.1.0.0/16
area-range is placed on an ABR and summarizes the area's prefixes into one type 3 LSA. Authentication, hello and dead intervals (10 and 40 seconds on broadcast links), the stub flag and the area ID must match between neighbors. A virtual link connects a disconnected area through a transit area:
set protocols ospf area 0.0.0.0 virtual-link neighbor-id 10.255.0.9 transit-area 0.0.0.1
A passive interface advertises its prefix into OSPF but forms no neighbors. Use it for loopbacks and user-facing links.
Common mistakes
Putting no-summaries on every router. It is configured only on the ABR of the stub or NSSA area.
Expecting type 5 LSAs in a stub area. They are blocked. Use an NSSA for an ASBR inside the area.
Forgetting the reference bandwidth. With the default of 100 Mbps, a 1 Gbps and a 10 Gbps link both have cost 1.
Mismatched stub flags. A stub area router does not form a neighbor with a normal area router on the same link.
Assuming import policy filters internal routes. It cannot; the next page explains why.
What to remember for the exam
- Link state IGPs flood LSAs, then every router runs SPF on the same area database.
- LSA 1 and 2 stay in the area, 3 and 4 are created by the ABR, 5 spans the AS, and 7 lives only in an NSSA.
- Stub blocks type 5, totally stubby also blocks type 3, and an NSSA allows type 7 and translates it to type 5 at the ABR.
- The Junos default reference bandwidth is 100 Mbps.
- OSPF preference is 10 internal and 150 external; external type 2 is the default.
area-rangesummarizes on an ABR; a virtual link needs a transit area that is not stub.
Check yourself
Which LSA type does an ASBR inside an NSSA originate, and who converts it?
It originates type 7, and the ABR translates it to type 5 for the rest of the AS.
Where do you configure
no-summariesto make an area totally stubby?On the ABR for that area, using the
stubstatement.Why do a 1 Gbps and a 10 Gbps link both show cost 1 by default?
The default reference bandwidth is 100 Mbps, so any link at or above it gets cost 1; raise it with
reference-bandwidth.
Topic 1 of 3 in Interior Gateway Protocols
Test yourself on Interior Gateway Protocols
The full Juniper JNCIP-ENT JN0-650 question bank has 858 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.