wifi: Remove max A-MPDU and A-MSDU size attributes from configuration objects

This commit is contained in:
Stefano Avallone
2019-01-16 00:17:30 +01:00
parent ae683546e0
commit 4724112166
22 changed files with 308 additions and 626 deletions

View File

@@ -55,7 +55,8 @@ us a note on ns-developers mailing list.</p>
<h2>New API:</h2>
<ul>
<li>Added the attribute <b>Release</b> to the class <b>EpsBearer</b>, to select the release (e.g., release 15)</li>
<li>The attributes <b>RegularWifiMac::HtSupported</b>, <b>RegularWifiMac::VhtSupported</b>, <b>RegularWifiMac::HeSupported</b>, <b>RegularWifiMac::RifsSupported</b>, <b>WifiPhy::ShortGuardEnabled</b>, <b>WifiPhy::GuardInterval</b> and <b>WifiPhy::GreenfieldEnabled</b> have been deprecated. Intead, it is advised to use <b>WifiNetDevice::HtConfiguration</b>, <b>WifiNetDevice::VhtConfiguration</b> and <b>WifiNetDevice::HeConfiguration</b>.</li>
<li>The attributes <b>RegularWifiMac::HtSupported</b>, <b>RegularWifiMac::VhtSupported</b>, <b>RegularWifiMac::HeSupported</b>, <b>RegularWifiMac::RifsSupported</b>, <b>WifiPhy::ShortGuardEnabled</b>, <b>WifiPhy::GuardInterval</b> and <b>WifiPhy::GreenfieldEnabled</b> have been deprecated. Instead, it is advised to use <b>WifiNetDevice::HtConfiguration</b>, <b>WifiNetDevice::VhtConfiguration</b> and <b>WifiNetDevice::HeConfiguration</b>.</li>
<li>The attributes <b>{Ht,Vht,He}Configuration::{Vo,Vi,Be,Bk}MaxAmsduSize</b> and <b>{Ht,Vht,He}Configuration::{Vo,Vi,Be,Bk}MaxAmpduSize</b> have been deprecated. Instead, it is advised to use <b>RegularWifiMac::{VO, VI, BE, BK}_MaxAmsduSize</b> and <b>RegularWifiMac::{VO, VI, BE, BK}_MaxAmpduSize</b>.</li>
<li>A new attribute <b>WifiPhy::PostReceptionErrorModel</b> has been added to force specific packet drops.</li>
<li>A new attribute <b>WifiPhy::PreambleDetectionModel</b> has been added to decide whether PHY preambles are successfully detected.</li>
<li>New attributes <b>QosTxop::AddBaResponseTimeout</b> and <b>QosTxop::FailedAddBaTimeout</b> have been added to set the timeout to wait for an ADDBA response after the ACK to the ADDBA request is received and to set the timeout after a failed BA agreement, respectively.</li>

View File

@@ -250,7 +250,7 @@ Experiment::Run (Parameters params)
edca->SetTxopLimit (MicroSeconds (3008));
}
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/BeMaxAmpduSize", UintegerValue (0)); //Disable A-MPDU
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BE_MaxAmpduSize", UintegerValue (0)); //Disable A-MPDU
// Define mobility model
MobilityHelper mobility;

View File

@@ -262,7 +262,7 @@ int main (int argc, char *argv[])
"Ssid", SsidValue (ssid));
wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (0)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/BeMaxAmpduSize", UintegerValue (BeMaxAmpduSize));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BE_MaxAmpduSize", UintegerValue (BeMaxAmpduSize));
}
else if (standard == "802.11ac")
{
@@ -285,7 +285,7 @@ int main (int argc, char *argv[])
"Ssid", SsidValue (ssid));
wifiApDevices.Add (wifi.Install (wifiPhy, wifiMac, wifiApNodes.Get (0)));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/VhtConfiguration/BeMaxAmpduSize", UintegerValue (BeMaxAmpduSize));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BE_MaxAmpduSize", UintegerValue (BeMaxAmpduSize));
}
wifiDevices.Add (wifiStaDevices);

View File

@@ -119,7 +119,7 @@ int main (int argc, char *argv[])
NetDeviceContainer apDevice;
apDevice = wifi.Install (phy, mac, wifiApNode);
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/BeMaxAmpduSize", UintegerValue (maxAmpduSize));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
// Setting mobility model
MobilityHelper mobility;

View File

@@ -33,7 +33,7 @@
#include "ns3/packet-sink-helper.h"
#include "ns3/yans-wifi-channel.h"
#include "ns3/wifi-net-device.h"
#include "ns3/ht-configuration.h"
#include "ns3/wifi-mac.h"
// This is an example that illustrates how 802.11n aggregation is configured.
// It defines 4 independent Wi-Fi networks (working on different channels).
@@ -134,8 +134,7 @@ int main (int argc, char *argv[])
// Disable A-MPDU
Ptr<NetDevice> dev = wifiStaNodes.Get (1)->GetDevice (0);
Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev);
Ptr<HtConfiguration> htConfiguration = wifi_dev->GetHtConfiguration ();
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (0));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
@@ -145,8 +144,7 @@ int main (int argc, char *argv[])
// Disable A-MPDU
dev = wifiApNodes.Get (1)->GetDevice (0);
wifi_dev = DynamicCast<WifiNetDevice> (dev);
htConfiguration = wifi_dev->GetHtConfiguration ();
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (0));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
// Network C
ssid = Ssid ("network-C");
@@ -159,9 +157,8 @@ int main (int argc, char *argv[])
// Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
dev = wifiStaNodes.Get (2)->GetDevice (0);
wifi_dev = DynamicCast<WifiNetDevice> (dev);
htConfiguration = wifi_dev->GetHtConfiguration ();
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (0));
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (7935));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (7935));
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
@@ -171,9 +168,8 @@ int main (int argc, char *argv[])
// Disable A-MPDU and enable A-MSDU with the highest maximum size allowed by the standard (7935 bytes)
dev = wifiApNodes.Get (2)->GetDevice (0);
wifi_dev = DynamicCast<WifiNetDevice> (dev);
htConfiguration = wifi_dev->GetHtConfiguration ();
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (0));
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (7935));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (0));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (7935));
// Network D
ssid = Ssid ("network-D");
@@ -187,9 +183,8 @@ int main (int argc, char *argv[])
// enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
dev = wifiStaNodes.Get (3)->GetDevice (0);
wifi_dev = DynamicCast<WifiNetDevice> (dev);
htConfiguration = wifi_dev->GetHtConfiguration ();
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (32768));
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (3839));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (32768));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (3839));
mac.SetType ("ns3::ApWifiMac",
"Ssid", SsidValue (ssid),
@@ -200,9 +195,8 @@ int main (int argc, char *argv[])
// enable A-MSDU with the smallest maximum size allowed by the standard (3839 bytes)
dev = wifiApNodes.Get (3)->GetDevice (0);
wifi_dev = DynamicCast<WifiNetDevice> (dev);
htConfiguration = wifi_dev->GetHtConfiguration ();
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (32768));
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (3839));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmpduSize", UintegerValue (32768));
wifi_dev->GetMac ()->SetAttribute ("BE_MaxAmsduSize", UintegerValue (3839));
// Setting mobility model
MobilityHelper mobility;

View File

@@ -372,9 +372,7 @@ int main (int argc, char *argv[])
wifi.AssignStreams (serverDevice, 100);
wifi.AssignStreams (clientDevice, 100);
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/BeMaxAmpduSize", UintegerValue (maxAmpduSize));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/VhtConfiguration/BeMaxAmpduSize", UintegerValue (maxAmpduSize));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HeConfiguration/BeMaxAmpduSize", UintegerValue (maxAmpduSize));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/BE_MaxAmpduSize", UintegerValue (maxAmpduSize));
Config::ConnectWithoutContext ("/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/RemoteStationManager/$ns3::" + wifiManager + "WifiManager/Rate", MakeCallback (&RateChange));

View File

@@ -42,7 +42,7 @@ HeCapabilities::HeCapabilities ()
m_groupAddressedMultiStaBlockAckInDlMuSupport (0),
m_omiAcontrolSupport (0),
m_ofdmaRaSupport (0),
m_maximumAmpduLengthExponent (0),
m_maxAmpduLengthExponent (0),
m_amsduFragmentationSupport (0),
m_flexibleTwtScheduleSupport (0),
m_rxControlFrameToMultiBss (0),
@@ -191,7 +191,7 @@ HeCapabilities::SetHeMacCapabilitiesInfo (uint32_t ctrl1, uint8_t ctrl2)
m_groupAddressedMultiStaBlockAckInDlMuSupport = (ctrl1 >> 24) & 0x01;
m_omiAcontrolSupport = (ctrl1 >> 25) & 0x03;
m_ofdmaRaSupport = (ctrl1 >> 26) & 0x01;
m_maximumAmpduLengthExponent = (ctrl1 >> 27) & 0x03;
m_maxAmpduLengthExponent = (ctrl1 >> 27) & 0x03;
m_amsduFragmentationSupport = (ctrl1 >> 29) & 0x01;
m_flexibleTwtScheduleSupport = (ctrl1 >> 30) & 0x01;
m_rxControlFrameToMultiBss = (ctrl1 >> 31) & 0x01;
@@ -223,7 +223,7 @@ HeCapabilities::GetHeMacCapabilitiesInfo1 () const
val |= (m_groupAddressedMultiStaBlockAckInDlMuSupport & 0x01) << 24;
val |= (m_omiAcontrolSupport & 0x03) << 25;
val |= (m_ofdmaRaSupport & 0x01) << 26;
val |= (m_maximumAmpduLengthExponent & 0x03) << 27;
val |= (m_maxAmpduLengthExponent & 0x03) << 27;
val |= (m_amsduFragmentationSupport & 0x01) << 29;
val |= (m_flexibleTwtScheduleSupport & 0x01) << 30;
val |= (m_rxControlFrameToMultiBss & 0x01) << 31;
@@ -433,10 +433,17 @@ HeCapabilities::SetHeLtfAndGiForHePpdus (uint8_t heLtfAndGiForHePpdus)
}
void
HeCapabilities::SetMaxAmpduLengthExponent (uint8_t exponent)
HeCapabilities::SetMaxAmpduLength (uint32_t maxampdulength)
{
NS_ASSERT (exponent <= 7);
m_maximumAmpduLengthExponent = exponent;
for (uint8_t i = 0; i <= 3; i++)
{
if ((1ul << (20 + i)) - 1 == maxampdulength)
{
m_maxAmpduLengthExponent = i;
return;
}
}
NS_ABORT_MSG ("Invalid A-MPDU Max Length value");
}
void
@@ -477,6 +484,12 @@ HeCapabilities::GetHighestNssSupported (void) const
return m_highestNssSupportedM1 + 1;
}
uint32_t
HeCapabilities::GetMaxAmpduLength (void) const
{
return (1ul << (20 + m_maxAmpduLengthExponent)) - 1;
}
/**
* output stream output operator
* \param os the output stream

View File

@@ -159,11 +159,11 @@ public:
// MAC Capabilities Info fields
/**
* Set maximum AMPDU length exponent.
* Set the maximum AMPDU length.
*
* \param exponent the maximum AMPDU length exponent
* \param maxampdulength 2^(20 + x) - 1, x in the range 0 to 3
*/
void SetMaxAmpduLengthExponent (uint8_t exponent);
void SetMaxAmpduLength (uint32_t maxampdulength);
// MCS and NSS field information
/**
@@ -194,6 +194,13 @@ public:
*/
bool IsSupportedRxMcs (uint8_t mcs) const;
/**
* Return the maximum A-MPDU length.
*
* \return the maximum A-MPDU length
*/
uint32_t GetMaxAmpduLength (void) const;
/*
* This information element is a bit special in that it is only
* included if the STA is an HE STA. To support this we
@@ -237,7 +244,7 @@ private:
uint8_t m_groupAddressedMultiStaBlockAckInDlMuSupport; //!< group addressed multi STA block ack in DL support
uint8_t m_omiAcontrolSupport; //!< OMI A control support
uint8_t m_ofdmaRaSupport; //!< OFDM RA support
uint8_t m_maximumAmpduLengthExponent; //!< maximum AMPDU length exponenet
uint8_t m_maxAmpduLengthExponent; //!< maximum AMPDU length exponenet
uint8_t m_amsduFragmentationSupport; //!< AMSDU fragmentation support
uint8_t m_flexibleTwtScheduleSupport; //!< flexible TWT schedule support
uint8_t m_rxControlFrameToMultiBss; //!< receive control frame to multi bias

View File

@@ -57,54 +57,6 @@ HeConfiguration::GetTypeId (void)
MakeUintegerAccessor (&HeConfiguration::GetMpduBufferSize,
&HeConfiguration::SetMpduBufferSize),
MakeUintegerChecker<uint16_t> (64, 256))
.AddAttribute ("VoMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VO access class. "
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HeConfiguration::m_voMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("ViMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VI access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HeConfiguration::m_viMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("BeMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BE access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HeConfiguration::m_beMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("BkMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BK access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HeConfiguration::m_bkMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("VoMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VO access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HeConfiguration::m_voMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 4194303))
.AddAttribute ("ViMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VI access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (4194303),
MakeUintegerAccessor (&HeConfiguration::m_viMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 4194303))
.AddAttribute ("BeMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BE access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (4194303),
MakeUintegerAccessor (&HeConfiguration::m_beMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 4194303))
.AddAttribute ("BkMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BK access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HeConfiguration::m_bkMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 4194303))
;
return tid;
}

View File

@@ -60,16 +60,6 @@ private:
Time m_guardInterval; //!< Supported HE guard interval
uint8_t m_bssColor; //!< BSS color
uint16_t m_mpduBufferSize; //!< MPDU buffer size
uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO
uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI
uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE
uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK
uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO
uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI
uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE
uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK
};
} //namespace ns3

View File

@@ -38,7 +38,7 @@ HtCapabilities::HtCapabilities ()
m_psmpSupport (0),
m_fortyMhzIntolerant (0),
m_lsigProtectionSupport (0),
m_maxAmpduLength (0),
m_maxAmpduLengthExponent (0),
m_minMpduStartSpace (0),
m_ampduReserved (0),
m_reservedMcsSet1 (0),
@@ -135,9 +135,11 @@ HtCapabilities::SetShortGuardInterval40 (uint8_t shortguardinterval)
}
void
HtCapabilities::SetMaxAmsduLength (uint8_t maxamsdulength)
HtCapabilities::SetMaxAmsduLength (uint16_t maxamsdulength)
{
m_maxAmsduLength = maxamsdulength;
NS_ABORT_MSG_IF (maxamsdulength != 3839 && maxamsdulength != 7935,
"Invalid A-MSDU Max Length value");
m_maxAmsduLength = (maxamsdulength == 3839 ? 0 : 1);
}
void
@@ -147,9 +149,17 @@ HtCapabilities::SetLSigProtectionSupport (uint8_t lsigprotection)
}
void
HtCapabilities::SetMaxAmpduLength (uint8_t maxampdulength)
HtCapabilities::SetMaxAmpduLength (uint32_t maxampdulength)
{
m_maxAmpduLength = maxampdulength;
for (uint8_t i = 0; i <= 3; i++)
{
if ((1ul << (13 + i)) - 1 == maxampdulength)
{
m_maxAmpduLengthExponent = i;
return;
}
}
NS_ABORT_MSG ("Invalid A-MPDU Max Length value");
}
void
@@ -212,6 +222,22 @@ HtCapabilities::GetShortGuardInterval20 (void) const
return m_shortGuardInterval20;
}
uint16_t
HtCapabilities::GetMaxAmsduLength (void) const
{
if (m_maxAmsduLength == 0)
{
return 3839;
}
return 7935;
}
uint32_t
HtCapabilities::GetMaxAmpduLength (void) const
{
return (1ul << (13 + m_maxAmpduLengthExponent)) - 1;
}
bool
HtCapabilities::IsSupportedMcs (uint8_t mcs) const
{
@@ -309,7 +335,7 @@ HtCapabilities::SetHtCapabilitiesInfo (uint16_t ctrl)
void
HtCapabilities::SetAmpduParameters (uint8_t ctrl)
{
m_maxAmpduLength = ctrl & 0x03;
m_maxAmpduLengthExponent = ctrl & 0x03;
m_minMpduStartSpace = (ctrl >> 2) & 0x1b;
m_ampduReserved = (ctrl >> 5) & 0xe0;
}
@@ -318,7 +344,7 @@ uint8_t
HtCapabilities::GetAmpduParameters (void) const
{
uint8_t val = 0;
val |= m_maxAmpduLength & 0x03;
val |= m_maxAmpduLengthExponent & 0x03;
val |= (m_minMpduStartSpace & 0x1b) << 2;
val |= (m_ampduReserved & 0xe0) << 5;
return val;

View File

@@ -122,9 +122,9 @@ public:
/**
* Set the maximum AMSDU length.
*
* \param maxamsdulength
* \param maxamsdulength Either 3839 or 7935
*/
void SetMaxAmsduLength (uint8_t maxamsdulength);
void SetMaxAmsduLength (uint16_t maxamsdulength);
/**
* Set the LSIG protection support.
*
@@ -135,9 +135,9 @@ public:
/**
* Set the maximum AMPDU length.
*
* \param maxampdulength
* \param maxampdulength 2^(13 + x) - 1, x in the range 0 to 3
*/
void SetMaxAmpduLength (uint8_t maxampdulength);
void SetMaxAmpduLength (uint32_t maxampdulength);
/**
* Set the receive MCS bitmask.
@@ -243,6 +243,18 @@ public:
* \return the short guard interval 20 value
*/
uint8_t GetShortGuardInterval20 (void) const;
/**
* Return the maximum A-MSDU length.
*
* \return the maximum A-MSDU length
*/
uint16_t GetMaxAmsduLength (void) const;
/**
* Return the maximum A-MPDU length.
*
* \return the maximum A-MPDU length
*/
uint32_t GetMaxAmpduLength (void) const;
/**
* Return the is MCS supported flag.
*
@@ -324,7 +336,7 @@ private:
uint8_t m_lsigProtectionSupport; ///< LSIG protection support
//A-MPDU Parameters field
uint8_t m_maxAmpduLength; ///< maximum AMPDU length
uint8_t m_maxAmpduLengthExponent; ///< maximum AMPDU length
uint8_t m_minMpduStartSpace; ///< minimum MPDU start space
uint8_t m_ampduReserved; ///< AMPDU reserved

View File

@@ -64,54 +64,6 @@ HtConfiguration::GetTypeId (void)
MakeBooleanAccessor (&HtConfiguration::SetRifsSupported,
&HtConfiguration::GetRifsSupported),
MakeBooleanChecker ())
.AddAttribute ("VoMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VO access class. "
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HtConfiguration::m_voMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 7935))
.AddAttribute ("ViMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VI access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HtConfiguration::m_viMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 7935))
.AddAttribute ("BeMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BE access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HtConfiguration::m_beMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 7935))
.AddAttribute ("BkMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BK access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HtConfiguration::m_bkMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 7935))
.AddAttribute ("VoMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VO access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HtConfiguration::m_voMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 65535))
.AddAttribute ("ViMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VI access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (65535),
MakeUintegerAccessor (&HtConfiguration::m_viMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 65535))
.AddAttribute ("BeMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BE access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (65535),
MakeUintegerAccessor (&HtConfiguration::m_beMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 65535))
.AddAttribute ("BkMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BK access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&HtConfiguration::m_bkMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 65535))
;
return tid;
}

View File

@@ -89,16 +89,6 @@ private:
bool m_sgiSupported; ///< flag whether short guard interval is supported
bool m_rifsSupported; ///< flag whether RIFS is supported
bool m_greenfieldSupported; ///< flag whether Greenfield is supported
uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO
uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI
uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE
uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK
uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO
uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI
uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE
uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK
};
} //namespace ns3

View File

@@ -40,9 +40,7 @@
#include "wifi-phy.h"
#include "wifi-net-device.h"
#include "wifi-mac.h"
#include "ht-configuration.h"
#include "vht-configuration.h"
#include "he-configuration.h"
#include <algorithm>
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] "
@@ -3249,76 +3247,36 @@ MacLow::GetMaxAmsduSize (AcIndex ac) const
{
UintegerValue size;
WifiModulationClass modulation = GetDataTxVector (m_currentPacket, &m_currentHdr).GetMode ().GetModulationClass ();
switch (ac)
{
case AC_BE:
m_mac->GetAttribute ("BE_MaxAmsduSize", size);
break;
case AC_BK:
m_mac->GetAttribute ("BK_MaxAmsduSize", size);
break;
case AC_VI:
m_mac->GetAttribute ("VI_MaxAmsduSize", size);
break;
case AC_VO:
m_mac->GetAttribute ("VO_MaxAmsduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
if (modulation == WIFI_MOD_CLASS_HT)
{
Ptr<HtConfiguration> htConfiguration = m_mac->GetHtConfiguration ();
NS_ASSERT (htConfiguration); //If modulation to transmit A-MSDU is HT, we should have a HT configuration attached
switch (ac)
{
case AC_BE:
htConfiguration->GetAttribute ("BeMaxAmsduSize", size);
break;
case AC_BK:
htConfiguration->GetAttribute ("BkMaxAmsduSize", size);
break;
case AC_VI:
htConfiguration->GetAttribute ("ViMaxAmsduSize", size);
break;
case AC_VO:
htConfiguration->GetAttribute ("VoMaxAmsduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
return std::min (size.Get (), static_cast<uint64_t> (7935));
}
else if (modulation == WIFI_MOD_CLASS_VHT)
if (modulation == WIFI_MOD_CLASS_VHT || modulation == WIFI_MOD_CLASS_HE)
{
Ptr<VhtConfiguration> vhtConfiguration = m_mac->GetVhtConfiguration ();
NS_ASSERT (vhtConfiguration); //If modulation to transmit A-MSDU is VHT, we should have a VHT configuration attached
switch (ac)
{
case AC_BE:
vhtConfiguration->GetAttribute ("BeMaxAmsduSize", size);
break;
case AC_BK:
vhtConfiguration->GetAttribute ("BkMaxAmsduSize", size);
break;
case AC_VI:
vhtConfiguration->GetAttribute ("ViMaxAmsduSize", size);
break;
case AC_VO:
vhtConfiguration->GetAttribute ("VoMaxAmsduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
return std::min (size.Get (), static_cast<uint64_t> (11398));
}
else if (modulation == WIFI_MOD_CLASS_HE)
{
Ptr<HeConfiguration> heConfiguration = m_mac->GetHeConfiguration ();
NS_ASSERT (heConfiguration); //If modulation to transmit A-MSDU is HE, we should have a HE configuration attached
switch (ac)
{
case AC_BE:
heConfiguration->GetAttribute ("BeMaxAmsduSize", size);
break;
case AC_BK:
heConfiguration->GetAttribute ("BkMaxAmsduSize", size);
break;
case AC_VI:
heConfiguration->GetAttribute ("ViMaxAmsduSize", size);
break;
case AC_VO:
heConfiguration->GetAttribute ("VoMaxAmsduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
}
return size.Get ();
return 0;
}
uint32_t
@@ -3326,76 +3284,40 @@ MacLow::GetMaxAmpduSize (AcIndex ac) const
{
UintegerValue size;
WifiModulationClass modulation = GetDataTxVector (m_currentPacket, &m_currentHdr).GetMode ().GetModulationClass ();
switch (ac)
{
case AC_BE:
m_mac->GetAttribute ("BE_MaxAmpduSize", size);
break;
case AC_BK:
m_mac->GetAttribute ("BK_MaxAmpduSize", size);
break;
case AC_VI:
m_mac->GetAttribute ("VI_MaxAmpduSize", size);
break;
case AC_VO:
m_mac->GetAttribute ("VO_MaxAmpduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
if (modulation == WIFI_MOD_CLASS_HT)
{
Ptr<HtConfiguration> htConfiguration = m_mac->GetHtConfiguration ();
NS_ASSERT (htConfiguration); //If modulation to transmit A-MPDU is HT, we should have a HT configuration attached
switch (ac)
{
case AC_BE:
htConfiguration->GetAttribute ("BeMaxAmpduSize", size);
break;
case AC_BK:
htConfiguration->GetAttribute ("BkMaxAmpduSize", size);
break;
case AC_VI:
htConfiguration->GetAttribute ("ViMaxAmpduSize", size);
break;
case AC_VO:
htConfiguration->GetAttribute ("VoMaxAmpduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
return std::min (size.Get (), static_cast<uint64_t> (65535));
}
else if (modulation == WIFI_MOD_CLASS_VHT)
if (modulation == WIFI_MOD_CLASS_VHT)
{
Ptr<VhtConfiguration> vhtConfiguration = m_mac->GetVhtConfiguration ();
NS_ASSERT (vhtConfiguration); //If modulation to transmit A-MPDU is VHT, we should have a VHT configuration attached
switch (ac)
{
case AC_BE:
vhtConfiguration->GetAttribute ("BeMaxAmpduSize", size);
break;
case AC_BK:
vhtConfiguration->GetAttribute ("BkMaxAmpduSize", size);
break;
case AC_VI:
vhtConfiguration->GetAttribute ("ViMaxAmpduSize", size);
break;
case AC_VO:
vhtConfiguration->GetAttribute ("VoMaxAmpduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
return std::min (size.Get (), static_cast<uint64_t> (1048575));
}
else if (modulation == WIFI_MOD_CLASS_HE)
if (modulation == WIFI_MOD_CLASS_HE)
{
Ptr<HeConfiguration> heConfiguration = m_mac->GetHeConfiguration ();
NS_ASSERT (heConfiguration); //If modulation to transmit A-MPDU is HE, we should have a HE configuration attached
switch (ac)
{
case AC_BE:
heConfiguration->GetAttribute ("BeMaxAmpduSize", size);
break;
case AC_BK:
heConfiguration->GetAttribute ("BkMaxAmpduSize", size);
break;
case AC_VI:
heConfiguration->GetAttribute ("ViMaxAmpduSize", size);
break;
case AC_VO:
heConfiguration->GetAttribute ("VoMaxAmpduSize", size);
break;
default:
NS_ASSERT (false);
return 0;
}
return std::min (size.Get (), static_cast<uint64_t> (8388607));
}
return size.Get ();
return 0;
}
} //namespace ns3

View File

@@ -35,6 +35,8 @@
#include "ht-configuration.h"
#include "vht-configuration.h"
#include "he-configuration.h"
#include <algorithm>
#include <cmath>
namespace ns3 {
@@ -169,21 +171,25 @@ RegularWifiMac::GetHtCapabilities (void) const
capabilities.SetShortGuardInterval20 (sgiSupported);
capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && sgiSupported);
capabilities.SetGreenfield (greenfieldSupported);
uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
// Set Maximum A-MSDU Length subfield
uint16_t maxAmsduSize = std::max ({m_voMaxAmsduSize, m_viMaxAmsduSize,
m_beMaxAmsduSize, m_bkMaxAmsduSize});
if (maxAmsduSize <= 3839)
{
capabilities.SetMaxAmsduLength (3839);
}
else
{
capabilities.SetMaxAmsduLength (7935);
}
uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
m_beMaxAmpduSize, m_bkMaxAmpduSize});
// round to the next power of two minus one
maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
// The maximum A-MPDU length in HT capabilities elements ranges from 2^13-1 to 2^16-1
capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 8191u), 65535u));
capabilities.SetLSigProtectionSupport (!greenfieldSupported);
UintegerValue beMaxAmpduSize, bkMaxAmpduSize, voMaxAmpduSize, viMaxAmpduSize;
htConfiguration->GetAttribute ("BeMaxAmpduSize", beMaxAmpduSize);
htConfiguration->GetAttribute ("BkMaxAmpduSize", bkMaxAmpduSize);
htConfiguration->GetAttribute ("ViMaxAmpduSize", voMaxAmpduSize);
htConfiguration->GetAttribute ("VoMaxAmpduSize", viMaxAmpduSize);
double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (beMaxAmpduSize.Get (), bkMaxAmpduSize.Get ()), std::max (voMaxAmpduSize.Get (), viMaxAmpduSize.Get ()))
+ 1.0)
/ std::log (2.0))
- 13.0),
0.0);
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
capabilities.SetMaxAmpduLength (std::max<uint8_t> (3, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 3 for HT
uint64_t maxSupportedRate = 0; //in bit/s
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
@@ -231,19 +237,31 @@ RegularWifiMac::GetVhtCapabilities (void) const
{
capabilities.SetSupportedChannelWidthSet (0);
}
uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
// Set Maximum MPDU Length subfield
uint16_t maxAmsduSize = std::max ({m_voMaxAmsduSize, m_viMaxAmsduSize,
m_beMaxAmsduSize, m_bkMaxAmsduSize});
if (maxAmsduSize <= 3839)
{
capabilities.SetMaxMpduLength (3895);
}
else if (maxAmsduSize <= 7935)
{
capabilities.SetMaxMpduLength (7991);
}
else
{
capabilities.SetMaxMpduLength (11454);
}
uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
m_beMaxAmpduSize, m_bkMaxAmpduSize});
// round to the next power of two minus one
maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
// The maximum A-MPDU length in VHT capabilities elements ranges from 2^13-1 to 2^20-1
capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 8191u), 1048575u));
capabilities.SetRxLdpc (0);
capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && sgiSupported);
capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && sgiSupported);
UintegerValue beMaxAmpduSize, bkMaxAmpduSize, voMaxAmpduSize, viMaxAmpduSize;
vhtConfiguration->GetAttribute ("BeMaxAmpduSize", beMaxAmpduSize);
vhtConfiguration->GetAttribute ("BkMaxAmpduSize", bkMaxAmpduSize);
vhtConfiguration->GetAttribute ("ViMaxAmpduSize", voMaxAmpduSize);
vhtConfiguration->GetAttribute ("VoMaxAmpduSize", viMaxAmpduSize);
double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (beMaxAmpduSize.Get (), bkMaxAmpduSize.Get ()), std::max (voMaxAmpduSize.Get (), viMaxAmpduSize.Get ())) + 1.0) / std::log (2.0)) - 13.0), 0.0);
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
uint8_t maxMcs = 0;
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
@@ -320,18 +338,13 @@ RegularWifiMac::GetHeCapabilities (void) const
gi |= 0x02;
}
capabilities.SetHeLtfAndGiForHePpdus (gi);
UintegerValue beMaxAmpduSize, bkMaxAmpduSize, voMaxAmpduSize, viMaxAmpduSize;
heConfiguration->GetAttribute ("BeMaxAmpduSize", beMaxAmpduSize);
heConfiguration->GetAttribute ("BkMaxAmpduSize", bkMaxAmpduSize);
heConfiguration->GetAttribute ("ViMaxAmpduSize", voMaxAmpduSize);
heConfiguration->GetAttribute ("VoMaxAmpduSize", viMaxAmpduSize);
double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (beMaxAmpduSize.Get (), bkMaxAmpduSize.Get ()), std::max (voMaxAmpduSize.Get (), viMaxAmpduSize.Get ()))
+ 1.0)
/ std::log (2.0))
- 20.0),
0.0);
NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
m_beMaxAmpduSize, m_bkMaxAmpduSize});
// round to the next power of two minus one
maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
// The maximum A-MPDU length in HE capabilities elements ranges from 2^20-1 to 2^23-1
capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 1048575u), 8388607u));
uint8_t maxMcs = 0;
for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
{
@@ -348,134 +361,6 @@ RegularWifiMac::GetHeCapabilities (void) const
return capabilities;
}
void
RegularWifiMac::SetVoMaxAmsduSize (uint16_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("VoMaxAmsduSize", UintegerValue (size));
}
}
m_voMaxAmsduSize = size;
}
void
RegularWifiMac::SetViMaxAmsduSize (uint16_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("ViMaxAmsduSize", UintegerValue (size));
}
}
m_viMaxAmsduSize = size;
}
void
RegularWifiMac::SetBeMaxAmsduSize (uint16_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (size));
}
}
m_beMaxAmsduSize = size;
}
void
RegularWifiMac::SetBkMaxAmsduSize (uint16_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("BkMaxAmsduSize", UintegerValue (size));
}
}
m_bkMaxAmsduSize = size;
}
void
RegularWifiMac::SetVoMaxAmpduSize (uint32_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("VoMaxAmpduSize", UintegerValue (size));
}
}
m_voMaxAmpduSize = size;
}
void
RegularWifiMac::SetViMaxAmpduSize (uint32_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("ViMaxAmpduSize", UintegerValue (size));
}
}
m_viMaxAmpduSize = size;
}
void
RegularWifiMac::SetBeMaxAmpduSize (uint32_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (size));
}
}
m_beMaxAmpduSize = size;
}
void
RegularWifiMac::SetBkMaxAmpduSize (uint32_t size)
{
NS_LOG_FUNCTION (this << size);
Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (GetDevice ());
if (device)
{
Ptr<HtConfiguration> htConfiguration = device->GetHtConfiguration ();
if (htConfiguration)
{
htConfiguration->SetAttribute ("BkMaxAmpduSize", UintegerValue (size));
}
}
m_bkMaxAmpduSize = size;
}
void
RegularWifiMac::SetVoBlockAckThreshold (uint8_t threshold)
{
@@ -1182,52 +1067,60 @@ RegularWifiMac::GetTypeId (void)
MakeBooleanAccessor (&RegularWifiMac::SetCtsToSelfSupported),
MakeBooleanChecker ())
.AddAttribute ("VO_MaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VO access class. "
"Value 0 means A-MSDU is disabled for that AC.",
"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). "
"Value 0 means A-MSDU aggregation is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11426))
MakeUintegerAccessor (&RegularWifiMac::m_voMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11398))
.AddAttribute ("VI_MaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VI access class."
"Value 0 means A-MSDU is disabled for that AC.",
"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). "
"Value 0 means A-MSDU aggregation is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11426))
MakeUintegerAccessor (&RegularWifiMac::m_viMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11398))
.AddAttribute ("BE_MaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BE access class."
"Value 0 means A-MSDU is disabled for that AC.",
"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). "
"Value 0 means A-MSDU aggregation is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11426))
MakeUintegerAccessor (&RegularWifiMac::m_beMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11398))
.AddAttribute ("BK_MaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BK access class."
"Value 0 means A-MSDU is disabled for that AC.",
"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). "
"Value 0 means A-MSDU aggregation is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11426))
MakeUintegerAccessor (&RegularWifiMac::m_bkMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11398))
.AddAttribute ("VO_MaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VO access class."
"Value 0 means A-MPDU is disabled for that AC.",
"Maximum length in bytes of an A-MPDU for AC_VO access class "
"(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
"Value 0 means A-MPDU aggregation is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmpduSize),
MakeUintegerAccessor (&RegularWifiMac::m_voMaxAmpduSize),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("VI_MaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VI access class."
"Value 0 means A-MPDU is disabled for that AC.",
"Maximum length in bytes of an A-MPDU for AC_VI access class "
"(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
"Value 0 means A-MPDU aggregation is disabled for that AC.",
UintegerValue (65535),
MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmpduSize),
MakeUintegerAccessor (&RegularWifiMac::m_viMaxAmpduSize),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("BE_MaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BE access class."
"Value 0 means A-MPDU is disabled for that AC.",
"Maximum length in bytes of an A-MPDU for AC_BE access class "
"(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
"Value 0 means A-MPDU aggregation is disabled for that AC.",
UintegerValue (65535),
MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmpduSize),
MakeUintegerAccessor (&RegularWifiMac::m_beMaxAmpduSize),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("BK_MaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BK access class."
"Value 0 means A-MPDU is disabled for that AC.",
"Maximum length in bytes of an A-MPDU for AC_BK access class "
"(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
"Value 0 means A-MPDU aggregation is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmpduSize),
MakeUintegerAccessor (&RegularWifiMac::m_bkMaxAmpduSize),
MakeUintegerChecker<uint32_t> ())
.AddAttribute ("VO_BlockAckThreshold",
"If number of packets in VO queue reaches this value, "
@@ -1356,14 +1249,6 @@ RegularWifiMac::FinishConfigureStandard (WifiPhyStandard standard)
Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
NS_ASSERT (htConfiguration);
htConfiguration->SetRifsSupported (m_rifsSupported);
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (m_beMaxAmpduSize));
htConfiguration->SetAttribute ("BkMaxAmpduSize", UintegerValue (m_bkMaxAmpduSize));
htConfiguration->SetAttribute ("ViMaxAmpduSize", UintegerValue (m_viMaxAmpduSize));
htConfiguration->SetAttribute ("VoMaxAmpduSize", UintegerValue (m_voMaxAmpduSize));
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (m_beMaxAmsduSize));
htConfiguration->SetAttribute ("BkMaxAmsduSize", UintegerValue (m_bkMaxAmsduSize));
htConfiguration->SetAttribute ("ViMaxAmsduSize", UintegerValue (m_viMaxAmsduSize));
htConfiguration->SetAttribute ("VoMaxAmsduSize", UintegerValue (m_voMaxAmsduSize));
SetQosSupported (true);
cwmin = 15;
cwmax = 1023;
@@ -1377,14 +1262,6 @@ RegularWifiMac::FinishConfigureStandard (WifiPhyStandard standard)
Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
NS_ASSERT (htConfiguration);
htConfiguration->SetRifsSupported (m_rifsSupported);
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (m_beMaxAmpduSize));
htConfiguration->SetAttribute ("BkMaxAmpduSize", UintegerValue (m_bkMaxAmpduSize));
htConfiguration->SetAttribute ("ViMaxAmpduSize", UintegerValue (m_viMaxAmpduSize));
htConfiguration->SetAttribute ("VoMaxAmpduSize", UintegerValue (m_voMaxAmpduSize));
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (m_beMaxAmsduSize));
htConfiguration->SetAttribute ("BkMaxAmsduSize", UintegerValue (m_bkMaxAmsduSize));
htConfiguration->SetAttribute ("ViMaxAmsduSize", UintegerValue (m_viMaxAmsduSize));
htConfiguration->SetAttribute ("VoMaxAmsduSize", UintegerValue (m_voMaxAmsduSize));
SetQosSupported (true);
}
case WIFI_PHY_STANDARD_80211g:

View File

@@ -515,7 +515,6 @@ protected:
*/
bool GetHeSupported () const;
private:
/// type conversion operator
RegularWifiMac (const RegularWifiMac &);
@@ -535,56 +534,6 @@ private:
*/
void SetupEdcaQueue (AcIndex ac);
/**
* Set the maximum A-MSDU size for AC_VO.
*
* \param size the maximum A-MSDU size for AC_VO.
*/
void SetVoMaxAmsduSize (uint16_t size);
/**
* Set the maximum A-MSDU size for AC_VI.
*
* \param size the maximum A-MSDU size for AC_VI.
*/
void SetViMaxAmsduSize (uint16_t size);
/**
* Set the maximum A-MSDU size for AC_BE.
*
* \param size the maximum A-MSDU size for AC_BE.
*/
void SetBeMaxAmsduSize (uint16_t size);
/**
* Set the maximum A-MSDU size for AC_BK.
*
* \param size the maximum A-MSDU size for AC_BK.
*/
void SetBkMaxAmsduSize (uint16_t size);
/**
* Set the maximum A-MPDU size for AC_VO.
*
* \param size the maximum A-MPDU size for AC_VO.
*/
void SetVoMaxAmpduSize (uint32_t size);
/**
* Set the maximum A-MPDU size for AC_VI.
*
* \param size the maximum A-MPDU size for AC_VI.
*/
void SetViMaxAmpduSize (uint32_t size);
/**
* Set the maximum A-MPDU size for AC_BE.
*
* \param size the maximum A-MPDU size for AC_BE.
*/
void SetBeMaxAmpduSize (uint32_t size);
/**
* Set the maximum A-MPDU size for AC_BK.
*
* \param size the maximum A-MPDU size for AC_BK.
*/
void SetBkMaxAmpduSize (uint32_t size);
/**
* Set the Block ACK threshold for AC_VO.
*

View File

@@ -208,9 +208,22 @@ VhtCapabilities::GetSupportedMcsAndNssSet () const
}
void
VhtCapabilities::SetMaxMpduLength (uint8_t length)
VhtCapabilities::SetMaxMpduLength (uint16_t length)
{
m_maxMpduLength = length;
NS_ABORT_MSG_IF (length != 3895 && length != 7991 && length == 11454,
"Invalid MPDU Max Length value");
if (length == 11454)
{
m_maxMpduLength = 2;
}
else if (length == 7991)
{
m_maxMpduLength = 1;
}
else
{
m_maxMpduLength = 0;
}
}
void
@@ -250,9 +263,17 @@ VhtCapabilities::SetTxStbc (uint8_t txstbc)
}
void
VhtCapabilities::SetMaxAmpduLengthExponent (uint8_t exponent)
VhtCapabilities::SetMaxAmpduLength (uint32_t maxampdulength)
{
m_maxAmpduLengthExponent = exponent;
for (uint8_t i = 0; i <= 7; i++)
{
if ((1ul << (13 + i)) - 1 == maxampdulength)
{
m_maxAmpduLengthExponent = i;
return;
}
}
NS_ABORT_MSG ("Invalid A-MPDU Max Length value");
}
void
@@ -321,6 +342,24 @@ VhtCapabilities::SetTxHighestSupportedLgiDataRate (uint16_t supporteddatarate)
m_txHighestSupportedLongGuardIntervalDataRate = supporteddatarate;
}
uint16_t
VhtCapabilities::GetMaxMpduLength (void) const
{
if (m_maxMpduLength == 0)
{
return 3895;
}
if (m_maxMpduLength == 1)
{
return 7991;
}
if (m_maxMpduLength == 2)
{
return 11454;
}
NS_ABORT_MSG ("The value 3 is reserved");
}
uint8_t
VhtCapabilities::GetSupportedChannelWidthSet () const
{
@@ -345,6 +384,12 @@ VhtCapabilities::GetTxStbc () const
return m_txStbc;
}
uint32_t
VhtCapabilities::GetMaxAmpduLength (void) const
{
return (1ul << (13 + m_maxAmpduLengthExponent)) - 1;
}
bool
VhtCapabilities::IsSupportedMcs (uint8_t mcs, uint8_t nss) const
{

View File

@@ -99,9 +99,9 @@ public:
/**
* Set the maximum MPDU length.
*
* \param length the maximum MPDU length
* \param length the maximum MPDU length (3895, 7991 or 11454)
*/
void SetMaxMpduLength (uint8_t length);
void SetMaxMpduLength (uint16_t length);
/**
* Set the supported channel width set.
*
@@ -139,12 +139,18 @@ public:
*/
void SetTxStbc (uint8_t txstbc);
/**
* Set the maximum AMPDU length exponent.
* Set the maximum AMPDU length.
*
* \param exponent the maximum AMPDU length exponent
* \param maxampdulength 2^(13 + x) - 1, x in the range 0 to 7
*/
void SetMaxAmpduLengthExponent (uint8_t exponent);
void SetMaxAmpduLength (uint32_t maxampdulength);
/**
* Get the maximum MPDU length.
*
* \return the maximum MPDU length
*/
uint16_t GetMaxMpduLength (void) const;
/**
* Get the supported channel width set.
*
@@ -223,6 +229,13 @@ public:
*/
bool IsSupportedRxMcs (uint8_t mcs) const;
/**
* Return the maximum A-MPDU length.
*
* \return the maximum A-MPDU length
*/
uint32_t GetMaxAmpduLength (void) const;
/**
* This information element is a bit special in that it is only
* included if the STA is an VHT STA. To support this we

View File

@@ -45,54 +45,6 @@ VhtConfiguration::GetTypeId (void)
.SetParent<Object> ()
.SetGroupName ("Wifi")
.AddConstructor<VhtConfiguration> ()
.AddAttribute ("VoMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VO access class. "
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&VhtConfiguration::m_voMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("ViMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_VI access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&VhtConfiguration::m_viMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("BeMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BE access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&VhtConfiguration::m_beMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("BkMaxAmsduSize",
"Maximum length in bytes of an A-MSDU for AC_BK access class."
"Value 0 means A-MSDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&VhtConfiguration::m_bkMaxAmsduSize),
MakeUintegerChecker<uint16_t> (0, 11454))
.AddAttribute ("VoMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VO access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&VhtConfiguration::m_voMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 1048575))
.AddAttribute ("ViMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_VI access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (1048575),
MakeUintegerAccessor (&VhtConfiguration::m_viMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 1048575))
.AddAttribute ("BeMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BE access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (1048575),
MakeUintegerAccessor (&VhtConfiguration::m_beMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 1048575))
.AddAttribute ("BkMaxAmpduSize",
"Maximum length in bytes of an A-MPDU for AC_BK access class."
"Value 0 means A-MPDU is disabled for that AC.",
UintegerValue (0),
MakeUintegerAccessor (&VhtConfiguration::m_bkMaxAmpduSize),
MakeUintegerChecker<uint32_t> (0, 1048575))
;
return tid;
}

View File

@@ -41,17 +41,6 @@ public:
static TypeId GetTypeId (void);
private:
uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO
uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI
uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE
uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK
uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO
uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI
uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE
uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK
};
} //namespace ns3

View File

@@ -102,7 +102,7 @@ AmpduAggregationTest::DoRun (void)
/*
* Configure MPDU aggregation.
*/
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (65535));
m_mac->SetAttribute ("BE_MaxAmpduSize", UintegerValue (65535));
/*
* Create a dummy packet of 1500 bytes and fill mac header fields.
@@ -308,8 +308,8 @@ TwoLevelAggregationTest::DoRun (void)
/*
* Configure aggregation.
*/
htConfiguration->SetAttribute ("BeMaxAmsduSize", UintegerValue (4095));
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (65535));
m_mac->SetAttribute ("BE_MaxAmsduSize", UintegerValue (4095));
m_mac->SetAttribute ("BE_MaxAmpduSize", UintegerValue (65535));
/*
* Create dummy packets of 1500 bytes and fill mac header fields that will be used for the tests.
@@ -357,7 +357,7 @@ TwoLevelAggregationTest::DoRun (void)
* It checks whether MSDU aggregation has been rejected because the maximum MPDU size is set to 0 (returned packet should be equal to 0).
* This test is needed to ensure that no packets are removed from the queue in MacLow::PerformMsduAggregation, since aggregation will no occur in MacLow::AggregateToAmpdu.
*/
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (65535));
m_mac->SetAttribute ("BE_MaxAmpduSize", UintegerValue (65535));
m_mac->GetBEQueue ()->GetWifiMacQueue ()->Enqueue (Create<WifiMacQueueItem> (pkt, hdr));
packet = m_mac->GetBEQueue ()->GetLow ()->PerformMsduAggregation (peekedPacket, &peekedHdr, &tstamp, currentAggregatedPacket, 0);
@@ -372,7 +372,7 @@ TwoLevelAggregationTest::DoRun (void)
* It checks whether MSDU aggregation has been rejected because there is no packets ready in the queue (returned packet should be equal to 0).
* This test is needed to ensure that there is no issue when the queue is empty.
*/
htConfiguration->SetAttribute ("BeMaxAmpduSize", UintegerValue (4095));
m_mac->SetAttribute ("BE_MaxAmpduSize", UintegerValue (4095));
m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);
m_mac->GetBEQueue ()->GetWifiMacQueue ()->Remove (pkt);