Chapter 3 Advanced Routing : Open Shortest Path First (OSPF) : OSPF Background and concepts : How OSPF works : OSPF packets
  
OSPF packets
Every OSPF packet starts with a standard 24-byte header, and another 24 bytes of information or more. The header contains all the information necessary to determine whether the packet should be accepted for further processing.
Table 11: OSPF packet
1-byte Version field
1-byte Type field
2-byte Packet length
3-byte Router ID
 
4-byte Area ID
 
2-byte Checksum
2-byte Auth Type
8-byte Authentication
 
4-byte Network Mask
2-byte Hello interval
1-byte Options field
1-byte Router Priority
 
4-byte Dead Router interval
4-byte DR field
4-byte BDR field
4-byte Neighbor ID
The following descriptions summarize the OSPF packet header fields.
Version field— The OSPF version number. This specification documents version 2 of the protocol.
Type field—There are 5 OSPF packet types. From one to five, respectively, they are Hello, Database Description, Link State Request, Link State Update, and Link State Acknowledgment.
Packet length—The length of the OSPF protocol packet in bytes. This length includes the standard OSPF 24-byte header, so all OSPF packets are at 24-bytes long.
Router ID—The Router ID of the packet's source.
Area ID—A 32-bit number identifying the area that this packet belongs to. All OSPF packets are associated with a single area. Most travel a single hop only. Packets travelling over a virtual link are labelled with the backbone Area ID of 0.0.0.0.
Checksum—The standard IP checksum of the entire contents of the packet, starting with the OSPF packet header but excluding the 64-bit authentication field. This checksum is calculated as the 16-bit one's complement of the one's complement sum of all the 16-bit words in the packet, excepting the 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 checksumming. The checksum is considered to be part of the packet authentication procedure; for some authentication types the checksum calculation is omitted.
Auth Type—Identifies the authentication procedure to be used for the packet. Authentication types include Null authentication (0), Simple password (1), Cryptographic authentication (2), and all others are reserved for future use.
Authentication—A 64-bit field for use by the authentication scheme. When AuType indicates no authentication is being used, the Authentication fields is not checked and can be any value. When AuType is set to 2 (Cryptographic authentication), the 64-bit authentication field is split into the following four fields: Zero field, Key ID field, Authentication data length field, and Cryptographic sequence field.
The Key ID field indicates the key and algorithm used to create the message digest appended to the packet. The authentication data length field indicates how many bytes long the message digest is, and the cryptographic sequence number is at non-decreasing number that is set when the packet is received and authenticated to prevent replay attacks.
Network Mask—The subnet where this packet is valid.
Hello interval—The period of time between sending out Hello packets. See “Hello and dead intervals”.
Options field— The OSPF protocol defines several optional capabilities. A router indicates the optional capabilities that it supports in its OSPF Hello packets, Database Description packets and in its LSAs. This enables routers supporting a mix of optional capabilities to coexist in a single Autonomous System.
Router priority—The priority between 0 and 255 that determines which routers become the DR and BDR. See “Designated router (DR) and backup router (BDR)”.
Dead router interval—The period of time when there is no response from a router before it is declared dead. See “Hello and dead intervals”.
DR and BDR fields—The DR and BDR fields each list the router that fills that role on this network, generally the routers with the highest priorities. See “Designated router (DR) and backup router (BDR)”.
Neighbor ID—The ID number of a neighboring router. This ID is used to discover new routers and respond to them.