+1 vote
by (98.9k points)
Explain IPv4 header format in detail.

1 Answer

0 votes
by (98.9k points)
Best answer

The IPv4 packet header contains a fixed mandatory part, which is made of 13 fields. Let’s take a closer look at the IPv4 header format, the header fields and the roles each of them has.

IPv4 packet header table with all its values.

IPv4 packet header

  • Version: The first 4-bit header field informs about the current IP version in use, which, in this case, is IPv4
  • Internet Header Length (IHL): The IHL has four bits that specify the number of 32-bit words in the header – the minimum header length is 20 data bytes and the minimum value of this field is five
  • Service Type: This field provides the queuing of the IP packets in their transmission
  • Total Length: This is the total size of the header and data in bytes, where the minimum size of the Total Lenght field is 20 bytes and the maximum size is 65,535 bytes
  • Identification: If the IP datagram is fragmented (broken into smaller pieces), the ID field helps identify fragments and determine to which IP packet they belong to
  • IP Flags: This is a 3-bit field that uses a few possible configuration combinations of control flags for fragmentation:
    • Bit 0 is reserved and always set to 0
    • Bit 1 represents the Don’t Fragment (DF) flag, which indicates that this packet should not be fragmented
    • Bit 2 represents the More Fragments (MF) flag, which is set on all fragmented packets except the last one
  • Fragmentation Offset (Fragment Offset): The Fragment Offset field takes up 13 bits, and it performs packet tracing by representing the data bytes ahead; i.e., it determines where in the original packet the particular fragment belongs
  • Time to Live (TTL): TTL limits the datagram’s lifetime to prevent packets from an endless loop in the internet system by causing undeliverable datagrams to be discarded automatically
  • Protocol: This 8-bit field defines which protocol is used in the data portion of the packet
  • Header Checksum: If there are any communication errors in the header, the Header Checksum field detects them
  • Source IP Address: The 32-bit IPv4 address of the sender of the packet
  • Destination IP Address: The 32-bit IPv4 address of the receiver of the packet
  • Options: This optional feature is used when the value in the Internet Header Length is greater than five, hence the header length field increases (it may contain Time Stamp, Record Route or another optional field)

Related questions

0 votes
1 answer 55 views
0 votes
1 answer 62 views
0 votes
1 answer 78 views
+1 vote
0 answers 29 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers


504 users