wifi: Add ModulationLookupTable for WifiMode rework

This commit is contained in:
Muhammad Iqbal CR
2020-12-03 14:21:08 -06:00
committed by Rediet
parent c7ff001548
commit d42598b300
7 changed files with 66 additions and 0 deletions

View File

@@ -45,6 +45,14 @@ const PhyEntity::PpduFormats DsssPhy::m_dsssPpduFormats {
WIFI_PPDU_FIELD_NON_HT_HEADER, //Short PHY header
WIFI_PPDU_FIELD_DATA } }
};
const PhyEntity::ModulationLookupTable DsssPhy::m_dsssModulationLookupTable {
// Unique name Code rate Constellation size
{ "DsssRate1Mbps", { WIFI_CODE_RATE_UNDEFINED, 2 } },
{ "DsssRate2Mbps", { WIFI_CODE_RATE_UNDEFINED, 4 } },
{ "DsssRate5_5Mbps", { WIFI_CODE_RATE_UNDEFINED, 16 } },
{ "DsssRate11Mbps", { WIFI_CODE_RATE_UNDEFINED, 256 } }
};
/* *NS_CHECK_STYLE_ON* */
DsssPhy::DsssPhy ()

View File

@@ -142,6 +142,8 @@ private:
PhyFieldRxStatus EndReceiveHeader (Ptr<Event> event);
static const PpduFormats m_dsssPpduFormats; //!< DSSS and HR/DSSS PPDU formats
static const ModulationLookupTable m_dsssModulationLookupTable; //!< lookup table to retrieve code rate and constellation size corresponding to a unique name of modulation
}; //class DsssPhy
} //namespace ns3

View File

@@ -35,6 +35,20 @@ NS_LOG_COMPONENT_DEFINE ("ErpOfdmPhy");
* ERP-OFDM PHY (IEEE 802.11-2016, clause 18)
*******************************************************/
/* *NS_CHECK_STYLE_OFF* */
const PhyEntity::ModulationLookupTable ErpOfdmPhy::m_erpOfdmModulationLookupTable {
// Unique name Code rate Constellation size
{ "ErpOfdmRate6Mbps", { WIFI_CODE_RATE_1_2, 2 } },
{ "ErpOfdmRate9Mbps", { WIFI_CODE_RATE_3_4, 2 } },
{ "ErpOfdmRate12Mbps", { WIFI_CODE_RATE_1_2, 4 } },
{ "ErpOfdmRate18Mbps", { WIFI_CODE_RATE_3_4, 4 } },
{ "ErpOfdmRate24Mbps", { WIFI_CODE_RATE_1_2, 16 } },
{ "ErpOfdmRate36Mbps", { WIFI_CODE_RATE_3_4, 16 } },
{ "ErpOfdmRate48Mbps", { WIFI_CODE_RATE_2_3, 64 } },
{ "ErpOfdmRate54Mbps", { WIFI_CODE_RATE_3_4, 64 } }
};
/* *NS_CHECK_STYLE_ON* */
ErpOfdmPhy::ErpOfdmPhy ()
: OfdmPhy (OFDM_PHY_DEFAULT, false) //don't add OFDM modes to list
{

View File

@@ -131,6 +131,8 @@ private:
WifiMode GetHeaderMode (WifiTxVector txVector) const override;
Time GetPreambleDuration (WifiTxVector txVector) const override;
Time GetHeaderDuration (WifiTxVector txVector) const override;
static const ModulationLookupTable m_erpOfdmModulationLookupTable; //!< lookup table to retrieve code rate and constellation size corresponding to a unique name of modulation
}; //class ErpOfdmPhy
} //namespace ns3

View File

@@ -42,6 +42,34 @@ const PhyEntity::PpduFormats OfdmPhy::m_ofdmPpduFormats {
WIFI_PPDU_FIELD_NON_HT_HEADER, //SIG
WIFI_PPDU_FIELD_DATA } }
};
const PhyEntity::ModulationLookupTable OfdmPhy::m_ofdmModulationLookupTable {
// Unique name Code rate Constellation size
{ "OfdmRate6Mbps", { WIFI_CODE_RATE_1_2, 2 } }, // 20 MHz
{ "OfdmRate9Mbps", { WIFI_CODE_RATE_3_4, 2 } }, // |
{ "OfdmRate12Mbps", { WIFI_CODE_RATE_1_2, 4 } }, // V
{ "OfdmRate18Mbps", { WIFI_CODE_RATE_3_4, 4 } },
{ "OfdmRate24Mbps", { WIFI_CODE_RATE_1_2, 16 } },
{ "OfdmRate36Mbps", { WIFI_CODE_RATE_3_4, 16 } },
{ "OfdmRate48Mbps", { WIFI_CODE_RATE_2_3, 64 } },
{ "OfdmRate54Mbps", { WIFI_CODE_RATE_3_4, 64 } },
{ "OfdmRate3MbpsBW10MHz", { WIFI_CODE_RATE_1_2, 2 } }, // 10 MHz
{ "OfdmRate4_5MbpsBW10MHz", { WIFI_CODE_RATE_3_4, 2 } }, // |
{ "OfdmRate6MbpsBW10MHz", { WIFI_CODE_RATE_1_2, 4 } }, // V
{ "OfdmRate9MbpsBW10MHz", { WIFI_CODE_RATE_3_4, 4 } },
{ "OfdmRate12MbpsBW10MHz", { WIFI_CODE_RATE_1_2, 16 } },
{ "OfdmRate18MbpsBW10MHz", { WIFI_CODE_RATE_3_4, 16 } },
{ "OfdmRate24MbpsBW10MHz", { WIFI_CODE_RATE_2_3, 64 } },
{ "OfdmRate27MbpsBW10MHz", { WIFI_CODE_RATE_3_4, 64 } },
{ "OfdmRate1_5MbpsBW5MHz", { WIFI_CODE_RATE_1_2, 2 } }, // 5 MHz
{ "OfdmRate2_25MbpsBW5MHz", { WIFI_CODE_RATE_3_4, 2 } }, // |
{ "OfdmRate3MbpsBW5MHz", { WIFI_CODE_RATE_1_2, 4 } }, // V
{ "OfdmRate4_5MbpsBW5MHz", { WIFI_CODE_RATE_3_4, 4 } },
{ "OfdmRate6MbpsBW5MHz", { WIFI_CODE_RATE_1_2, 16 } },
{ "OfdmRate9MbpsBW5MHz", { WIFI_CODE_RATE_3_4, 16 } },
{ "OfdmRate12MbpsBW5MHz", { WIFI_CODE_RATE_2_3, 64 } },
{ "OfdmRate13_5MbpsBW5MHz", { WIFI_CODE_RATE_3_4, 64 } }
};
/* *NS_CHECK_STYLE_ON* */
OfdmPhy::OfdmPhy (OfdmPhyVariant variant /* = OFDM_PHY_DEFAULT */, bool buildModeList /* = true */)

View File

@@ -318,6 +318,8 @@ protected:
private:
static const PpduFormats m_ofdmPpduFormats; //!< OFDM PPDU formats
static const ModulationLookupTable m_ofdmModulationLookupTable; //!< lookup table to retrieve code rate and constellation size corresponding to a unique name of modulation
}; //class OfdmPhy
} //namespace ns3

View File

@@ -468,6 +468,16 @@ protected:
*/
typedef std::map<WifiPreamble, std::vector<WifiPpduField> > PpduFormats;
/**
* A pair to hold modulation information: code rate and constellation size.
*/
typedef std::pair<WifiCodeRate, uint16_t> CodeRateConstellationSizePair;
/**
* A modulation lookup table using unique name of modulation as key.
*/
typedef std::map<std::string, CodeRateConstellationSizePair> ModulationLookupTable;
/**
* Return the PPDU formats of the PHY.
*