capturing packet from wlan0 with netgraph?

Monthadar Al Jaberi monthadar at gmail.com
Thu Dec 30 13:47:36 UTC 2010


Hi,

I have an idea in my head and would like to know if it is possible.

I want to simulate and test the net80211 mesh code in FreeBSD Current.
I have an RSPRO board with 3 atheros cards.

My  basic idea is to run three jails each having its own network
stack, and redirect all data packets coming out/in of the wlan driver
to a Server running a home brew application that simulates the medium.
That would be great, right? Realtime unchanged code to test, running
different application in their own jails.

So first I started to test netgraph with a simple test case, I want to
receive all packets from one wireless card and see the data in
wireshark or tcpdump...

This is my netgraph code:
mkpeer wlan0: hub lower hook0
name wlan0:lower hub
connect hub: wlan0: hook1 upper
connect hub: arge0: hook2 lower


So if I understood man ng_ether correct, this should capture
everything from wlan and redirect to ethernet cable.

But I get a panic after a couple of seconds:
Trap cause = 4 (address error (load or I-fetch) - kernel mode)
[ thread pid 11 tid 100037 ]
Stopped at      ip_input+0xd8:  lw      v0,0(s0)

I suspect that data flows to all hooks of the hub, and that is a bad
thing right? Need to create a special hub node to filter data? Or
maybe use two ethernet cables for out resp. in?

Is it even possible to do what I want? Or am I thinking wrong? And is
there a simpler way?

What I want is to test mesh code in a bunch of FreeBSD systems without
moving the hardware, one could just stack RSPROs and connected them a
big switch and a PC.
Hope was I clear in my thoughts.

Best regards,
-- 
//Monthadar Al Jaberi


More information about the freebsd-net mailing list