OSPF Packet Header Format
2 min readHave you ever wondered what is inside the OSPF packet header and how they communicate with other routers in the domain? The OSPF packet header varies depending upon the message type. Below is the common header format that the routers in the OSPF domain use to process packets.
Version Number | Type | Packet length |
Router ID | ||
Area ID | ||
Checksum | Authentication Type | |
Authentication | ||
Message Body |
VERSION
OSPF has two versions: Version 1 (RFC 1131) and Version 2. Iโm not sure if anyone has ever tried the version 1. It was published in the year 1989 and it was immediately replaced by version 2. I tried to check the RFC to know more about this but this is what I got:
I cannot differentiate the two versions because right now when we say OSPF (for IPv4), that means we are referring to version 2.
TYPE
There are 5 different OSPF packet types: Type 1 โ Hello packet, Type 2- Database Descriptor packet, Type 3 โ Link State Request packet, Type 4 โ Link State Update packet, and Type 5 โ Link State Acknowledgement packet. So if the field has a value of 3 that means it is a Link State Request packet type.
PACKET LENGTH
This is total OSPF packet length in bytes which also includes the OSPF packet header
ROUTER ID
This is the router ID of the source of the packet or the advertising router.
AREA ID
It is the area number to which the message belongs to and presented in dotted decimal.
CHECKSUM
This is the 16-bit standard IP checksum which includes calculation of the entire message except the authentication field.
AUTHENTICATION TYPE
There are 3 OSPF authentication type: 0 โ no password, 1 โ clear text, 3 โ MD5 password. So when you use an MD5 password on the interface, this field should have a value of 3.
AUTHENTICATION
This is a 64-bit field used for data integrity.