wifi: Add minimal MAC support for 802.11be

This commit is contained in:
Sébastien Deronne
2022-02-19 19:39:28 +01:00
committed by Stefano Avallone
parent a14fe4a51c
commit 37b46a0bd9
5 changed files with 67 additions and 16 deletions

View File

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

View File

@@ -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<QosTxop> ())
.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<uint16_t> (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<uint16_t> (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<uint16_t> (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<uint16_t> (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<uint32_t> (0, 6500631))
MakeUintegerChecker<uint32_t> (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<uint32_t> (0, 6500631))
MakeUintegerChecker<uint32_t> (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<uint32_t> (0, 6500631))
MakeUintegerChecker<uint32_t> (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<uint32_t> (0, 6500631))
MakeUintegerChecker<uint32_t> (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<EhtConfiguration>
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)
{

View File

@@ -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<HeConfiguration> GetHeConfiguration (void) const;
/**
* \return pointer to EhtConfiguration if it exists
*/
Ptr<EhtConfiguration> 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.

View File

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

View File

@@ -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.
*