wifi, spectrum: Introduce channel spacing granularity for faster processing
These 2 commits introduce channel spacing granularity to reduce processing times when using SpectrumWifiPhy
, but at the expense of precision. 5 MHz granularity is used for 2.4 GHz and 5.8-5.9 GHz (aka 11p) bands and 20 MHz for the rest. DSSS 22 MHz bands will be truncated to 20 MHz. In addition, there is no no out-of-band emission modeling.
At most, i.e. for HE 160 MHz, we'll have only 8 SpectrumValue
s with the simplified model instead of the current 6145...
An attribute has been added to SpectrumWifiPhy
so as to switch to this "lightweight" model.
OFDMA is not supported yet, but it could be handled later on by using 1 MHz granularity (but, of course, there's no free lunch...).
PS: @sderonne and @tomhenderson had already reviewed a previous version of this work (see stavallo/ns-3-dev!56 (closed))
Perf evaluation
Here are the averaged results (over 10 runs) for the 63 tested cases within wifi-spectrum-saturation-example
(which uses HT for 20 and 40 MHz) using time -p sh -c 'seq 10 | xargs -Iz ./waf --run-no-build "wifi-spectrum-saturation-example --wifiType=ns3::SpectrumWifiPhy --bandSpacing=SubcarrierSpacing"'
Debug mode
Absolute stats in debug mode
wifiType | Band spacing | Real | User | Sys |
---|---|---|---|---|
ns3::YansWifiPhy | N/A | 3703.606s | 3702.904s | 0.531s |
ns3::SpectrumWifiPhy | ChannelSpacing (new) | 3777.789s | 3777.042s | 0.572s |
ns3::SpectrumWifiPhy | SubcarrierSpacing (default) | 3951.163s | 3950.418s | 0.580s |
Relative stats of the new lightweight modeling in debug mode
Reference | Real | User | Sys |
---|---|---|---|
YansWifiPhy | +2.0% | +2.0% | +7.7% |
SpectrumWifiPhy (default) | -4.4% | -4.4% | -1.4% |
Optimized mode
Absolute stats in optimized mode
wifiType | Band spacing | Real | User | Sys |
---|---|---|---|---|
ns3::YansWifiPhy | N/A | 444.583s | 443.984s | 0.484s |
ns3::SpectrumWifiPhy | ChannelSpacing (new) | 457.04s | 456.442s | 0.478s |
ns3::SpectrumWifiPhy | SubcarrierSpacing (default) | 486.713s | 486.095s | 0.512s |
Relative stats of the new lightweight modeling in optimized mode
Reference | Real | User | Sys |
---|---|---|---|
YansWifiPhy | +2.8% | +2.8% | -1.2% |
SpectrumWifiPhy (default) | -6.1% | -6.1% | -6.6% |
Conclusion
The max band that we have is 40 MHz so more gain should be expected for 160 MHz. In addition, the difference with Yans could be due to the fact that we consider multiple bands for Spectrum in the Interference model.
So, with simple scenarios such as these, we can see gains even when considering ramp up phases.