make wifi node promiscuous mode

445 views
Skip to first unread message

Bin Ni

unread,
May 14, 2009, 12:14:34 PM5/14/09
to ns-3-users
Hi all,

I have one question to bother you that I would like to make the Wifi
node working as promiscuous mode so that I could enable the node
capture each packet it hears on the air. I think currently the default
mode is non-promiscuous mode. How could I change it to promiscuous
mode?

I know in Node.cc I found this

device->SetReceiveCallback (MakeCallback
(&Node::NonPromiscReceiveFromDevice, this));

I simply changed the line to

device->SetReceiveCallback (MakeCallback
(&Node::PromiscReceiveFromDevice, this));

because Node::PromiscReceiveFromDevice is already there....

but it couldn't be compiled.

Anybody did the same case before? I will appreciate you so much if you
could offer me any hint about that...

Thanks!

Regards,
Bin

Gustavo Carneiro

unread,
May 14, 2009, 1:07:48 PM5/14/09
to ns-3-...@googlegroups.com


2009/5/14 Bin Ni <skydo...@gmail.com>


Hi all,

I have one question to bother you that I would like to make the Wifi
node working as promiscuous mode so that I could enable the node
capture each packet it hears on the air.

I do not think you really need to force promiscuous mode on everything.  NS-3 has "promiscuous procotol handlers", instead of "promiscuous mode".

See Node::RegisterProtocolHandler, there is an optional parameter 'promiscuous', whose default value is 'false', you can also register a handler with promiscuous value 'true'.
 
I think currently the default
mode is non-promiscuous mode. How could I change it to promiscuous
mode?

I know in Node.cc I found this

device->SetReceiveCallback (MakeCallback
(&Node::NonPromiscReceiveFromDevice, this));

I simply changed the line to

device->SetReceiveCallback (MakeCallback
(&Node::PromiscReceiveFromDevice, this));

because Node::PromiscReceiveFromDevice is already there....

but it couldn't be compiled.

Anybody did the same case before? I will appreciate you so much if you
could offer me any hint about that...

Thanks!

Regards,
Bin




--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert

Nicola Baldo

unread,
May 15, 2009, 6:43:46 AM5/15/09
to ns-3-users
Hi Bim,

> I have one question to bother you that I would like to make the Wifi
> node working as promiscuous mode so that I could enable the node
> capture each packet it hears on the air. I think currently the default
> mode is non-promiscuous mode. How could I change it to promiscuous
> mode?

I suggest you to have a look at the following example, which uses
promiscuos mode with wifi:

examples/wifi-wired-bridging.cc

Regards,

Nicola
Reply all
Reply to author
Forward
0 new messages