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

(-)a/src/wifi/model/ap-wifi-mac.cc (-14 / +36 lines)
 Lines 299-308   ApWifiMac::GetSupportedRates (void) const Link Here 
299
{
299
{
300
  NS_LOG_FUNCTION (this);
300
  NS_LOG_FUNCTION (this);
301
  SupportedRates rates;
301
  SupportedRates rates;
302
  //If it is an HT-AP then add the BSSMembershipSelectorSet
302
  //If it is an HT-AP or VHT-AP, then add the BSSMembershipSelectorSet
303
  //which only includes 127 for HT now. The standard says that the BSSMembershipSelectorSet
303
  //The standard says that the BSSMembershipSelectorSet
304
  //must have its MSB set to 1 (must be treated as a Basic Rate)
304
  //must have its MSB set to 1 (must be treated as a Basic Rate)
305
  //Also the standard mentioned that at leat 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
305
  //Also the standard mentioned that at least 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
306
  if (m_htSupported || m_vhtSupported)
306
  if (m_htSupported || m_vhtSupported)
307
    {
307
    {
308
      for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
308
      for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
 Lines 310-326   ApWifiMac::GetSupportedRates (void) const Link Here 
310
          rates.SetBasicRate (m_phy->GetBssMembershipSelector (i));
310
          rates.SetBasicRate (m_phy->GetBssMembershipSelector (i));
311
        }
311
        }
312
    }
312
    }
313
  // 
314
  uint8_t nss = 1;  // Number of spatial streams is 1 for non-MIMO modes
313
  //Send the set of supported rates and make sure that we indicate
315
  //Send the set of supported rates and make sure that we indicate
314
  //the Basic Rate set in this set of supported rates.
316
  //the Basic Rate set in this set of supported rates.
315
  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
317
  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
316
    {
318
    {
317
      WifiMode mode = m_phy->GetMode (i);
319
      WifiMode mode = m_phy->GetMode (i);
318
      rates.AddSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1));
320
      uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
321
      NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
322
      rates.AddSupportedRate (modeDataRate);
319
      //Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
323
      //Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
320
      //here we choose to add the mandatory rates to the BSSBasicRateSet,
324
      //here we choose to add the mandatory rates to the BSSBasicRateSet,
321
      //exept for 802.11b where we assume that only the non HR-DSSS rates are part of the BSSBasicRateSet
325
      //except for 802.11b where we assume that only the non HR-DSSS rates are part of the BSSBasicRateSet
322
      if (mode.IsMandatory () && (mode.GetModulationClass () != WIFI_MOD_CLASS_HR_DSSS))
326
      if (mode.IsMandatory () && (mode.GetModulationClass () != WIFI_MOD_CLASS_HR_DSSS))
323
        {
327
        {
328
          NS_LOG_DEBUG ("Adding basic mode " << mode.GetUniqueName ());
324
          m_stationManager->AddBasicMode (mode);
329
          m_stationManager->AddBasicMode (mode);
325
        }
330
        }
326
    }
331
    }
 Lines 328-334   ApWifiMac::GetSupportedRates (void) const Link Here 
328
  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
333
  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
329
    {
334
    {
330
      WifiMode mode = m_stationManager->GetBasicMode (j);
335
      WifiMode mode = m_stationManager->GetBasicMode (j);
331
      rates.SetBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1));
336
      uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
337
      NS_LOG_DEBUG ("Setting basic rate " << mode.GetUniqueName ());
338
      rates.SetBasicRate (modeDataRate);
332
    }
339
    }
333
340
334
  return rates;
341
  return rates;
 Lines 361-376   ApWifiMac::GetHtCapabilities (void) const Link Here 
361
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
368
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
362
        {
369
        {
363
          WifiMode mcs = m_phy->GetMcs (i);
370
          WifiMode mcs = m_phy->GetMcs (i);
371
          if (mcs.GetModulationClass () != WIFI_MOD_CLASS_HT)
372
            {
373
              continue;
374
            }
364
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
375
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
365
          if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_HT)
376
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
366
              && (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1) > maxSupportedRate))
377
          NS_ASSERT (nss > 0 && nss < 4);
378
          if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss) > maxSupportedRate)
367
            {
379
            {
368
              maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1);
380
              maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss);
381
              NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
369
            }
382
            }
370
        }
383
        }
371
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
384
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
372
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
385
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
373
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetNumberOfTransmitAntennas ());
386
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetSupportedTxSpatialStreams ());
374
    }
387
    }
375
  return capabilities;
388
  return capabilities;
376
}
389
}
 Lines 405-412   ApWifiMac::GetVhtCapabilities (void) const Link Here 
405
              maxMcs = mcs.GetMcsValue ();
418
              maxMcs = mcs.GetMcsValue ();
406
            }
419
            }
407
        }
420
        }
408
      capabilities.SetRxMcsMap (maxMcs, 1); //Only 1 SS is currently supported
421
      // Support same MaxMCS for each spatial stream 
409
      capabilities.SetTxMcsMap (maxMcs, 1); //Only 1 SS is currently supported
422
      for (uint8_t nss = 1; nss <= m_phy->GetSupportedRxSpatialStreams (); nss++)
423
        {
424
          capabilities.SetRxMcsMap (maxMcs, nss);
425
        }
426
      for (uint8_t nss = 1; nss <= m_phy->GetSupportedTxSpatialStreams (); nss++)
427
        {
428
          capabilities.SetTxMcsMap (maxMcs, nss);
429
        }
410
    }
430
    }
411
  return capabilities;
431
  return capabilities;
412
}
432
}
 Lines 649-655   ApWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) Link Here 
649
              for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
669
              for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
650
                {
670
                {
651
                  WifiMode mode = m_stationManager->GetBasicMode (i);
671
                  WifiMode mode = m_stationManager->GetBasicMode (i);
652
                  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
672
                  uint8_t nss = 1; // Assume 1 spatial stream in basic mode
673
                  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
653
                    {
674
                    {
654
                      problem = true;
675
                      problem = true;
655
                      break;
676
                      break;
 Lines 697-703   ApWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) Link Here 
697
                  for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
718
                  for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
698
                    {
719
                    {
699
                      WifiMode mode = m_phy->GetMode (j);
720
                      WifiMode mode = m_phy->GetMode (j);
700
                      if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
721
                      uint8_t nss = 1; // Assume 1 spatial stream in basic mode
722
                      if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
701
                        {
723
                        {
702
                          m_stationManager->AddSupportedMode (from, mode);
724
                          m_stationManager->AddSupportedMode (from, mode);
703
                        }
725
                        }
(-)a/src/wifi/model/error-rate-model.cc (-4 / +2 lines)
 Lines 34-53   TypeId ErrorRateModel::GetTypeId (void) Link Here 
34
}
34
}
35
35
36
double
36
double
37
ErrorRateModel::CalculateSnr (WifiMode txMode, double ber) const
37
ErrorRateModel::CalculateSnr (WifiTxVector txVector, double ber) const
38
{
38
{
39
  //This is a very simple binary search.
39
  //This is a very simple binary search.
40
  double low, high, precision;
40
  double low, high, precision;
41
  low = 1e-25;
41
  low = 1e-25;
42
  high = 1e25;
42
  high = 1e25;
43
  precision = 1e-12;
43
  precision = 1e-12;
44
  WifiTxVector txVector;
45
  txVector.SetMode (txMode);
46
  while (high - low > precision)
44
  while (high - low > precision)
47
    {
45
    {
48
      NS_ASSERT (high >= low);
46
      NS_ASSERT (high >= low);
49
      double middle = low + (high - low) / 2;
47
      double middle = low + (high - low) / 2;
50
      if ((1 - GetChunkSuccessRate (txMode, txVector, middle, 1)) > ber)
48
      if ((1 - GetChunkSuccessRate (txVector.GetMode (), txVector, middle, 1)) > ber)
51
        {
49
        {
52
          low = middle;
50
          low = middle;
53
        }
51
        }
(-)a/src/wifi/model/error-rate-model.h (-4 / +11 lines)
 Lines 38-49   public: Link Here 
38
  static TypeId GetTypeId (void);
38
  static TypeId GetTypeId (void);
39
39
40
  /**
40
  /**
41
   * \param txMode a specific transmission mode
41
   * \param txVector a specific transmission vector including WifiMode
42
   * \param ber a target ber
42
   * \param ber a target ber
43
   *
43
   *
44
   * \return the snr which corresponds to the requested ber
44
   * \return the snr which corresponds to the requested ber
45
   */
45
   */
46
  double CalculateSnr (WifiMode txMode, double ber) const;
46
  double CalculateSnr (WifiTxVector txVector, double ber) const;
47
47
48
  /**
48
  /**
49
   * A pure virtual method that must be implemented in the subclass.
49
   * A pure virtual method that must be implemented in the subclass.
 Lines 54-61   public: Link Here 
54
   * The probability of successfully receiving the chunk depends on
54
   * The probability of successfully receiving the chunk depends on
55
   * the mode, the SNR, and the size of the chunk.
55
   * the mode, the SNR, and the size of the chunk.
56
   *
56
   *
57
   * \param mode the Wi-Fi mode the chunk is sent
57
   * Note that both a WifiMode and a WifiTxVector (which contains a WifiMode)
58
   * \param txvector TXVECTOR of the transmission
58
   * are passed into this method.  The WifiTxVector may be from a signal that
59
   * contains multiple modes (e.g. PLCP header sent differently from PLCP
60
   * payload).  Consequently, the mode parameter is what the method uses
61
   * to calculate the chunk error rate, and the txVector is used for 
62
   * other information as needed.
63
   *
64
   * \param mode the Wi-Fi mode applicable to this chunk
65
   * \param txvector TXVECTOR of the overall transmission
59
   * \param snr the SNR of the chunk
66
   * \param snr the SNR of the chunk
60
   * \param nbits the number of bits in this chunk
67
   * \param nbits the number of bits in this chunk
61
   *
68
   *
(-)a/src/wifi/model/ideal-wifi-manager.cc (-1 / +2 lines)
 Lines 72-78   IdealWifiManager::SetupPhy (Ptr<WifiPhy> phy) Link Here 
72
  for (uint32_t i = 0; i < nModes; i++)
72
  for (uint32_t i = 0; i < nModes; i++)
73
    {
73
    {
74
      WifiMode mode = phy->GetMode (i);
74
      WifiMode mode = phy->GetMode (i);
75
      AddModeSnrThreshold (mode, phy->CalculateSnr (mode, m_ber));
75
      WifiTxVector txVector (mode, 0, 0, false, 1, 1, 20, false, false);
76
      AddModeSnrThreshold (mode, phy->CalculateSnr (txVector, m_ber));
76
    }
77
    }
77
78
78
  WifiRemoteStationManager::SetupPhy (phy);
79
  WifiRemoteStationManager::SetupPhy (phy);
(-)a/src/wifi/model/interference-helper.cc (-1 / +1 lines)
 Lines 273-279   InterferenceHelper::CalculateChunkSuccessRate (double snir, Time duration, WifiM Link Here 
273
    {
273
    {
274
      return 1.0;
274
      return 1.0;
275
    }
275
    }
276
  uint32_t rate = mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1);
276
  uint32_t rate = mode.GetPhyRate (txVector);
277
  uint64_t nbits = (uint64_t)(rate * duration.GetSeconds ());
277
  uint64_t nbits = (uint64_t)(rate * duration.GetSeconds ());
278
  double csr = m_errorRateModel->GetChunkSuccessRate (mode, txVector, snir, (uint32_t)nbits);
278
  double csr = m_errorRateModel->GetChunkSuccessRate (mode, txVector, snir, (uint32_t)nbits);
279
  return csr;
279
  return csr;
(-)a/src/wifi/model/nist-error-rate-model.cc (-11 / +12 lines)
 Lines 250-263   double Link Here 
250
NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, double snr, uint32_t nbits) const
250
NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, double snr, uint32_t nbits) const
251
{
251
{
252
  NS_LOG_FUNCTION (this << mode << txVector.GetMode () << snr << nbits);
252
  NS_LOG_FUNCTION (this << mode << txVector.GetMode () << snr << nbits);
253
  uint8_t nss = txVector.GetNss ();
253
  if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM
254
  if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM
254
      || mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM
255
      || mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM
255
      || mode.GetModulationClass () == WIFI_MOD_CLASS_HT
256
      || mode.GetModulationClass () == WIFI_MOD_CLASS_HT
256
      || mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
257
      || mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
257
    {
258
    {
258
      if (mode.GetConstellationSize (1) == 2)
259
      if (mode.GetConstellationSize (nss) == 2)
259
        {
260
        {
260
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_1_2)
261
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_1_2)
261
            {
262
            {
262
              return GetFecBpskBer (snr,
263
              return GetFecBpskBer (snr,
263
                                    nbits,
264
                                    nbits,
 Lines 270-278   NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
270
                                    3); //b value
271
                                    3); //b value
271
            }
272
            }
272
        }
273
        }
273
      else if (mode.GetConstellationSize (1) == 4)
274
      else if (mode.GetConstellationSize (nss) == 4)
274
        {
275
        {
275
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_1_2)
276
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_1_2)
276
            {
277
            {
277
              return GetFecQpskBer (snr,
278
              return GetFecQpskBer (snr,
278
                                    nbits,
279
                                    nbits,
 Lines 285-293   NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
285
                                    3); //b value
286
                                    3); //b value
286
            }
287
            }
287
        }
288
        }
288
      else if (mode.GetConstellationSize (1) == 16)
289
      else if (mode.GetConstellationSize (nss) == 16)
289
        {
290
        {
290
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_1_2)
291
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_1_2)
291
            {
292
            {
292
              return GetFec16QamBer (snr,
293
              return GetFec16QamBer (snr,
293
                                     nbits,
294
                                     nbits,
 Lines 300-314   NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
300
                                     3); //b value
301
                                     3); //b value
301
            }
302
            }
302
        }
303
        }
303
      else if (mode.GetConstellationSize (1) == 64)
304
      else if (mode.GetConstellationSize (nss) == 64)
304
        {
305
        {
305
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_2_3)
306
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_2_3)
306
            {
307
            {
307
              return GetFec64QamBer (snr,
308
              return GetFec64QamBer (snr,
308
                                     nbits,
309
                                     nbits,
309
                                     2); //b value
310
                                     2); //b value
310
            }
311
            }
311
          else if (mode.GetCodeRate (1) == WIFI_CODE_RATE_5_6)
312
          else if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_5_6)
312
            {
313
            {
313
              return GetFec64QamBer (snr,
314
              return GetFec64QamBer (snr,
314
                                     nbits,
315
                                     nbits,
 Lines 321-329   NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
321
                                     3); //b value
322
                                     3); //b value
322
            }
323
            }
323
        }
324
        }
324
      else if (mode.GetConstellationSize (1) == 256)
325
      else if (mode.GetConstellationSize (nss) == 256)
325
        {
326
        {
326
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_5_6)
327
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_5_6)
327
            {
328
            {
328
              return GetFec256QamBer (snr,
329
              return GetFec256QamBer (snr,
329
                                      nbits,
330
                                      nbits,
(-)a/src/wifi/model/rraa-wifi-manager.cc (-1 / +2 lines)
 Lines 394-400   RraaWifiManager::GetThresholds (RraaWifiRemoteStation *station, Link Here 
394
struct RraaWifiManager::ThresholdsItem
394
struct RraaWifiManager::ThresholdsItem
395
RraaWifiManager::GetThresholds (WifiMode mode, RraaWifiRemoteStation *station) const
395
RraaWifiManager::GetThresholds (WifiMode mode, RraaWifiRemoteStation *station) const
396
{
396
{
397
  switch (mode.GetDataRate (GetChannelWidth (station), GetShortGuardInterval (station), 1) / 1000000)
397
  uint8_t nss = 1;  // This RAA only supports 1 spatial stream
398
  switch (mode.GetDataRate (GetChannelWidth (station), GetShortGuardInterval (station), nss) / 1000000)
398
    {
399
    {
399
    case 54:
400
    case 54:
400
      {
401
      {
(-)a/src/wifi/model/sta-wifi-mac.cc (-11 / +29 lines)
 Lines 544-553   StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) Link Here 
544
          for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
544
          for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
545
            {
545
            {
546
              WifiMode mode = m_phy->GetMode (i);
546
              WifiMode mode = m_phy->GetMode (i);
547
              if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
547
              uint8_t nss = 1; // Assume 1 spatial stream
548
              if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
548
                {
549
                {
549
                  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
550
                  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
550
                  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
551
                  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
551
                    {
552
                    {
552
                      m_stationManager->AddBasicMode (mode);
553
                      m_stationManager->AddBasicMode (mode);
553
                    }
554
                    }
 Lines 596-605   StaWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) Link Here 
596
              for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
597
              for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
597
                {
598
                {
598
                  WifiMode mode = m_phy->GetMode (i);
599
                  WifiMode mode = m_phy->GetMode (i);
599
                  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
600
                  uint8_t nss = 1; // Assume 1 spatial stream
601
                  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
600
                    {
602
                    {
601
                      m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
603
                      m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
602
                      if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
604
                      if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
603
                        {
605
                        {
604
                          m_stationManager->AddBasicMode (mode);
606
                          m_stationManager->AddBasicMode (mode);
605
                        }
607
                        }
 Lines 655-660   SupportedRates Link Here 
655
StaWifiMac::GetSupportedRates (void) const
657
StaWifiMac::GetSupportedRates (void) const
656
{
658
{
657
  SupportedRates rates;
659
  SupportedRates rates;
660
  uint8_t nss = 1;  // Number of spatial streams is 1 for non-MIMO modes
658
  if (m_htSupported || m_vhtSupported)
661
  if (m_htSupported || m_vhtSupported)
659
    {
662
    {
660
      for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
663
      for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
 Lines 665-671   StaWifiMac::GetSupportedRates (void) const Link Here 
665
  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
668
  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
666
    {
669
    {
667
      WifiMode mode = m_phy->GetMode (i);
670
      WifiMode mode = m_phy->GetMode (i);
668
      rates.AddSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1));
671
      uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
672
      NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
673
      rates.AddSupportedRate (modeDataRate);
669
    }
674
    }
670
  return rates;
675
  return rates;
671
}
676
}
 Lines 697-712   StaWifiMac::GetHtCapabilities (void) const Link Here 
697
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
702
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
698
        {
703
        {
699
          WifiMode mcs = m_phy->GetMcs (i);
704
          WifiMode mcs = m_phy->GetMcs (i);
705
          if (mcs.GetModulationClass () != WIFI_MOD_CLASS_HT)
706
            {
707
              continue;
708
            }
700
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
709
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
701
          if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_HT)
710
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
702
              && (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1) > maxSupportedRate))
711
          NS_ASSERT (nss > 0 && nss < 4);
712
          if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss) > maxSupportedRate)
703
            {
713
            {
704
              maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), 1);
714
              maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss);
715
              NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
705
            }
716
            }
706
        }
717
        }
707
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
718
      capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
708
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
719
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
709
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetNumberOfTransmitAntennas ());
720
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetSupportedTxSpatialStreams ());
710
    }
721
    }
711
  return capabilities;
722
  return capabilities;
712
}
723
}
 Lines 741-748   StaWifiMac::GetVhtCapabilities (void) const Link Here 
741
              maxMcs = mcs.GetMcsValue ();
752
              maxMcs = mcs.GetMcsValue ();
742
            }
753
            }
743
        }
754
        }
744
      capabilities.SetRxMcsMap (maxMcs, 1); //Only 1 SS is currently supported
755
      // Support same MaxMCS for each spatial stream
745
      capabilities.SetTxMcsMap (maxMcs, 1); //Only 1 SS is currently supported
756
      for (uint8_t nss = 1; nss <= m_phy->GetSupportedRxSpatialStreams (); nss++)
757
        {
758
          capabilities.SetRxMcsMap (maxMcs, nss);
759
        }
760
      for (uint8_t nss = 1; nss <= m_phy->GetSupportedTxSpatialStreams (); nss++)
761
        {
762
          capabilities.SetTxMcsMap (maxMcs, nss);
763
        }
746
    }
764
    }
747
  return capabilities;
765
  return capabilities;
748
}
766
}
(-)a/src/wifi/model/vht-capabilities.h (-1 / +23 lines)
 Lines 90-99   public: Link Here 
90
  uint8_t GetTxStbc () const;
90
  uint8_t GetTxStbc () const;
91
  uint8_t GetMaxAmpduLengthExponent () const;
91
  uint8_t GetMaxAmpduLengthExponent () const;
92
92
93
  //MCS and NSS field information
93
  // MCS and NSS field information
94
  // For each value of NSS ranging from 1 to 8, we need to encode two bits.
95
  // The value 0 indicates that the maximum MCS for that spatial stream is 7.
96
  // The value 1 indicates that the maximum MCS for that spatial stream is 8.
97
  // The value 2 indicates that the maximum MCS for that spatial stream is 9.
98
  //
99
  // The maps may be set all at once by passing in a 16-bit field corresponding
100
  // to the above, or incrementally for each NSS separately, where the 
101
  // MCS value must be in the range 7-9.
102
  /**
103
   * \param map The 16-bit encoding of Max MCS for each of 8 spatial streams
104
   */
94
  void SetRxMcsMap (uint16_t map);
105
  void SetRxMcsMap (uint16_t map);
106
  /**
107
   * \param mcs Max MCS value (between 7 and 9)
108
   * \param nss Spatial stream for which the Max MCS value is being set
109
   */
95
  void SetRxMcsMap (uint8_t mcs, uint8_t nss);
110
  void SetRxMcsMap (uint8_t mcs, uint8_t nss);
111
  /**
112
   * \param map The 16-bit encoding of Max MCS for each of 8 spatial streams
113
   */
96
  void SetTxMcsMap (uint16_t map);
114
  void SetTxMcsMap (uint16_t map);
115
  /**
116
   * \param mcs Max MCS value (between 7 and 9)
117
   * \param nss Spatial stream for which the Max MCS value is being set
118
   */
97
  void SetTxMcsMap (uint8_t mcs, uint8_t nss);
119
  void SetTxMcsMap (uint8_t mcs, uint8_t nss);
98
  void SetRxHighestSupportedLgiDataRate (uint16_t supporteddatarate);
120
  void SetRxHighestSupportedLgiDataRate (uint16_t supporteddatarate);
99
  void SetTxHighestSupportedLgiDataRate (uint16_t supporteddatarate);
121
  void SetTxHighestSupportedLgiDataRate (uint16_t supporteddatarate);
(-)a/src/wifi/model/wifi-mode.cc (-9 / +22 lines)
 Lines 20-25    Link Here 
20
 */
20
 */
21
21
22
#include "wifi-mode.h"
22
#include "wifi-mode.h"
23
#include "wifi-tx-vector.h"
23
#include "ns3/simulator.h"
24
#include "ns3/simulator.h"
24
#include "ns3/assert.h"
25
#include "ns3/assert.h"
25
#include "ns3/log.h"
26
#include "ns3/log.h"
 Lines 97-102   WifiMode::GetPhyRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t Link Here 
97
}
98
}
98
99
99
uint64_t
100
uint64_t
101
WifiMode::GetPhyRate (WifiTxVector txVector) const
102
{
103
  return GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), txVector.GetNss ());
104
}
105
106
uint64_t
100
WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
107
WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
101
{
108
{
102
  struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
109
  struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
 Lines 108-118   WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t Link Here 
108
    }
115
    }
109
  if (item->modClass == WIFI_MOD_CLASS_DSSS)
116
  if (item->modClass == WIFI_MOD_CLASS_DSSS)
110
    {
117
    {
111
      dataRate = (11000000 / 11) * log2 (GetConstellationSize (1));
118
      dataRate = (11000000 / 11) * log2 (GetConstellationSize (nss));
112
    }
119
    }
113
  else if (item->modClass == WIFI_MOD_CLASS_HR_DSSS)
120
  else if (item->modClass == WIFI_MOD_CLASS_HR_DSSS)
114
    {
121
    {
115
      dataRate = (11000000 / 8) * log2 (GetConstellationSize (1));
122
      dataRate = (11000000 / 8) * log2 (GetConstellationSize (nss));
116
    }
123
    }
117
  else if (item->modClass == WIFI_MOD_CLASS_OFDM || item->modClass == WIFI_MOD_CLASS_ERP_OFDM)
124
  else if (item->modClass == WIFI_MOD_CLASS_OFDM || item->modClass == WIFI_MOD_CLASS_ERP_OFDM)
118
    {
125
    {
 Lines 134-140   WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t Link Here 
134
        }
141
        }
135
142
136
      double codingRate;
143
      double codingRate;
137
      switch (GetCodeRate (1))
144
      switch (GetCodeRate (nss))
138
        {
145
        {
139
        case WIFI_CODE_RATE_3_4:
146
        case WIFI_CODE_RATE_3_4:
140
          codingRate = (3.0 / 4.0);
147
          codingRate = (3.0 / 4.0);
 Lines 151-163   WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t Link Here 
151
          break;
158
          break;
152
        }
159
        }
153
160
154
      uint32_t numberOfBitsPerSubcarrier = log2 (GetConstellationSize (1));
161
      uint32_t numberOfBitsPerSubcarrier = log2 (GetConstellationSize (nss));
155
162
156
      dataRate = lrint (ceil (symbolRate * usableSubCarriers * numberOfBitsPerSubcarrier * codingRate));
163
      dataRate = lrint (ceil (symbolRate * usableSubCarriers * numberOfBitsPerSubcarrier * codingRate));
157
    }
164
    }
158
  else if (item->modClass == WIFI_MOD_CLASS_HT || item->modClass == WIFI_MOD_CLASS_VHT)
165
  else if (item->modClass == WIFI_MOD_CLASS_HT || item->modClass == WIFI_MOD_CLASS_VHT)
159
    {
166
    {
160
      if (item->mcsValue == 9)
167
      if (item->modClass == WIFI_MOD_CLASS_VHT && item->mcsValue == 9)
161
        {
168
        {
162
          //VHT MCS 9 forbidden at 20 MHz
169
          //VHT MCS 9 forbidden at 20 MHz
163
          NS_ASSERT (channelWidth != 20);
170
          NS_ASSERT (channelWidth != 20);
 Lines 208-214   WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t Link Here 
208
          break;
215
          break;
209
        case WIFI_CODE_RATE_UNDEFINED:
216
        case WIFI_CODE_RATE_UNDEFINED:
210
        default:
217
        default:
211
          NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined");
218
          NS_FATAL_ERROR ("trying to get datarate for a mcs without any coding rate defined with nss: " << (uint16_t) nss);
212
          break;
219
          break;
213
        }
220
        }
214
221
 Lines 220-228   WifiMode::GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t Link Here 
220
    {
227
    {
221
      NS_ASSERT ("undefined datarate for the modulation class!");
228
      NS_ASSERT ("undefined datarate for the modulation class!");
222
    }
229
    }
230
  dataRate *= nss; // number of spatial streams
223
  return dataRate;
231
  return dataRate;
224
}
232
}
225
233
234
uint64_t
235
WifiMode::GetDataRate (WifiTxVector txVector) const
236
{
237
  return GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), txVector.GetNss ());
238
}
239
226
enum WifiCodeRate
240
enum WifiCodeRate
227
WifiMode::GetCodeRate (uint8_t nss) const
241
WifiMode::GetCodeRate (uint8_t nss) const
228
{
242
{
 Lines 230-237   WifiMode::GetCodeRate (uint8_t nss) const Link Here 
230
  if (item->modClass == WIFI_MOD_CLASS_HT)
244
  if (item->modClass == WIFI_MOD_CLASS_HT)
231
    {
245
    {
232
      NS_ASSERT (nss <= 4);
246
      NS_ASSERT (nss <= 4);
233
      NS_ASSERT ((item->mcsValue - (8 * (nss - 1))) >= 0 || (item->mcsValue - (8 * (nss - 1))) <= 7);
247
      switch (item->mcsValue % 8)
234
      switch (item->mcsValue - (8 * (nss - 1)))
235
        {
248
        {
236
        case 0:
249
        case 0:
237
        case 1:
250
        case 1:
 Lines 286-292   WifiMode::GetConstellationSize (uint8_t nss) const Link Here 
286
    {
299
    {
287
      NS_ASSERT (nss <= 4);
300
      NS_ASSERT (nss <= 4);
288
      NS_ASSERT ((item->mcsValue - (8 * (nss - 1))) >= 0 || (item->mcsValue - (8 * (nss - 1))) <= 7);
301
      NS_ASSERT ((item->mcsValue - (8 * (nss - 1))) >= 0 || (item->mcsValue - (8 * (nss - 1))) <= 7);
289
      switch (item->mcsValue - (8 * (nss - 1)))
302
      switch (item->mcsValue % 8)
290
        {
303
        {
291
        case 0:
304
        case 0:
292
          return 2;
305
          return 2;
(-)a/src/wifi/model/wifi-mode.h (+17 lines)
 Lines 31-36    Link Here 
31
31
32
namespace ns3 {
32
namespace ns3 {
33
33
34
class WifiTxVector;
35
34
/**
36
/**
35
 * This enumeration defines the modulation classes per
37
 * This enumeration defines the modulation classes per
36
 * (Table 9-4 "Modulation classes"; IEEE 802.11-2012).
38
 * (Table 9-4 "Modulation classes"; IEEE 802.11-2012).
 Lines 110-115   public: Link Here 
110
   */
112
   */
111
  uint64_t GetPhyRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const;
113
  uint64_t GetPhyRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const;
112
  /**
114
  /**
115
   * \param txVector the WifiTxVector of the signal
116
   *
117
   * \returns the physical bit rate of this signal.
118
   *
119
   * If a transmission mode uses 1/2 FEC, and if its
120
   * data rate is 3.25Mbps, the phy rate is 6.5Mbps
121
   */
122
  uint64_t GetPhyRate (WifiTxVector txVector) const;
123
  /**
113
   *
124
   *
114
   * \param channelWidth the considered channel width in MHz
125
   * \param channelWidth the considered channel width in MHz
115
   * \param isShortGuardInterval whether short guard interval is considered or not
126
   * \param isShortGuardInterval whether short guard interval is considered or not
 Lines 119-124   public: Link Here 
119
   */
130
   */
120
  uint64_t GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const;
131
  uint64_t GetDataRate (uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const;
121
  /**
132
  /**
133
   * \param txVector the WifiTxVector of the signal
134
   *
135
   * \returns the data bit rate of this signal.
136
   */
137
  uint64_t GetDataRate (WifiTxVector txVector) const;
138
  /**
122
   *
139
   *
123
   * \param nss the considered number of streams
140
   * \param nss the considered number of streams
124
   *
141
   *
(-)a/src/wifi/model/wifi-phy.h (-4 / +19 lines)
 Lines 483-495   public: Link Here 
483
  virtual bool IsModeSupported (WifiMode mode) const = 0;
483
  virtual bool IsModeSupported (WifiMode mode) const = 0;
484
484
485
  /**
485
  /**
486
   * \param txMode the transmission mode
486
   * \param txVector the transmission vector
487
   * \param ber the probability of bit error rate
487
   * \param ber the probability of bit error rate
488
   *
488
   *
489
   * \return the minimum snr which is required to achieve
489
   * \return the minimum snr which is required to achieve
490
   *          the requested ber for the specified transmission mode. (W/W)
490
   *          the requested ber for the specified transmission vector. (W/W)
491
   */
491
   */
492
  virtual double CalculateSnr (WifiMode txMode, double ber) const = 0;
492
  virtual double CalculateSnr (WifiTxVector txVector, double ber) const = 0;
493
493
494
  /**
494
  /**
495
  * The WifiPhy::NBssMembershipSelectors() method is used
495
  * The WifiPhy::NBssMembershipSelectors() method is used
 Lines 1273-1279   public: Link Here 
1273
   * \param channelwidth channel width
1273
   * \param channelwidth channel width
1274
   */
1274
   */
1275
  virtual void SetChannelWidth (uint32_t channelwidth) = 0;
1275
  virtual void SetChannelWidth (uint32_t channelwidth) = 0;
1276
1276
  /**
1277
   * \return the maximum number of supported Rx spatial streams
1278
   */
1279
  virtual uint8_t GetSupportedRxSpatialStreams (void) const = 0;
1280
  /**
1281
   * \return the maximum number of supported Tx spatial streams
1282
   */
1283
  virtual uint8_t GetSupportedTxSpatialStreams (void) const = 0;
1284
  /**
1285
   * \param width channel width (in MHz) to support
1286
   */
1287
  virtual void AddSupportedChannelWidth (uint32_t width) = 0;
1288
  /**
1289
   * \return a vector containing the supported channel widths, values in MHz
1290
   */
1291
  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const = 0;
1277
1292
1278
private:
1293
private:
1279
  /**
1294
  /**
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-24 / +14 lines)
 Lines 1004-1015   WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode r Link Here 
1004
  NS_LOG_FUNCTION (this << address << reqMode);
1004
  NS_LOG_FUNCTION (this << address << reqMode);
1005
  WifiMode mode = GetDefaultMode ();
1005
  WifiMode mode = GetDefaultMode ();
1006
  bool found = false;
1006
  bool found = false;
1007
  uint8_t nss = 1;  // Use one spatial stream for control response
1007
  //First, search the BSS Basic Rate set
1008
  //First, search the BSS Basic Rate set
1008
  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1009
  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1009
    {
1010
    {
1010
      if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1011
      if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1011
          && (i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1012
          && (i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1012
          && (i->GetConstellationSize (1) <= reqMode.GetConstellationSize (1))
1013
          && (i->GetConstellationSize (nss) <= reqMode.GetConstellationSize (nss))
1013
          && ((i->GetModulationClass () == reqMode.GetModulationClass ())
1014
          && ((i->GetModulationClass () == reqMode.GetModulationClass ())
1014
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
1015
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
1015
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_VHT)))
1016
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_VHT)))
 Lines 1022-1027   WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode r Link Here 
1022
          found = true;
1023
          found = true;
1023
        }
1024
        }
1024
    }
1025
    }
1026
  nss = 1;  // Continue the assumption that MIMO not used for control response
1025
  if (HasHtSupported () || HasVhtSupported ())
1027
  if (HasHtSupported () || HasVhtSupported ())
1026
    {
1028
    {
1027
      if (!found)
1029
      if (!found)
 Lines 1029-1036   WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode r Link Here 
1029
          mode = GetDefaultMcs ();
1031
          mode = GetDefaultMcs ();
1030
          for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
1032
          for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
1031
            {
1033
            {
1032
              if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1034
              if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1033
                  && i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1035
                  && i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1034
              //&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard
1036
              //&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard
1035
                {
1037
                {
1036
                  mode = *i;
1038
                  mode = *i;
 Lines 1067-1072   WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode r Link Here 
1067
   * \todo Note that we're ignoring the last sentence for now, because
1069
   * \todo Note that we're ignoring the last sentence for now, because
1068
   * there is not yet any manipulation here of PHY options.
1070
   * there is not yet any manipulation here of PHY options.
1069
   */
1071
   */
1072
  nss = 1;  // Continue the assumption that MIMO not used for control response
1070
  for (uint32_t idx = 0; idx < m_wifiPhy->GetNModes (); idx++)
1073
  for (uint32_t idx = 0; idx < m_wifiPhy->GetNModes (); idx++)
1071
    {
1074
    {
1072
      WifiMode thismode = m_wifiPhy->GetMode (idx);
1075
      WifiMode thismode = m_wifiPhy->GetMode (idx);
 Lines 1081-1089   WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode r Link Here 
1081
       * ...then it's our best choice so far.
1084
       * ...then it's our best choice so far.
1082
       */
1085
       */
1083
      if (thismode.IsMandatory ()
1086
      if (thismode.IsMandatory ()
1084
          && (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1087
          && (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1085
          && (thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1088
          && (thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1086
          && (thismode.GetConstellationSize (1) <= reqMode.GetConstellationSize (1))
1089
          && (thismode.GetConstellationSize (nss) <= reqMode.GetConstellationSize (nss))
1087
          && ((thismode.GetModulationClass () == reqMode.GetModulationClass ())
1090
          && ((thismode.GetModulationClass () == reqMode.GetModulationClass ())
1088
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
1091
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)
1089
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)))
1092
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)))
 Lines 1096-1109   WifiRemoteStationManager::GetControlAnswerMode (Mac48Address address, WifiMode r Link Here 
1096
          found = true;
1099
          found = true;
1097
        }
1100
        }
1098
    }
1101
    }
1102
  nss = 1;  // Continue the assumption that MIMO not used for control response
1099
  if (HasHtSupported () || HasVhtSupported ())
1103
  if (HasHtSupported () || HasVhtSupported ())
1100
    {
1104
    {
1101
      for (uint32_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++)
1105
      for (uint32_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++)
1102
        {
1106
        {
1103
          WifiMode thismode = m_wifiPhy->GetMcs (idx);
1107
          WifiMode thismode = m_wifiPhy->GetMcs (idx);
1104
          if (thismode.IsMandatory ()
1108
          if (thismode.IsMandatory ()
1105
              && (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1109
              && (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1106
              && thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1))
1110
              && thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, nss))
1107
              //&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard
1111
              //&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard
1108
            {
1112
            {
1109
              mode = thismode;
1113
              mode = thismode;
 Lines 1322-1329   WifiRemoteStationManager::LookupState (Mac48Address address) const Link Here 
1322
  state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval ();
1326
  state->m_shortGuardInterval = m_wifiPhy->GetGuardInterval ();
1323
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1327
  state->m_greenfield = m_wifiPhy->GetGreenfield ();
1324
  state->m_shortPreamble = m_wifiPhy->GetShortPlcpPreamble ();
1328
  state->m_shortPreamble = m_wifiPhy->GetShortPlcpPreamble ();
1325
  state->m_rx = 1;
1326
  state->m_tx = 1;
1327
  state->m_ness = 0;
1329
  state->m_ness = 0;
1328
  state->m_aggregation = false;
1330
  state->m_aggregation = false;
1329
  state->m_stbc = false;
1331
  state->m_stbc = false;
 Lines 1602-1619   WifiRemoteStationManager::GetStbc (const WifiRemoteStation *station) const Link Here 
1602
}
1604
}
1603
1605
1604
uint32_t
1606
uint32_t
1605
WifiRemoteStationManager::GetNumberOfReceiveAntennas (const WifiRemoteStation *station) const
1606
{
1607
  return station->m_state->m_rx;
1608
}
1609
1610
uint32_t
1611
WifiRemoteStationManager::GetNumberOfTransmitAntennas (const WifiRemoteStation *station) const
1612
{
1613
  return station->m_state->m_tx;
1614
}
1615
1616
uint32_t
1617
WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const
1607
WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const
1618
{
1608
{
1619
  return station->m_state->m_ness;
1609
  return station->m_state->m_ness;
(-)a/src/wifi/model/wifi-remote-station-manager.h (-18 lines)
 Lines 738-759   protected: Link Here 
738
   */
738
   */
739
  bool GetShortPreamble (const WifiRemoteStation *station) const;
739
  bool GetShortPreamble (const WifiRemoteStation *station) const;
740
  /**
740
  /**
741
   * Return the number of receive antennas the station has.
742
   *
743
   * \param station the station being queried
744
   *
745
   * \return the number of receive antennas the station has
746
   */
747
  uint32_t GetNumberOfReceiveAntennas (const WifiRemoteStation *station) const;
748
  /**
749
   * Return the number of transmit antennas the station has.
750
   *
751
   * \param station the station being queried
752
   *
753
   * \return the number of transmit antennas the station has
754
   */
755
  uint32_t GetNumberOfTransmitAntennas (const WifiRemoteStation *station) const;
756
  /**
757
   * \returns the number of Ness the station has.
741
   * \returns the number of Ness the station has.
758
   *
742
   *
759
   * \param station the station being queried
743
   * \param station the station being queried
 Lines 1134-1141   struct WifiRemoteStationState Link Here 
1134
1118
1135
  uint32_t m_channelWidth;    //!< Channel width (in MHz) supported by the remote station
1119
  uint32_t m_channelWidth;    //!< Channel width (in MHz) supported by the remote station
1136
  bool m_shortGuardInterval;  //!< Flag if short guard interval is supported by the remote station
1120
  bool m_shortGuardInterval;  //!< Flag if short guard interval is supported by the remote station
1137
  uint32_t m_rx;              //!< Number of RX antennas of the remote station
1138
  uint32_t m_tx;              //!< Number of TX antennas of the remote station
1139
  uint32_t m_ness;            //!< Number of streams in beamforming of the remote station
1121
  uint32_t m_ness;            //!< Number of streams in beamforming of the remote station
1140
  bool m_stbc;                //!< Flag if STBC is used by the remote station
1122
  bool m_stbc;                //!< Flag if STBC is used by the remote station
1141
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
1123
  bool m_aggregation;         //!< Flag if MPDU aggregation is used by the remote station
(-)a/src/wifi/model/yans-error-rate-model.cc (-22 / +23 lines)
 Lines 188-206   double Link Here 
188
YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, double snr, uint32_t nbits) const
188
YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, double snr, uint32_t nbits) const
189
{
189
{
190
  NS_LOG_FUNCTION (this << mode << txVector.GetMode () << snr << nbits);
190
  NS_LOG_FUNCTION (this << mode << txVector.GetMode () << snr << nbits);
191
  uint8_t nss = txVector.GetNss ();
191
  if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM
192
  if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM
192
      || mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM
193
      || mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM
193
      || mode.GetModulationClass () == WIFI_MOD_CLASS_HT
194
      || mode.GetModulationClass () == WIFI_MOD_CLASS_HT
194
      || mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
195
      || mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
195
    {
196
    {
196
      if (mode.GetConstellationSize (1) == 2)
197
      if (mode.GetConstellationSize (nss) == 2)
197
        {
198
        {
198
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_1_2)
199
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_1_2)
199
            {
200
            {
200
              return GetFecBpskBer (snr,
201
              return GetFecBpskBer (snr,
201
                                    nbits,
202
                                    nbits,
202
                                    txVector.GetChannelWidth () * 1000000, //signal spread
203
                                    txVector.GetChannelWidth () * 1000000, //signal spread
203
                                    mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
204
                                    mode.GetPhyRate (txVector), //phy rate
204
                                    10, //dFree
205
                                    10, //dFree
205
                                    11); //adFree
206
                                    11); //adFree
206
            }
207
            }
 Lines 209-227   YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
209
              return GetFecBpskBer (snr,
210
              return GetFecBpskBer (snr,
210
                                    nbits,
211
                                    nbits,
211
                                    txVector.GetChannelWidth () * 1000000, //signal spread
212
                                    txVector.GetChannelWidth () * 1000000, //signal spread
212
                                    mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
213
                                    mode.GetPhyRate (txVector), //phy rate
213
                                    5, //dFree
214
                                    5, //dFree
214
                                    8); //adFree
215
                                    8); //adFree
215
            }
216
            }
216
        }
217
        }
217
      else if (mode.GetConstellationSize (1) == 4)
218
      else if (mode.GetConstellationSize (nss) == 4)
218
        {
219
        {
219
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_1_2)
220
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_1_2)
220
            {
221
            {
221
              return GetFecQamBer (snr,
222
              return GetFecQamBer (snr,
222
                                   nbits,
223
                                   nbits,
223
                                   txVector.GetChannelWidth () * 1000000, //signal spread
224
                                   txVector.GetChannelWidth () * 1000000, //signal spread
224
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
225
                                   mode.GetPhyRate (txVector), //phy rate
225
                                   4, //m
226
                                   4, //m
226
                                   10, //dFree
227
                                   10, //dFree
227
                                   11, //adFree
228
                                   11, //adFree
 Lines 232-252   YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
232
              return GetFecQamBer (snr,
233
              return GetFecQamBer (snr,
233
                                   nbits,
234
                                   nbits,
234
                                   txVector.GetChannelWidth () * 1000000, //signal spread
235
                                   txVector.GetChannelWidth () * 1000000, //signal spread
235
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
236
                                   mode.GetPhyRate (txVector), //phy rate
236
                                   4, //m
237
                                   4, //m
237
                                   5, //dFree
238
                                   5, //dFree
238
                                   8, //adFree
239
                                   8, //adFree
239
                                   31); //adFreePlusOne
240
                                   31); //adFreePlusOne
240
            }
241
            }
241
        }
242
        }
242
      else if (mode.GetConstellationSize (1) == 16)
243
      else if (mode.GetConstellationSize (nss) == 16)
243
        {
244
        {
244
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_1_2)
245
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_1_2)
245
            {
246
            {
246
              return GetFecQamBer (snr,
247
              return GetFecQamBer (snr,
247
                                   nbits,
248
                                   nbits,
248
                                   txVector.GetChannelWidth () * 1000000, //signal spread
249
                                   txVector.GetChannelWidth () * 1000000, //signal spread
249
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
250
                                   mode.GetPhyRate (txVector), //phy rate
250
                                   16, //m
251
                                   16, //m
251
                                   10, //dFree
252
                                   10, //dFree
252
                                   11, //adFree
253
                                   11, //adFree
 Lines 257-289   YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
257
              return GetFecQamBer (snr,
258
              return GetFecQamBer (snr,
258
                                   nbits,
259
                                   nbits,
259
                                   txVector.GetChannelWidth () * 1000000, //signal spread
260
                                   txVector.GetChannelWidth () * 1000000, //signal spread
260
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
261
                                   mode.GetPhyRate (txVector), //phy rate
261
                                   16, //m
262
                                   16, //m
262
                                   5, //dFree
263
                                   5, //dFree
263
                                   8, //adFree
264
                                   8, //adFree
264
                                   31); //adFreePlusOne
265
                                   31); //adFreePlusOne
265
            }
266
            }
266
        }
267
        }
267
      else if (mode.GetConstellationSize (1) == 64)
268
      else if (mode.GetConstellationSize (nss) == 64)
268
        {
269
        {
269
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_2_3)
270
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_2_3)
270
            {
271
            {
271
              return GetFecQamBer (snr,
272
              return GetFecQamBer (snr,
272
                                   nbits,
273
                                   nbits,
273
                                   txVector.GetChannelWidth () * 1000000, //signal spread
274
                                   txVector.GetChannelWidth () * 1000000, //signal spread
274
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
275
                                   mode.GetPhyRate (txVector), //phy rate
275
                                   64, //m
276
                                   64, //m
276
                                   6, //dFree
277
                                   6, //dFree
277
                                   1, //adFree
278
                                   1, //adFree
278
                                   16); //adFreePlusOne
279
                                   16); //adFreePlusOne
279
            }
280
            }
280
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_5_6)
281
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_5_6)
281
            {
282
            {
282
              //Table B.32  in Pâl Frenger et al., "Multi-rate Convolutional Codes".
283
              //Table B.32  in Pâl Frenger et al., "Multi-rate Convolutional Codes".
283
              return GetFecQamBer (snr,
284
              return GetFecQamBer (snr,
284
                                   nbits,
285
                                   nbits,
285
                                   txVector.GetChannelWidth () * 1000000, //signal spread
286
                                   txVector.GetChannelWidth () * 1000000, //signal spread
286
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
287
                                   mode.GetPhyRate (txVector), //phy rate
287
                                   64, //m
288
                                   64, //m
288
                                   4, //dFree
289
                                   4, //dFree
289
                                   14, //adFree
290
                                   14, //adFree
 Lines 294-314   YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
294
              return GetFecQamBer (snr,
295
              return GetFecQamBer (snr,
295
                                   nbits,
296
                                   nbits,
296
                                   txVector.GetChannelWidth () * 1000000, //signal spread
297
                                   txVector.GetChannelWidth () * 1000000, //signal spread
297
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), //phy rate
298
                                   mode.GetPhyRate (txVector), //phy rate
298
                                   64, //m
299
                                   64, //m
299
                                   5, //dFree
300
                                   5, //dFree
300
                                   8, //adFree
301
                                   8, //adFree
301
                                   31); //adFreePlusOne
302
                                   31); //adFreePlusOne
302
            }
303
            }
303
        }
304
        }
304
      else if (mode.GetConstellationSize (1) == 256)
305
      else if (mode.GetConstellationSize (nss) == 256)
305
        {
306
        {
306
          if (mode.GetCodeRate (1) == WIFI_CODE_RATE_5_6)
307
          if (mode.GetCodeRate (nss) == WIFI_CODE_RATE_5_6)
307
            {
308
            {
308
              return GetFecQamBer (snr,
309
              return GetFecQamBer (snr,
309
                                   nbits,
310
                                   nbits,
310
                                   txVector.GetChannelWidth () * 1000000, // signal spread
311
                                   txVector.GetChannelWidth () * 1000000, // signal spread
311
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), // phy rate
312
                                   mode.GetPhyRate (txVector), //phy rate
312
                                   256, // m
313
                                   256, // m
313
                                   4,  // dFree
314
                                   4,  // dFree
314
                                   14,  // adFree
315
                                   14,  // adFree
 Lines 320-326   YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, WifiTxVector txVector, d Link Here 
320
              return GetFecQamBer (snr,
321
              return GetFecQamBer (snr,
321
                                   nbits,
322
                                   nbits,
322
                                   txVector.GetChannelWidth () * 1000000, // signal spread
323
                                   txVector.GetChannelWidth () * 1000000, // signal spread
323
                                   mode.GetPhyRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1), // phy rate
324
                                   mode.GetPhyRate (txVector), //phy rate
324
                                   256, // m
325
                                   256, // m
325
                                   5,  // dFree
326
                                   5,  // dFree
326
                                   8,  // adFree
327
                                   8,  // adFree
(-)a/src/wifi/model/yans-wifi-phy.cc (-4 / +39 lines)
 Lines 406-414   YansWifiPhy::GetMobility (void) Link Here 
406
}
406
}
407
407
408
double
408
double
409
YansWifiPhy::CalculateSnr (WifiMode txMode, double ber) const
409
YansWifiPhy::CalculateSnr (WifiTxVector txVector, double ber) const
410
{
410
{
411
  return m_interference.GetErrorRateModel ()->CalculateSnr (txMode, ber);
411
  return m_interference.GetErrorRateModel ()->CalculateSnr (txVector, ber);
412
}
412
}
413
413
414
Ptr<WifiChannel>
414
Ptr<WifiChannel>
 Lines 775-781   YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, WifiPr Link Here 
775
void
775
void
776
YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, WifiPreamble preamble, enum mpduType mpdutype)
776
YansWifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, WifiPreamble preamble, enum mpduType mpdutype)
777
{
777
{
778
  NS_LOG_FUNCTION (this << packet << txVector.GetMode () << txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1) << preamble << (uint32_t)txVector.GetTxPowerLevel () << (uint32_t)mpdutype);
778
  NS_LOG_FUNCTION (this << packet << txVector.GetMode () 
779
    << txVector.GetMode ().GetDataRate (txVector)
780
    << preamble << (uint32_t)txVector.GetTxPowerLevel () << (uint32_t)mpdutype);
779
  /* Transmission can happen if:
781
  /* Transmission can happen if:
780
   *  - we are syncing on a packet. It is the responsability of the
782
   *  - we are syncing on a packet. It is the responsability of the
781
   *    MAC layer to avoid doing this but the PHY does nothing to
783
   *    MAC layer to avoid doing this but the PHY does nothing to
 Lines 1168-1174   YansWifiPhy::EndReceive (Ptr<Packet> packet, enum WifiPreamble preamble, enum mp Link Here 
1168
1170
1169
  if (m_plcpSuccess == true)
1171
  if (m_plcpSuccess == true)
1170
    {
1172
    {
1171
      NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate (event->GetTxVector ().GetChannelWidth (), event->GetTxVector ().IsShortGuardInterval (), 1)) <<
1173
      NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate (event->GetTxVector ())) <<
1172
                    ", snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per << ", size=" << packet->GetSize ());
1174
                    ", snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per << ", size=" << packet->GetSize ());
1173
1175
1174
      if (m_random->GetValue () > snrPer.per)
1176
      if (m_random->GetValue () > snrPer.per)
 Lines 1321-1326   YansWifiPhy::SetChannelWidth (uint32_t channelwidth) Link Here 
1321
{
1323
{
1322
  NS_ASSERT_MSG (channelwidth == 5 || channelwidth == 10 || channelwidth == 20 || channelwidth == 22 || channelwidth == 40 || channelwidth == 80 || channelwidth == 160, "wrong channel width value");
1324
  NS_ASSERT_MSG (channelwidth == 5 || channelwidth == 10 || channelwidth == 20 || channelwidth == 22 || channelwidth == 40 || channelwidth == 80 || channelwidth == 160, "wrong channel width value");
1323
  m_channelWidth = channelwidth;
1325
  m_channelWidth = channelwidth;
1326
  AddSupportedChannelWidth (channelwidth);
1324
}
1327
}
1325
1328
1326
uint32_t
1329
uint32_t
 Lines 1329-1334   YansWifiPhy::GetChannelWidth (void) const Link Here 
1329
  return m_channelWidth;
1332
  return m_channelWidth;
1330
}
1333
}
1331
1334
1335
uint8_t 
1336
YansWifiPhy::GetSupportedRxSpatialStreams (void) const
1337
{
1338
  return (static_cast<uint8_t> (GetNumberOfReceiveAntennas ()));
1339
}
1340
1341
uint8_t 
1342
YansWifiPhy::GetSupportedTxSpatialStreams (void) const
1343
{
1344
  return (static_cast<uint8_t> (GetNumberOfTransmitAntennas ()));
1345
}
1346
1347
void
1348
YansWifiPhy::AddSupportedChannelWidth (uint32_t width)
1349
{
1350
  NS_LOG_FUNCTION (this << width);
1351
  for (std::vector<uint32_t>::size_type i = 0; i != m_supportedChannelWidthSet.size (); i++)
1352
    {
1353
      if (m_supportedChannelWidthSet[i] == width)
1354
        {
1355
          return;
1356
        }
1357
    }
1358
  m_supportedChannelWidthSet.push_back (width);
1359
}
1360
1361
std::vector<uint32_t> 
1362
YansWifiPhy::GetSupportedChannelWidthSet (void) const
1363
{
1364
  return m_supportedChannelWidthSet;
1365
}
1366
1332
uint32_t
1367
uint32_t
1333
YansWifiPhy::GetNBssMembershipSelectors (void) const
1368
YansWifiPhy::GetNBssMembershipSelectors (void) const
1334
{
1369
{
(-)a/src/wifi/model/yans-wifi-phy.h (-1 / +6 lines)
 Lines 299-305   public: Link Here 
299
  virtual WifiMode GetMode (uint32_t mode) const;
299
  virtual WifiMode GetMode (uint32_t mode) const;
300
  virtual bool IsModeSupported (WifiMode mode) const;
300
  virtual bool IsModeSupported (WifiMode mode) const;
301
  virtual bool IsMcsSupported (WifiMode mcs);
301
  virtual bool IsMcsSupported (WifiMode mcs);
302
  virtual double CalculateSnr (WifiMode txMode, double ber) const;
302
  virtual double CalculateSnr (WifiTxVector txVector, double ber) const;
303
  virtual Ptr<WifiChannel> GetChannel (void) const;
303
  virtual Ptr<WifiChannel> GetChannel (void) const;
304
304
305
  virtual void ConfigureStandard (enum WifiPhyStandard standard);
305
  virtual void ConfigureStandard (enum WifiPhyStandard standard);
 Lines 410-415   public: Link Here 
410
   */
410
   */
411
  virtual void SetChannelWidth (uint32_t channelwidth);
411
  virtual void SetChannelWidth (uint32_t channelwidth);
412
412
413
  virtual uint8_t GetSupportedRxSpatialStreams (void) const;
414
  virtual uint8_t GetSupportedTxSpatialStreams (void) const;
415
  virtual void AddSupportedChannelWidth (uint32_t width);
416
  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const;
413
  virtual uint32_t GetNBssMembershipSelectors (void) const;
417
  virtual uint32_t GetNBssMembershipSelectors (void) const;
414
  virtual uint32_t GetBssMembershipSelector (uint32_t selector) const;
418
  virtual uint32_t GetBssMembershipSelector (uint32_t selector) const;
415
  virtual WifiModeList GetMembershipSelectorModes (uint32_t selector);
419
  virtual WifiModeList GetMembershipSelectorModes (uint32_t selector);
 Lines 538-543   private: Link Here 
538
  bool     m_greenfield;            //!< Flag if GreenField format is supported
542
  bool     m_greenfield;            //!< Flag if GreenField format is supported
539
  bool     m_guardInterval;         //!< Flag if short guard interval is used
543
  bool     m_guardInterval;         //!< Flag if short guard interval is used
540
  uint32_t m_channelWidth;          //!< Channel width
544
  uint32_t m_channelWidth;          //!< Channel width
545
  std::vector<uint32_t> m_supportedChannelWidthSet; //!< Supported channel width
541
  bool     m_plcpPreamble;          //!< Flag if short PLCP preamble is used
546
  bool     m_plcpPreamble;          //!< Flag if short PLCP preamble is used
542
547
543
  /**
548
  /**

Return to bug 2296