Hello, DBD, LSR, LSU and LSAck: what each packet does, the OSPF header, multicast addresses and how packets map to neighbour states.
Intermediate · 10 min read
Technical definition
OSPF packet types are the five message formats OSPF uses between routers: Hello (1), Database Description (2), Link State Request (3), Link State Update (4) and Link State Acknowledgement (5). All five are carried directly in IP, protocol number 89.
Five packets, one header
The five OSPF packet types in a neighbour exchange
All five types ride directly on IP protocol 89 (not TCP or UDP) to 224.0.0.5 and 224.0.0.6. Hellos continue every 10 seconds on broadcast links to keep the neighbour alive.
Every OSPF packet begins with the same 24-byte header carrying the version (2 for OSPFv2), the packet type, the length, the router ID, the area ID, a checksum and authentication data. The type field says what follows.
The five OSPF packet types
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Unicast is used between two routers once they know each other. 224.0.0.6 is AllDRouters: routers on a broadcast network send updates there so only the DR and BDR collect them.
What a Hello carries
The Hello decides whether two routers become neighbours. It contains the router ID, area ID, network mask, Hello and Dead intervals, router priority, the current DR and BDR, authentication data and the list of neighbours the sender has already seen. Mismatched area, mask on a broadcast link, timers or authentication stops the adjacency; see Hello and Dead timers for how that looks in practice.
Packets and neighbour states
Which packet moves a neighbour to the next state
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Routers that stay at 2-Way are normal on a broadcast network: DROTHERs form Full adjacencies only with the DR and BDR.
Reading it from the router
Example commands and output on this page were written from Cisco IOS documentation and generally described behaviour. They were not captured from a live device, so prompts and details can differ on your platform and version.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip ospf traffic
OSPF statistics:
Rcvd: 28 total, 0 checksum errors
15 hello, 4 database desc, 1 link state req
5 link state updates, 3 link state acks
Sent: 30 total
16 hello, 4 database desc, 1 link state req
6 link state updates, 3 link state acks
Example output. A growing hello count with no database descriptions suggests neighbours are not progressing past Init or 2-Way; compare with show ip ospf neighbor.
Test yourself
Predict · scenario 1
Which OSPF packet type is used to discover neighbours?
Predict · scenario 2
OSPF is carried in IP as protocol number:
Predict · scenario 3
A router has asked for a missing LSA. Which packet does the neighbour send back?
FAQ
Does OSPF use TCP or UDP?
Neither. OSPF runs directly over IP as protocol 89, with its own acknowledgements and retransmissions. That is why you filter it with an ACL entry for protocol ospf rather than a port.
What is the difference between an LSA and an LSU?
An LSA describes one piece of topology. An LSU is the packet that carries one or more LSAs. Routers acknowledge them with LSAck packets.
Why does the DBD packet have master and slave?
During database exchange one router must lead the sequence numbering. The router with the higher router ID becomes the master and polls; the other, the slave, answers.