tcpdump mailing list archives

Re: IP length vs IP6 length inconsistency (fwd)


From: Guy Harris <guy () alum mit edu>
Date: Thu, 13 Sep 2007 18:53:56 -0700


On Aug 7, 2007, at 6:04 AM, Pekka Savola wrote:

In tcpdump 3.9.7 (Fedora 7) but seeing the same on FreeBSD, I noticed that on a similarly generated TCP packet, IPv4 output differs from IPv6 in that "length" in v4 includes the IP header length, but in v6 it does not.

In the protocol specifications, the "total length" in the IPv4 header includes the IP header length, but in v6 the "payload length" doesn't include the initial IPv6 40-byte header length.

There are differences as to how next-headers are chained in v4 vs v6. but I'd be tempted to argue that a uniform representation would be helpful.

Is this inconsistency intentional?

If the intent is to display the raw value of the length fields in the headers, then, yes, it is, as the meanings of the length fields differ.

Is the length intended to print out the whole IP packet length (which in the case of v6 would probably require chasing down the extension header chain)

No, just adding 40 to the payload length field. Extension headers are, according to RFC 2460, included in the length count.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: