From 417658e961361c90f27a8a5ae5cc34dbb523cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sat, 6 Nov 2021 15:31:10 +0100 Subject: [PATCH] wifi: Add standard, band, preambles, modulation classes and coding rates for 802.11ad --- src/wifi/model/wifi-phy-band.h | 4 ++++ src/wifi/model/wifi-phy-common.cc | 12 ++++++++++++ src/wifi/model/wifi-phy-common.h | 29 +++++++++++++++++++++++++++++ src/wifi/model/wifi-standards.h | 10 ++++++++++ 4 files changed, 55 insertions(+) diff --git a/src/wifi/model/wifi-phy-band.h b/src/wifi/model/wifi-phy-band.h index dbe113f26..cf6364015 100644 --- a/src/wifi/model/wifi-phy-band.h +++ b/src/wifi/model/wifi-phy-band.h @@ -37,6 +37,8 @@ enum WifiPhyBand WIFI_PHY_BAND_5GHZ, /** The 6 GHz band */ WIFI_PHY_BAND_6GHZ, + /** The 60 GHz band */ + WIFI_PHY_BAND_60GHZ, /** Unspecified */ WIFI_PHY_BAND_UNSPECIFIED }; @@ -58,6 +60,8 @@ inline std::ostream& operator<< (std::ostream& os, WifiPhyBand band) return (os << "5GHz"); case WIFI_PHY_BAND_6GHZ: return (os << "6GHz"); + case WIFI_PHY_BAND_60GHZ: + return (os << "60GHz"); default: return (os << "INVALID"); } diff --git a/src/wifi/model/wifi-phy-common.cc b/src/wifi/model/wifi-phy-common.cc index 0e85e337c..81695114a 100644 --- a/src/wifi/model/wifi-phy-common.cc +++ b/src/wifi/model/wifi-phy-common.cc @@ -102,6 +102,18 @@ GetPreambleForTransmission (WifiModulationClass modulation, bool useShortPreambl { return WIFI_PREAMBLE_HE_SU; } + else if (modulation == WIFI_MOD_CLASS_DMG_CTRL) + { + return WIFI_PREAMBLE_DMG_CTRL; + } + else if (modulation == WIFI_MOD_CLASS_DMG_SC) + { + return WIFI_PREAMBLE_DMG_SC; + } + else if (modulation == WIFI_MOD_CLASS_DMG_OFDM) + { + return WIFI_PREAMBLE_DMG_OFDM; + } else if (modulation == WIFI_MOD_CLASS_VHT) { return WIFI_PREAMBLE_VHT_SU; diff --git a/src/wifi/model/wifi-phy-common.h b/src/wifi/model/wifi-phy-common.h index 5ed33f16e..5d9e6932c 100644 --- a/src/wifi/model/wifi-phy-common.h +++ b/src/wifi/model/wifi-phy-common.h @@ -60,6 +60,14 @@ const uint16_t WIFI_CODE_RATE_1_2 = 1; //!< 1/2 coding rate const uint16_t WIFI_CODE_RATE_2_3 = 2; //!< 2/3 coding rate const uint16_t WIFI_CODE_RATE_3_4 = 3; //!< 3/4 coding rate const uint16_t WIFI_CODE_RATE_5_6 = 4; //!< 5/6 coding rate +const uint16_t WIFI_CODE_RATE_5_8 = 5; //!< 5/8 coding rate +const uint16_t WIFI_CODE_RATE_13_16 = 6; //!< 13/16 coding rate +const uint16_t WIFI_CODE_RATE_1_4 = 7; //!< 1/4 coding rate +const uint16_t WIFI_CODE_RATE_13_28 = 8; //!< 13/28 coding rate +const uint16_t WIFI_CODE_RATE_13_21 = 9; //!< 13/21 coding rate +const uint16_t WIFI_CODE_RATE_52_63 = 10; //!< 52/63 coding rate +const uint16_t WIFI_CODE_RATE_13_14 = 11; //!< 13/14 coding rate +const uint16_t WIFI_CODE_RATE_7_8 = 12; //!< 7/8 coding rate /** * \ingroup wifi @@ -72,6 +80,9 @@ enum WifiPreamble WIFI_PREAMBLE_HT_MF, WIFI_PREAMBLE_VHT_SU, WIFI_PREAMBLE_VHT_MU, + WIFI_PREAMBLE_DMG_CTRL, + WIFI_PREAMBLE_DMG_SC, + WIFI_PREAMBLE_DMG_OFDM, WIFI_PREAMBLE_HE_SU, WIFI_PREAMBLE_HE_ER_SU, WIFI_PREAMBLE_HE_MU, @@ -101,6 +112,12 @@ inline std::ostream& operator<< (std::ostream &os, const WifiPreamble &preamble) return (os << "VHT_SU"); case WIFI_PREAMBLE_VHT_MU: return (os << "VHT_MU"); + case WIFI_PREAMBLE_DMG_CTRL: + return (os << "DMG_CTRL"); + case WIFI_PREAMBLE_DMG_SC: + return (os << "DMG_SC"); + case WIFI_PREAMBLE_DMG_OFDM: + return (os << "DMG_OFDM"); case WIFI_PREAMBLE_HE_SU: return (os << "HE_SU"); case WIFI_PREAMBLE_HE_ER_SU: @@ -136,6 +153,10 @@ 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_DMG_CTRL, //!< DMG (Clause 21) + WIFI_MOD_CLASS_DMG_OFDM, //!< DMG (Clause 21) + WIFI_MOD_CLASS_DMG_SC, //!< DMG (Clause 21) + WIFI_MOD_CLASS_DMG_LP_SC,//!< DMG (Clause 21) WIFI_MOD_CLASS_HE, //!< HE (Clause 27) WIFI_MOD_CLASS_EHT //!< EHT (Clause 36) }; @@ -163,6 +184,14 @@ inline std::ostream& operator<< (std::ostream &os, const WifiModulationClass &mo return (os << "HT"); case WIFI_MOD_CLASS_VHT: return (os << "VHT"); + case WIFI_MOD_CLASS_DMG_CTRL: + return (os << "DMG_CTRL"); + case WIFI_MOD_CLASS_DMG_OFDM: + return (os << "DMG_OFDM"); + case WIFI_MOD_CLASS_DMG_SC: + return (os << "DMG_SC"); + case WIFI_MOD_CLASS_DMG_LP_SC: + return (os << "DMG_LP_SC"); case WIFI_MOD_CLASS_HE: return (os << "HE"); case WIFI_MOD_CLASS_EHT: diff --git a/src/wifi/model/wifi-standards.h b/src/wifi/model/wifi-standards.h index 7bebfcad0..cc3290dc8 100644 --- a/src/wifi/model/wifi-standards.h +++ b/src/wifi/model/wifi-standards.h @@ -41,6 +41,7 @@ enum WifiStandard WIFI_STANDARD_80211p, WIFI_STANDARD_80211n, WIFI_STANDARD_80211ac, + WIFI_STANDARD_80211ad, WIFI_STANDARD_80211ax, WIFI_STANDARD_80211be }; @@ -68,6 +69,8 @@ inline std::ostream& operator<< (std::ostream& os, WifiStandard standard) return (os << "802.11n"); case WIFI_STANDARD_80211ac: return (os << "802.11ac"); + case WIFI_STANDARD_80211ad: + return (os << "802.11ad"); case WIFI_STANDARD_80211ax: return (os << "802.11ax"); case WIFI_STANDARD_80211be: @@ -89,6 +92,7 @@ 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_80211ad, { WIFI_PHY_BAND_60GHZ } }, { 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 } } }; @@ -146,6 +150,8 @@ inline uint16_t GetMaximumChannelWidth (WifiStandard standard) case WIFI_STANDARD_80211ax: case WIFI_STANDARD_80211be: return 160; + case WIFI_STANDARD_80211ad: + return 2160; default: NS_ABORT_MSG ("Unknown standard: " << standard); return 0; @@ -169,6 +175,8 @@ inline uint16_t GetDefaultChannelWidth (WifiStandard standard, WifiPhyBand band) return 10; case WIFI_STANDARD_80211ac: return 80; + case WIFI_STANDARD_80211ad: + return 2160; case WIFI_STANDARD_80211ax: case WIFI_STANDARD_80211be: return (band == WIFI_PHY_BAND_2_4GHZ ? 20 : 80); @@ -193,6 +201,8 @@ inline WifiPhyBand GetDefaultPhyBand (WifiStandard standard) case WIFI_STANDARD_80211ax: case WIFI_STANDARD_80211be: return WIFI_PHY_BAND_5GHZ; + case WIFI_STANDARD_80211ad: + return WIFI_PHY_BAND_60GHZ; default: return WIFI_PHY_BAND_2_4GHZ; }