Bug 852: Support ERP-OFDM rates and thus '802.11g'

This commit is contained in:
Dean Armstrong
2010-07-05 10:15:37 +01:00
parent 8088d0e9e1
commit 2264c85354
18 changed files with 202 additions and 3 deletions

View File

@@ -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:

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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)
{

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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 ();
}

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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,

View File

@@ -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 ();

View File

@@ -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 ();

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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);