Bug 1971 - 802.11n at 2.4 GHz should include a signal extension duration
802.11n at 2.4 GHz should include a signal extension duration
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P5 enhancement
Assigned To: Daniel L.
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-03 04:25 EDT by sebastien.deronne
Modified: 2014-10-29 21:20 EDT (History)
2 users (show)

See Also:


Attachments
Patch (2.27 KB, application/octet-stream)
2014-09-03 04:25 EDT, sebastien.deronne
Details
patch v2 (11.72 KB, patch)
2014-10-20 16:47 EDT, sebastien.deronne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sebastien.deronne 2014-09-03 04:25:19 EDT
Created attachment 1870 [details]
Patch

Similarly to 802.11g, 802.11n standard specifies that a packet should be followed by a period of no transmission of 6 µs (= signal extension) when working at 2.4 GHz.

To do so, it is required to check the working frequency in WifiPhy. You can find the proposed patch in attachment.
Comment 1 Tom Henderson 2014-10-16 16:35:17 EDT
Sebastien, when I test this patch (after applying patches for 1968 and 1970), I get the following error; can you look into it?

In file included from ../src/wifi/model/wifi-phy.cc:21:0:
../src/wifi/model/wifi-phy.h: In static member function ‘static double ns3::WifiPhy::GetPayloadDurationMicroSeconds(uint32_t, ns3::WifiTxVector)’:
../src/wifi/model/wifi-phy.h:1164:10: error: invalid use of member ‘ns3::WifiPhy::m_channelStartingFrequency’ in static member function
   double m_channelStartingFrequency; //!< Standard-dependent center frequency of 0-th channel in MHz
          ^
../src/wifi/model/wifi-phy.cc:423:13: error: from this location
         if (m_channelStartingFrequency>=2400 && m_channelStartingFrequency<=2500)
             ^
In file included from ../src/wifi/model/wifi-phy.cc:21:0:
../src/wifi/model/wifi-phy.h:1164:10: error: invalid use of member ‘ns3::WifiPhy::m_channelStartingFrequency’ in static member function
   double m_channelStartingFrequency; //!< Standard-dependent center frequency of 0-th channel in MHz
          ^
../src/wifi/model/wifi-phy.cc:423:49: error: from this location
         if (m_channelStartingFrequency>=2400 && m_channelStartingFrequency<=2500)
                                                 ^
Comment 2 sebastien.deronne 2014-10-16 16:42:06 EDT
OK Tom, I'll look at that this weekend.
I'll post a new patch based on the upgraded ns-3-dev repo.
Comment 3 sebastien.deronne 2014-10-18 05:15:54 EDT
Tom, there are two solutions to solve this problem:

1. We no more use static functions for CalculateTxDuration and for GetPayloadDurationMicroSeconds (defined in WifiPhy.h)

2. We add an argument in CalculateTxDuration and for GetPayloadDurationMicroSeconds to indicate the operating frequency.

In my initial code, I used the first solution (that I accidentally forgot to include in the patch, which explains the obtained error). But I think the second solution is maybe more appropriate.

What is your opinion?
Comment 4 Tom Henderson 2014-10-20 10:01:48 EDT
(In reply to sebastien.deronne from comment #3)
> Tom, there are two solutions to solve this problem:
> 
> 1. We no more use static functions for CalculateTxDuration and for
> GetPayloadDurationMicroSeconds (defined in WifiPhy.h)
> 
> 2. We add an argument in CalculateTxDuration and for
> GetPayloadDurationMicroSeconds to indicate the operating frequency.
> 
> In my initial code, I used the first solution (that I accidentally forgot to
> include in the patch, which explains the obtained error). But I think the
> second solution is maybe more appropriate.
> 
> What is your opinion?


It seems to me that the second solution is more in keeping with the overall design to avoid private members in the base class (other than trace sources).
Comment 5 sebastien.deronne 2014-10-20 16:47:22 EDT
Created attachment 1909 [details]
patch v2
Comment 6 sebastien.deronne 2014-10-20 16:48:25 EDT
Tom, I attached the new patch which addresses this issue using the second solution.
Comment 7 Tom Henderson 2014-10-22 09:34:17 EDT
(In reply to sebastien.deronne from comment #6)
> Tom, I attached the new patch which addresses this issue using the second
> solution.

Looks fine to me; I'll reschedule applying this to next week to give opportunity for others to comment on the API change that cuts across modules.
Comment 8 Tom Henderson 2014-10-29 21:20:00 EDT
I pushed the v2 patch in changeset 11041:f353014f08e9 with a couple of changes:

- added a bit of doxygen for new parameters
- the test devices-wifi-tx-duration was extended to cover the new signal durations