OSPF Hello packet

There are five types of packets in OSPF: Hello packets are the first packets sent and received for OSPF processing; OSPF Hello packets are used to discover and maintain neighbors.

OSPF Hello packet format

OSPF packets are encapsulated in IP; the protocol number in the IP header is 89. The destination IP address of a Hello packet is usually 224.0.0.5, which is a multicast address representing all OSPF routers. When running OSPF over NBMA, such as Frame Relay, the IP address specified in the neighbor command becomes the destination IP address.

OSPF packets have a 24-byte OSPF header to identify the type of OSPF packet; Hello packets are type 1.

 Figure OSPF Hello format
Figure OSPF Hello format

Network Mask

The Network Mask (32 bits) is the subnet mask of the interface to which the Hello packet is sent. In order to be a neighbor, the Network Mask must match; for an interface whose IP address is set to ip unnumbered, the Network Mask is 0.0.0.0.

Hello Interval

The Hello Interval (16 bits) is the interval for sending Hello packets, and the default Hello Interval is 10 seconds in the current environment.

Options

Options (8 bits), indicating the various OSPF router capability, such as whether stub areas are supported in the Options field.

Router Priority

Router Priority (8 bits) is used to select DR/BDR in a multi-access network such as Ethernet. The router with the higher Router Priority is selected as DR/BDR. If the Router Priority is set to 0, the router does not participate in the DR/BDR selection.

Router Dead Interval

If no Hello packets are received for a period of Router Dead Interval (32 bits), the neighbor is considered down. The Router Dead Interval must also match in order to establish a neighbor.

Designated Router

The Designated Router (32-bit) contains the IP address of the DR, which is “0.0.0.0” when the DR is being selected or when the network type is point-to-point without DR/BDR selection.

Backup Designated Router

The Backup Designated Router (32-bit) contains the IP address of the BDR, which is “0.0.0.0” when the BDR is being selected or when the network type is point-to-point without DR/BDR selection.

Neighbor

Neighbor (32 bits) stores the router ID that is recognized as the neighbor. The initial value is “0.0.0.0”. If there are multiple neighbors, Neighbor will have multiple lines.


Conditions for becoming a neighbor

Establish a neighbor with an OSPF Hello packet. In order to do so, the following information contained in the Hello packet must match.

  • Area ID(OSPF header)
  • AuType/Authentication(OSPF header)
  • Network Mask
  • Hello Interval
  • Dead Interval
  • Options(E/N bit)

In OSPF, the first step is to establish a neighbor. If you cannot successfully establish a neighbor, check the above information in the Hello packet.

 Figure conditions to be neighbor
Figure conditions to be neighbor

Default value for Hello Interval/Dead Interval

The default value of Hello Interval/Dead Interval is determined by the network type of the OSPF enabled interface, as follows

Network Type Hello Interval Dead Interval
BROADCAST 10 40
POINT_TO_POINT 10 40
NON_BROADCAST 30 120

The network type of NON_BROADCAST would be Frame Relay or ATM interface. It is safe to assume that the default Hello/Dead Interval is 10/40 seconds, since Frame Relay/ATM is rarely used.


Change and verify Hello/Dead Interval.

The default Hello/Dead Interval is 10/40 seconds. This means that it will take about 40 seconds to recognize that a neighbor is down. To change the Hello/Dead Interval, use the following command in the interface configuration of an OSPF-enabled interface.

Change Hello/Dead Interval

(config)#interface <interface-name>
(config-if)#ip ospf hello-interval <hello>
(config-if)#ip ospf dead-interval <dead>

<interface-name> : Interface name
<hello> : Hello Interval value
<dead> : Dead Interval value

The recommended value for Dead Interval is 4 times the value of Hello Interval; when the value of Hello Interval is changed, Dead Interval will automatically be set to 4 times the value of Hello Interval. However, changing the Dead Interval setting will not automatically change the Hello Interval value.

Dead Interval can also be set to 1 second to allow for faster detection of neighbor down. configure the following in OSPF-enabled interface configuration mode.

Set Dead Interval to 1 second.

(config)#interface <interface-name>
(config-if)#ip ospf dead-interval minimal hello-multiplier <number>

<interface-name> : interface name
<number> : 3-20.

The value of Hello/Dead Interval is a condition for establishing a neighbor. When changing the settings, be careful to match the routers that should be neighbors.

To verify the value of Hello/Dead Interval, use the show ip ospf interface command. a sample of the show ip ospf interface command is shown below.

R1#show ip ospf interface
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.12.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 2.2.2.2, Interface address 192.168.12.2
  Backup Designated router (ID) 1.1.1.1, Interface address 192.168.12.1
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:09
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 2.2.2.2  (Designated Router)
  Suppress hello for 0 neighbor(s)

How the OSPF works