G'Day Darren,

On Tue, Jun 12, 2007 at 04:22:00PM -0700, [EMAIL PROTECTED] wrote:
[...] 
> >>Also, can you explain where the probes for each protocol fit in
> >>relation to the greater processing for the protocol?
> >
> >Sure, probes fire when packets are sent and received. The actual
> >location of the probe macros in the kernel TCP/IP code is based on
> >available information and maintainability. This means that ip
> >probes may be placed in tcp_send_data() and udp_send_data(), just
> >as MIB macros for IP statistics appear in tcp.c and udp.c
> 
> Saying "when packets are sent and received" is a little bit too
> vague.  Does this mean when IP* packets are sent/received
> via the mac layer, dls layer, the driver layer or IP layer?  And
> how far into each layer?

This is easier to explain if I post a webrev (which I want to do ASAP).
Anyway, for sent traffic - it is probed as late as possible while the
conn_t is still available; and for received traffic, it is probed
early in common places.

Or described another way - IP is probed when ip meets dld or dls.

> To compare this with snoop, what we get is more or less understood
> to be a copy of the data sent to/from a device driver with anything
> above it, so we know it is possible to see corrupt frames, incorrect
> checksums, etc.

Great - so I don't need to reinvent that functionality since snoop has
me covered. ;-)

Seriously, yes, I would prefer these DTrace providers to provide identical
protocol headers to what snoop can see, but if there is some IP header
mangling down in dld or dls, then snoop would have a better view of
packets than the current placement of IP probes. But the question is - 
is there IP header mangling in dld or dls (and why would there be)?

I do see that dls_soft_ring_fanout() can drop ip packets that don't have
a complete ipv4 header,

                if ((MBLKL(mp) < sizeof (ipha_t)) || !OK_32PTR(mp->b_rptr)) {
                        if ((mp = msgpullup(mp, sizeof (ipha_t))) == NULL) {
                                /* Let's toss this away */
                                dls_bad_ip_pkt++;
                                freemsg(mp);
                                continue;
                        }

which seems like a precaution anyway, rather than something that will
frequently happen,

        # echo dls_bad_ip_pkt/D | mdb -k
        dls_bad_ip_pkt:
        dls_bad_ip_pkt: 0         

> Having a good understanding of where the probes fit in the
> overall architecture will help a lot towards us networking folks
> understanding what we can (or cannot) see when using them.

Sure. Maybe this helps also - this is the DTrace probe listing from
the old prototype, which shows the function locations for the ip probes,

# dtrace -ln 'ip:::'
   ID   PROVIDER            MODULE                          FUNCTION NAME
47950         ip                ip                     udp_send_data send
47951         ip                ip                     tcp_send_data send
47952         ip                ip                    ip_wput_ire_v6 send
47953         ip                ip                       ip_wput_ire send
47963         ip                ip                        ip_rput_v6 receive
47964         ip                ip                          ip_input receive

Of course, this list is likely to get a lot longer as IP Filter and IPsec
are traced properly, and ipv4 and ipv6 providers are added.

[...]
> >So far so good, now need to replace the "20" value with args[2]->ipv4_ihl,
> >
> ># dtrace -n 'ip:::send,ip:::receive { tracemem(args[2]->ipv4_hdr,
> >   args[2]->ipv4_ihl); }'
> >dtrace: invalid probe specifier ip:::send,ip:::receive { 
> >tracemem(args[2]->ipv4_hdr, args[2]->ipv4_ihl); }: tracemem( ) argument #2 
> >must be a non-zero positive integral constant expression
> 
> Will ipv4_ihl be the number of bytes or the value as found in
> the header? (a count of 4 byte words)

In the first prototype it was 4 byte words, which I found a little annoying
to use. I'm thinking the translated version could be bytes, and clearly
documented as such, while bearing in mind that a pointer to the raw
header is available also. The translated version is there for useability
(eg, IP addresses are represented as strings).

[...]
> >>For IPv6, how do you see this design evolving to include looking
> >>at extension header data?
> >
> >Extension header data would only be accessed through the ipv6 provider,
> >and can be added to the ipv6info_t struct.
> 
> For most IPv6 extension headers, there is a limit on them
> appearing only once, with the exception being destination
> options.  How do you see that being handled?

Anything requiring looping through like-members presents a little headache
in DTrace - which doesn't provide (or so far, really need) looping in the
D language.

I see them as important but not crucial for a first release of the ipv6
provider - destination options can be added as members to ipv6info_t when
the right way to present them has been found. But thanks for bringing it up
- it is another problem that needs careful consideration.

cheers,

Brendan

-- 
Brendan
[CA, USA]
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to