use of void ns3::YansWifiPhy::SetChannelNumber ( uint16_t id )

154 views
Skip to first unread message

Michael

unread,
Sep 11, 2009, 12:22:53 PM9/11/09
to ns-3-users
I am trying to set up a wireless adhoc network where groups of nodes
are on different channels. What all needs to be set on each node to
enable this to work? I tried just setting the channel numbers
differently, but all nodes are still able to transmit/receive to all
nodes, regardless of which channel number they are assigned. Does
this require a separate instance of WifiPhyChannel for each channel
number? I didn't see any of the examples that use SetChannelNumber.

Thanks!
Michael

Mathieu Lacage

unread,
Sep 15, 2009, 3:08:57 AM9/15/09
to ns-3-...@googlegroups.com
Which version of ns-3 are you using ?

No: all devices should be connected to the same instance of a
WifiPhyChannel but they should be assigned different 'channel
number's. YansWifiPhyChannel does use the 'channel number' to decide
when to forward a packet to a PHY or not.

Mathieu
--
Mathieu Lacage <mathieu...@gmail.com>

Michael

unread,
Sep 17, 2009, 7:16:16 AM9/17/09
to ns-3-users
I am using the latest dev version of ns-3.

I added the following lines into third.cc to see if I can figure out
how to use ChannelNumber:
insert at line 86 (above the phy.SetChannel (channel.Create ()); line:
YansWifiPhy testCN;
testCN.SetChannelNumber (1000);

When I do this I get an error:
"assert failed. file=../src/devices/wifi/wifi-phy-state-helper.cc,
line=379, cond="IsStateSwitching()"
line 379 is NS_ASSERT(IsStateSwitching());

I checked in yans-wifi-phy.cc for the same assert, and on line 311 it
is NS_ASSERT(!IsStateSwitching());

When I added the ! to line 379 of wifi-phy-state-helper.cc so that it
would be the same as line 311 of yans-wifi-phy.cc, the error went
away.

I'm not sure if I did something wrong with my attempt at using
ChannelNumber, or if the ! got lost.

Michael

On Sep 15, 3:08 am, Mathieu Lacage <mathieu.lac...@gmail.com> wrote:
> Which version of ns-3 are you using ?
>
> On Fri, Sep 11, 2009 at 6:22 PM, Michael <nowat...@gmail.com> wrote:
> > wireless adhoc network where groups of nodes
> > are on different channels.  What all needs to be set on each node to
> > enable this to work?  I tried just setting the channel numbers
> > differently, but all nodes are still able to transmit/receive to all
> > nodes, regardless of which channel number they are assigned.  Does
> > this require a separate instance of WifiPhyChannel for each channel
> > number?  I didn't see any of the examples that use SetChannelNumber
>
> No: all devices should be connected to the same instance of a
> WifiPhyChannel but they should be assigned different 'channel
> number's. YansWifiPhyChannel does use the 'channel number' to decide
> when to forward a packet to a PHY or not.
>
> Mathieu
> --
> Mathieu Lacage <mathieu.lac...@gmail.com>

Raad Qandah

unread,
Oct 19, 2012, 4:54:10 AM10/19/12
to ns-3-...@googlegroups.com
Dear Micheal,

I need help in the same topic you have been asking about I need an example of how I can make different network (nodes) operate on different channels
can you provide me with an example or document about this
thanks in advance

Regards,
Raad Qandah
Reply all
Reply to author
Forward
0 new messages