From d6f82d20e0a542521c9efd0e46e6b7373f55f692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sun, 21 Feb 2021 13:43:24 +0100 Subject: [PATCH] wifi: Add new standards, preambles and modulation class for 802.11be --- src/wifi/model/wifi-phy-common.cc | 19 +++++++++++++------ src/wifi/model/wifi-phy-common.h | 13 +++++++++++-- src/wifi/model/wifi-standards.h | 11 +++++++++-- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/wifi/model/wifi-phy-common.cc b/src/wifi/model/wifi-phy-common.cc index 6d89620b2..ff308327f 100644 --- a/src/wifi/model/wifi-phy-common.cc +++ b/src/wifi/model/wifi-phy-common.cc @@ -30,10 +30,10 @@ uint16_t ConvertGuardIntervalToNanoSeconds (WifiMode mode, const Ptr device) { uint16_t gi = 800; - if (mode.GetModulationClass () == WIFI_MOD_CLASS_HE) + if (mode.GetModulationClass () >= WIFI_MOD_CLASS_HE) { Ptr heConfiguration = device->GetHeConfiguration (); - NS_ASSERT (heConfiguration); //If HE modulation is used, we should have a HE configuration attached + NS_ASSERT (heConfiguration); //If HE/EHT modulation is used, we should have a HE configuration attached gi = static_cast (heConfiguration->GetGuardInterval ().GetNanoSeconds ()); } else if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT || mode.GetModulationClass () == WIFI_MOD_CLASS_VHT) @@ -49,7 +49,7 @@ uint16_t ConvertGuardIntervalToNanoSeconds (WifiMode mode, bool htShortGuardInterval, Time heGuardInterval) { uint16_t gi; - if (mode.GetModulationClass () == WIFI_MOD_CLASS_HE) + if (mode.GetModulationClass () >= WIFI_MOD_CLASS_HE) { gi = static_cast (heGuardInterval.GetNanoSeconds ()); } @@ -94,7 +94,11 @@ GetChannelWidthForTransmission (WifiMode mode, uint16_t operatingChannelWidth, WifiPreamble GetPreambleForTransmission (WifiModulationClass modulation, bool useShortPreamble) { - if (modulation == WIFI_MOD_CLASS_HE) + if (modulation == WIFI_MOD_CLASS_EHT) + { + return WIFI_PREAMBLE_EHT_MU; + } + else if (modulation == WIFI_MOD_CLASS_HE) { return WIFI_PREAMBLE_HE_SU; } @@ -132,6 +136,7 @@ IsAllowedControlAnswerModulationClass (WifiModulationClass modClassReq, WifiModu case WIFI_MOD_CLASS_HT: case WIFI_MOD_CLASS_VHT: case WIFI_MOD_CLASS_HE: + case WIFI_MOD_CLASS_EHT: return true; default: NS_FATAL_ERROR ("Modulation class not defined"); @@ -153,6 +158,8 @@ GetPpduMaxTime (WifiPreamble preamble) case WIFI_PREAMBLE_HE_ER_SU: case WIFI_PREAMBLE_HE_MU: case WIFI_PREAMBLE_HE_TB: + case WIFI_PREAMBLE_EHT_MU: + case WIFI_PREAMBLE_EHT_TB: duration = MicroSeconds (5484); break; default: @@ -171,13 +178,13 @@ IsMu (WifiPreamble preamble) bool IsDlMu (WifiPreamble preamble) { - return (preamble == WIFI_PREAMBLE_HE_MU); + return ((preamble == WIFI_PREAMBLE_HE_MU) || (preamble == WIFI_PREAMBLE_EHT_MU)); } bool IsUlMu (WifiPreamble preamble) { - return (preamble == WIFI_PREAMBLE_HE_TB); + return ((preamble == WIFI_PREAMBLE_HE_TB) || (preamble == WIFI_PREAMBLE_EHT_TB)); } } //namespace ns3 diff --git a/src/wifi/model/wifi-phy-common.h b/src/wifi/model/wifi-phy-common.h index b22073f02..863d9f1ae 100644 --- a/src/wifi/model/wifi-phy-common.h +++ b/src/wifi/model/wifi-phy-common.h @@ -74,7 +74,9 @@ enum WifiPreamble WIFI_PREAMBLE_HE_SU, WIFI_PREAMBLE_HE_ER_SU, WIFI_PREAMBLE_HE_MU, - WIFI_PREAMBLE_HE_TB + WIFI_PREAMBLE_HE_TB, + WIFI_PREAMBLE_EHT_MU, + WIFI_PREAMBLE_EHT_TB }; /** @@ -106,6 +108,10 @@ inline std::ostream& operator<< (std::ostream &os, const WifiPreamble &preamble) return (os << "HE_MU"); case WIFI_PREAMBLE_HE_TB: return (os << "HE_TB"); + case WIFI_PREAMBLE_EHT_MU: + return (os << "EHT_MU"); + case WIFI_PREAMBLE_EHT_TB: + return (os << "EHT_TB"); default: NS_FATAL_ERROR ("Invalid preamble"); return (os << "INVALID"); @@ -129,7 +135,8 @@ enum WifiModulationClass WIFI_MOD_CLASS_OFDM, //!< OFDM (Clause 17) WIFI_MOD_CLASS_HT, //!< HT (Clause 19) WIFI_MOD_CLASS_VHT, //!< VHT (Clause 22) - WIFI_MOD_CLASS_HE //!< HE (Clause 27) + WIFI_MOD_CLASS_HE, //!< HE (Clause 27) + WIFI_MOD_CLASS_EHT //!< EHT (Clause 36) }; /** @@ -157,6 +164,8 @@ inline std::ostream& operator<< (std::ostream &os, const WifiModulationClass &mo return (os << "VHT"); case WIFI_MOD_CLASS_HE: return (os << "HE"); + case WIFI_MOD_CLASS_EHT: + return (os << "EHT"); default: NS_FATAL_ERROR ("Unknown modulation"); return (os << "unknown"); diff --git a/src/wifi/model/wifi-standards.h b/src/wifi/model/wifi-standards.h index 29580fe12..7bebfcad0 100644 --- a/src/wifi/model/wifi-standards.h +++ b/src/wifi/model/wifi-standards.h @@ -41,7 +41,8 @@ enum WifiStandard WIFI_STANDARD_80211p, WIFI_STANDARD_80211n, WIFI_STANDARD_80211ac, - WIFI_STANDARD_80211ax + WIFI_STANDARD_80211ax, + WIFI_STANDARD_80211be }; /** @@ -69,6 +70,8 @@ inline std::ostream& operator<< (std::ostream& os, WifiStandard standard) return (os << "802.11ac"); case WIFI_STANDARD_80211ax: return (os << "802.11ax"); + case WIFI_STANDARD_80211be: + return (os << "802.11be"); default: return (os << "UNSPECIFIED"); } @@ -86,7 +89,8 @@ const std::map> wifiStandards = { WIFI_STANDARD_80211p, { WIFI_PHY_BAND_5GHZ } }, { WIFI_STANDARD_80211n, { WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ } }, { WIFI_STANDARD_80211ac, { WIFI_PHY_BAND_5GHZ } }, - { WIFI_STANDARD_80211ax, { WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ } } + { WIFI_STANDARD_80211ax, { WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ } }, + { WIFI_STANDARD_80211be, { WIFI_PHY_BAND_2_4GHZ, WIFI_PHY_BAND_5GHZ, WIFI_PHY_BAND_6GHZ } } }; /** @@ -140,6 +144,7 @@ inline uint16_t GetMaximumChannelWidth (WifiStandard standard) return 40; case WIFI_STANDARD_80211ac: case WIFI_STANDARD_80211ax: + case WIFI_STANDARD_80211be: return 160; default: NS_ABORT_MSG ("Unknown standard: " << standard); @@ -165,6 +170,7 @@ inline uint16_t GetDefaultChannelWidth (WifiStandard standard, WifiPhyBand band) case WIFI_STANDARD_80211ac: return 80; case WIFI_STANDARD_80211ax: + case WIFI_STANDARD_80211be: return (band == WIFI_PHY_BAND_2_4GHZ ? 20 : 80); default: return 20; @@ -185,6 +191,7 @@ inline WifiPhyBand GetDefaultPhyBand (WifiStandard standard) case WIFI_STANDARD_80211a: case WIFI_STANDARD_80211ac: case WIFI_STANDARD_80211ax: + case WIFI_STANDARD_80211be: return WIFI_PHY_BAND_5GHZ; default: return WIFI_PHY_BAND_2_4GHZ;