The different types of packets sent by OSPF routers are contained in the common 24-byte OSPF header. While delving into the specifics of the OSPF header is beyond the scope of the ROUTE exam, it is still important to have a basic understanding of the fields contained within this header and what they are used for. Figure 3-7 illustrates the common 24-octet OSPF header:
Fig. 3-7. The OSPF Packet Header
The 8-bit Version field specifies the OSPF version. The default value for this field is 2. However, when OSPFv3 is enabled, this field is also set to 3. OSPFv3 will be described in detail later in this guide. The 8-bit Type field is used to specify the OSPF packet type. There are 5 main OSPF packet types, which are described in detail later in this chapter. These five packet types are:
- Type 1 = Hello packet
- Type 2 = Database Description packet
- Type 3 = Link State Request packet
- Type 4 = Link State Update packet
- Type 5 = Link State Acknowledgement packet
The 16-bit Packet Length field is used to specify the length of the protocol packet. This length includes the standard OSPF header. The 32-bit Router ID field is used to specify the IP address of the router from which the packet originated. On Cisco IOS devices, this field will contain the highest IP address of all physical interfaces configured on the device running OSPF. If Loopback interfaces are configured on the device, the field will contain the highest IP address of all configured Loopback interfaces. Alternatively, this field can also contain a manually configured router ID if one has been explicitly configured or specified by the administrator.
NOTE: When the router ID has been selected, it will never change unless the router is reloaded, the interface that the IP address was derived from is shut down or removed, or the OSPF process is reset using the clear ip ospf process privileged EXEC command on the router.
The 32-bit Area ID is used to identify the OSPF area of the packet. A packet can only belong to a single OSPF area. If the packet is received via a Virtual Link the Area ID will be the OSPF backbone, or area 0. Virtual Links are described in detail later in this chapter. The Checksum field is 16-bits long and indicates the standard IP checksum of the entire contents of the packet, starting with the OSPF packet header but excluding the 64-bit authentication field. If the packet’s length is not an integral number of 16-bit words, the packet is padded with a byte of zero before being checksummed.
The 16-bit Authentication (Auth) Type field identifies the type of authentication used. This field is only valid for OSPFv2 and may contain one of three codes:
- Code 0 – This means that there is null (no) authentication. This is the default
- Code 1 – This means that the authentication type is plain text
- Code 2 – This means that the authentication type is Message Digest 5 (MD5)
NOTE: OSPF authentication is a core ROUTE requirement. It is described later in this chapter.
And finally, the 64-bit Authentication field is for the actual authentication information or data, if authentication has been enabled. It is important to remember that this field is only valid for OSPFv2. If plain text authentication is being used, this field contains the authentication key. However, if MD5 authentication is being used, this field is redefined into several other fields, which are beyond the scope of the ROUTE exam. Figure 3-8 shows the different fields as they appear in a wire capture of an OSPF packet:
Fig. 3-8. OSPF Packet Header Capture
Within the OSPF packet header, the 8-bit Type field is used to specify the OSPF packet type. As previously stated, there are five OSPF packet types. These five packet types are:
- Type 1 = Hello packet
- Type 2 = Database Description packet
- Type 3 = Link State Request packet
- Type 4 = Link State Update packet
- Type 5 = Link State Acknowledgement packe
OSPF Hello Packets
Hello packets are used to discover other directly connected OSPF routers and to establish OSPF adjacencies between OSPF routers. OSPF uses Multicast to send Hello packets for Broadcast and point-to-point network types. These packets are addressed to the AllSPFRouters Multicast group address 224.0.0.5. For non-Broadcast links, e.g. Frame Relay OSPF uses Unicast to send Hello packets directly to statically configured neighbors.
NOTE: By default, all OSPF packets, i.e. Multicast and Broadcast, are sent with an IP TTL of 1. This limits these packets to the local link. In other words, you cannot establish an OSPF adjacency with another router that is more than one hop away. This is also applicable to EIGRP.
OSPF Hello packets are also used on Broadcast links to elect a Designated Router (DR) and also a Backup Designated (BDR) router. The DR listens specifically to the Multicast address 224.0.0.6 (AllDRRouters). The DR and BDR were described in detail previously in this chapter. Figure 3-9 illustrates the fields contained within the OSPF Hello packet:
Fig. 3-9. OSPF Hello Packet
The 4-byte Network Mask field contains the subnet mask of the advertising OSPF interface. The network mask is checked only on Broadcast media. Unnumbered point-to-point interfaces and Virtual Links set this value to 0.0.0.0. Both will be described later in this chapter.
The 2-byte Hello field displays the value of the Hello interval, which is the number of seconds between two Hello packets, requested by the advertising router. Possible values range from 1 to 255. By default, the Hello interval is 10 seconds on Broadcast and point-to-point media and 30 seconds on all other media.
The 1-byte Options field is used by the local router to advertise optional capabilities. Each bit in the Options field represents a different function. The various bit definitions are:
- The DN bit is used for loop prevention in a Virtual Private Network environment. An OSPF router receiving an update with the bit set does not forward that update
- The O bit indicates that the local router supports Opaque LSAs, mentioned in RFC 2370. Opaque LSAs are described later in this chapter
- The DC bit indicates that the local router supports Demand Circuits, mentioned in RFC 1793. Demand Circuits are described later in this chapter
-
The L bit, which is set only in OSPF Hello and Database Description packets, indicates that the local router supports Link Local Signaling or LLS. When this bit is set, OSPF routers add a special data block at the end of OSPF packets or right after the authentication data block when cryptographic authentication is used. LLS is beyond the scope of the ROUTE exam and will not be described in any further detail in this guide
- The NP bit describes the handling and support of Not-So-Stubby Area (NSSA) LSAs, mentioned in RFC 1587. NSSAs are described later in this chapter
- The MC bit indicates that the local router supports Multicast OSPF LSAs. This is not supported in Cisco IOS software as Cisco does not support Multicast OSPF
- The E bit describes the handling and support of external LSAs
The 1-byte Router Priority field contains the priority of the local router. By default, this field has a value of 1. The value is used in the election of the Designated Router and Backup Designated Router. Possible values range from 0 to 255. The higher the priority, the higher the chances the local router will become the Designated Router. A priority value of 0 means the local router will not participate in the Designated Router or Backup Designated Router election.
The 4-byte Router Dead Interval field shows the value of the dead interval. The dead interval is the time, in seconds, before a neighbor router is declared dead. This value is requested by the advertising router. The default value for the dead interval is four times the value of the Hello interval, which would be a default of 40 seconds on Broadcast and point-to-point interfaces and 120 seconds on all other types of media.
The 4-byte Designated Router field lists the IP address of the Designated Router (DR). A value of 0.0.0.0 is used when no designated router has been elected for example, on a point-to-point link or when a router has been explicitly configured not to participate in this election.
The 4-byte Backup Designated Router field identifies the Backup Designated Router (BDR) and lists the interface address of the current BDR. A value of 0.0.0.0 is used when no Backup Designated Router has been elected.
And finally, the (Active) Neighbor field is a variable length field that displays the router ID of all OSPF routers for which a Hello packet has been received on the network segment.
Database Description Packets
Database Description packets are used during the database exchange when each OSPF router advertises its local database information. These packets are commonly referred to as DBD packets or also as DD packets. The first DBD packet is used for the master and slave election for database exchange. The DBD packet also contains the initial sequence number selected by the master. The router with the highest router ID becomes the master and initiates database synchronization. This is the only router that can increment the sequence number. The master router begins the database exchange and polls the slave for information. The master and slave election is held on a per-neighbor basis.
It is important to understand that the master and slave election is not the same as the DR and BDR election process. This is commonly incorrectly assumed. The master and slave election is based solely on the router with the highest IP address; however, the DR/BDR election process may be determined using the IP address or the priority.
Assume, for example, two routers named R1 and R2 are beginning the adjacency establishment process. R1 has a RID of 1.1.1.1 while R2 has a RID of 2.2.2.2. The network administrator has configured R1 with an OSPF priority value of 255 to ensure that this router will be elected the DR. During the master and slave determination process, R2 will be elected master by virtue of the higher RID. However, the priority configured on R1 results in R1 being elected the DR. In essence, the DR (R1) can be the slave during the master and slave election process.
After the master and slave have been elected, DBD packets are used to summarize the local database by sending LSA headers to the remote router. The remote router analyzes these headers to determine whether it lacks any information within its own copy of the LSDB. The OSPF Database Description packet is illustrated in Figure 3-10:

Fig. 3-10. OSPF Database Description Packet
Within the DBD packet, the 2-byte Interface MTU field contains the MTU value, in octets, of the outgoing interface. In other words, this field contains the largest data size that can be sent through the associated interface (in bytes). When the interface is used on a virtual link, the field is set to a value of 0x0000. In order for an OSPF neighbor adjacency to be successfully established, the MTU must be the same on all routers. If you change this value on one router, you must configure the same value on all other routers on the same subnet.
NOTE: The interface MTU values for EIGRP do not have to be the same in order for an EIGRP neighbor relationship to be successfully established.
The 1-byte Options field contains the same options contained within the OSPF Hello packet. For brevity, these options will not be described again.
The Database Description or Flags field is a 1-byte field that provides an OSPF router with the capability to exchange multiple DBD packets with a neighbor during an adjacency formation. The various bit definitions contained within this field are as follows:
- The R bit indicates Out-Of-Band (OOB) L SDB resynchronization. All DBD packets sent during the OOB resynchronization procedure are sent with the R-bit set. Going into detail on this field is beyond the scope of the ROUTE exam
- The Initial (I) bit designates whether this DBD packet is the first in a series of packets. The first DBD packet has a value of 1, while subsequent packets have a value of 0
- The More (M) bit informs the neighboring router whether the DBD packet is the last in a series. The last packet has a value of 0, while previous packets have a value of 1. In other words, if this field has a value of 1, it means more packets will follow
- The Mater/Slave (MS) bit is used to identify which OSPF router is in control of the actual database synchronization process. The master router uses a value of 1 in this field, while the slave uses a value of 0 in this field
The 4-byte DBD Sequence Number field is used to guarantee that all DBD packets are received and processed during the synchronization process through use of a sequence number. The Master router initializes this field to a unique value in the first DD packet, with each subsequent packet being incremented by 1. The sequence number is incremented only by the master.
And finally, the variable length LSA Header field carries the LSA headers describing the local router’s database information. Each header is 20 octets in length and uniquely identifies each LSA in the database. Each DD packet may contain multiple LSA headers.
Link State Request Packets
Link State Request packets are sent by OSPF routers to request missing or out-of-date database information. These packets contain identifiers that uniquely describe the requested Link State Advertisement. An individual Link State Request packet may contain a single set of identifiers or multiple sets of identifiers to request multiple Link State Advertisements. LSR packets are also used after database exchange to request LSAs that were seen during the database exchange that the local router does not have. Figure 3-11 shows the format of the OSPF LSR packet:
Fig. 3-11. OSPF Link State Request Packet
The 4-byte Link State Advertisement Type field contains the type of Link State Advertisement being requested. It may contain one of the following fields:
- Type 1 = Router Link State Advertisement
- Type 2 = Network Link State Advertisement
- Type 3 = Network Summary Link State Advertisement
- Type 4 = ASBR Summary Link State Advertisement
- Type 5 = AS External Link State Advertisement
- Type 6 = Multicast Link State Advertisement
- Type 7 = NSSA External Link State Advertisement
- Type 8 = External Attributes Link State Advertisement
- Type 9 = Opaque Link State Advertisement – Link Local
- Type 10 = Opaque Link State Advertisement – Area
- Type 11 = Opaque Link State Advertisement – Autonomous System
NOTE: The LSAs listed above are described in detail in the following section
The 4-byte Link State ID field encodes information specific to the LSA. The information that is contained in this field depends on the type of Link State Advertisement. And last but not least, the 4-byte Advertising Router field contains the RID of the router that first originated the LSA.
Link State Update Packets
Link State Update (LSU) packets are used by the router to advertise LSAs. LSU packets may be Unicast to an OSPF neighbor in response to a received Link State Request from that neighbor. Most commonly, however, they are reliably flooded throughout the network to the AllSPFRouters Multicast group address 224.0.0.5 until each router has a copy. The flooded updates are then acknowledged in the LSA Acknowledgement packet. If the LSA is not acknowledged, it will be retransmitted every 5 seconds, by default. Figure 3-12 shows an LSU sent to a neighbor in response to an LSR:
Fig. 3-12. Unicast LSU Packet
Figure 3-13 shows an LSU that is reliably flooded to the Multicast group address 224.0.0.5:
Fig. 3-13. Multicast LSU Packet
The LSU is comprised of two main parts. The first is the 4-byte Number of LSAs field. This field displays the number of LSAs carried within the LSU packet. The second part is one or more Link State Advertisements. This variable length field contains the complete LSA. Each type of LSA has a common header format along with specific data fields to describe its information. An LSU packet may contain a single LSA or multiple LSAs.
Link State Acknowledgement Packets
The Link State Acknowledgement (LSAck) packet is used to acknowledge each LSA and is sent in response to LSU packets. By explicitly acknowledging packets with LSAcks, the flooding mechanism used by OSPF is considered reliable.
The LSAck simply contains the common OSPF header followed by a list of LSA headers. This variable-length field allows the local router to acknowledge multiple LSAs using a single packet. LSAcks are sent using Multicast. On multi-access networks, if the router sending the LSAck is a DR or BDR router, Link State Acknowledgements are sent to the Multicast group address 224.0.0.5 (AllSPFRouters). However, if the router sending the Link State Acknowledgements is not a DR or BDR device, then LSAck packets are sent to the Multicast group address 224.0.0.6 (AllDRRouters). Figure 3-14 illustrates the format of the LSAck:
Fig. 3-14. Link State Acknowledgement Packet
In conclusion, it is important to remember the different OSPF packet type and what information they contain. This will not only benefit you in the exam, but will go a long way in aiding to understand the overall operation of OSPF as a protocol. In Cisco IOS software, you can use the show ip ospf traffic command to view OSPF packet statistics.
This command shows the total count for the sent and received OSPF packets and then segments this further to the individual OSPF process and then the interfaces enabled for OSPF routing under that process. This command can also be used to troubleshoot OSPF adjacency establishment and is not as processor intensive as debugging. The information printed by this command is illustrated in the following output:
| R4#show ip ospf trafficOSPF statistics: Rcvd: 702 total, 0 checksum errors 682 hello, 3 database desc, 0 link state req 12 link state updates, 5 link state acksSent: 1378 total 1364 hello, 2 database desc, 1 link state req 5 link state updates, 6 link state acks
OSPF Router with ID (4.4.4.4) (Process ID 4) OSPF queue statistics for process ID 4: InputQ UpdateQ OutputQ
Interface statistics:
Interface Serial0/0 OSPF packets received/sent OSPF header errors OSPF LSA errors
Interface FastEthernet0/0 OSPF packets received/sent OSPF header errors OSPF LSA errors
Summary traffic statistics for process ID 4: Rcvd: 703 total, 0 errors |






