OSPF routers exchange information about the network through LSAs. Each type of LSA serves a specific purpose:
Type 1: Router LSA
Type 2: Network LSA
Type 3: Summary LSA
Type 4: ASBR Summary LSA
Type 5: External LSA
Type 7: NSSA External LSA
LSAs are the building blocks of OSPF. They help routers construct the Link-State Database (LSDB), which represents the entire network topology and is used for calculating routes.
OSPF divides the network into areas to reduce complexity and improve performance.
Area 0 (Backbone Area):
Stub Area:
NSSA (Not-So-Stubby Area):
For OSPF routers to exchange LSAs, they must form neighbor relationships.
The neighbor relationship progresses through several states:
OSPF recognizes different types of networks and adjusts its behavior accordingly:
Broadcast:
Point-to-Point:
Non-Broadcast Multi-Access (NBMA):
Point-to-Multipoint:
Scalability:
Fast Convergence:
Support for Multiple Metrics:
Loop-Free:
Here’s a simple OSPF configuration for a Juniper router:
Enable OSPF on an Interface in Area 0:
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0
Configure Stub Area:
set protocols ospf area 0.0.0.0 stub no-summaries
Enable MD5 Authentication:
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 authentication md5 key-id 1 key "password"
Data Centers:
Service Providers:
Enterprise Networks:
OSPF is a robust and flexible routing protocol suitable for large and complex networks. As you progress, focus on understanding how LSAs interact to form the LSDB, and practice configuring OSPF in lab environments to reinforce your learning.
After a router establishes full adjacency with its neighbors and synchronizes the Link-State Database (LSDB), it runs the SPF (Shortest Path First) algorithm to compute the shortest paths.
SPF is triggered when:
A new LSA is received that causes a change in the topology.
A neighbor goes down or comes up.
A configuration change occurs (e.g., interface cost, area configuration).
Full SPF (full tree recalculation) happens by default.
Incremental SPF is supported in some platforms (Junos supports optimized SPF recalculation), where only affected parts of the tree are recalculated.
If Router A receives a Type 1 LSA from Router B with a new cost to a link, Router A:
Updates the LSDB.
Runs SPF.
Updates its routing table with new next-hop information.
This explains OSPF convergence: LSAs → LSDB update → SPF → RIB update.
OSPFv3 uses link-local addresses for neighbor relationships.
Interface IPv6 addresses are not required to be globally routable.
OSPFv3 forms adjacency per link, not per subnet.
Type 8 (Link-LSA): Advertises the router’s link-local address and IPv6 prefixes on a specific link.
Type 9 (Intra-Area Prefix LSA): Carries IPv6 prefix information that was formerly embedded in Type 1 and Type 2 LSAs in OSPFv2.
OSPFv3 uses the protocols ospf3 hierarchy.
It can be configured within a routing-instance, supporting multiple logical OSPFv3 processes.
Example:
set protocols ospf3 area 0.0.0.0 interface ge-0/0/1.0
Redistribution allows routes from other sources (e.g., BGP, static, RIP) to be injected into OSPF.
Routes redistributed into OSPF are advertised via Type 5 LSAs (external LSAs).
Metric-type defines how cost is calculated:
Type 1: Cost includes internal OSPF path plus external metric.
Type 2: External metric only; internal path ignored (default).
set protocols ospf export REDIST-POLICY
set policy-options policy-statement REDIST-POLICY term 1 from protocol static
set policy-options policy-statement REDIST-POLICY term 1 then accept
To set metric type:
set policy-options policy-statement REDIST-POLICY term 1 then metric-type 1
Null authentication (no authentication)
Simple (plaintext) authentication:
Configured using a simple password.
Not secure.
MD5 authentication:
Secure method using cryptographic hash.
Recommended for production.
Example (Simple):
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 authentication simple password ospfpass
OSPFv3 does not have built-in authentication fields.
Instead, it uses IPSec AH (Authentication Header) or ESP (Encapsulating Security Payload) for authentication and encryption.
LSA refresh interval: 30 minutes (1800 seconds)
MaxAge: 3600 seconds (1 hour)
Ensures LSDB doesn’t contain stale entries.
Helps with graceful aging and purging of topology data.
To check LSAs and their ages:
show ospf database
Output includes:
LSA type and ID
Age (in seconds)
Advertising router
Sequence number
This helps with troubleshooting SPF recalculation and route convergence issues.
| Topic | Key Takeaway |
|---|---|
| SPF Trigger & Type | Incremental or full SPF triggered by LSA changes |
| OSPFv3 Neighboring | Link-local address based, uses LSAs 8 & 9 |
| Redistribution Control | Metric-type 1 vs 2, policy-statement usage |
| Auth Mechanism | OSPFv2: Simple/MD5; OSPFv3: IPSec AH/ESP |
| LSA Refresh & Aging | 30-min refresh, 1-hour MaxAge, visible via show ospf database |
Why might two Junos routers remain stuck in the EXSTART state during OSPF adjacency formation?
A mismatch in MTU size between the two interfaces commonly causes the EXSTART state.
During OSPF database synchronization, routers exchange Database Description (DBD) packets. If the MTU advertised in the DBD packet is larger than what the neighbor interface supports, the receiving router rejects the packet. This prevents progression from EXSTART to EXCHANGE. In Junos networks, this often occurs when interfaces use different MTU settings or when tunnels modify packet sizes. Engineers sometimes mistakenly troubleshoot authentication or area mismatches first, but MTU is a frequent root cause. The typical fix is to align interface MTU values or configure OSPF to ignore MTU mismatches if appropriate. Understanding this state machine behavior is critical for diagnosing adjacency failures quickly in service provider networks.
Demand Score: 82
Exam Relevance Score: 90
Why does OSPF prefer Type 1 external routes (E1) over Type 2 external routes (E2)?
E1 routes include the internal OSPF path cost, while E2 routes only use the external cost.
When an external route enters an OSPF domain through redistribution, it can be advertised as either E1 or E2. An E2 route carries only the external metric assigned at redistribution, so the internal path to the ASBR is ignored in route comparison. In contrast, an E1 route adds the internal OSPF cost to reach the ASBR to the external metric. Because the route calculation reflects the full path cost, E1 routes provide more accurate path selection across large networks. Junos routers follow standard OSPF preference rules and therefore prefer E1 routes over E2 routes when both exist for the same destination. This behavior is especially important in service provider networks where multiple ASBRs redistribute routes.
Demand Score: 76
Exam Relevance Score: 88
Why might an OSPF neighbor remain stuck in the INIT state?
The router is receiving Hello packets but its own router ID is not listed in the neighbor’s Hello packet.
OSPF Hello packets contain a list of neighbors from which Hellos have been received. If Router A receives a Hello from Router B but Router B has not yet received a Hello from Router A, Router B will not include Router A’s router ID in its Hello packet. Router A therefore sees the neighbor in INIT state. This typically happens when multicast traffic is blocked, mismatched network types exist (broadcast vs point-to-point), or ACLs prevent return traffic. In service provider environments, incorrect interface network type or missing OSPF configuration on the peer interface is a common cause. Engineers should verify bidirectional communication and Hello packet exchanges.
Demand Score: 74
Exam Relevance Score: 86
What happens when OSPF route summarization is configured on an ABR in Junos?
The ABR advertises a summary LSA representing multiple networks from one area into another.
Route summarization reduces routing table size and limits LSA flooding between OSPF areas. When configured on an ABR, multiple intra-area routes can be aggregated into a single summary prefix before being advertised into another area. This improves scalability and stability in large service provider networks. However, summarization may hide specific routes and can affect path selection if more specific prefixes exist elsewhere in the topology. Engineers must design summarization boundaries carefully to avoid black-holing traffic or creating suboptimal routing paths. Junos supports this using area range configuration under OSPF.
Demand Score: 71
Exam Relevance Score: 84