[Ns-developers] SetPromiscReceiveCallback not working unless broadcast or host is intended receiver

Kevin Peters kevjay at gmail.com
Mon Mar 1 18:16:41 PST 2010


On Mon, Mar 1, 2010 at 4:21 AM, Mathieu Lacage <
mathieu.lacage at sophia.inria.fr> wrote:

> On Fri, 2010-02-26 at 15:33 -0600, Kevin Peters wrote:
> > In my routing protocol (wireless ns3-7), I am trying to sniff all packets
> > via SetPromiscReceiveCallback.  The problem is that the hosts do not
> > overhear packets unless they are broadcast (PacketType 2) or they are the
> > intended receivers (PacketType 1).  I dug into the code and eventually
> > traced down to the MacLowRxCallback m_rxCallback in
> > src/devices/wifi/mac-low.cc not being called when the packet is not
> intended
> > for that host.  If I add "goto rxPacket;" at
> >
> http://code.nsnam.org/ns-3.7/file/be3fb855c65a/src/devices/wifi/mac-low.cc#l692
> ,
> > the hosts can then overhear packets from other nodes like I expect.
> >
> > I want to make sure that this is in fact a bug and that this behavior is
> not
> > intentional (I don't want to run into any problems by making this
> change).
>
> The behavior of mac-low.cc is intentional but it looks like the promisc
> trace support ignored that. I am not sure what would break if you added
> the goto you mention. It would probably need some serious testing.
>
> Mathieu
>
>
Thanks for the feedback Mathieu.  I went ahead and filed
http://www.nsnam.org/bugzilla/show_bug.cgi?id=827 for this.  I have made the
change discussed above in my mac-low.cc, integrated
the SetPromiscReceiveCallback at the routing layer, and have so far not seen
any problems with my testing.

Regards,
Kevin


More information about the Ns-developers mailing list