The IPv4 header serves as the starting point of every IPv4 packet and plays a vital role in routing the packet to its intended destination. This fixed-size data structure contains essential information used by networking hardware. The fields within the IPv4 header are listed below in sequential order:
IPv4 Header Format Overview:
Version (4 bits) – Indicates the version of the IP protocol being used. Always set to 4 for IPv4 packets.
Header Length (4 bits) – Indicates the length of the header in 32-bit words, ranging from 5 to 15 due to optional fields.
Type of Service (8 bits) – Describes handling needs and packet priority.
Total Length (16 bits) – Indicates the overall packet length in bytes, including header and data.
Identification (16 bits) – Used for fragmentation and reassembly, assigns a unique identification number to the packet.
Flags (3 bits) – Regulates fragmentation with “More Fragments” (MF) and “Don’t Fragment” (DF) flags.
Fragment Offset (13 bits) – Indicates the offset of data in the packet relative to the original unfragmented packet.
Time to Live (8 bits) – Specifies the maximum number of hops a packet can make before being discarded.
Protocol (8 bits) – Identifies the protocol used in the data section, e.g., TCP, UDP, or ICMP.
Header Checksum (16 bits) – Used to check the header’s integrity.
Source Address (32 bits) – Contains the IP address of the sender.
Destination Address (32 bits) – Contains the IP address of the recipient.
Options (variable) – Optional field for additional information, like security and routing data.
This summarizes the key elements of the IPv4 header format.
Alexey Shkittin
CEO
Articles
A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses (2026 Update)
A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses Subnetting is a critical
We use necessary cookies to run this website. With your consent, we use analytics and selected third-party services. You can accept, reject or manage your choices.
Necessary
Always active
Required for the website to work and to store your cookie preferences.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Analytics
Helps us understand website usage and improve our content.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Third-party services
Used for selected external services, embedded content and communication features.