OSPF Packets


Types of OSPF Packets

Link-state packets are the tools used by OSPF to help determine the fastest available route for a packet. OSPF uses the following link-state packets (LSPs) to establish and maintain neighbor adjacencies and exchange routing updates. Each packet serves a specific purpose in the OSPF routing process, as follows:

  • Type 1: Hello packet – This is used to establish and maintain adjacency with other OSPF routers.
  • Type 2: Database Description (DBD) packet – This contains an abbreviated list of the LSDB of the sending router and is used by receiving routers to check against the local LSDB. The LSDB must be identical on all link-state routers within an area to construct an accurate SPF tree.
  • Type 3: Link-State Request (LSR) packet – Receiving routers can then request more information about any entry in the DBD by sending an LSR.
  • Type 4: Link-State Update (LSU) packet – This is used to reply to LSRs and to announce new information. LSUs contain several different types of LSAs.
  • Type 5: Link-State Acknowledgment (LSAck) packet – When an LSU is received, the router sends an LSAck to confirm receipt of the LSU. The LSAck data field is empty.

The table summarizes the five different types of LSPs used by OSPFv2. OSPFv3 has similar packet types.

Table caption
Type Packet Name Description
1 Hello Discovers neighbors and builds adjacencies between them
2 Database Description (DBD) Checks for database synchronization between routers
3 Link-State Request (LSR) Requests specific link-state records from router to router
4 Link-State Update (LSU) Sends specifically requested link-state records
5 Link-State Acknowledgment (LSAck) Acknowledges the other packet types

Link-State Updates

Routers initially exchange Type 2 DBD packets, which is an abbreviated list of the LSDB of the sending router. It is used by receiving routers to check against the local LSDB.

A Type 3 LSR packet is used by the receiving routers to request more information about an entry in the DBD.

The Type 4 LSU packet is used to reply to an LSR packet.

A Type 5 packet is used to acknowledge the receipt of a Type 4 LSU.

LSUs are also used to forward OSPF routing updates, such as link changes. Specifically, an LSU packet can contain 11 different types of OSPFv2 LSAs, with some of the more common ones shown in the figure. OSPFv3 renamed several of these LSAs and also contains two additional LSAs.

Note: The difference between the LSU and LSA terms can sometimes be confusing because these terms are often used interchangeably. However, an LSU contains one or more LSAs.

shows that an OSPFv2 LSU can contain one or more different types of LSAs

LSUs Contain LSAs

  • An LSU contains one or more LSAs.
  • LSAs contain route information for destination networks.

Hello Packet

The OSPF Type 1 packet is the Hello packet. Hello packets are used to do the following:

  • Discover OSPF neighbors and establish neighbor adjacencies.
  • Advertise parameters on which two routers must agree to become neighbors.
  • Elect the Designated Router (DR) and Backup Designated Router (BDR) on multiaccess networks like Ethernet. Point-to-point links do not require DR or BDR.

The figure displays the fields contained in the OSPFv2 Type 1 Hello packet.

shows a diagram of the contents/fields of an OSPFv2 Hello packet




OSPF Operation