[Ns-developers] CSMA Tracing Rework
craigdo@ee.washington.edu
craigdo at ee.washington.edu
Thu Feb 19 20:22:05 PST 2009
We have a couple of P1 bugs for ns-3.4 that I am currently working on
resolving
1) http://www.nsnam.org/bugzilla/show_bug.cgi?id=438 (csma helper hooks the
transmit queue enqueue operation for pcap tracing)
2) http://www.nsnam.org/bugzilla/show_bug.cgi?id=443 (Net device pcap traces
arent consistent with what tcpdump would display)
I've put together a repo that begins to address these issues (for CSMA at
least). You can find it at http://code.nsnam.org/craigdo/ns-3-traces if you
want to take a look.
The basic idea is to fill out the number of trace sources to provide enough
hooks to make it clear where and when things are happening. I added hooks
to events that happen at the "top" of the device as things come in or go out
to and from L3 along with drop events that happen at that level. I added
another group of trace sources at the "bottom" of the device that fire as
things go out to or in from the channel along with drop events that happen
at that level.
There is a new trace hook called "Sniffer" that provides packets for a
non-promiscuous packet sniffer -- the same thing that you would get if you
ran a tcpdump packet sniffer on the interface. This trace source is hooked
into the same logical places as tcpdump would (with its PF_PACKET ETH_P_ALL
sockets) but on the device side. Note that this is a non-promiscuous
sniffer so it won't capture PACKET_OTHERHOST packets. It may be useful to
make a promiscuous sniffer (Attribute "PromiscSniffer") that would work just
like tcpdump (i.e., capture all packets on the channel in one place).
I think this makes it a lot more clear what exactly you are tracing when you
connect to these sources. The existing device queue is still there with its
associated trace sources, so AsciiTrace is unchanged. The ambiguous trace
hooks are removed (e.g., "Drop").
I would like to do a similar treatment on all of the real net devices in
/src/devices. Comments?
This will, of course, mean regenerating most of the regression traces.
I have reproduced the new trace sources below. More detailed descriptions
may be found in the doxygen in csma-net-device.h
-- Craig
---------- Begin Source ----------
//
// Trace sources at the "top" of the net device, where packets transition
// to/from higher layers.
//
.AddTraceSource ("MacTx",
"Trace source indicating a packet is being queued for
transmission by this device",
.AddTraceSource ("MacTxDrop",
"Trace source indicating a packet has been dropped by the
device before transmission",
.AddTraceSource ("MacRx",
"Trace source indicating a packet has been received by this
device and is being forwarded up the stack",
//
// Trace souces at the "bottom" of the net device, where packets transition
// to/from the channel.
//
.AddTraceSource ("PhyTx",
"Trace source indicating a packet has been completely
transmitted over the channel medium",
.AddTraceSource ("PhyTxDrop",
"Trace source indicating a packet has been dropped by the
device during transmission",
.AddTraceSource ("PhyRx",
"Trace source indicating a packet has been completely
received from the channel medium by the device",
.AddTraceSource ("PhyRxDrop",
"Trace source indicating a packet has been dropped by the
device during reception",
.AddTraceSource ("PhyTxBackoff",
"Trace source indicating a packet has been delayed by the
CSMA backoff process",
//
// Trace source designed to simulate a packet sniffer facility
//
.AddTraceSource ("Sniffer",
"Trace source simulating a non-promiscuous packet
sniffer attached to the device",
---------- End Source ----------
More information about the Ns-developers
mailing list