wifins-3

Modifying the operating frequency (for 802.11ac) on ns-3


I am attempting to change the operating frequency to 300MHz (to simulate the working of 802.11af) but retain the overall PHY layer configuration of 802.11ac.

I have gone through earlier posts and realized that the SetFrequency() function (in the class YansWifiPhy) can be employed. However, when I implement the following statement ('wifi' is an object of the class WifiHelper)-

NetDeviceContainer staDevices = wifi.Install (phy, mac, wifiStaNodes);

I get an error since the object 'phy' is required to be of YansWifiPhyHelper datatype, not YansWifiPhy. However, I can't seem to change the frequency using the YansWifiPhyHelper class. How do I resolve this problem?


Solution

  • As you can see YansWifiPhy is a child class of WifiPhy. The typeId of WifiPhy has Frequency as an attribute. You can set this attribute using any to of the following way:

    1. You can change the default value of ns3::WifiPhy::Frequency using the Config::SetDefault function. The documentation for the same can be found here.
    2. Secondly you can use the Set function of YansWifiPhyHelper to set any attribute of YansWifiPhy (WifiPhy). You can find an example of this here. The only difference from the link will be that you need to change the attribute name to Frequency and change the value accordingly.

    Please, let me know in case of any doubts or any of these don't work for you.