IPv4
Datagram
Format
A visual representation of the IPv4 packet structure with accurate 32-bit word organization
0 bits
16 bits
32 bits
Version
(4 bits)
Indicates the IP version (4 for IPv4)
IHL
(4 bits)
Internet Header Length - Size of the IP header in 32-bit words
TOS
(8 bits)
Type of Service - Specifies quality of service parameters
Total Length
(16 bits)
Total length of the datagram in bytes (header + data)
Identification
(16 bits)
Unique value for identifying fragments of the same datagram
Flags
(3 bits)
Control flags for fragmentation (DF, MF)
Fragment Offset
(13 bits)
Position of fragment data relative to the start of data in the original datagram
TTL
(8 bits)
Time to Live - Maximum number of hops the datagram can take
Protocol
(8 bits)
Indicates the protocol used in the data portion (e.g., TCP=6, UDP=17)
Header Checksum
(16 bits)
Used for error checking of the header
Source IP Address
(32 bits)
32-bit IP address of the sending host (e.g., 192.168.1.1)
Destination IP Address
(32 bits)
32-bit IP address of the receiving host (e.g., 10.0.0.2)
Options (if any)
(0-40 bytes)
Optional fields for special processing (rarely used)
Data
(Variable length)
Payload data from higher layer protocols (TCP, UDP, etc.)
Field Legend
Key identification fields
Service and quality fields
Routing and control fields
Data payload section