[Ns-developers] NS-3 promiscuous mode for NetDevice

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Mon Jun 30 12:54:02 PDT 2008


On Mon, 2008-06-30 at 18:16 +0100, Gustavo Carneiro wrote:
> One thing that I need from NS-3 right now, and is not possible without
> patching the core, is to enable promiscuous mode protocol handlers.  My
> particular use case is rather complicated, but let's suppose a simpler
> scenario to illustrate the case.  Suppose I want to create a 802.1D Learning
> Bridge, for instance for implementing a proper 802.11 Access Point.  The
> LearningBridge module needs to receive all L2 frames from netdevices, even
> the ones with destination address not matching the netdevice it arrived on.
> 
>   I think it is clear this feature is needed.  Now, I would welcome advice
> on what is the best way I can implement it[1].  I can see different ways to
> accomplish the goal:

An even simpler way to do this than any of the two options you describe
and what is done in the 802.11 code is to simply make your netdevice
model export two sets of trace sources which hook at different locations
in your model. 

For example, the wifi model has the two following trace sources:
/NodeList/x/DeviceList/y/Phy/Tx
and,
/NodeList/x/DeviceList/y/Mac/Tx

The former hooks at the top of the PHY layer while the latter hooks at
the top of the MAC layer. If you hook at the PHY layer, you get the
promiscuous output. If you hook at the MAC layer, you get the
non-promiscuous output (in fact, for wifi, there is no such thing as
"promiscuous". It is usually called "monitor" mode on linux).

The question then, is, what does the helper API export and, do you want
to allow the helper API to export the two different modes. I would say
that this really depends on your model. Right now, the wifi code exports
the PHY hook traces, hence generating pcap traces for "monitor" mode by
default but, I would be happy to see patches to add support for a
non-monitor mode to the helper API. Anyhow, my point, though, is that
none of that has much to do with the NetDevice API, and everything to do
with the helper API.

regards,
Mathieu



More information about the Ns-developers mailing list