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

(-)a/examples/wireless/mixed-bg-network.cc (-7 / +7 lines)
 Lines 235-241    Link Here 
235
  std::cout << "Protection mode" << "\t\t" << "Slot time supported" << "\t\t" << "PLCP preamble supported" << "\t\t" << "Scenario" << "\t" << "Throughput" << std::endl;
235
  std::cout << "Protection mode" << "\t\t" << "Slot time supported" << "\t\t" << "PLCP preamble supported" << "\t\t" << "Scenario" << "\t" << "Throughput" << std::endl;
236
  
236
  
237
  throughput = experiment.Run (false, false, false, false, isUdp, payloadSize, simulationTime);
237
  throughput = experiment.Run (false, false, false, false, isUdp, payloadSize, simulationTime);
238
  if (throughput < 17 || throughput > 18)
238
  if (throughput < 23 || throughput > 24)
239
    {
239
    {
240
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
240
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
241
      exit (1);
241
      exit (1);
 Lines 251-257    Link Here 
251
  std::cout << "Disabled" << "\t\t" << "Short" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "G-only" << "\t\t" << throughput <<" Mbit/s" << std::endl;
251
  std::cout << "Disabled" << "\t\t" << "Short" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "G-only" << "\t\t" << throughput <<" Mbit/s" << std::endl;
252
  
252
  
253
  throughput = experiment.Run (false, false, false, true, isUdp, payloadSize, simulationTime);
253
  throughput = experiment.Run (false, false, false, true, isUdp, payloadSize, simulationTime);
254
  if (throughput < 17 || throughput > 18)
254
  if (throughput < 23 || throughput > 24)
255
    {
255
    {
256
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
256
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
257
      exit (1);
257
      exit (1);
 Lines 259-265    Link Here 
259
  std::cout << "Disabled" << "\t\t" << "Long" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "Mixed" << "\t\t" << throughput <<" Mbit/s" << std::endl;
259
  std::cout << "Disabled" << "\t\t" << "Long" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "Mixed" << "\t\t" << throughput <<" Mbit/s" << std::endl;
260
  
260
  
261
  throughput = experiment.Run (false, false, true, true, isUdp, payloadSize, simulationTime);
261
  throughput = experiment.Run (false, false, true, true, isUdp, payloadSize, simulationTime);
262
  if (throughput < 17 || throughput > 18)
262
  if (throughput < 23 || throughput > 24)
263
    {
263
    {
264
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
264
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
265
      exit (1);
265
      exit (1);
 Lines 269-275    Link Here 
269
  Config::SetDefault ("ns3::WifiRemoteStationManager::ProtectionMode", StringValue ("Rts-Cts"));
269
  Config::SetDefault ("ns3::WifiRemoteStationManager::ProtectionMode", StringValue ("Rts-Cts"));
270
  
270
  
271
  throughput = experiment.Run (true, false, false, true, isUdp, payloadSize, simulationTime);
271
  throughput = experiment.Run (true, false, false, true, isUdp, payloadSize, simulationTime);
272
  if (throughput < 9 || throughput > 10)
272
  if (throughput < 19 || throughput > 20)
273
    {
273
    {
274
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
274
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
275
      exit (1);
275
      exit (1);
 Lines 277-283    Link Here 
277
  std::cout << "RTS/CTS" << "\t\t\t" << "Long" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "Mixed" << "\t\t" << throughput <<" Mbit/s" << std::endl;
277
  std::cout << "RTS/CTS" << "\t\t\t" << "Long" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "Mixed" << "\t\t" << throughput <<" Mbit/s" << std::endl;
278
  
278
  
279
  throughput = experiment.Run (true, false, true, true, isUdp, payloadSize, simulationTime);
279
  throughput = experiment.Run (true, false, true, true, isUdp, payloadSize, simulationTime);
280
  if (throughput < 11 || throughput > 12)
280
  if (throughput < 19 || throughput > 20)
281
    {
281
    {
282
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
282
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
283
      exit (1);
283
      exit (1);
 Lines 287-293    Link Here 
287
  Config::SetDefault ("ns3::WifiRemoteStationManager::ProtectionMode", StringValue ("Cts-To-Self"));
287
  Config::SetDefault ("ns3::WifiRemoteStationManager::ProtectionMode", StringValue ("Cts-To-Self"));
288
  
288
  
289
  throughput = experiment.Run (true, false, false, true, isUdp, payloadSize, simulationTime);
289
  throughput = experiment.Run (true, false, false, true, isUdp, payloadSize, simulationTime);
290
  if (throughput < 12 || throughput > 13)
290
  if (throughput < 21 || throughput > 22)
291
    {
291
    {
292
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
292
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
293
      exit (1);
293
      exit (1);
 Lines 295-301    Link Here 
295
  std::cout << "CTS-TO-SELF" << "\t\t" << "Long" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "Mixed" << "\t\t" << throughput <<" Mbit/s" << std::endl;
295
  std::cout << "CTS-TO-SELF" << "\t\t" << "Long" << "\t\t\t\t" << "Long" << "\t\t\t\t" << "Mixed" << "\t\t" << throughput <<" Mbit/s" << std::endl;
296
  
296
  
297
  throughput = experiment.Run (true, false, true, true, isUdp, payloadSize, simulationTime);
297
  throughput = experiment.Run (true, false, true, true, isUdp, payloadSize, simulationTime);
298
  if (throughput < 14 || throughput > 15)
298
  if (throughput < 21 || throughput > 22)
299
    {
299
    {
300
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
300
      NS_LOG_ERROR ("Obtained throughput is not in the expected boundaries!");
301
      exit (1);
301
      exit (1);
(-)a/src/wifi/model/ap-wifi-mac.cc (-4 / +2 lines)
 Lines 577-591    Link Here 
577
    {
577
    {
578
    if (GetShortSlotTimeEnabled () == true)
578
    if (GetShortSlotTimeEnabled () == true)
579
      {
579
      {
580
        //Enable short slot time and set cwMin to 15
580
        //Enable short slot time
581
        SetSlot (MicroSeconds (9));
581
        SetSlot (MicroSeconds (9));
582
        ConfigureContentionWindow (15, 1023);
583
      }
582
      }
584
    else
583
    else
585
      {
584
      {
586
        //Disable short slot time and set CWmin to 31
585
        //Disable short slot time
587
        SetSlot (MicroSeconds (20));
586
        SetSlot (MicroSeconds (20));
588
        ConfigureContentionWindow (31, 1023);
589
      }
587
      }
590
    }
588
    }
591
}
589
}
(-)a/src/wifi/model/regular-wifi-mac.cc (-4 / +3 lines)
 Lines 1091-1097    Link Here 
1091
    case WIFI_PHY_STANDARD_80211ac:
1091
    case WIFI_PHY_STANDARD_80211ac:
1092
      SetVhtSupported (true);
1092
      SetVhtSupported (true);
1093
    case WIFI_PHY_STANDARD_80211n_5GHZ:
1093
    case WIFI_PHY_STANDARD_80211n_5GHZ:
1094
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
1094
      SetHtSupported (true);
1095
      SetHtSupported (true);
1096
    case WIFI_PHY_STANDARD_80211g:
1097
      m_erpSupported = true;
1095
    case WIFI_PHY_STANDARD_holland:
1098
    case WIFI_PHY_STANDARD_holland:
1096
    case WIFI_PHY_STANDARD_80211a:
1099
    case WIFI_PHY_STANDARD_80211a:
1097
    case WIFI_PHY_STANDARD_80211_10MHZ:
1100
    case WIFI_PHY_STANDARD_80211_10MHZ:
 Lines 1099-1108    Link Here 
1099
      cwmin = 15;
1102
      cwmin = 15;
1100
      cwmax = 1023;
1103
      cwmax = 1023;
1101
      break;
1104
      break;
1102
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
1103
      SetHtSupported (true);
1104
    case WIFI_PHY_STANDARD_80211g:
1105
      m_erpSupported = true;
1106
    case WIFI_PHY_STANDARD_80211b:
1105
    case WIFI_PHY_STANDARD_80211b:
1107
      cwmin = 31;
1106
      cwmin = 31;
1108
      cwmax = 1023;
1107
      cwmax = 1023;
(-)a/src/wifi/model/sta-wifi-mac.cc (-29 / +54 lines)
 Lines 530-544    Link Here 
530
                }
530
                }
531
              if (capabilities.IsShortSlotTime () == true)
531
              if (capabilities.IsShortSlotTime () == true)
532
                {
532
                {
533
                  //enable short slot time and set cwMin to 15
533
                  //enable short slot time
534
                  SetSlot (MicroSeconds (9));
534
                  SetSlot (MicroSeconds (9));
535
                  ConfigureContentionWindow (15, 1023);
536
                }
535
                }
537
              else
536
              else
538
                {
537
                {
539
                  //disable short slot time and set cwMin to 31
538
                  //disable short slot time
540
                  SetSlot (MicroSeconds (20));
539
                  SetSlot (MicroSeconds (20));
541
                  ConfigureContentionWindow (31, 1023);
542
                }
540
                }
543
            }
541
            }
544
          m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
542
          m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
 Lines 589-615    Link Here 
589
          bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
587
          bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
590
          if (m_erpSupported)
588
          if (m_erpSupported)
591
            {
589
            {
592
              ErpInformation erpInformation = probeResp.GetErpInformation ();
590
              bool isErpAllowed = false;
593
              if (erpInformation.GetUseProtection() == true)
591
              for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
594
                {
592
              {
595
                  m_stationManager->SetUseNonErpProtection (true);
593
                WifiMode mode = m_phy->GetMode (i);
596
                }
594
                if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM && rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
597
              else
595
                  {
598
                {
596
                    isErpAllowed = true;
599
                  m_stationManager->SetUseNonErpProtection (false);
597
                    break;
600
                }
598
                  }
601
              if (capabilities.IsShortSlotTime () == true)
599
              }
602
                {
600
              if (!isErpAllowed)
603
                  //enable short slot time and set cwMin to 15
604
                  SetSlot (MicroSeconds (9));
605
                  ConfigureContentionWindow (15, 1023);
606
                }
607
              else
608
                {
601
                {
609
                  //disable short slot time and set cwMin to 31
602
                  //disable short slot time and set cwMin to 31
610
                  SetSlot (MicroSeconds (20));
603
                  SetSlot (MicroSeconds (20));
611
                  ConfigureContentionWindow (31, 1023);
604
                  ConfigureContentionWindow (31, 1023);
612
                }
605
                }
606
              else
607
                {
608
                  ErpInformation erpInformation = probeResp.GetErpInformation ();
609
                  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
610
                  if (m_stationManager->GetShortSlotTimeEnabled ())
611
                    {
612
                      //enable short slot time
613
                      SetSlot (MicroSeconds (9));
614
                    }
615
                  else
616
                    {
617
                      //disable short slot time
618
                      SetSlot (MicroSeconds (20));
619
                    }
620
                }
613
            }
621
            }
614
          m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
622
          m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
615
          m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
623
          m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
 Lines 644-663    Link Here 
644
              bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
652
              bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
645
              if (m_erpSupported)
653
              if (m_erpSupported)
646
                {
654
                {
647
                  ErpInformation erpInformation = assocResp.GetErpInformation ();
655
                  bool isErpAllowed = false;
648
                  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
656
                  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
649
                  if (m_stationManager->GetShortSlotTimeEnabled ())
657
                  {
650
                    {
658
                    WifiMode mode = m_phy->GetMode (i);
651
                      //enable short slot time and set cwMin to 15
659
                    if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM && rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, 1)))
652
                      SetSlot (MicroSeconds (9));
660
                      {
653
                      ConfigureContentionWindow (15, 1023);
661
                        isErpAllowed = true;
654
                    }
662
                        break;
655
                  else
663
                      }
664
                  }
665
                  if (!isErpAllowed)
656
                    {
666
                    {
657
                      //disable short slot time and set cwMin to 31
667
                      //disable short slot time and set cwMin to 31
658
                      SetSlot (MicroSeconds (20));
668
                      SetSlot (MicroSeconds (20));
659
                      ConfigureContentionWindow (31, 1023);
669
                      ConfigureContentionWindow (31, 1023);
660
                    }
670
                    }
671
                  else
672
                    {
673
                      ErpInformation erpInformation = assocResp.GetErpInformation ();
674
                      isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
675
                      if (m_stationManager->GetShortSlotTimeEnabled ())
676
                        {
677
                          //enable short slot time
678
                          SetSlot (MicroSeconds (9));
679
                        }
680
                      else
681
                        {
682
                          //disable short slot time
683
                          SetSlot (MicroSeconds (20));
684
                        }
685
                    }
661
                }
686
                }
662
              m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
687
              m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
663
              m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
688
              m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());

Return to bug 2327