Course contents

Module 2: OSPF OperationLesson 2.4 (4 of 5 in this module)8 of 30 in the OSPF course

OSPF packet types

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
The five OSPF packet types in a neighbour exchangeTwo OSPF routers exchange Hello packets to become neighbours, then Database Description packets to summarise their link-state databases, Link State Requests for missing LSAs, Link State Updates carrying the LSAs, and Link State Acknowledgements.R1R2Hello (type 1): find neighbours, check parametersHello (type 1): reply: I see you (2-Way)DBD (type 2): database summary, master/slaveDBD (type 2): my summaryLSR (type 3): send me these LSAsLSU (type 4): here are the full LSAsLSAck (type 5): received
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
The five OSPF packet typesType; Name; Purpose; Sent to. 1: Hello Discover neighbours, check parameters, keep adjacency alive, elect DR and BDR 224.0.0.5, every OSPF router 2: Database Description (DBD) Summarise the link-state database headers during exchange Unicast to the neighbour 3: Link State Request (LSR) Ask for specific LSAs that are missing or newer Unicast to the neighbour 4: Link State Update (LSU) Carry full LSAs: the reply to an LSR, or a flooded change 224.0.0.5 or 224.0.0.6 (DR/BDR), or unicast 5: Link State Acknowledgement (LSAck) Confirm receipt of LSAs so the sender stops retransmitting Unicast or multicastTypeNamePurposeSent to1HelloDiscover neighbours,check parameters, keepadjacency alive, elect DRand BDR224.0.0.5, every OSPFrouter2Database Description(DBD)Summarise the link-statedatabase headers duringexchangeUnicast to the neighbour3Link State Request (LSR)Ask for specific LSAsthat are missing or newerUnicast to the neighbour4Link State Update (LSU)Carry full LSAs: thereply to an LSR, or aflooded change224.0.0.5 or 224.0.0.6(DR/BDR), or unicast5Link StateAcknowledgement (LSAck)Confirm receipt of LSAsso the sender stopsretransmittingUnicast or multicast

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
Which packet moves a neighbour to the next stateState; Packet or event; Meaning. Down: None No Hello received Init: Hello received without my router ID I heard them, they have not heard me 2-Way: Hello listing my router ID Bidirectional: DR and BDR are elected here ExStart: DBD (empty) Decide master and slave and initial sequence number Exchange: DBD with database headers Compare database summaries Loading: LSR then LSU Request and receive the missing LSAs Full: LSAck Databases are identicalStatePacket or eventMeaningDownNoneNo Hello receivedInitHello received without my router IDI heard them, they have not heard me2-WayHello listing my router IDBidirectional: DR and BDR are electedhereExStartDBD (empty)Decide master and slave and initialsequence numberExchangeDBD with database headersCompare database summariesLoadingLSR then LSURequest and receive the missing LSAsFullLSAckDatabases are identical

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.