set channel number using YansWifiPhyHelper

872 views
Skip to first unread message

thunder

unread,
Aug 19, 2011, 11:02:27 AM8/19/11
to ns-3-users
hi all,
how can I set the wifi channel number using YansWifiPhyHelper??
please help
thanks in advance

John Abraham

unread,
Aug 20, 2011, 5:56:31 AM8/20/11
to ns-3-users
You will have to use YansWifiPhy not the helper to set the channel
number
http://www.nsnam.org/doxygen/classns3_1_1_yans_wifi_phy.html#a9edcaa32bbe6037bc3a493e05e39b364

thunder

unread,
Aug 27, 2011, 3:43:23 PM8/27/11
to ns-3-users
the problem is that I don't know how should I use it because I can't
find an example that uses it
because swithching from YansWifiPhyHelper to YansWifiPhy will need
changing some other methods used in the same main file

any idea??

thanks Abraham

On Aug 20, 12:56 pm, John Abraham <johnj...@gmail.com> wrote:
> You will have to use YansWifiPhy not the helper to set the channel
> numberhttp://www.nsnam.org/doxygen/classns3_1_1_yans_wifi_phy.html#a9edcaa3...

Jeremy Mack

unread,
Jan 25, 2013, 4:13:45 PM1/25/13
to ns-3-...@googlegroups.com
Hey Raad,

Did you ever solve this problem? I am currently in the same situation.

Alessandro Russo

unread,
Jan 27, 2013, 12:35:57 PM1/27/13
to ns-3-...@googlegroups.com
Hi,
may be it helps

YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default();
wifiChannel.AddPropagationLoss("ns3::NakagamiPropagationLossModel");

YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default();
// All nodes on channel 6 should be created together,
// adding another set of nodes B later, B will actually do not hear
the nodes in set A
// Note that no inter-channel interference is yet implemented
wifiPhy.Set("ChannelNumber",UintegerValue(6));
wifiPhy.SetChannel(wifiChannel.Create());
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default();
wifiMac.SetType("ns3::AdhocWifiMac");

NetDeviceContainer netDev = wifi.Install(wifiPhy, wifiMac, nodes);

Regards,

Alessandro R.
> --
> You received this message because you are subscribed to the Google Groups
> "ns-3-users" group.
> To post to this group, send email to ns-3-...@googlegroups.com.
> To unsubscribe from this group, send email to
> ns-3-users+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages