diff --git a/src/wifi/model/mpdu-aggregator.cc b/src/wifi/model/mpdu-aggregator.cc index b0fafaff3..9e3df9451 100644 --- a/src/wifi/model/mpdu-aggregator.cc +++ b/src/wifi/model/mpdu-aggregator.cc @@ -145,7 +145,7 @@ MpduAggregator::GetMaxAmpduSize (Mac48Address recipient, uint8_t tid, // Determine the constraint imposed by the recipient based on the PPDU // format used to transmit the A-MPDU - if (modulation == WIFI_MOD_CLASS_HE) + if (modulation >= WIFI_MOD_CLASS_HE) { NS_ABORT_MSG_IF (!heCapabilities, "HE Capabilities element not received"); diff --git a/src/wifi/model/wifi-mac.cc b/src/wifi/model/wifi-mac.cc index 0bc791dfc..71d8d9334 100644 --- a/src/wifi/model/wifi-mac.cc +++ b/src/wifi/model/wifi-mac.cc @@ -33,6 +33,7 @@ #include "ns3/ht-configuration.h" #include "ns3/vht-configuration.h" #include "ns3/he-configuration.h" +#include "ns3/eht-configuration.h" #include "ns3/he-frame-exchange-manager.h" #include "extended-capabilities.h" @@ -118,60 +119,64 @@ WifiMac::GetTypeId (void) MakePointerChecker ()) .AddAttribute ("VO_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_VO access class " - "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). " + "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " "Value 0 means A-MSDU aggregation is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&WifiMac::m_voMaxAmsduSize), MakeUintegerChecker (0, 11398)) .AddAttribute ("VI_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_VI access class " - "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). " + "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " "Value 0 means A-MSDU aggregation is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&WifiMac::m_viMaxAmsduSize), MakeUintegerChecker (0, 11398)) .AddAttribute ("BE_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_BE access class " - "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). " + "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " "Value 0 means A-MSDU aggregation is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&WifiMac::m_beMaxAmsduSize), MakeUintegerChecker (0, 11398)) .AddAttribute ("BK_MaxAmsduSize", "Maximum length in bytes of an A-MSDU for AC_BK access class " - "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). " + "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). " "Value 0 means A-MSDU aggregation is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&WifiMac::m_bkMaxAmsduSize), MakeUintegerChecker (0, 11398)) .AddAttribute ("VO_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_VO access class " - "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). " + "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " + "and 15523200 for EHT PPDUs). " "Value 0 means A-MPDU aggregation is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&WifiMac::m_voMaxAmpduSize), - MakeUintegerChecker (0, 6500631)) + MakeUintegerChecker (0, 15523200)) .AddAttribute ("VI_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_VI access class " - "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). " + "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " + "and 15523200 for EHT PPDUs). " "Value 0 means A-MPDU aggregation is disabled for that AC.", UintegerValue (65535), MakeUintegerAccessor (&WifiMac::m_viMaxAmpduSize), - MakeUintegerChecker (0, 6500631)) + MakeUintegerChecker (0, 15523200)) .AddAttribute ("BE_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_BE access class " - "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). " + "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " + "and 15523200 for EHT PPDUs). " "Value 0 means A-MPDU aggregation is disabled for that AC.", UintegerValue (65535), MakeUintegerAccessor (&WifiMac::m_beMaxAmpduSize), - MakeUintegerChecker (0, 6500631)) + MakeUintegerChecker (0, 15523200)) .AddAttribute ("BK_MaxAmpduSize", "Maximum length in bytes of an A-MPDU for AC_BK access class " - "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). " + "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs " + "and 15523200 for EHT PPDUs). " "Value 0 means A-MPDU aggregation is disabled for that AC.", UintegerValue (0), MakeUintegerAccessor (&WifiMac::m_bkMaxAmpduSize), - MakeUintegerChecker (0, 6500631)) + MakeUintegerChecker (0, 15523200)) .AddAttribute ("VO_BlockAckThreshold", "If number of packets in VO queue reaches this value, " "block ack mechanism is used. If this value is 0, block ack is never used." @@ -1061,6 +1066,12 @@ WifiMac::GetHeConfiguration (void) const return GetDevice ()->GetHeConfiguration (); } +Ptr +WifiMac::GetEhtConfiguration (void) const +{ + return GetDevice ()->GetEhtConfiguration (); +} + bool WifiMac::GetHtSupported () const { @@ -1091,6 +1102,16 @@ WifiMac::GetHeSupported () const return false; } +bool +WifiMac::GetEhtSupported () const +{ + if (GetEhtConfiguration ()) + { + return true; + } + return false; +} + void WifiMac::SetVoBlockAckThreshold (uint8_t threshold) { diff --git a/src/wifi/model/wifi-mac.h b/src/wifi/model/wifi-mac.h index b95f5b492..b895fc86d 100644 --- a/src/wifi/model/wifi-mac.h +++ b/src/wifi/model/wifi-mac.h @@ -41,6 +41,7 @@ class WifiMacQueueItem; class HtConfiguration; class VhtConfiguration; class HeConfiguration; +class EhtConfiguration; class FrameExchangeManager; class ChannelAccessManager; class ExtendedCapabilities; @@ -347,6 +348,10 @@ public: * \return pointer to HeConfiguration if it exists */ Ptr GetHeConfiguration (void) const; + /** + * \return pointer to EhtConfiguration if it exists + */ + Ptr GetEhtConfiguration (void) const; /** * Return the extended capabilities of the device. @@ -409,6 +414,12 @@ public: * \return true if HE is supported, false otherwise */ bool GetHeSupported () const; + /** + * Return whether the device supports EHT. + * + * \return true if EHT is supported, false otherwise + */ + bool GetEhtSupported () const; /** * Return the maximum A-MPDU size of the given Access Category. diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index a7b9ff58e..d802debd7 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -34,6 +34,7 @@ #include "ns3/ht-phy.h" #include "ns3/vht-configuration.h" #include "ns3/he-configuration.h" +#include "ns3/eht-configuration.h" #include "wifi-net-device.h" namespace ns3 { @@ -246,6 +247,12 @@ WifiRemoteStationManager::GetHeSupported (void) const return m_wifiPhy->GetDevice ()->GetHeConfiguration () != nullptr; } +bool +WifiRemoteStationManager::GetEhtSupported (void) const +{ + return m_wifiPhy->GetDevice ()->GetEhtConfiguration () != nullptr; +} + bool WifiRemoteStationManager::GetLdpcSupported (void) const { @@ -576,7 +583,11 @@ WifiRemoteStationManager::GetCtsToSelfTxVector (void) { WifiMode defaultMode = GetDefaultMode (); WifiPreamble defaultPreamble; - if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HE) + if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_EHT) + { + defaultPreamble = WIFI_PREAMBLE_EHT_MU; + } + else if (defaultMode.GetModulationClass () == WIFI_MOD_CLASS_HE) { defaultPreamble = WIFI_PREAMBLE_HE_SU; } @@ -956,7 +967,8 @@ WifiRemoteStationManager::NeedRts (const WifiMacHeader &header, uint32_t size) && ((mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT) || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT) - || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE)) + || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE) + || (mode.GetModulationClass () == WIFI_MOD_CLASS_EHT)) && m_useNonErpProtection) { NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations"); @@ -984,7 +996,8 @@ WifiRemoteStationManager::NeedCtsToSelf (WifiTxVector txVector) && ((mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) || (mode.GetModulationClass () == WIFI_MOD_CLASS_HT) || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT) - || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE)) + || (mode.GetModulationClass () == WIFI_MOD_CLASS_HE) + || (mode.GetModulationClass () == WIFI_MOD_CLASS_EHT)) && m_useNonErpProtection) { NS_LOG_DEBUG ("WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations"); diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index aed7793bc..a13c76e0c 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -277,6 +277,12 @@ public: * \return true if HE capability support is enabled, false otherwise */ bool GetHeSupported (void) const; + /** + * Return whether the device has EHT capability support enabled. + * + * \return true if EHT capability support is enabled, false otherwise + */ + bool GetEhtSupported (void) const; /** * Return whether the device has LDPC support enabled. *