Bug 2351 - Wrong symbol rate calculation for channels with 10 and 5 Mhz width
Wrong symbol rate calculation for channels with 10 and 5 Mhz width
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3.25
All All
: P5 major
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-29 11:55 UTC by Ali Rostami
Modified: 2016-07-30 04:08 UTC (History)
1 user (show)

See Also:


Attachments
Suggested Patch (765 bytes, patch)
2016-03-29 11:55 UTC, Ali Rostami
Details | Diff
final patch (2.71 KB, patch)
2016-07-30 04:04 UTC, sebastien.deronne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Rostami 2016-03-29 11:55:41 UTC
Created attachment 2360 [details]
Suggested Patch

WifiMode::GetDataRate function seems to calculate the symbol rate for 20Mhz channel, while considers other differences between 20, 10, and 5 Mhz channels such as the number of usable subcarriers.
The function uses following line to calculate the symbol rate:
      double symbolRate = (1 / 4.0) * 1e6;
While is should be:
      double symbolRate = (1 / 8.0) * 1e6;
and:
      double symbolRate = (1 / 16.0) * 1e6;
for the 10 Mhz channel width and the 5 Mhz channel width, respectively.
Comment 1 sebastien.deronne 2016-07-26 02:37:21 UTC
This could be pushed
Comment 2 sebastien.deronne 2016-07-30 03:25:58 UTC
wave-mac-extension is failing with those changes, I'll check before pushing
Comment 3 sebastien.deronne 2016-07-30 03:39:22 UTC
Patch is actually NOK, data rates are half of expected!
Comment 4 sebastien.deronne 2016-07-30 04:04:53 UTC
Created attachment 2504 [details]
final patch

The patch has been corrected: 10 MHz uses double symbol duration than 20 MHz, with the same number of subcarriers (and thus half subcarrier spacing). We now retrieve the correct data rate and tests are all passing fine.
Comment 5 sebastien.deronne 2016-07-30 04:05:20 UTC
patch is now ready to be pushed!
Comment 6 sebastien.deronne 2016-07-30 04:08:28 UTC
fixed in changeset 12229:9e43ad888f78