Skip to content
Portfolio

Open Shortest Path First (OSPF) Adjacency process

OSPF routers exchange several packet types while forming an adjacency and synchronizing the LSDB.

NumberMessage TypeFull NamePurposeNeighbor State Used
1HelloHello PacketDiscover neighbors, negotiate parameters, and maintain the adjacency (Keepalive).Init / 2-Way
2DBDDatabase DescriptionThe “catalog” or summary of the network map to check what the neighbor is missing.Exstart / Exchange
3LSRLink State RequestThe “order form” used to request specific network data discovered in the DBD.Loading
4LSULink State UpdateThe “delivery truck” that carries the actual, detailed LSA network data.Loading
5LSAckLink State AcknowledgmentThe “receipt confirmation”. Confirms that an LSU arrived safe and sound.Loading / Full

Neighbor state must reach FULL before the LSDB is considered synchronized.

OSPF packet types and adjacency exchange OSPF packet types and adjacency exchange

Version: OSPFv2 or OSPFv3

Type:
1- Hello
2- DBD Database Descriptor
3- LSR Link State Request
4- LSU Link State Update (LSA Link State Advertisements are inside LSUs)
5- Link State Acknowledgment

Router ID: Of the advertising router, and interface

Authentication Type:
0 - No password
1 - Plain text password
2 - MD5 authentication

  • OSPF discover each other and form adjacencies via Hello packets.
  • They send Hello packets out each interface where OSPF is enabled (except passive interfaces)
  • Multicast to 224.0.0.5
  • Sent every 10 seconds by default (even when the adjacency is already formed, to make sure the router is still up)
  • Router ID: 32 bit number that uniquely identifies each OSFP router.
  • Hello Interval How often router sends Hello packets.
  • Dead Interval: How long a router waits to hear from a neighbor before declaring it out of service. Default 4x Hello Interval.
  • Neighbors: A list of adjacent OSPF routers that this router has received a Hello packet from.
  • Area ID: The area configured for that interface
  • Router priority: An 8 bit number used to select DR and BDR and BSR IPv4 addres: if known
  • Authentication Flag: Authentication details if configured.
  • Stub Area Flag: If the area is a stub area.

1. Down
The initial state, no hello packets have been received from the neighbor.

2. Init
The router has received a packet form the neighbor, but bidirectional communication is not yet established.

3. 2-way
Bidirectional communication is confirmed because the local router sees its own Router ID listed in the neighbor’s Hello packet. On broadcast networks (like Ethernet), the Designated Router (DR) and Backup Designated Router (BDR) election happens during this state.

4. Exstart
Two-way traffic established; DR/BDR election occurs.

5. Exchange
Sharing LSA headers via DBD packets.

    1. Loading Requesting missing LSAs (LSR) and receiving them (LSU).
    1. Full LSDBs are 100% identical; full adjacency.
  1. Area numbers must match
  2. Interfaces must be in the same subnet
  3. OSPF process must not be shutdown
  4. OSPF Router IDs must be unique
  5. Hello and Dead timers must match
  6. Authentication settings must match
  7. IP MTU settings must match
  8. OSPF network type must match
  1. Router LSA
  2. Network LSA
  3. AS-External LSA