OSPF The Hello Packet

 

Type 1: The Hello Packet

The hello packet is described in section A.3.2 of RFC 2328 and immediately follows the standard OSPF 24bit header. The format is shown below:

OSPF hello

Each field is described below:

Network Mask: This is the interface network mask.

HelloInterval: This is the number of seconds between hello packets. By default this is 10 seconds on a broadcast, or point-to-point network, and 30 seconds on non-broadcast or point-to-multipoint neteok. The dead-time interval is, by default, four times the hello interval.

Options: The options field describes whether the router supports optional capabilities, and is used in both hello packets, and database description packets. When used in hello packets, it allows a router to reject a neighbour based on a capability mismatch. The options are described briefly below:

E-bit   - Described how AS-External-LSAs are flooded
MC-bit  - Describes multi-cast OSP extentions
N/P-bit - Describes the handling of type-7 LSAs
EA-bit  - Describes the router's willingness to receive and forward External-Attributes-LSAs
DC-bit  - Describes the support for OSPF demand circuits

Rtr Pri: This is the OSPF priority. If set to 0 the router cannot become a DR or BDR.

RouterDeadInterval: This is the number of seconds a router will wait to receive a neighbours hello packet before declaring it down

Designated Router: This is  identify of the DR identified by it’s IP address. If there is no DR this value is set to 0.0.0.0

Backup Designated Router: This is  identify of the BDR identified by it’s IP address. If there is no BDR this value is set to 0.0.0.0

The below packet capture from Wireshark shows each field:

hello packet

The purpose of the hello packet it to ensure two-way communication between two OSPF neighbours, and to serve as a failure detection system. The TTL (time to live) is set to 1, which means the packet is not routable. The hello packet is responsible for the following four primary functions:

1) Establishing neighbour relationships

To discover OSPF neighbours in a broadcast network the router listens for hello packets sent to the multicast destination 224.0.0.5 (the All OSPF Routers multicast address). Note – it’s possible to see the multicast groups the router has joined with the show ip interface command:

R1#show ip interface fastEthernet 0/0 | i Multi
Multicast reserved groups joined: 224.0.0.5

Hello packets are sourced from the primary interface address, and not the secondary address(es), this is also true for EIGRP and RIPv2. It is also acceptable to use unnumbered interfaces.

2) Agreeing and verifying neighbour parameters

In order for a neighbour relationship to form, the following must be true:

  • Authentication must be successfully passed
  • The OSPF interfaces must be in the same subnet (except for non-broadcast interfaces)
  • The OSPF interfaces must be in the same area
  • The OSPF interfaces must be of the same OSPF type (i.e. regular, stub, nssa)
  • The Router IDs must be different
  • OSPF hello and dead intervals must be the same

3) Ensuring neighbour communication is bidirectional

When two OSPF speaking routers send initial hellos, each hello contains  a list of router IDs the router is aware of. If a router receives a hello packet containing its own Router ID then it knows there is bidirectional communication with its neighbour.  Consider the following OSPF broadcast domain:

OSPF Broadcast Network

As can be seen from the broadcast domain below 10.1.1.1 sends a multicast to 224.0.0.5. All the other routers reply directly with unicast hellos, listing their know neighbours. 10.1.1.3 lists 10.1.1.1 as a neighbour and therefore bidirectional communication is established.

OSPF Hello two-way

4) Maintaining neighbour relationships

Neighbours ensure neighbour reachability by sending hello packets at regular intervals. On broadcast or point-to-point networks this is 10 seconds, and on nonbroadcast and point-to-multipoint networks this is 30 seconds. The dead interval default to fours times the hello interval.