View | Details | Raw Unified | Return to bug 2003
Collapse All | Expand All

(-)a/src/wifi/model/ap-wifi-mac.cc (-1 / +13 lines)
 Lines 334-339    Link Here 
334
  return rates;
334
  return rates;
335
}
335
}
336
336
337
CapabilityInformation
338
ApWifiMac::GetCapabilities (void) const
339
{
340
  CapabilityInformation capabilities;
341
  capabilities.SetShortPreamble (m_phy->GetShortPlcpPreamble ());
342
  return capabilities;
343
}
344
337
HtCapabilities
345
HtCapabilities
338
ApWifiMac::GetHtCapabilities (void) const
346
ApWifiMac::GetHtCapabilities (void) const
339
{
347
{
 Lines 417-422    Link Here 
417
  probe.SetSsid (GetSsid ());
425
  probe.SetSsid (GetSsid ());
418
  probe.SetSupportedRates (GetSupportedRates ());
426
  probe.SetSupportedRates (GetSupportedRates ());
419
  probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
427
  probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
428
  probe.SetCapabilities (GetCapabilities ());
420
  if (m_htSupported || m_vhtSupported)
429
  if (m_htSupported || m_vhtSupported)
421
    {
430
    {
422
      probe.SetHtCapabilities (GetHtCapabilities ());
431
      probe.SetHtCapabilities (GetHtCapabilities ());
 Lines 459-465    Link Here 
459
    }
468
    }
460
  assoc.SetSupportedRates (GetSupportedRates ());
469
  assoc.SetSupportedRates (GetSupportedRates ());
461
  assoc.SetStatusCode (code);
470
  assoc.SetStatusCode (code);
462
471
  assoc.SetCapabilities (GetCapabilities ());
463
  if (m_htSupported || m_vhtSupported)
472
  if (m_htSupported || m_vhtSupported)
464
    {
473
    {
465
      assoc.SetHtCapabilities (GetHtCapabilities ());
474
      assoc.SetHtCapabilities (GetHtCapabilities ());
 Lines 494-499    Link Here 
494
  beacon.SetSsid (GetSsid ());
503
  beacon.SetSsid (GetSsid ());
495
  beacon.SetSupportedRates (GetSupportedRates ());
504
  beacon.SetSupportedRates (GetSupportedRates ());
496
  beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
505
  beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
506
  beacon.SetCapabilities (GetCapabilities ());
497
  if (m_htSupported || m_vhtSupported)
507
  if (m_htSupported || m_vhtSupported)
498
    {
508
    {
499
      beacon.SetHtCapabilities (GetHtCapabilities ());
509
      beacon.SetHtCapabilities (GetHtCapabilities ());
 Lines 630-635    Link Here 
630
              //rate set is compatible with our Basic Rate set
640
              //rate set is compatible with our Basic Rate set
631
              MgtAssocRequestHeader assocReq;
641
              MgtAssocRequestHeader assocReq;
632
              packet->RemoveHeader (assocReq);
642
              packet->RemoveHeader (assocReq);
643
              CapabilityInformation capabilities = assocReq.GetCapabilities ();
644
              m_stationManager->AddSupportedPlcpPreamble (from, capabilities.IsShortPreamble ());
633
              SupportedRates rates = assocReq.GetSupportedRates ();
645
              SupportedRates rates = assocReq.GetSupportedRates ();
634
              bool problem = false;
646
              bool problem = false;
635
              for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
647
              for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
(-)a/src/wifi/model/ap-wifi-mac.h (-1 / +8 lines)
 Lines 24-34    Link Here 
24
#define AP_WIFI_MAC_H
24
#define AP_WIFI_MAC_H
25
25
26
#include "regular-wifi-mac.h"
26
#include "regular-wifi-mac.h"
27
#include "capability-information.h"
27
#include "ht-capabilities.h"
28
#include "ht-capabilities.h"
29
#include "vht-capabilities.h"
28
#include "amsdu-subframe-header.h"
30
#include "amsdu-subframe-header.h"
29
#include "supported-rates.h"
31
#include "supported-rates.h"
30
#include "ns3/random-variable-stream.h"
32
#include "ns3/random-variable-stream.h"
31
#include "vht-capabilities.h"
32
33
33
namespace ns3 {
34
namespace ns3 {
34
35
 Lines 181-186    Link Here 
181
   */
182
   */
182
  void SendOneBeacon (void);
183
  void SendOneBeacon (void);
183
  /**
184
  /**
185
   * Return the Capability information of the current AP.
186
   *
187
   * \return the Capability information that we support
188
   */
189
  CapabilityInformation GetCapabilities (void) const;
190
  /**
184
   * Return the HT capability of the current AP.
191
   * Return the HT capability of the current AP.
185
   *
192
   *
186
   * \return the HT capability that we support
193
   * \return the HT capability that we support
(-)a/src/wifi/model/capability-information.cc (+17 lines)
 Lines 47-52    Link Here 
47
  Set (1);
47
  Set (1);
48
}
48
}
49
49
50
void
51
CapabilityInformation::SetShortPreamble (bool shortPreamble)
52
{
53
  NS_LOG_FUNCTION (this);
54
  if (shortPreamble)
55
    {
56
      Set (5);
57
    }
58
}
59
50
bool
60
bool
51
CapabilityInformation::IsEss (void) const
61
CapabilityInformation::IsEss (void) const
52
{
62
{
 Lines 61-66    Link Here 
61
  return Is (1);
71
  return Is (1);
62
}
72
}
63
73
74
bool
75
CapabilityInformation::IsShortPreamble (void) const
76
{
77
  NS_LOG_FUNCTION (this);
78
  return Is (5);
79
}
80
64
void
81
void
65
CapabilityInformation::Set (uint8_t n)
82
CapabilityInformation::Set (uint8_t n)
66
{
83
{
(-)a/src/wifi/model/capability-information.h (+16 lines)
 Lines 46-51    Link Here 
46
   * in the capability information field.
46
   * in the capability information field.
47
   */
47
   */
48
  void SetIbss (void);
48
  void SetIbss (void);
49
  /**
50
   * Set the short preamble bit
51
   * in the capability information field.
52
   *
53
   * shortPreamble the short preamble bit
54
   *
55
   */
56
  void SetShortPreamble (bool shortPreamble);
49
57
50
  /**
58
  /**
51
   * Check if the Extended Service Set (ESS) bit
59
   * Check if the Extended Service Set (ESS) bit
 Lines 63-68    Link Here 
63
   *         field is set to 1
71
   *         field is set to 1
64
   */
72
   */
65
  bool IsIbss (void) const;
73
  bool IsIbss (void) const;
74
  /**
75
   * Check if the short preamble bit
76
   * in the capability information field is set to 1.
77
   *
78
   * \return short preamble bit in the capability information
79
   *         field is set to 1
80
   */
81
  bool IsShortPreamble (void) const;
66
82
67
  /**
83
  /**
68
   * Return the serialized size of capability
84
   * Return the serialized size of capability
(-)a/src/wifi/model/mac-low.cc (+24 lines)
 Lines 1422-1427    Link Here 
1422
    {
1422
    {
1423
      preamble = WIFI_PREAMBLE_HT_MF;
1423
      preamble = WIFI_PREAMBLE_HT_MF;
1424
    }
1424
    }
1425
  else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ()))
1426
    {
1427
      preamble = WIFI_PREAMBLE_SHORT;
1428
    }
1425
  else
1429
  else
1426
    {
1430
    {
1427
      preamble = WIFI_PREAMBLE_LONG;
1431
      preamble = WIFI_PREAMBLE_LONG;
 Lines 1458-1463    Link Here 
1458
        {
1462
        {
1459
          preamble = WIFI_PREAMBLE_HT_MF;
1463
          preamble = WIFI_PREAMBLE_HT_MF;
1460
        }
1464
        }
1465
      else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ()))
1466
        {
1467
          preamble = WIFI_PREAMBLE_SHORT;
1468
        }
1461
      else
1469
      else
1462
        {
1470
        {
1463
          preamble = WIFI_PREAMBLE_LONG;
1471
          preamble = WIFI_PREAMBLE_LONG;
 Lines 1862-1867    Link Here 
1862
    {
1870
    {
1863
      preamble = WIFI_PREAMBLE_HT_MF;
1871
      preamble = WIFI_PREAMBLE_HT_MF;
1864
    }
1872
    }
1873
  else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ()))
1874
    {
1875
      preamble = WIFI_PREAMBLE_SHORT;
1876
    }
1865
  else
1877
  else
1866
    {
1878
    {
1867
      preamble = WIFI_PREAMBLE_LONG;
1879
      preamble = WIFI_PREAMBLE_LONG;
 Lines 1946-1951    Link Here 
1946
    {
1958
    {
1947
      preamble = WIFI_PREAMBLE_HT_MF;
1959
      preamble = WIFI_PREAMBLE_HT_MF;
1948
    }
1960
    }
1961
  else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ()))
1962
    {
1963
      preamble = WIFI_PREAMBLE_SHORT;
1964
    }
1949
  else
1965
  else
1950
    {
1966
    {
1951
      preamble = WIFI_PREAMBLE_LONG;
1967
      preamble = WIFI_PREAMBLE_LONG;
 Lines 2176-2181    Link Here 
2176
    {
2192
    {
2177
      preamble = WIFI_PREAMBLE_HT_MF;
2193
      preamble = WIFI_PREAMBLE_HT_MF;
2178
    }
2194
    }
2195
  else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ()))
2196
    {
2197
      preamble = WIFI_PREAMBLE_SHORT;
2198
    }
2179
  else
2199
  else
2180
    {
2200
    {
2181
      preamble = WIFI_PREAMBLE_LONG;
2201
      preamble = WIFI_PREAMBLE_LONG;
 Lines 2814-2819    Link Here 
2814
    {
2834
    {
2815
      preamble = WIFI_PREAMBLE_HT_MF;
2835
      preamble = WIFI_PREAMBLE_HT_MF;
2816
    }
2836
    }
2837
  else if (m_phy->GetShortPlcpPreamble () && m_stationManager->GetShortPreambleSupported (m_currentHdr.GetAddr1 ()))
2838
    {
2839
      preamble = WIFI_PREAMBLE_SHORT;
2840
    }
2817
  else
2841
  else
2818
    {
2842
    {
2819
      preamble = WIFI_PREAMBLE_LONG;
2843
      preamble = WIFI_PREAMBLE_LONG;
(-)a/src/wifi/model/mgt-headers.cc (-9 / +45 lines)
 Lines 186-191    Link Here 
186
}
186
}
187
187
188
void
188
void
189
MgtProbeResponseHeader::SetCapabilities (CapabilityInformation capabilities)
190
{
191
  m_capability = capabilities;
192
}
193
194
CapabilityInformation
195
MgtProbeResponseHeader::GetCapabilities (void) const
196
{
197
  return m_capability;
198
}
199
200
void
189
MgtProbeResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities)
201
MgtProbeResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities)
190
{
202
{
191
  m_htCapability = htcapabilities;
203
  m_htCapability = htcapabilities;
 Lines 358-372    Link Here 
358
}
370
}
359
371
360
void
372
void
373
MgtAssocRequestHeader::SetListenInterval (uint16_t interval)
374
{
375
  m_listenInterval = interval;
376
}
377
378
void
379
MgtAssocRequestHeader::SetCapabilities (CapabilityInformation capabilities)
380
{
381
  m_capability = capabilities;
382
}
383
384
CapabilityInformation
385
MgtAssocRequestHeader::GetCapabilities (void) const
386
{
387
  return m_capability;
388
}
389
390
void
361
MgtAssocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities)
391
MgtAssocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities)
362
{
392
{
363
  m_htCapability = htcapabilities;
393
  m_htCapability = htcapabilities;
364
}
394
}
365
395
366
void
396
HtCapabilities
367
MgtAssocRequestHeader::SetListenInterval (uint16_t interval)
397
MgtAssocRequestHeader::GetHtCapabilities (void) const
368
{
398
{
369
  m_listenInterval = interval;
399
  return m_htCapability;
370
}
400
}
371
401
372
void
402
void
 Lines 381-392    Link Here 
381
  return m_vhtCapability;
411
  return m_vhtCapability;
382
}
412
}
383
413
384
HtCapabilities
385
MgtAssocRequestHeader::GetHtCapabilities (void) const
386
{
387
  return m_htCapability;
388
}
389
390
Ssid
414
Ssid
391
MgtAssocRequestHeader::GetSsid (void) const
415
MgtAssocRequestHeader::GetSsid (void) const
392
{
416
{
 Lines 513-518    Link Here 
513
}
537
}
514
538
515
void
539
void
540
MgtAssocResponseHeader::SetCapabilities (CapabilityInformation capabilities)
541
{
542
  m_capability = capabilities;
543
}
544
545
CapabilityInformation
546
MgtAssocResponseHeader::GetCapabilities (void) const
547
{
548
  return m_capability;
549
}
550
551
void
516
MgtAssocResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities)
552
MgtAssocResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities)
517
{
553
{
518
  m_htCapability = htcapabilities;
554
  m_htCapability = htcapabilities;
(-)a/src/wifi/model/mgt-headers.h (-13 / +47 lines)
 Lines 31-37    Link Here 
31
#include "supported-rates.h"
31
#include "supported-rates.h"
32
#include "ssid.h"
32
#include "ssid.h"
33
#include "ht-capabilities.h"
33
#include "ht-capabilities.h"
34
#include "ht-capabilities.h"
35
#include "vht-capabilities.h"
34
#include "vht-capabilities.h"
36
35
37
namespace ns3 {
36
namespace ns3 {
 Lines 65-70    Link Here 
65
   */
64
   */
66
  void SetListenInterval (uint16_t interval);
65
  void SetListenInterval (uint16_t interval);
67
  /**
66
  /**
67
   * Set the Capability information.
68
   *
69
   * \param capabilities Capability information
70
   */
71
  void SetCapabilities (CapabilityInformation capabilities);
72
  /**
68
   * Set the HT capabilities.
73
   * Set the HT capabilities.
69
   *
74
   *
70
   * \param htcapabilities HT capabilities
75
   * \param htcapabilities HT capabilities
 Lines 77-94    Link Here 
77
    */
82
    */
78
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
83
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
79
  /**
84
  /**
80
  * Return the VHT capabilities.
85
   * Return the Capability information.
81
  *
86
   *
82
  * \return VHT capabilities
87
   * \return Capability information
83
  */
88
   */
84
  VhtCapabilities GetVhtCapabilities (void) const;
89
  CapabilityInformation GetCapabilities (void) const;
85
86
  /**
90
  /**
87
   * Return the HT capabilities.
91
   * Return the HT capabilities.
88
   *
92
   *
89
   * \return HT capabilities
93
   * \return HT capabilities
90
   */
94
   */
91
  HtCapabilities GetHtCapabilities (void) const;
95
  HtCapabilities GetHtCapabilities (void) const;
96
  /**
97
  * Return the VHT capabilities.
98
  *
99
  * \return VHT capabilities
100
  */
101
  VhtCapabilities GetVhtCapabilities (void) const;
92
102
93
  /**
103
  /**
94
   * Return the Service Set Identifier (SSID).
104
   * Return the Service Set Identifier (SSID).
 Lines 154-159    Link Here 
154
   */
164
   */
155
  SupportedRates GetSupportedRates (void);
165
  SupportedRates GetSupportedRates (void);
156
  /**
166
  /**
167
   * Return the Capability information.
168
   *
169
   * \return Capability information
170
   */
171
  CapabilityInformation GetCapabilities (void) const;
172
  /**
173
   * Set the Capability information.
174
   *
175
   * \param capabilities Capability information
176
   */
177
  void SetCapabilities (CapabilityInformation capabilities);
178
  /**
157
   * Return the HT capabilities.
179
   * Return the HT capabilities.
158
   *
180
   *
159
   * \return HT capabilities
181
   * \return HT capabilities
 Lines 319-348    Link Here 
319
   */
341
   */
320
  SupportedRates GetSupportedRates (void) const;
342
  SupportedRates GetSupportedRates (void) const;
321
  /**
343
  /**
344
   * Return the Capability information.
345
   *
346
   * \return Capability information
347
   */
348
  CapabilityInformation GetCapabilities (void) const;
349
  /**
322
   * Return the HT capabilities.
350
   * Return the HT capabilities.
323
   *
351
   *
324
   * \return HT capabilities
352
   * \return HT capabilities
325
   */
353
   */
326
  HtCapabilities GetHtCapabilities (void) const;
354
  HtCapabilities GetHtCapabilities (void) const;
327
  /**
355
  /**
328
   * Set the VHT capabilities.
329
   *
330
   * \param vhtcapabilities VHT capabilities
331
   */
332
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
333
  /**
334
  * Return the VHT capabilities.
356
  * Return the VHT capabilities.
335
  *
357
  *
336
  * \return VHT capabilities
358
  * \return VHT capabilities
337
  */
359
  */
338
  VhtCapabilities GetVhtCapabilities (void) const;
360
  VhtCapabilities GetVhtCapabilities (void) const;
339
  /**
361
  /**
362
   * Set the Capability information.
363
   *
364
   * \param capabilities Capability information
365
   */
366
  void SetCapabilities (CapabilityInformation capabilities);
367
  /**
340
   * Set the HT capabilities.
368
   * Set the HT capabilities.
341
   *
369
   *
342
   * \param htcapabilities HT capabilities
370
   * \param htcapabilities HT capabilities
343
   */
371
   */
344
  void SetHtCapabilities (HtCapabilities htcapabilities);
372
  void SetHtCapabilities (HtCapabilities htcapabilities);
345
  /**
373
  /**
374
   * Set the VHT capabilities.
375
   *
376
   * \param vhtcapabilities VHT capabilities
377
   */
378
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
379
  /**
346
   * Set the Service Set Identifier (SSID).
380
   * Set the Service Set Identifier (SSID).
347
   *
381
   *
348
   * \param ssid SSID
382
   * \param ssid SSID
(-)a/src/wifi/model/sta-wifi-mac.cc (+11 lines)
 Lines 222-227    Link Here 
222
  MgtAssocRequestHeader assoc;
222
  MgtAssocRequestHeader assoc;
223
  assoc.SetSsid (GetSsid ());
223
  assoc.SetSsid (GetSsid ());
224
  assoc.SetSupportedRates (GetSupportedRates ());
224
  assoc.SetSupportedRates (GetSupportedRates ());
225
  assoc.SetCapabilities (GetCapabilities ());
225
  if (m_htSupported || m_vhtSupported)
226
  if (m_htSupported || m_vhtSupported)
226
    {
227
    {
227
      assoc.SetHtCapabilities (GetHtCapabilities ());
228
      assoc.SetHtCapabilities (GetHtCapabilities ());
 Lines 558-563    Link Here 
558
        {
559
        {
559
          MgtAssocResponseHeader assocResp;
560
          MgtAssocResponseHeader assocResp;
560
          packet->RemoveHeader (assocResp);
561
          packet->RemoveHeader (assocResp);
562
          CapabilityInformation capabilities = assocResp.GetCapabilities ();
563
          m_stationManager->AddSupportedPlcpPreamble (hdr->GetAddr2 (), capabilities.IsShortPreamble ());
561
          if (m_assocRequestEvent.IsRunning ())
564
          if (m_assocRequestEvent.IsRunning ())
562
            {
565
            {
563
              m_assocRequestEvent.Cancel ();
566
              m_assocRequestEvent.Cancel ();
 Lines 655-660    Link Here 
655
  return rates;
658
  return rates;
656
}
659
}
657
660
661
CapabilityInformation
662
StaWifiMac::GetCapabilities (void) const
663
{
664
  CapabilityInformation capabilities;
665
  capabilities.SetShortPreamble (m_phy->GetShortPlcpPreamble ());
666
  return capabilities;
667
}
668
658
HtCapabilities
669
HtCapabilities
659
StaWifiMac::GetHtCapabilities (void) const
670
StaWifiMac::GetHtCapabilities (void) const
660
{
671
{
(-)a/src/wifi/model/sta-wifi-mac.h (-2 / +9 lines)
 Lines 28-33    Link Here 
28
#include "ns3/traced-callback.h"
28
#include "ns3/traced-callback.h"
29
#include "supported-rates.h"
29
#include "supported-rates.h"
30
#include "amsdu-subframe-header.h"
30
#include "amsdu-subframe-header.h"
31
#include "capability-information.h"
31
32
32
namespace ns3  {
33
namespace ns3  {
33
34
 Lines 171-183    Link Here 
171
   */
172
   */
172
  void SetState (enum MacState value);
173
  void SetState (enum MacState value);
173
  /**
174
  /**
174
   * Return the HT capability of the current AP.
175
   * Return the Capability information of the current STA.
176
   *
177
   * \return the Capability information that we support
178
   */
179
  CapabilityInformation GetCapabilities (void) const;
180
  /**
181
   * Return the HT capability of the current STA.
175
   *
182
   *
176
   * \return the HT capability that we support
183
   * \return the HT capability that we support
177
   */
184
   */
178
  HtCapabilities GetHtCapabilities (void) const;
185
  HtCapabilities GetHtCapabilities (void) const;
179
  /**
186
  /**
180
   * Return the VHT capability of the current AP.
187
   * Return the VHT capability of the current STA.
181
   *
188
   *
182
   * \return the VHT capability that we support
189
   * \return the VHT capability that we support
183
   */
190
   */
(-)a/src/wifi/model/wifi-phy.cc (-3 / +3 lines)
 Lines 262-268    Link Here 
262
      return WifiPhy::GetErpOfdmRate6Mbps ();
262
      return WifiPhy::GetErpOfdmRate6Mbps ();
263
    case WIFI_MOD_CLASS_DSSS:
263
    case WIFI_MOD_CLASS_DSSS:
264
    case WIFI_MOD_CLASS_HR_DSSS:
264
    case WIFI_MOD_CLASS_HR_DSSS:
265
      if (preamble == WIFI_PREAMBLE_LONG)
265
      if (preamble == WIFI_PREAMBLE_LONG || payloadMode == WifiPhy::GetDsssRate1Mbps ())
266
        {
266
        {
267
          //(Section 16.2.3 "PLCP field definitions" and Section 17.2.2.2 "Long PPDU format"; IEEE Std 802.11-2012)
267
          //(Section 16.2.3 "PLCP field definitions" and Section 17.2.2.2 "Long PPDU format"; IEEE Std 802.11-2012)
268
          return WifiPhy::GetDsssRate1Mbps ();
268
          return WifiPhy::GetDsssRate1Mbps ();
 Lines 326-332    Link Here 
326
      return MicroSeconds (4);
326
      return MicroSeconds (4);
327
    case WIFI_MOD_CLASS_DSSS:
327
    case WIFI_MOD_CLASS_DSSS:
328
    case WIFI_MOD_CLASS_HR_DSSS:
328
    case WIFI_MOD_CLASS_HR_DSSS:
329
      if (preamble == WIFI_PREAMBLE_SHORT)
329
      if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22, 0, 1) > 1000000))
330
        {
330
        {
331
          //(Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
331
          //(Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
332
          return MicroSeconds (24);
332
          return MicroSeconds (24);
 Lines 378-384    Link Here 
378
      return MicroSeconds (16);
378
      return MicroSeconds (16);
379
    case WIFI_MOD_CLASS_DSSS:
379
    case WIFI_MOD_CLASS_DSSS:
380
    case WIFI_MOD_CLASS_HR_DSSS:
380
    case WIFI_MOD_CLASS_HR_DSSS:
381
      if (preamble == WIFI_PREAMBLE_SHORT)
381
      if ((preamble == WIFI_PREAMBLE_SHORT) && (txVector.GetMode ().GetDataRate (22, 0, 1) > 1000000))
382
        {
382
        {
383
          //(Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
383
          //(Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
384
          return MicroSeconds (72);
384
          return MicroSeconds (72);
(-)a/src/wifi/model/wifi-phy.h (+8 lines)
 Lines 1220-1225    Link Here 
1220
   */
1220
   */
1221
  virtual bool GetGreenfield (void) const = 0;
1221
  virtual bool GetGreenfield (void) const = 0;
1222
  /**
1222
  /**
1223
   * \param shortPreamble Enable or disable short PLCP preamble
1224
   */
1225
  virtual void SetShortPlcpPreamble (bool shortPreamble) = 0;
1226
  /**
1227
   * \return true if short PLCP preamble is supported, false otherwise
1228
   */
1229
  virtual bool GetShortPlcpPreamble (void) const = 0;
1230
  /**
1223
   * \return the channel width
1231
   * \return the channel width
1224
   */
1232
   */
1225
  virtual uint32_t GetChannelWidth (void) const = 0;
1233
  virtual uint32_t GetChannelWidth (void) const = 0;
(-)a/src/wifi/model/wifi-remote-station-manager.cc (+22 lines)
 Lines 480-485    Link Here 
480
}
480
}
481
481
482
void
482
void
483
WifiRemoteStationManager::AddSupportedPlcpPreamble (Mac48Address address, bool isShortPreambleSupported)
484
{
485
  NS_LOG_FUNCTION (this << address << isShortPreambleSupported);
486
  NS_ASSERT (!address.IsGroup ());
487
  WifiRemoteStationState *state = LookupState (address);
488
  state->m_shortPreamble = isShortPreambleSupported;
489
}
490
491
void
483
WifiRemoteStationManager::AddSupportedMode (Mac48Address address, WifiMode mode)
492
WifiRemoteStationManager::AddSupportedMode (Mac48Address address, WifiMode mode)
484
{
493
{
485
  NS_LOG_FUNCTION (this << address << mode);
494
  NS_LOG_FUNCTION (this << address << mode);
 Lines 1305-1310    Link Here 
1305
  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1314
  state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1306
  state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval ();
1315
  state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval ();
1307
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1316
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1317
  state->m_shortPreamble = m_wifiPhy->GetShortPlcpPreamble ();
1308
  state->m_rx = 1;
1318
  state->m_rx = 1;
1309
  state->m_tx = 1;
1319
  state->m_tx = 1;
1310
  state->m_ness = 0;
1320
  state->m_ness = 0;
 Lines 1401-1406    Link Here 
1401
  return LookupState (address)->m_greenfield;
1411
  return LookupState (address)->m_greenfield;
1402
}
1412
}
1403
1413
1414
bool
1415
WifiRemoteStationManager::GetShortPreambleSupported (Mac48Address address) const
1416
{
1417
  return LookupState (address)->m_shortPreamble;
1418
}
1419
1404
WifiMode
1420
WifiMode
1405
WifiRemoteStationManager::GetDefaultMode (void) const
1421
WifiRemoteStationManager::GetDefaultMode (void) const
1406
{
1422
{
 Lines 1561-1566    Link Here 
1561
}
1577
}
1562
1578
1563
bool
1579
bool
1580
WifiRemoteStationManager::GetShortPreamble (const WifiRemoteStation *station) const
1581
{
1582
  return station->m_state->m_shortPreamble;
1583
}
1584
1585
bool
1564
WifiRemoteStationManager::GetAggregation (const WifiRemoteStation *station) const
1586
WifiRemoteStationManager::GetAggregation (const WifiRemoteStation *station) const
1565
{
1587
{
1566
  return station->m_state->m_aggregation;
1588
  return station->m_state->m_aggregation;
(-)a/src/wifi/model/wifi-remote-station-manager.h (-2 / +28 lines)
 Lines 244-249    Link Here 
244
   */
244
   */
245
  bool GetGreenfieldSupported (Mac48Address address) const;
245
  bool GetGreenfieldSupported (Mac48Address address) const;
246
  /**
246
  /**
247
   * Return whether the station supports short PLCP preamble or not.
248
   *
249
   * \param address the address of the station
250
   *
251
   * \return true if short PLCP preamble is supported by the station,
252
   *         false otherwise
253
   */
254
  bool GetShortPreambleSupported (Mac48Address address) const;
255
  /**
247
   * Add a given Modulation and Coding Scheme (MCS) index to
256
   * Add a given Modulation and Coding Scheme (MCS) index to
248
   * the set of basic MCS.
257
   * the set of basic MCS.
249
   *
258
   *
 Lines 285-291    Link Here 
285
   */
294
   */
286
  WifiMode GetNonUnicastMode (void) const;
295
  WifiMode GetNonUnicastMode (void) const;
287
296
288
289
  /**
297
  /**
290
   * Invoked in an AP upon disassociation of a
298
   * Invoked in an AP upon disassociation of a
291
   * specific STA.
299
   * specific STA.
 Lines 315-320    Link Here 
315
  void AddAllSupportedModes (Mac48Address address);
323
  void AddAllSupportedModes (Mac48Address address);
316
324
317
  /**
325
  /**
326
   * Record whether the short PLCP preamble is supported by the station.
327
   *
328
   * \param address the address of the station
329
   * \param isShortPreambleSupported whether or not short PLCP preamble is supported by the station
330
   */
331
  void AddSupportedPlcpPreamble (Mac48Address address, bool isShortPreambleSupported);
332
333
  /**
318
   * Return whether the station state is brand new.
334
   * Return whether the station state is brand new.
319
   *
335
   *
320
   * \param address the address of the station
336
   * \param address the address of the station
 Lines 713-718    Link Here 
713
   */
729
   */
714
  bool GetGreenfield (const WifiRemoteStation *station) const;
730
  bool GetGreenfield (const WifiRemoteStation *station) const;
715
  /**
731
  /**
732
   * Return whether the station supports short PLCP preamble or not.
733
   *
734
   * \param station the station being queried
735
   *
736
   * \return true if short PLCP preamble is supported by the station,
737
   *         false otherwise
738
   */
739
  bool GetShortPreamble (const WifiRemoteStation *station) const;
740
  /**
716
   * Return the number of receive antennas the station has.
741
   * Return the number of receive antennas the station has.
717
   *
742
   *
718
   * \param station the station being queried
743
   * \param station the station being queried
 Lines 1114-1120    Link Here 
1114
  uint32_t m_ness;            //!< Number of streams in beamforming of the remote station
1139
  uint32_t m_ness;            //!< Number of streams in beamforming of the remote station
1115
  bool m_stbc;                //!< Flag if STBC is used by the remote station
1140
  bool m_stbc;                //!< Flag if STBC is used by the remote station
1116
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
1141
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
1117
  bool m_greenfield;          //!< Flag if green field is used by the remote station
1142
  bool m_greenfield;          //!< Flag if greenfield is used by the remote station
1143
  bool m_shortPreamble;       //!< Flag if short PLCP preamble is used by the remote station
1118
};
1144
};
1119
1145
1120
/**
1146
/**
(-)a/src/wifi/model/yans-wifi-phy.cc (+18 lines)
 Lines 167-172    Link Here 
167
                   MakeBooleanAccessor (&YansWifiPhy::GetGreenfield,
167
                   MakeBooleanAccessor (&YansWifiPhy::GetGreenfield,
168
                                        &YansWifiPhy::SetGreenfield),
168
                                        &YansWifiPhy::SetGreenfield),
169
                   MakeBooleanChecker ())
169
                   MakeBooleanChecker ())
170
    .AddAttribute ("ShortPlcpPreambleEnabled",
171
                   "Whether or not short PLCP preamble is enabled.",
172
                   BooleanValue (false),
173
                   MakeBooleanAccessor (&YansWifiPhy::GetShortPlcpPreamble,
174
                                        &YansWifiPhy::SetShortPlcpPreamble),
175
                   MakeBooleanChecker ())
170
    .AddAttribute ("ChannelWidth",
176
    .AddAttribute ("ChannelWidth",
171
                   "Whether 5MHz, 10MHz, 20MHz, 22MHz, 40MHz, 80 MHz or 160 MHz.",
177
                   "Whether 5MHz, 10MHz, 20MHz, 22MHz, 40MHz, 80 MHz or 160 MHz.",
172
                   UintegerValue (20),
178
                   UintegerValue (20),
 Lines 1278-1283    Link Here 
1278
  return m_greenfield;
1284
  return m_greenfield;
1279
}
1285
}
1280
1286
1287
bool
1288
YansWifiPhy::GetShortPlcpPreamble (void) const
1289
{
1290
  return m_plcpPreamble;
1291
}
1292
1293
void
1294
YansWifiPhy::SetShortPlcpPreamble (bool preamble)
1295
{
1296
  m_plcpPreamble = preamble;
1297
}
1298
1281
void
1299
void
1282
YansWifiPhy::SetChannelWidth (uint32_t channelwidth)
1300
YansWifiPhy::SetChannelWidth (uint32_t channelwidth)
1283
{
1301
{
(-)a/src/wifi/model/yans-wifi-phy.h (-1 / +13 lines)
 Lines 387-392    Link Here 
387
   */
387
   */
388
  virtual bool GetGreenfield (void) const;
388
  virtual bool GetGreenfield (void) const;
389
  /**
389
  /**
390
   * Enable or disable short PLCP preamble.
391
   *
392
   * \param sets short PLCP preamble is supported or not
393
   */
394
  virtual void SetShortPlcpPreamble (bool preamble);
395
  /**
396
   * Return whether short PLCP preamble is supported.
397
   *
398
   * \returns if short PLCP preamble is supported or not
399
   */
400
  virtual bool GetShortPlcpPreamble (void) const;
401
  /**
390
   * Return channel width.
402
   * Return channel width.
391
   *
403
   *
392
   * \return channel width
404
   * \return channel width
 Lines 528-534    Link Here 
528
  bool     m_greenfield;            //!< Flag if GreenField format is supported
540
  bool     m_greenfield;            //!< Flag if GreenField format is supported
529
  bool     m_guardInterval;         //!< Flag if short guard interval is used
541
  bool     m_guardInterval;         //!< Flag if short guard interval is used
530
  uint32_t m_channelWidth;          //!< Channel width
542
  uint32_t m_channelWidth;          //!< Channel width
531
543
  bool     m_plcpPreamble;          //!< Flag if short PLCP preamble is used
532
544
533
  /**
545
  /**
534
   * This vector holds the set of transmission modes that this
546
   * This vector holds the set of transmission modes that this
(-)a/src/wifi/test/tx-duration-test.cc (-4 / +4 lines)
 Lines 223-232    Link Here 
223
    && CheckTxDuration (1024, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4096 + 192)
223
    && CheckTxDuration (1024, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4096 + 192)
224
    && CheckTxDuration (1025, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4100 + 192)
224
    && CheckTxDuration (1025, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4100 + 192)
225
    && CheckTxDuration (1026, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4104 + 192)
225
    && CheckTxDuration (1026, WifiPhy::GetDsssRate2Mbps (), 22, false, WIFI_PREAMBLE_LONG, 4104 + 192)
226
    && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8184 + 96)
226
    && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8184 + 192)
227
    && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8192 + 96)
227
    && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8192 + 192)
228
    && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8200 + 96)
228
    && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8200 + 192)
229
    && CheckTxDuration (1026, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8208 + 96)
229
    && CheckTxDuration (1026, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_SHORT, 8208 + 192)
230
    && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8184 + 192)
230
    && CheckTxDuration (1023, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8184 + 192)
231
    && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8192 + 192)
231
    && CheckTxDuration (1024, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8192 + 192)
232
    && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8200 + 192)
232
    && CheckTxDuration (1025, WifiPhy::GetDsssRate1Mbps (), 22, false, WIFI_PREAMBLE_LONG, 8200 + 192)

Return to bug 2003