DTrace IP Provider [PSARC/2008/302 FastTrack timeout 05/07/2008]

Erik Nordmark erik.nordmark at sun.com
Thu May 15 10:03:00 PDT 2008


Brendan Gregg - Sun Microsystems wrote:

> ipinfo_t is to provide basic IP details across all protocols: TCP, UDP,
> ICMP, etc - which isn't obvious from this case alone.  We can't assume
> that a complete IP header will be available at these times - it may be as
> an implementation artifact but this isn't stable.  What we can provide is
> an "IP payload length at time of tracing", and document that this is
> provided for convenience.  The IP provider ipv4info_t and ipv6info_t
> structs are to provide the best understanding of what IP really does.

I think you are missing the point. It should be "IP packet length" 
instead of "IP payload length", since the latter term isn't even 
well-defined.
For the implementation this means that the number is a bit larger:
  - no need to subtract the IPv4 header length from ipha_length
  - for IPv6 add in the constant 40 byte size of the IPv6 header

> Exporting the packet length easily from the IP provider would indeed be
> useful and has a clear definition that should reduce confusion.  We can
> add this to the ipv6info_t as ipv6_length, with the ipv4 companion as 
> ipv4_length.  How does that sound?

I think you should replace the
        uint16_t ip_plength;            /* payload length */
with
        uint16_t ip_length;            /* packet length */	

The ip version specific ones should best reflect the actual IP headers, 
which are different for IPv4 and IPv6. Thus having an ipv4_length (which 
is the packet length - the ipha_length in the IPv4 header) and 
ipv6_plength (which is the ipv6 payload length field in the IPv6 header.)

   Erik



More information about the opensolaris-arc mailing list