Kamran Mushtaq
Back to Networking
Networking

IPv4 Header – Internet Header Length (IHL)

Added: July 6, 2026

Definition

  • The Internet Header Length (IHL) field tells the receiver how long the IPv4 header is.
  • It marks where the header ends and where the actual data (payload) begins.

What Problem It Solves

  • The IPv4 header is not always 20 bytes because Options may be added.
  • IHL tells routers and the destination exactly where to start reading the payload, preventing confusion.

What Happens If Not Used

  • Devices would have to guess where the payload starts.
  • If Options were present, part of the header could be mistaken for application data, causing packet processing to fail.

Easy Wording

It tells the receiver where the IP header ends and the actual message begins.

Layman Example

Think of a package with a shipping label. The IHL tells you how large the label is, so you know where the actual package contents begin.

Technical Example

Request Flow:

  • Your browser sends a request to a web server.
  • Your computer builds an IPv4 packet.
  • If no Options exist, IHL = 5 (5 × 4 = 20 bytes).
  • A router reads Version, then IHL, and knows the payload starts immediately after byte 20.
  • It forwards the packet, and the server correctly extracts the TCP segment.

Limitation: IHL only tells where the payload starts. It doesn't indicate the packet's total size. Total Length, provides the complete packet size.