OSPF (Open Shortest Path First)

A Link-State protocol that builds a complete topological map of the network using Dijkstra's SPF algorithm. It is the industry standard for enterprise IGP.

1. Fundamental Mechanics

OSPF routers communicate via IP Protocol 89. They send Hello packets to discover neighbors and form adjacencies. Once adjacent, they exchange LSAs (Link State Advertisements) to synchronize their LSDB (Link State Database).

2. LSA Types (The Building Blocks)

Understanding LSAs is key to troubleshooting OSPF. They define the "scope" of information.

Type Name Generated By Scope Description
1 Router Every Router Intra-Area "I am Router X, I have links A, B, C with these costs."
2 Network DR Intra-Area "I am the DR for this Ethernet segment. Routers X, Y, Z are attached here."
3 Summary ABR Inter-Area "I can reach Network N in another area with Cost C." (Aggregates Type 1/2).
4 ASBR Summary ABR Global "I know how to reach the ASBR (Router Y). Here is the cost."
5 External ASBR Global "I know an external route (e.g., Internet/EIGRP) to Network Z."
7 NSSA External ASBR (in NSSA) NSSA Only Same as Type 5, but allowed inside a Not-So-Stubby Area. ABR converts this to Type 5.

3. OSPF Area Types

Areas reduce the size of the LSDB and limit LSA flooding.

Standard Area

The default. Accepts all LSA types (1, 2, 3, 4, 5). Routes are detailed.

Stub Area

Goal: Reduce routing table size on edge routers.

Totally Stubby Area (Cisco Proprietary)

Goal: Maximum reduction.

NSSA (Not-So-Stubby Area)

Goal: Like a Stub, but you have a local external connection (e.g., a 4G modem or partner link).

4. Network Types

How OSPF behaves depends on the Layer 2 medium.

Type Default On Hello Timer DR/BDR?
Broadcast Ethernet 10s Yes
Point-to-Point Serial / HDLC 10s No
Non-Broadcast (NBMA) Frame Relay / X.25 30s Yes (Manual Neighbors)
Design Tip: Loopbacks

A Loopback interface defaults to LOOPBACK network type, which advertises the IP as a /32 host route, regardless of the configured mask. To advertise the full subnet (e.g. /24), change it: ip ospf network point-to-point.

5. Neighbor States (FSM)

Troubleshooting stuck adjacencies requires knowing the states.


References