diff --git a/src/devices/wifi/adhoc-wifi-mac.cc b/src/devices/wifi/adhoc-wifi-mac.cc index ad2c5de48..118ea3d91 100644 --- a/src/devices/wifi/adhoc-wifi-mac.cc +++ b/src/devices/wifi/adhoc-wifi-mac.cc @@ -273,6 +273,8 @@ AdhocWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) case WIFI_PHY_STANDARD_80211_5Mhz: // fall through case WIFI_PHY_STANDARD_80211a: + // fall through + case WIFI_PHY_STANDARD_80211g: ConfigureDcf (m_dca, 15, 1023, AC_BE_NQOS); break; case WIFI_PHY_STANDARD_80211b: diff --git a/src/devices/wifi/interference-helper-tx-duration-test.cc b/src/devices/wifi/interference-helper-tx-duration-test.cc index 473585d5f..0e802b8b7 100644 --- a/src/devices/wifi/interference-helper-tx-duration-test.cc +++ b/src/devices/wifi/interference-helper-tx-duration-test.cc @@ -173,6 +173,12 @@ InterferenceHelperTxDurationTest::DoRun (void) && CheckTxDuration (76, WifiPhy::GetOfdmRate54Mbps (), WIFI_PREAMBLE_LONG, 32) && CheckTxDuration (14, WifiPhy::GetOfdmRate54Mbps (), WIFI_PREAMBLE_LONG, 24); + // 802.11g durations are same as 802.11a durations but with 6 us signal extension + retval = retval + && CheckTxDuration (1536, WifiPhy::GetErpOfdmRate54Mbps (), WIFI_PREAMBLE_LONG, 254) + && CheckTxDuration (76, WifiPhy::GetErpOfdmRate54Mbps (), WIFI_PREAMBLE_LONG, 38) + && CheckTxDuration (14, WifiPhy::GetErpOfdmRate54Mbps (), WIFI_PREAMBLE_LONG, 30); + return (!retval); } diff --git a/src/devices/wifi/interference-helper.cc b/src/devices/wifi/interference-helper.cc index 90e4ae19c..c8f99272c 100644 --- a/src/devices/wifi/interference-helper.cc +++ b/src/devices/wifi/interference-helper.cc @@ -206,6 +206,9 @@ InterferenceHelper::GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamb } } + case WIFI_MOD_CLASS_ERP_OFDM: + return WifiPhy::GetErpOfdmRate6Mbps (); + case WIFI_MOD_CLASS_DSSS: if (preamble == WIFI_PREAMBLE_LONG) { @@ -250,6 +253,9 @@ InterferenceHelper::GetPlcpHeaderDurationMicroSeconds (WifiMode payloadMode, Wif } } + case WIFI_MOD_CLASS_ERP_OFDM: + return 16; + case WIFI_MOD_CLASS_DSSS: if (preamble == WIFI_PREAMBLE_SHORT) { @@ -292,6 +298,9 @@ InterferenceHelper::GetPlcpPreambleDurationMicroSeconds (WifiMode payloadMode, W } } + case WIFI_MOD_CLASS_ERP_OFDM: + return 4; + case WIFI_MOD_CLASS_DSSS: if (preamble == WIFI_PREAMBLE_SHORT) { @@ -318,6 +327,7 @@ InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl switch (payloadMode.GetModulationClass ()) { case WIFI_MOD_CLASS_OFDM: + case WIFI_MOD_CLASS_ERP_OFDM: { // IEEE Std 802.11-2007, section 17.3.2.3, table 17-4 // corresponds to T_{SYM} in the table @@ -343,6 +353,10 @@ InterferenceHelper::GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payl // IEEE Std 802.11-2007, section 17.3.5.3, equation (17-11) uint32_t numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0)/numDataBitsPerSymbol)); + // Add signal extension for ERP PHY + if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) + return numSymbols*symbolDurationUs + 6; + else return numSymbols*symbolDurationUs; } diff --git a/src/devices/wifi/nist-error-rate-model.cc b/src/devices/wifi/nist-error-rate-model.cc index fed0099cb..a0c6d97ec 100644 --- a/src/devices/wifi/nist-error-rate-model.cc +++ b/src/devices/wifi/nist-error-rate-model.cc @@ -190,7 +190,8 @@ NistErrorRateModel::GetFec64QamBer (double snr, uint32_t nbits, double NistErrorRateModel::GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const { - if (mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM) + if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM || + mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM) { if (mode.GetConstellationSize () == 2) { diff --git a/src/devices/wifi/nqap-wifi-mac.cc b/src/devices/wifi/nqap-wifi-mac.cc index 8903ff969..7cbff42aa 100644 --- a/src/devices/wifi/nqap-wifi-mac.cc +++ b/src/devices/wifi/nqap-wifi-mac.cc @@ -593,6 +593,8 @@ NqapWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) case WIFI_PHY_STANDARD_80211_5Mhz: // fall through case WIFI_PHY_STANDARD_80211a: + // fall through + case WIFI_PHY_STANDARD_80211g: ConfigureDcf (m_dca, 15, 1023, AC_BE_NQOS); break; case WIFI_PHY_STANDARD_80211b: diff --git a/src/devices/wifi/nqsta-wifi-mac.cc b/src/devices/wifi/nqsta-wifi-mac.cc index 8f626e630..fe12910d1 100644 --- a/src/devices/wifi/nqsta-wifi-mac.cc +++ b/src/devices/wifi/nqsta-wifi-mac.cc @@ -676,6 +676,8 @@ NqstaWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) case WIFI_PHY_STANDARD_80211_5Mhz: // fall through case WIFI_PHY_STANDARD_80211a: + // fall through + case WIFI_PHY_STANDARD_80211g: ConfigureDcf (m_dca, 15, 1023, AC_BE_NQOS); break; case WIFI_PHY_STANDARD_80211b: diff --git a/src/devices/wifi/qadhoc-wifi-mac.cc b/src/devices/wifi/qadhoc-wifi-mac.cc index d5a31abb0..2ad641563 100644 --- a/src/devices/wifi/qadhoc-wifi-mac.cc +++ b/src/devices/wifi/qadhoc-wifi-mac.cc @@ -494,6 +494,8 @@ QadhocWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) // fall through case WIFI_PHY_STANDARD_80211a: // fall through + case WIFI_PHY_STANDARD_80211g: + // fall through case WIFI_PHY_STANDARD_80211_10Mhz: // fall through case WIFI_PHY_STANDARD_80211_5Mhz: diff --git a/src/devices/wifi/qap-wifi-mac.cc b/src/devices/wifi/qap-wifi-mac.cc index 649060d73..534e01ac1 100644 --- a/src/devices/wifi/qap-wifi-mac.cc +++ b/src/devices/wifi/qap-wifi-mac.cc @@ -841,6 +841,8 @@ QapWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) // fall through case WIFI_PHY_STANDARD_80211a: // fall through + case WIFI_PHY_STANDARD_80211g: + // fall through case WIFI_PHY_STANDARD_80211_10Mhz: // fall through case WIFI_PHY_STANDARD_80211_5Mhz: diff --git a/src/devices/wifi/qsta-wifi-mac.cc b/src/devices/wifi/qsta-wifi-mac.cc index 4b32e64a5..2a7ac1eab 100644 --- a/src/devices/wifi/qsta-wifi-mac.cc +++ b/src/devices/wifi/qsta-wifi-mac.cc @@ -830,6 +830,8 @@ QstaWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) // fall through case WIFI_PHY_STANDARD_80211a: // fall through + case WIFI_PHY_STANDARD_80211g: + // fall through case WIFI_PHY_STANDARD_80211_10Mhz: // fall through case WIFI_PHY_STANDARD_80211_5Mhz: diff --git a/src/devices/wifi/rraa-wifi-manager.cc b/src/devices/wifi/rraa-wifi-manager.cc index b151ff21a..f07f270cf 100644 --- a/src/devices/wifi/rraa-wifi-manager.cc +++ b/src/devices/wifi/rraa-wifi-manager.cc @@ -419,7 +419,7 @@ RraaWifiManager::GetThresholds (WifiMode mode) const return mode6; } break; } - NS_ASSERT_MSG(false, "Thresholds for an unknown mode are asked"); + NS_ASSERT_MSG(false, "Thresholds for an unknown mode are asked (" << mode << ")"); return ThresholdsItem (); } diff --git a/src/devices/wifi/wifi-mac.cc b/src/devices/wifi/wifi-mac.cc index aa71ba034..20379961f 100644 --- a/src/devices/wifi/wifi-mac.cc +++ b/src/devices/wifi/wifi-mac.cc @@ -267,6 +267,9 @@ WifiMac::ConfigureStandard (enum WifiPhyStandard standard) case WIFI_PHY_STANDARD_80211b: Configure80211b (); break; + case WIFI_PHY_STANDARD_80211g: + Configure80211g (); + break; case WIFI_PHY_STANDARD_80211_10Mhz: Configure80211_10Mhz (); break; @@ -311,6 +314,18 @@ WifiMac::Configure80211b (void) SetAckTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); } +void +WifiMac::Configure80211g (void) +{ + SetSifs(MicroSeconds(10)); + // Note no support for Short Slot Time as yet + SetSlot(MicroSeconds(20)); + SetEifsNoDifs(MicroSeconds(10+304)); + SetPifs(MicroSeconds(10+20)); + SetCtsTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); + SetAckTimeout(MicroSeconds(10+304+20+GetDefaultMaxPropagationDelay().GetMicroSeconds ()*2)); +} + void WifiMac::Configure80211_10Mhz (void) { diff --git a/src/devices/wifi/wifi-mac.h b/src/devices/wifi/wifi-mac.h index 153c33e86..0b3285f16 100644 --- a/src/devices/wifi/wifi-mac.h +++ b/src/devices/wifi/wifi-mac.h @@ -245,6 +245,7 @@ private: void Configure80211a (void); void Configure80211b (void); + void Configure80211g (void); void Configure80211_10Mhz (void); void Configure80211_5Mhz (); void Configure80211p_CCH (void); diff --git a/src/devices/wifi/wifi-phy-standard.h b/src/devices/wifi/wifi-phy-standard.h index 906e7235c..1b351a37a 100644 --- a/src/devices/wifi/wifi-phy-standard.h +++ b/src/devices/wifi/wifi-phy-standard.h @@ -25,6 +25,7 @@ namespace ns3 { enum WifiPhyStandard { WIFI_PHY_STANDARD_80211a, WIFI_PHY_STANDARD_80211b, + WIFI_PHY_STANDARD_80211g, WIFI_PHY_STANDARD_80211_10Mhz, WIFI_PHY_STANDARD_80211_5Mhz, WIFI_PHY_STANDARD_holland, diff --git a/src/devices/wifi/wifi-phy.cc b/src/devices/wifi/wifi-phy.cc index 0183ed647..186605b6f 100644 --- a/src/devices/wifi/wifi-phy.cc +++ b/src/devices/wifi/wifi-phy.cc @@ -203,6 +203,114 @@ WifiPhy::GetDsssRate11Mbps () } +/** + * Clause 19.5 rates (ERP-OFDM) + */ +WifiMode +WifiPhy::GetErpOfdmRate6Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate6Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + true, + 20000000, 6000000, + WIFI_CODE_RATE_1_2, + 2); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate9Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate9Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + false, + 20000000, 9000000, + WIFI_CODE_RATE_3_4, + 2); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate12Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate12Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + true, + 20000000, 12000000, + WIFI_CODE_RATE_1_2, + 4); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate18Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate18Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + false, + 20000000, 18000000, + WIFI_CODE_RATE_3_4, + 4); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate24Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate24Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + true, + 20000000, 24000000, + WIFI_CODE_RATE_1_2, + 16); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate36Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate36Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + false, + 20000000, 36000000, + WIFI_CODE_RATE_3_4, + 16); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate48Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate48Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + false, + 20000000, 48000000, + WIFI_CODE_RATE_2_3, + 64); + return mode; +} + +WifiMode +WifiPhy::GetErpOfdmRate54Mbps () +{ + static WifiMode mode = + WifiModeFactory::CreateWifiMode ("ErpOfdmRate54Mbps", + WIFI_MOD_CLASS_ERP_OFDM, + false, + 20000000, 54000000, + WIFI_CODE_RATE_3_4, + 64); + return mode; +} + + /** * Clause 17 rates (OFDM) */ @@ -551,6 +659,14 @@ public: ns3::WifiPhy::GetDsssRate2Mbps (); ns3::WifiPhy::GetDsssRate5_5Mbps (); ns3::WifiPhy::GetDsssRate11Mbps (); + ns3::WifiPhy::GetErpOfdmRate6Mbps (); + ns3::WifiPhy::GetErpOfdmRate9Mbps (); + ns3::WifiPhy::GetErpOfdmRate12Mbps (); + ns3::WifiPhy::GetErpOfdmRate18Mbps (); + ns3::WifiPhy::GetErpOfdmRate24Mbps (); + ns3::WifiPhy::GetErpOfdmRate36Mbps (); + ns3::WifiPhy::GetErpOfdmRate48Mbps (); + ns3::WifiPhy::GetErpOfdmRate54Mbps (); ns3::WifiPhy::GetOfdmRate6Mbps (); ns3::WifiPhy::GetOfdmRate9Mbps (); ns3::WifiPhy::GetOfdmRate12Mbps (); diff --git a/src/devices/wifi/wifi-phy.h b/src/devices/wifi/wifi-phy.h index f3bb17b52..909b2f5fe 100644 --- a/src/devices/wifi/wifi-phy.h +++ b/src/devices/wifi/wifi-phy.h @@ -306,6 +306,14 @@ public: static WifiMode GetDsssRate2Mbps (); static WifiMode GetDsssRate5_5Mbps (); static WifiMode GetDsssRate11Mbps (); + static WifiMode GetErpOfdmRate6Mbps (); + static WifiMode GetErpOfdmRate9Mbps (); + static WifiMode GetErpOfdmRate12Mbps (); + static WifiMode GetErpOfdmRate18Mbps (); + static WifiMode GetErpOfdmRate24Mbps (); + static WifiMode GetErpOfdmRate36Mbps (); + static WifiMode GetErpOfdmRate48Mbps (); + static WifiMode GetErpOfdmRate54Mbps (); static WifiMode GetOfdmRate6Mbps (); static WifiMode GetOfdmRate9Mbps (); static WifiMode GetOfdmRate12Mbps (); diff --git a/src/devices/wifi/yans-error-rate-model.cc b/src/devices/wifi/yans-error-rate-model.cc index 5839bed20..418355f0c 100644 --- a/src/devices/wifi/yans-error-rate-model.cc +++ b/src/devices/wifi/yans-error-rate-model.cc @@ -171,7 +171,8 @@ YansErrorRateModel::GetFecQamBer (double snr, uint32_t nbits, double YansErrorRateModel::GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const { - if (mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM) + if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM || + mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM) { if (mode.GetConstellationSize () == 2) { diff --git a/src/devices/wifi/yans-wifi-phy.cc b/src/devices/wifi/yans-wifi-phy.cc index 583634a57..1d3f1de01 100644 --- a/src/devices/wifi/yans-wifi-phy.cc +++ b/src/devices/wifi/yans-wifi-phy.cc @@ -162,6 +162,9 @@ YansWifiPhy::ConfigureStandard (enum WifiPhyStandard standard) case WIFI_PHY_STANDARD_80211b: Configure80211b (); break; + case WIFI_PHY_STANDARD_80211g: + Configure80211g (); + break; case WIFI_PHY_STANDARD_80211_10Mhz: Configure80211_10Mhz (); break; @@ -560,6 +563,26 @@ YansWifiPhy::Configure80211b (void) m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); } +void +YansWifiPhy::Configure80211g (void) +{ + NS_LOG_FUNCTION (this); + m_channelStartingFrequency = 2412; // 2.412 GHz + + m_deviceRateSet.push_back (WifiPhy::GetDsssRate1Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetDsssRate2Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetDsssRate5_5Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate6Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate9Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetDsssRate11Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate12Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate18Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate24Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate36Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate48Mbps ()); + m_deviceRateSet.push_back (WifiPhy::GetErpOfdmRate54Mbps ()); +} + void YansWifiPhy::Configure80211_10Mhz (void) { diff --git a/src/devices/wifi/yans-wifi-phy.h b/src/devices/wifi/yans-wifi-phy.h index b855fb437..13d94c26b 100644 --- a/src/devices/wifi/yans-wifi-phy.h +++ b/src/devices/wifi/yans-wifi-phy.h @@ -147,6 +147,7 @@ private: virtual void DoDispose (void); void Configure80211a (void); void Configure80211b (void); + void Configure80211g (void); void Configure80211_10Mhz (void); void Configure80211_5Mhz (); void ConfigureHolland (void);