Sub topic 12
Hello packets and adjacencies
This chapter assumes you know basic IP addressing, what a routing table is, and the difference between a router and a switch. Before a link-state router can flood anything, it must learn who its neighbors are. Hello packets do that job.
Why discovery comes first
A link-state router describes its own links in an advertisement. It can only do so after it knows which routers sit on the other end of each interface. Routers also need to know when a neighbor disappears, so they can stop using it. Both tasks use small periodic messages called hello packets.
What a hello packet carries
A hello packet is a small message a router sends out each interface at a fixed interval. OSPF sends it to the multicast address 224.0.0.5. It carries the sender's identity and the settings the two sides must agree on.
| Field | Purpose |
|---|---|
| Router ID | Identifies the sender |
| Hello interval | How often hellos are sent |
| Dead interval | How long to wait in silence before declaring the neighbor down |
| Area ID | The area the interface belongs to |
| Neighbor list | Router IDs the sender has already heard on this link |
The neighbor list is what makes discovery two-way. A router only moves forward when it sees its own router ID in the other side's hello.
Neighbor states
A neighbor passes through several states. The simplified OSPF sequence looks like this:
In Init, you have heard the neighbor, but it has not yet heard you. In Two-Way, each side has seen itself listed by the other. That proves the link works in both directions.
Neighbor versus adjacency
These two words mean different things. A neighbor is any router you have exchanged hellos with. An adjacency is a closer relationship in which two routers synchronize their link-state databases and exchange advertisements. On a point-to-point link, every neighbor becomes adjacent. On a shared Ethernet segment, forming adjacencies between all pairs would be wasteful. OSPF elects a designated router there, and the other routers form adjacencies only with it. A later chapter covers that election.
Failure detection
Each hello resets a countdown timer. If the dead interval passes without a hello, the router declares the neighbor down. It then updates its own advertisement and floods the change. The default OSPF dead interval is usually four times the hello interval. Shorter timers detect failure faster, but they risk false alarms when a busy link drops a few hello packets.
Common errors
Neighbors that never reach Two-Way or Full usually have a mismatch. Check these in order:
- Hello and dead intervals differ between the two routers.
- The interfaces are in different areas.
- The subnet masks differ, or the addresses are on different subnets.
- Authentication settings do not match.
- An access list or firewall blocks the multicast hello packets.
- Two routers use the same router ID.
Exercises
Exercise
Router A sees router B's hellos, but B's neighbor list does not yet contain A. In which state is A's view of B, and what must happen for the state to advance?
Show answer
A sees B in the Init state. It advances to Two-Way when B receives A's hello and includes A's router ID in its own hello, which A then sees.
Exercise
Two routers on the same link have hello intervals of 10 seconds and 30 seconds. What happens, and why?
Show answer
They do not form a neighbor relationship. OSPF requires the hello and dead intervals to match, so each router ignores the other's hello packets.