Days 26, 27, 28: OSPF

CCNA Study Guide: OSPFv2 (Exam Topic 3.4)

1.0 OSPFv2 Fundamentals: The Link-State Advantage

Open Shortest Path First (OSPF) is a Link-State Interior Gateway Protocol (IGP). Unlike distance-vector protocols that rely on "routing by rumor," OSPF routers build a complete, synchronized map of the network topology.

The Metaphor: The GPS vs. The Signpost

Core Characteristics

Attribute

Description

Protocol Type

Link-State IGP

Algorithm

Dijkstra’s Shortest Path First (SPF)

Admin Distance (AD)

110

Multicast Addresses

224.0.0.5 (All OSPF Routers), 224.0.0.6 (DR/BDR)

2.0 The Path to Adjacency: OSPF Core Operations

OSPF routers must go through a structured process to become fully adjacent and synchronize their Link State Database (LSDB).

The 3-Step Process

  1. Become Neighbors: Routers discover each other via Hello packets.

  2. Exchange LSAs: Routers share Link State Advertisements (LSAs) to synchronize their databases.

  3. Calculate Routes: Once the LSDB is identical, each router runs the SPF algorithm to find the best paths.

OSPFv2 Neighbor States

State

Description

Down

No Hellos received.

Init

Hello received, but your own Router ID is not in the neighbor's list.

2-Way

Bidirectional communication confirmed (DR/BDR election happens here).

ExStart

Determining Master/Slave relationship for data exchange.

Exchange

Exchanging Database Descriptors (DBDs) (summaries of the LSDB).

Loading

Requesting specific missing info via LSRs and LSUs.

Full

LSDBs are fully synchronized. Normal operation.

3.0 Essential OSPF Components

3.1 Router ID (RID) Selection

The RID is a unique 32-bit identifier for the router. It is selected in this order:

  1. Manual Configuration: router-id 1.1.1.1 (Best Practice).

  2. Highest Loopback IP: Highest IP on any active loopback interface.

  3. Highest Physical IP: Highest IP on any active physical interface.

3.2 The OSPF Metric: Cost

OSPF calculates cost based on interface bandwidth. A lower cumulative cost is preferred.

$$Cost = \frac{Reference\ Bandwidth}{Interface\ Bandwidth}$$

Important: The default reference bandwidth is 100 Mbps. On modern networks (Gigabit or 10G), you must manually increase this to ensure OSPF can distinguish between different high-speed links.

3.3 LSA Types (CCNA Focus)

4.0 Network Types and the DR/BDR Election

On multi-access networks (like Ethernet), OSPF elects a Designated Router (DR) and a Backup Designated Router (BDR) to manage LSA flooding and reduce the number of adjacencies.

Feature

Broadcast (Ethernet)

Point-to-Point (Serial)

DR/BDR Election

Yes

No

Hello / Dead Timer

10s / 40s

10s / 40s

DR/BDR Election Hierarchy

  1. Highest Interface Priority: Default is 1. A priority of 0 makes a router ineligible.

  2. Highest Router ID: The tie-breaker if priorities are equal.

Note: The election is non-preemptive. If a new router with a higher priority joins the network, it will not become the DR until the current DR/BDR process is reset or the current DR fails.

5.0 OSPFv2 Configuration

5.1 Basic Implementation

# Method 1: Traditional Network Command

Router(config)# router ospf 1

Router(config-router)# router-id 1.1.1.1

Router(config-router)# network 10.1.1.0 0.0.0.255 area 0


# Method 2: Interface-level Command (Preferred)

Router(config)# interface g0/0

Router(config-if)# ip ospf 1 area 0


5.2 Common Optimizations

6.0 Troubleshooting OSPF Adjacency Issues

If two routers fail to reach the FULL state, check for mismatches in these parameters:

  1. Area ID: Must match.

  2. Subnet & Mask: Must be on the same primary subnet.

  3. Hello/Dead Timers: Must match (Default 10/40).

  4. Authentication: Passwords and types must match.

  5. MTU Size: If they mismatch, routers get stuck in ExStart/Exchange.

  6. Unique Router IDs: Duplicate RIDs prevent adjacency.

TL;DR Summary




Revision #1
Created 2026-03-14 19:31:16 UTC by Tony Utter
Updated 2026-03-14 19:31:30 UTC by Tony Utter