OSPF neighbor discovery

Routers running OSPF need to establish a neighbor relationship before exchanging routing updates. OSPF neighbors are dynamically discovered by sending Hello packets out each OSPF-enabled interface on a router. Hello packets are sent to the multicast IP address of 224.0.0.5. If the two neighbors have compatible OSPF parameters listed in the Hello packets, the neighbor relationship will be formed.

By default, Hello packets are sent out every 10 second on an Ethernet network (this interval is known as the Hello interval). A Dead interval is four times the value of the Hello interval, so if a router on an Ethernet network doesn’t receive at least one Hello packet from an OSFP neighbor for 40 seconds, the routers will declares that neighbor to be down.

The following fields in the OSPF Hello packets must be the same on both routers in order for routers to become neighbors:

  • subnet
  • area id
  • hello and dead interval timers
  • authentication
  • area stub flag
  • MTU

The neighnbor discovery process is explained in the following example:

ospf example topology

Routers R1 and R2 are directly connected and run OSPF. Both routers will start sending Hellos to each other in order to establish a neighbor relationship. If the routers have compatible OSPF parameters, the neighbor relationship will be formed.

Each OSPF router is assigned a router ID. A router ID is determined by using one of the following methods:

  • using the router-id command under the OSPF process.
  • using the highest IP address of the router’s loopback interfaces.
  • using the highest IP address of the router’s physical interfaces. 
Geek University 2022