From cf13cf328f40f4c517e11c11ecb176f08179ea20 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 25 Nov 2020 22:44:41 +0100 Subject: [PATCH] wifi: Switch to using the QosFrameExchangeManager on QoS stations --- examples/wireless/wifi-80211e-txop.cc | 4 ++-- src/wifi/helper/wifi-helper.cc | 2 ++ src/wifi/model/regular-wifi-mac.cc | 11 +++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/wireless/wifi-80211e-txop.cc b/examples/wireless/wifi-80211e-txop.cc index 4ab28d3ef..bc2fbf2f8 100644 --- a/examples/wireless/wifi-80211e-txop.cc +++ b/examples/wireless/wifi-80211e-txop.cc @@ -372,7 +372,7 @@ int main (int argc, char *argv[]) throughput = totalPacketsThroughB * payloadSize * 8 / (simulationTime * 1000000.0); std::cout << "AC_BE with non-default TXOP limit (3.008ms): " << '\n' << " Throughput = " << throughput << " Mbit/s" << '\n'; - if (verifyResults && (throughput < 35.5 || throughput > 36.5)) + if (verifyResults && (throughput < 35 || throughput > 36)) { NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!"); exit (1); @@ -387,7 +387,7 @@ int main (int argc, char *argv[]) throughput = totalPacketsThroughC * payloadSize * 8 / (simulationTime * 1000000.0); std::cout << "AC_VI with default TXOP limit (3.008ms): " << '\n' << " Throughput = " << throughput << " Mbit/s" << '\n'; - if (verifyResults && (throughput < 36 || throughput > 37)) + if (verifyResults && (throughput < 35 || throughput > 36)) { NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!"); exit (1); diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index e7f300843..bc0bfbe1c 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -973,6 +973,7 @@ WifiHelper::EnableLogComponents (void) LogComponentEnable ("ConstantWifiAckPolicySelector", LOG_LEVEL_ALL); LogComponentEnable ("ChannelAccessManager", LOG_LEVEL_ALL); LogComponentEnable ("DsssErrorRateModel", LOG_LEVEL_ALL); + LogComponentEnable ("FrameExchangeManager", LOG_LEVEL_ALL); LogComponentEnable ("HeConfiguration", LOG_LEVEL_ALL); LogComponentEnable ("HtConfiguration", LOG_LEVEL_ALL); LogComponentEnable ("IdealWifiManager", LOG_LEVEL_ALL); @@ -990,6 +991,7 @@ WifiHelper::EnableLogComponents (void) LogComponentEnable ("OnoeWifiManager", LOG_LEVEL_ALL); LogComponentEnable ("OriginatorBlockAckAgreement", LOG_LEVEL_ALL); LogComponentEnable ("ParfWifiManager", LOG_LEVEL_ALL); + LogComponentEnable ("QosFrameExchangeManager", LOG_LEVEL_ALL); LogComponentEnable ("QosTxop", LOG_LEVEL_ALL); LogComponentEnable ("RegularWifiMac", LOG_LEVEL_ALL); LogComponentEnable ("RraaWifiManager", LOG_LEVEL_ALL); diff --git a/src/wifi/model/regular-wifi-mac.cc b/src/wifi/model/regular-wifi-mac.cc index d53667f37..1cb68b7af 100644 --- a/src/wifi/model/regular-wifi-mac.cc +++ b/src/wifi/model/regular-wifi-mac.cc @@ -36,7 +36,7 @@ #include "he-configuration.h" #include #include -#include "frame-exchange-manager.h" +#include "qos-frame-exchange-manager.h" namespace ns3 { @@ -149,7 +149,7 @@ RegularWifiMac::SetupFrameExchangeManager (void) } else if (GetQosSupported ()) { - // TODO create a QoS Frame Exchange Manager + m_feManager = CreateObject (); } else { @@ -164,6 +164,13 @@ RegularWifiMac::SetupFrameExchangeManager (void) m_feManager->SetAddress (GetAddress ()); m_feManager->SetBssid (GetBssid ()); m_channelAccessManager->SetupFrameExchangeManager (m_feManager); + if (GetQosSupported ()) + { + for (const auto& pair : m_edca) + { + pair.second->SetQosFrameExchangeManager (DynamicCast (m_feManager)); + } + } } }