ipv4 packet structure

Posted on 2013-09-18
Medium Priority
Last Modified: 2013-10-03
I heard that the ipv4 header range from 20 to 60 bytes. I  google around but could not validate that fact. Any ideas?
Question by:leblanc
  • 3
  • 2
LVL 84

Accepted Solution

Dave Baldwin earned 668 total points
ID: 39503416
That sounds about right.
See here:  http://en.wikipedia.org/wiki/IPv4#Packet_structure
LVL 24

Assisted Solution

aadih earned 1332 total points
ID: 39503437
If you want a good deal of details about IP v4, the following link will take you to a good tutorial:

http://www.tutorialspoint.com/ipv4/ipv4_packet_structure.htm >

Author Comment

ID: 39503543
Nice links but where does it say that the header can be from 20 to 60 bytes?
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

LVL 24

Expert Comment

ID: 39503565

"60 bytes": No.

"Length—A 4-bit field containing the length of the IP header in 32-bit increments. The minimum length of an IP header is 20 bytes, or five 32-bit increments. The maximum length of an IP header is 24 bytes, or six 32-bit increments. Therefore, the header length field should contain either 5 or 6."

http://www.ciscopress.com/articles/article.asp?p=348253&seqNum=4 >

Author Comment

ID: 39503574
Now I am confused. Can somebody explain the explanation below:
Internet Header Length (IHL)
    The second field (4 bits) is the Internet Header Length (IHL), which is the number of 32-bit words in the header. Since an IPv4 header may contain a variable number of options, this field specifies the size of the header (this also coincides with the offset to the data). The minimum value for this field is 5 (RFC 791), which is a length of 5×32 = 160 bits = 20 bytes. Being a 4-bit value, the maximum length is 15 words (15×32 bits) or 480 bits = 60 bytes. "

LVL 24

Assisted Solution

aadih earned 1332 total points
ID: 39503615
If you go directly to the RFC, you'll find: "The Option Length is the number of octets in the option counting the type, length, pointer, and overflow/flag octets (maximum length 40)."

So, the option field could be up to 40 bytes. If you add that to the other fields (20 bytes), you get a maximum header length of 60 bytes. That is, no option, 20 bytes; and with maximum option length, 60 bytes.

There are many details ("the devil is in the details"), which cannot be captured by high-level articles; but if interested, one must go and read the RFC itself.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question