What are the different fields in IPV4 header format?
2 min readJan 1, 2023
The IPv4 header is a standardized data structure that is used to transmit data across the Internet. It is composed of several fields that contain information about the packet and its destination. The fields in the IPv4 header are:
- Version (4 bits): Indicates the version of the IPv4 protocol being used.
- Header Length (4 bits): Indicates the length of the header in 32-bit words.
- Type of Service (8 bits): Indicates the priority of the packet and any special handling that should be applied to it.
- Total Length (16 bits): Indicates the total length of the packet in bytes, including the header and data.
- Identification (16 bits): A unique number that is used to identify the packet.
- Flags (3 bits): Used to control fragmentation and reassembly of the packet.
- Fragment Offset (13 bits): Indicates the position of this fragment in the original packet.
- Time to Live (8 bits): Indicates the maximum number of hops that the packet can make before it is discarded.
- Protocol (8 bits): Indicates the type of transport layer protocol being used (e.g. TCP, UDP).
- Header Checksum (16 bits): A checksum that is used to verify the integrity of the header.
- Source IP Address (32 bits): The IP address of the sender of the packet.
- Destination IP Address (32 bits): The IP address of the intended recipient of the packet.
- Options (variable length): Optional fields that can be used to specify additional information about the packet.
- Padding (variable length): Used to ensure that the header is a multiple of 32 bits in length.
The IPv4 header is usually 20 bytes in length, but the options and padding fields can make it longer. The header is followed by the data payload of the packet.