Open Shortest Path First (OSPF) uses five distinct packet types to establish and maintain neighbor relationships, exchange routing information, and ensure reliable communication. These packets are carried within an OSPF common header, which identifies the packet type. This document details the OSPF packet types, their roles in the adjacency state machine, the parameters required for neighbor formation, and verification commands.
OSPF Packet Types
OSPF employs five packet types, each identified by a type code in the OSPF common header:
Hello (Type 1):
Discovers and maintains neighbor relationships.
Sent periodically to verify neighbor reachability.
Contains parameters critical for adjacency formation (see below).
Database Description (DBD, Type 2):
Summarizes the Link-State Database (LSDB) during the initial adjacency formation.
Exchanged in the Exchange state to describe LSA headers, enabling routers to identify missing or outdated LSAs.
Link-State Request (LSR, Type 3):
Requests specific LSAs identified during DBD exchange.
Sent in the Loading state to retrieve complete LSA information from a neighbor.
Link-State Update (LSU, Type 4):
Carries one or more LSAs to update the neighbor’s LSDB.
Used during initial synchronization and for topology changes (e.g., link failures).
Link-State Acknowledgment (LSAck, Type 5):
Acknowledges receipt of LSAs to ensure reliable delivery.
Sent in response to LSUs to confirm successful processing.
Note: All OSPF packets use IP protocol number 89 and are encapsulated in IP packets. The OSPF common header includes the packet type (1–5), Router ID, Area ID, and authentication fields.
Parameters for Neighbor Adjacency
For two routers to form an OSPF neighbor relationship (reaching the Two-Way or Full state), the following parameters in the Hello packet and OSPF common header must match:
Hello Interval: Time between Hello packets (e.g., 10 seconds for Broadcast networks).
Dead Interval: Time before declaring a neighbor down (e.g., 40 seconds for Broadcast networks).
Area ID and Type: The OSPF area ID and type (e.g., normal, stub, NSSA). Stub/NSSA flags must match.
Subnet ID and Mask: The interface’s subnet and mask must be identical.
Authentication Type: If enabled, the authentication method (e.g., null, plaintext, MD5).
Authentication Key ID and Key: For MD5 authentication, the key ID and password must match.
List of Seen Neighbors: In multi-access networks, Hello packets include neighbors’ Router IDs to confirm bidirectional communication.
Router ID: Must be unique for each router.
Network Type: The OSPF network type (e.g., Broadcast, Point-to-Point) must be compatible.
MTU: The Maximum Transmission Unit must match to ensure successful DBD exchange.
Key Requirement: If any parameter mismatches, the neighbor relationship remains in the Down or Init state, preventing adjacency formation.
Packet Transmission Details
IP Protocol: All OSPF packets use IP protocol number 89.
Hello Packet Transmission:
On multi-access networks supporting multicast (e.g., Ethernet), Hello packets are sent to the multicast address 224.0.0.5 (All_OSPF_Routers).
On non-multicast networks (e.g., NBMA, Point-to-Point), Hello packets are sent as unicast to specific neighbor addresses.
Other Packets: DBD, LSR, LSU, and LSAck packets are typically unicast, except in specific cases (e.g., LSU flooding in Broadcast networks may use multicast).
Verification Commands
To verify OSPF neighbor states, packet parameters, and interface settings, use the following Cisco IOS/IOS XE commands:
Show Neighbor Status:
R1# show ip ospf neighbor
Displays neighbor Router ID, state (e.g., Full, Two-Way), interface, and timers.
Show Interface OSPF Details:
R1# show ip ospf interface [type number]
Shows interface-specific OSPF settings, including timers, network type, and authentication.
Show OSPF Process Details:
R1# show ip ospf
Provides OSPF process information, including Router ID, area configuration, and summary statistics.
Debug OSPF Packets (use with caution in production):
R1# debug ip ospf packet
Displays real-time OSPF packet details, useful for troubleshooting mismatches.
IOS XR Equivalents:
show ospf neighbor
show ospf interface [type number]
show ospf
debug ospf packet
Key Considerations
Adjacency Failures: Mismatched parameters (e.g., Hello Interval, MTU) are a common cause of neighbor adjacency issues. Use debug ip ospf adj to diagnose.
Multicast vs. Unicast: Understand the network type’s impact on packet transmission. For example, NBMA networks require manual neighbor configuration for unicast Hellos.
Packet Efficiency: Hello packets are lightweight but frequent, while LSU packets can be resource-intensive during topology changes.
State Machine: The progression from Init to Full state relies on the sequential use of packet types, making their understanding critical for troubleshooting.