wifi: crashes when using SpectrumWifiPhy in the 2.4 GHz band
I modified the wifi-he-network.cc script to use the SpectrumWifiPhy instead of YansWifiPhy. Here is the diff:
@@ -124,9 +123,12 @@
NodeContainer wifiApNode;
wifiApNode.Create (1);
- YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
- YansWifiPhyHelper phy;
- phy.SetChannel (channel.Create ());
+ Ptr<MultiModelSpectrumChannel> channel = CreateObject<MultiModelSpectrumChannel> ();
+ channel->AddPropagationLossModel (CreateObject<FriisPropagationLossModel> ());
+ channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
+
+ SpectrumWifiPhyHelper phy;
+ phy.SetChannel (channel);
WifiMacHelper mac;
WifiHelper wifi;
@@ -243,8 +245,6 @@
clientApp.Stop (Seconds (simulationTime + 1));
}
- Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-
Simulator::Stop (Seconds (simulationTime + 1));
Simulator::Run ();
Running the simulation in the 5 GHz band works fine, but it crashes in the 2.4 GHz band:
Stefanos-MacBook-Pro:ns-3-fem stefano$ ./waf --run "wifi-he-net --simulationTime=0.3 --frequency=2.4 --useRts=1 --minExpectedThroughput=6 --maxExpectedThroughput=223"
Waf: Entering directory `/Users/stefano/ns-3-fem/build'
[2753/2799] Compiling scratch/wifi-he-net.cc
[2761/2799] Linking build/scratch/wifi-he-net
Waf: Leaving directory `/Users/stefano/ns-3-fem/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (2.668s)
MCS value Channel width GI Throughput
0 20 MHz 3200 ns 6.08427 Mbit/s
0 20 MHz 1600 ns 6.75157 Mbit/s
0 20 MHz 800 ns 7.18336 Mbit/s
assert failed. cond="(numBandsInChannel % 2 == 1) && (totalNumBands % 2 == 1)", msg="Should have odd number of bands", +0.000034003s 0 file=../src/wifi/model/spectrum-wifi-phy.cc, line=517
libc++abi.dylib: terminating
Command ['/Users/stefano/ns-3-fem/build/scratch/wifi-he-net', '--simulationTime=0.3', '--frequency=2.4', '--useRts=1', '--minExpectedThroughput=6', '--maxExpectedThroughput=223'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --gdb").
Here is the complete script wifi-he-net.cc