Solved

ipv4 packet structure

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

LVL 84

Accepted Solution

Dave Baldwin earned 668 total points
ID: 39503416
See here:  http://en.wikipedia.org/wiki/IPv4#Packet_structure
0

LVL 24

Assisted Solution

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 >
0

LVL 1

Author Comment

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

LVL 24

Expert Comment

ID: 39503565
Okay.

"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 >
0

LVL 1

Author Comment

ID: 39503574
Now I am confused. Can somebody explain the explanation below:
"
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. "

http://en.wikipedia.org/wiki/IPv4#Packet_structure
0

LVL 24

Assisted Solution

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.
0

Featured Post

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.