Sub topic 4
Hello Packets and Neighbor Discovery
This chapter assumes you know IPv4 addressing and subnet masks, basic router interface configuration, and the idea of link-state routing from earlier chapters. It also assumes you know what a router ID is. Here you will see how OSPF routers find each other and which settings must match before they become neighbors.
What a Hello Packet Does
An OSPF router sends Hello packets out every interface where OSPF is enabled. Hellos do three jobs:
- They discover other OSPF routers on the link.
- They check that both sides agree on key parameters.
- They act as a keepalive. If Hellos stop arriving, the neighbor is declared down.
On broadcast and point-to-point links, Hellos go to the multicast address 224.0.0.5 (AllSPFRouters). This is an IP protocol 89 packet with a TTL of 1, so it never leaves the local link.
What a Hello Contains
| Field | Purpose |
|---|---|
| Router ID | Identifies the sender |
| Area ID | The area the interface belongs to |
| Network mask | The subnet mask of the sending interface |
| Hello interval | Seconds between Hellos |
| Dead interval | Seconds of silence before the neighbor is declared down |
| Router priority | Used in DR/BDR election |
| DR and BDR | Current DR and BDR on the segment, if any |
| Neighbor list | Router IDs the sender has heard Hellos from |
| Options | Flags such as stub-area support |
The neighbor list is how a router learns that the other side hears it too. When a router sees its own router ID in a received Hello, the relationship becomes two-way.
Parameters That Must Match
Two routers on the same link become neighbors only if these values agree:
- Area ID.
- Hello and dead intervals.
- Subnet and mask (except on point-to-point links in some implementations).
- Authentication type and key.
- Stub-area flag.
The router ID must also be unique. Priority, cost, and the DR/BDR fields do not need to match.
The default timers depend on the network type. Broadcast and point-to-point links use a Hello of 10 seconds and a dead interval of 40 seconds. Non-broadcast links use 30 and 120. The dead interval is normally four times the Hello interval.
Tuning the Timers
You can change the intervals per interface. Both ends must use the same values.
interface GigabitEthernet0/0
ip ospf hello-interval 5
ip ospf dead-interval 20Shorter timers detect failures faster, but they add CPU load and make the link more likely to flap during brief congestion.
Checking Discovery
Use these commands to see whether Hellos are working:
show ip ospf interface GigabitEthernet0/0
show ip ospf neighbor
debug ip ospf helloThe interface output shows the timers, area, and network type. If a neighbor is missing, compare those values on both routers. The debug output names the mismatch, such as "Mismatched hello parameters". Use debug sparingly on production routers.
Exercise
Router A has a Hello interval of 10 and a dead interval of 40. Router B, on the same Ethernet link, has a Hello interval of 5 and a dead interval of 20. Will they become neighbors, and why?
Show answer
No. Hello and dead intervals must match on both ends of the link. Each router discards the other's Hellos because of the mismatch, so neither lists the other as a neighbor. Setting both to the same values fixes it.
Exercise
Which field in a received Hello tells a router that the sender can also hear it?
Show answer
The neighbor list. When the router finds its own router ID in the sender's neighbor list, it knows communication is bidirectional and moves the neighbor to the 2-Way state.