Debugging a netgraph node

Bob Van Zant bob at veznat.com
Wed Jun 17 05:16:17 UTC 2009


I'm experimenting with netgraph to try to implement an IPv6 -> IPv4 gateway,
as specified here:

http://tools.ietf.org/html/draft-xli-behave-ivi-02

This is my first time ever working with netgraph and I admit to being a bit
lost. I have a netgraph node that gets wired up with an ng_ether node. My
lower hook gets wired to the ng_ether lower hook and my upper to his upper.
It's receiving IPv6 + UDP packets, creating IPv4 + UDP packets and then
writing the new packets out with NG_FWD_NEW_DATA.

I'm perfectly willing to waste time making stupid mistakes on this project,
however, right now I'm stuck. I can't "find" the translated packets I'm
writing anywhere to see what, if anything, is wrong with them. They don't
show up in tcpdump on the local machine (I've tried writing to both the
upper and lower hook). They don't show up in tcpdump on other machines on
the network.

I tried attaching nghook to the "orphans" hook of the ng_ether node but it
doesn't appear to be seeing any data.

netstat -s -p udp doesn't show any packets when my node is enabled (I think
this means my node is effectively swallowing them).

I've tried to figure out how to wire in an ng_tee node but I'm a little lost
as to how to do this (I still haven't figured out the ngctl syntax).

Any tips for figuring out what I'm doing wrong? Debug options to enable that
will show me more information about what's happening after I call
NG_FWD_NEW_DATA? If I got ng_tee wired in would it's tap hooks show me what
I want? A better way to try to tee the data?

Thanks,

Bob




More information about the freebsd-net mailing list