The IPv4 IHL field records header length in 32-bit words, with each word equal to four bytes. Multiply the field’s value by four to find the size in bytes: an IHL of 5 means a 20-byte header, while the maximum value of 15 allows 60 bytes, including options.

Multiple Choice

The IHL field indicates the IPv4 header length in what unit?

The IHL field expresses the IPv4 header length in 32-bit words. It’s a 4-bit field, and its value tells how many 32-bit words (each 4 bytes) make up the header. So to get the header length in bytes, multiply by 4. For example, an IHL value of 5 means a 20-byte header (the minimum, with no options), while the maximum is 15 words (60 bytes) because the field is only 4 bits wide. This design keeps the header length aligned to 32-bit boundaries, aiding efficient parsing.

An IPv4 packet carries more than the data a person wants to send. It also includes a header: a compact set of fields that tells network devices how to handle the packet. One small field in that header, called IHL, tells a device how long the header is. Its unit is 32-bit words, with each word equal to four bytes.

That detail matters because IPv4 headers can vary in length. Most are short and simple, but some include extra information. IHL helps a router find where the header ends and the packet’s data begins.

A small field with a specific job

IHL stands for Internet Header Length. It occupies four bits in the IPv4 header, so it can hold values from 0 to 15. But IPv4 headers can’t be shorter than 20 bytes, so valid IHL values start at 5.

Why does a value of 5 mean 20 bytes? Each IHL unit represents one 32-bit word. A 32-bit word contains four bytes, so the calculation is:

IHL value × 4 = header length in bytes

For example, an IHL value of 5 means five 32-bit words, or 20 bytes. A value of 6 means 24 bytes. At the upper limit, a value of 15 means 60 bytes.

The field’s four-bit size sets that maximum. Fifteen words is the largest value it can represent, and 15 × 4 gives 60 bytes. So the IPv4 header can range from 20 to 60 bytes long.

Why count in words rather than bytes?

IPv4’s header is laid out in 32-bit chunks. Expressing its length in those same chunks keeps the size value compact: a four-bit field can describe headers from 20 to 60 bytes in four-byte steps.

That means IHL doesn’t represent every possible byte length. It represents lengths that are multiples of four. This fits the IPv4 header’s structure, where fields are arranged on 32-bit boundaries. It also gives packet-reading software a straightforward rule: read IHL, multiply by four, and the result is the header’s length in bytes.

The distinction between bits, bytes, and words can be easy to blur. A bit is a single binary digit; a byte is eight bits; and a 32-bit word is four bytes. Since IHL counts 32-bit words, multiplying its value by 32 gives the header length in bits, while multiplying by 4 gives it in bytes. In everyday network tools, bytes are the more useful measure because packet sizes and memory locations are commonly expressed that way.

The usual 20-byte header

Many IPv4 packets have an IHL value of 5, which marks the minimum header length: 20 bytes. That basic header includes fields such as:

  • Version, which identifies the packet format as IPv4.

  • IHL, which records the header length in 32-bit words.

  • Total Length, which gives the size of the entire packet in bytes, including both header and data.

  • Time to Live (TTL), which limits how many router hops the packet can make.

  • Protocol, which identifies the type of data carried, such as TCP or UDP.

  • Source and destination addresses, which identify where the packet came from and where it is going.

These fields each have their own job. IHL tells a device where the header ends; Total Length tells it how large the whole packet is. They aren’t interchangeable. A packet can have a 20-byte header and carry much more data after it, subject to IPv4’s packet-size limits and the network path.

When the header grows

IPv4 allows optional fields to appear after the standard 20-byte portion of the header. These options may carry extra information, so the header needs more room. When options are present, the IHL value rises above 5.

Suppose a header is 28 bytes long. That size is seven groups of four bytes, so its IHL value is 7. A device can use that value to locate the start of the payload without needing to guess where the optional fields end.

IPv4 options have been used for functions such as recording route information or adding timestamps. They’re not common in ordinary internet traffic, and they can add work for routers that need to inspect them. Still, their presence helps explain why the header length can vary rather than always being fixed at 20 bytes.

Because IHL counts four-byte units, option data and any padding must fit the same boundary. If the added information doesn’t fill a whole number of 32-bit words, padding can bring the header up to the next four-byte boundary. This keeps the header’s length consistent with the unit that IHL records.

Reading IHL in a packet

The IPv4 header begins with a byte that contains two four-bit fields: Version in the first half and IHL in the second. In a packet capture, the first half usually has the value 4, marking IPv4. The second half gives the IHL value.

For instance, if the byte is shown as 0x45, the first hexadecimal digit, 4, indicates the IP version. The second digit, 5, gives the IHL. An IHL of 5 means a 20-byte header.

If the byte is 0x46, the version remains 4, while the IHL is 6. That signals a 24-byte header. Packet-analysis tools such as Wireshark display these fields in a more readable format, but understanding the raw value can make a packet trace feel less like a wall of numbers.

A parser needs this information before it can reach the payload. If it assumes every IPv4 header is exactly 20 bytes, it may mistake optional header data for application data whenever options are present. Reading IHL first gives it the right starting point.

IHL and the limits of interpretation

IHL describes only the IPv4 header. It doesn’t say how much application data is present, and it doesn’t identify the total packet size. For those details, a network device reads other fields, including Total Length.

It’s also useful to remember that packets may be split into fragments. Fragmentation changes how data is carried across a network, but each IPv4 fragment still has its own header, and that header has its own IHL value. The field continues to describe the length of that specific fragment’s header—not the size of the original, unfragmented packet.

In most routine cases, IHL is 5. That makes it easy to overlook. Yet the field is a good example of how a small piece of metadata helps keep packet processing orderly: it tells a device where control information stops and carried data begins.

So the key idea is simple: IHL counts 32-bit words. Multiply its value by four to get the header length in bytes. With that one conversion, a compact four-bit field becomes a clear guide to the shape of an IPv4 packet.