OSPF - The Neighbor Relationship



In order for OSPF-enabled routers to exchange information, they must form an adjacency (relationship) with their neighbor. Within this article, we will look at the process and various steps involved (Figure 1).


Before the OSPF router even starts to try and form an adjacency, OSPF must know/determine the following:

  • Router ID - The router-id is simply the routers name within the OSPF process. To determine the router-id the system selects the highest active IP address configured upon the interfaces.
  • OSPF Interfaces - Each interface that should run OSPF and send HELLO packets  This is configured, on Cisco devices via the ‘network’ command under the OSPF process. OSPF then adds a list of interfaces/routes that it will advertise to its LSBD (Link State Database).


The OSPF Type 1, HELLO packet is used for the dynamic discovery of neighbors and also to maintain neighbor relationships. HELLO packets are sent, via multicast the multicast address on all interfaces.

Let us look at how OSPF uses these HELLO packets is some more detail.

  1. Send HELLO - A HELLO is sent (every 10 seconds as default). Within this packet, a set of information is provided. This includes,
    • Router-ID
    • Neighbors
    • Hello and dead timers
    • Router Priority
    • Network Mask
    • BR/BDR IP Addresses
    • Area ID
    • Authentication password

Note: In order for the neighbor adjacency to form the HELLO and dead timers, network mask, area id, and authentication password must all match.

  1. Receive HELLO - The router receives the HELLO, and checks the information within. If the HELLO and dead timers, network mask, area id and/or authentication password do not match then the HELLO is dropped, and it is marked as an incompatible neighbor. In addition, the router also checks to see if its own router-id is listed within the neighbors of the HELLO packet.
  1. Send Reply HELLO - If the previous HELLO contained our router-id then a neighbor adjacency has already been formed. The dead timers are reset and a HELLO is sent back. If our router-id is not within the HELLO, then the new neighbor process begins.


Figure 1 - OSPF Neighbor Process/States.

New Neighbor

Now the process required to form a new neighbor relationship will begin. Lets step through each of the steps:

  1. Master/Slave - First of all the master/slave relation is determined, to decide who speaks first. This is determined by priority, with the router-id being used to break any potential tie. Next, the master sends a summary packet, also known as the database description (DBD), of the LSDB. The slave then sends theirs.
  2. DBD Review - Each DBD is acknowledged and reviewed. This involves each router looking through the DBD. For any routes that it does not know it requests more information from its neighbor. This process consists of the following steps/packets:
    1. LSR (Link State Request) - Slave requests details.
    2. LSU (Link State Update) - Master sends updates.
    3. LSR (Link State Request) - Master requests details.
    4. LSU (Link State Update) - Slave sends updates.
  1. Full Neighbor State - At this point, the neighbors are synchronized and the neighbor adjacency is fully complete.

About the Author


R Donato

Rick Donato is the Founder and Chief Editor of He currently works as an SDN/NFV Solutions Architect and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001