Bug 666 - wifi rates off by factor of 1000000 in ascii output
wifi rates off by factor of 1000000 in ascii output
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P1 trivial
Assigned To: duy
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-21 17:09 EDT by Michael Nowatkowski
Modified: 2009-09-27 03:30 EDT (History)
2 users (show)

See Also:


Attachments
fixed wifi rates off by factor of 1000000 (405 bytes, patch)
2009-09-26 17:18 EDT, duy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Nowatkowski 2009-08-21 17:09:18 EDT
The ascii output for wifi rates is off by a factor of 1000000.
This is fixed by changing line 139 of ns-3-dev/src/devices/wifi/supported-rates.cc
The current line is:
      os << (rate) << "mbs";

The proposed fix is:
      os << (rate/1000000) << "mbs";

Current snip of output from /examples/wifi-ap.cc is:
PHYTX mode=wifia-6mbs ns3::WifiMacHeader (MGT_BEACON ToDS=0, FromDS=0, MoreFrag=0, Retry=0, MoreData=0 Duration/ID=0us, DA=ff:ff:ff:ff:ff:ff, SA=00:00:00:00:00:03, BSSID=00:00:00:00:00:03, FragNumber=0, SeqNumber=0) ns3::MgtProbeResponseHeader (ssid=wifi-default, rates=[*6000000mbs 9000000mbs 12000000mbs 18000000mbs 24000000mbs 36000000mbs 48000000mbs 54000000mbs]) ns3::WifiMacTrailer ()

Snip of output from /examples/wifi-ap.cc after changing line 139:
PHYTX mode=wifia-6mbs ns3::WifiMacHeader (MGT_BEACON ToDS=0, FromDS=0, MoreFrag=0, Retry=0, MoreData=0 Duration/ID=0us, DA=ff:ff:ff:ff:ff:ff, SA=00:00:00:00:00:03, BSSID=00:00:00:00:00:03, FragNumber=0, SeqNumber=0) ns3::MgtProbeResponseHeader (ssid=wifi-default, rates=[*6mbs 9mbs 12mbs 18mbs 24mbs 36mbs 48mbs 54mbs]) ns3::WifiMacTrailer ()
Comment 1 duy 2009-09-26 17:16:09 EDT
I agree with Micheal's proposed fix.

In "src/devices/wifi/supported-rates.cc"

std::ostream &operator << (std::ostream &os, const SupportedRates &rates)
{
..
uint32_t rate = rates.GetRate (i);
...
}

rate contains bits per second.  The patch contains Micheal's proposed fix is here.  Passed regression tests.  Still need an OK from someone before I check in this bug.

Duy


(In reply to comment #0)
> The ascii output for wifi rates is off by a factor of 1000000.
> This is fixed by changing line 139 of
> ns-3-dev/src/devices/wifi/supported-rates.cc
> The current line is:
>       os << (rate) << "mbs";
> 
> The proposed fix is:
>       os << (rate/1000000) << "mbs";
> 
> Current snip of output from /examples/wifi-ap.cc is:
> PHYTX mode=wifia-6mbs ns3::WifiMacHeader (MGT_BEACON ToDS=0, FromDS=0,
> MoreFrag=0, Retry=0, MoreData=0 Duration/ID=0us, DA=ff:ff:ff:ff:ff:ff,
> SA=00:00:00:00:00:03, BSSID=00:00:00:00:00:03, FragNumber=0, SeqNumber=0)
> ns3::MgtProbeResponseHeader (ssid=wifi-default, rates=[*6000000mbs 9000000mbs
> 12000000mbs 18000000mbs 24000000mbs 36000000mbs 48000000mbs 54000000mbs])
> ns3::WifiMacTrailer ()
> 
> Snip of output from /examples/wifi-ap.cc after changing line 139:
> PHYTX mode=wifia-6mbs ns3::WifiMacHeader (MGT_BEACON ToDS=0, FromDS=0,
> MoreFrag=0, Retry=0, MoreData=0 Duration/ID=0us, DA=ff:ff:ff:ff:ff:ff,
> SA=00:00:00:00:00:03, BSSID=00:00:00:00:00:03, FragNumber=0, SeqNumber=0)
> ns3::MgtProbeResponseHeader (ssid=wifi-default, rates=[*6mbs 9mbs 12mbs 18mbs
> 24mbs 36mbs 48mbs 54mbs]) ns3::WifiMacTrailer ()
> 

Comment 2 duy 2009-09-26 17:18:19 EDT
Created attachment 602 [details]
fixed wifi rates off by factor of 1000000
Comment 3 Mathieu Lacage 2009-09-27 02:33:38 EDT
ok as obvious: please, apply.

thanks all !
Comment 4 duy 2009-09-27 03:30:41 EDT
changeset 7ca522b5c6c6