IPv4 Packet Header
Version
Contains a 4-bit binary value set to 0100 that identifies this as an IPv4 packet.
Differentiated Services or DiffServ (DS)
Formerly called the type of service (ToS) field, the DS field is an 8-bit field used to determine the priority of each packet. The six most significant bits of the DiffServ field are the differentiated services code point (DSCP) bits and the last two bits are the explicit congestion notification (ECN) bits.
Time to Live (TTL)
TTL contains an 8-bit binary value that is used to limit the lifetime of a packet. The source device of the IPv4 packet sets the initial TTL value. It is decreased by one each time the packet is processed by a router. If the TTL field decrements to zero, the router discards the packet and sends an Internet Control Message Protocol (ICMP) Time Exceeded message to the source IP address. Because the router decrements the TTL of each packet, the router must also recalculate the Header Checksum.
Options and Padding
These fields are rarely used and are beyond the scope of this module.
Internet Header Length (IHL), Total Length, and Header Checksum
These fields are used to identify and validate the packet.
Identification, Flags, and Fragment Offset
These fields are used to reorder a fragmented packet. Specifically, the IPv4 packet uses these fields to keep track of the fragments. A router may have to fragment and IPv4 packet when forwarding it from one medium to another with a smaller MTU.
Destination IPv4 Address
This contains a 32-bit binary value that represents the destination IPv4 address of the packet. The destination IPv4 address is a unicast, multicast, or broadcast address.
Source IPv4 Address
This contains a 32-bit binary value that represents the source IPv4 address of the packet. The source IPv4 address is always a unicast address.
Protocol
This field is used to identify the next level protocol. This 8-bit binary value indicates the data payload type that the packet is carrying, which enables the network layer to pass the data to the appropriate upper-layer protocol. Common values include ICMP (1), TCP (6), and UDP (17).
Header Checksum
This is used to detect corruption in the IPv4 header.