From da674b9139f57cfeeeff9e557a5cb1d4f1c24489 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Thu, 3 Dec 2020 09:16:25 +0100 Subject: [PATCH] wifi: Remove the WifiAckPolicySelector --- src/mesh/helper/mesh-helper.cc | 50 ------ src/mesh/helper/mesh-helper.h | 32 ---- src/wave/helper/wave-helper.cc | 28 ---- src/wave/helper/wave-helper.h | 33 ---- src/wifi/helper/wifi-helper.cc | 31 ---- src/wifi/helper/wifi-helper.h | 33 ---- .../constant-wifi-ack-policy-selector.cc | 150 ------------------ .../model/constant-wifi-ack-policy-selector.h | 65 -------- src/wifi/model/mac-low.cc | 6 - src/wifi/model/qos-txop.cc | 15 -- src/wifi/model/qos-txop.h | 14 -- src/wifi/model/wifi-ack-policy-selector.cc | 87 ---------- src/wifi/model/wifi-ack-policy-selector.h | 93 ----------- src/wifi/wscript | 4 - 14 files changed, 641 deletions(-) delete mode 100644 src/wifi/model/constant-wifi-ack-policy-selector.cc delete mode 100644 src/wifi/model/constant-wifi-ack-policy-selector.h delete mode 100644 src/wifi/model/wifi-ack-policy-selector.cc delete mode 100644 src/wifi/model/wifi-ack-policy-selector.h diff --git a/src/mesh/helper/mesh-helper.cc b/src/mesh/helper/mesh-helper.cc index 5512e40ab..4fb24e213 100644 --- a/src/mesh/helper/mesh-helper.cc +++ b/src/mesh/helper/mesh-helper.cc @@ -27,7 +27,6 @@ #include "ns3/minstrel-wifi-manager.h" #include "ns3/mesh-wifi-interface-mac.h" #include "ns3/wifi-helper.h" -#include "ns3/wifi-ack-policy-selector.h" #include "ns3/frame-exchange-manager.h" #include "ns3/wifi-default-protection-manager.h" #include "ns3/wifi-default-ack-manager.h" @@ -123,10 +122,6 @@ MeshHelper::Default (void) MeshHelper helper; helper.SetMacType (); helper.SetRemoteStationManager ("ns3::ArfWifiManager"); - helper.SetAckPolicySelectorForAc (AC_BE, "ns3::ConstantWifiAckPolicySelector"); - helper.SetAckPolicySelectorForAc (AC_BK, "ns3::ConstantWifiAckPolicySelector"); - helper.SetAckPolicySelectorForAc (AC_VI, "ns3::ConstantWifiAckPolicySelector"); - helper.SetAckPolicySelectorForAc (AC_VO, "ns3::ConstantWifiAckPolicySelector"); helper.SetSpreadInterfaceChannels (SPREAD_CHANNELS); return helper; } @@ -173,28 +168,6 @@ MeshHelper::SetRemoteStationManager (std::string type, m_stationManager.Set (n6, v6); m_stationManager.Set (n7, v7); } -void -MeshHelper::SetAckPolicySelectorForAc (AcIndex ac, std::string type, - std::string n0, const AttributeValue &v0, - std::string n1, const AttributeValue &v1, - std::string n2, const AttributeValue &v2, - std::string n3, const AttributeValue &v3, - std::string n4, const AttributeValue &v4, - std::string n5, const AttributeValue &v5, - std::string n6, const AttributeValue &v6, - std::string n7, const AttributeValue &v7) -{ - m_ackPolicySelector[ac] = ObjectFactory (); - m_ackPolicySelector[ac].SetTypeId (type); - m_ackPolicySelector[ac].Set (n0, v0); - m_ackPolicySelector[ac].Set (n1, v1); - m_ackPolicySelector[ac].Set (n2, v2); - m_ackPolicySelector[ac].Set (n3, v3); - m_ackPolicySelector[ac].Set (n4, v4); - m_ackPolicySelector[ac].Set (n5, v5); - m_ackPolicySelector[ac].Set (n6, v6); - m_ackPolicySelector[ac].Set (n7, v7); -} void MeshHelper::SetStandard (enum WifiStandard standard) { @@ -240,29 +213,6 @@ MeshHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr node, uin device->SetRemoteStationManager (manager); node->AddDevice (device); mac->SwitchFrequencyChannel (channelId); - // Install ack policy selector - PointerValue ptr; - Ptr ackSelector; - - mac->GetAttributeFailSafe ("BE_Txop", ptr); - ackSelector = m_ackPolicySelector[AC_BE].Create (); - ackSelector->SetQosTxop (ptr.Get ()); - ptr.Get ()->SetAckPolicySelector (ackSelector); - - mac->GetAttributeFailSafe ("BK_Txop", ptr); - ackSelector = m_ackPolicySelector[AC_BK].Create (); - ackSelector->SetQosTxop (ptr.Get ()); - ptr.Get ()->SetAckPolicySelector (ackSelector); - - mac->GetAttributeFailSafe ("VI_Txop", ptr); - ackSelector = m_ackPolicySelector[AC_VI].Create (); - ackSelector->SetQosTxop (ptr.Get ()); - ptr.Get ()->SetAckPolicySelector (ackSelector); - - mac->GetAttributeFailSafe ("VO_Txop", ptr); - ackSelector = m_ackPolicySelector[AC_VO].Create (); - ackSelector->SetQosTxop (ptr.Get ()); - ptr.Get ()->SetAckPolicySelector (ackSelector); return device; } diff --git a/src/mesh/helper/mesh-helper.h b/src/mesh/helper/mesh-helper.h index d1202183e..d5a41b1e3 100644 --- a/src/mesh/helper/mesh-helper.h +++ b/src/mesh/helper/mesh-helper.h @@ -121,38 +121,6 @@ public: std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); - /** - * \param ac the Access Category to attach the ack policy selector to. - * \param type the type of ns3::WifiAckPolicySelector to create. - * \param n0 the name of the attribute to set - * \param v0 the value of the attribute to set - * \param n1 the name of the attribute to set - * \param v1 the value of the attribute to set - * \param n2 the name of the attribute to set - * \param v2 the value of the attribute to set - * \param n3 the name of the attribute to set - * \param v3 the value of the attribute to set - * \param n4 the name of the attribute to set - * \param v4 the value of the attribute to set - * \param n5 the name of the attribute to set - * \param v5 the value of the attribute to set - * \param n6 the name of the attribute to set - * \param v6 the value of the attribute to set - * \param n7 the name of the attribute to set - * \param v7 the value of the attribute to set - * - * All the attributes specified in this method should exist - * in the requested ack policy selector. - */ - void SetAckPolicySelectorForAc (AcIndex ac, std::string type, - std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), - std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), - std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), - std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), - std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), - std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), - std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), - std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); /** * Set standard * \param standard the wifi phy standard diff --git a/src/wave/helper/wave-helper.cc b/src/wave/helper/wave-helper.cc index 922b0f36e..be05056c9 100644 --- a/src/wave/helper/wave-helper.cc +++ b/src/wave/helper/wave-helper.cc @@ -26,7 +26,6 @@ #include "ns3/minstrel-wifi-manager.h" #include "ns3/radiotap-header.h" #include "ns3/unused.h" -#include "ns3/wifi-ack-policy-selector.h" #include "wave-mac-helper.h" #include "wave-helper.h" @@ -278,10 +277,6 @@ WaveHelper::Default (void) "DataMode", StringValue ("OfdmRate6MbpsBW10MHz"), "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"), "NonUnicastMode", StringValue ("OfdmRate6MbpsBW10MHz")); - helper.SetAckPolicySelectorForAc (AC_BE, "ns3::ConstantWifiAckPolicySelector"); - helper.SetAckPolicySelectorForAc (AC_BK, "ns3::ConstantWifiAckPolicySelector"); - helper.SetAckPolicySelectorForAc (AC_VI, "ns3::ConstantWifiAckPolicySelector"); - helper.SetAckPolicySelectorForAc (AC_VO, "ns3::ConstantWifiAckPolicySelector"); return helper; } @@ -339,29 +334,6 @@ WaveHelper::SetRemoteStationManager (std::string type, m_stationManager.Set (n7, v7); } -void -WaveHelper::SetAckPolicySelectorForAc (AcIndex ac, std::string type, - std::string n0, const AttributeValue &v0, - std::string n1, const AttributeValue &v1, - std::string n2, const AttributeValue &v2, - std::string n3, const AttributeValue &v3, - std::string n4, const AttributeValue &v4, - std::string n5, const AttributeValue &v5, - std::string n6, const AttributeValue &v6, - std::string n7, const AttributeValue &v7) -{ - m_ackPolicySelector[ac] = ObjectFactory (); - m_ackPolicySelector[ac].SetTypeId (type); - m_ackPolicySelector[ac].Set (n0, v0); - m_ackPolicySelector[ac].Set (n1, v1); - m_ackPolicySelector[ac].Set (n2, v2); - m_ackPolicySelector[ac].Set (n3, v3); - m_ackPolicySelector[ac].Set (n4, v4); - m_ackPolicySelector[ac].Set (n5, v5); - m_ackPolicySelector[ac].Set (n6, v6); - m_ackPolicySelector[ac].Set (n7, v7); -} - void WaveHelper::SetChannelScheduler (std::string type, std::string n0, const AttributeValue &v0, diff --git a/src/wave/helper/wave-helper.h b/src/wave/helper/wave-helper.h index 40d969b2b..248b3123a 100644 --- a/src/wave/helper/wave-helper.h +++ b/src/wave/helper/wave-helper.h @@ -165,38 +165,6 @@ public: std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); - /** - * \param ac the Access Category to attach the ack policy selector to. - * \param type the type of ns3::WifiAckPolicySelector to create. - * \param n0 the name of the attribute to set - * \param v0 the value of the attribute to set - * \param n1 the name of the attribute to set - * \param v1 the value of the attribute to set - * \param n2 the name of the attribute to set - * \param v2 the value of the attribute to set - * \param n3 the name of the attribute to set - * \param v3 the value of the attribute to set - * \param n4 the name of the attribute to set - * \param v4 the value of the attribute to set - * \param n5 the name of the attribute to set - * \param v5 the value of the attribute to set - * \param n6 the name of the attribute to set - * \param v6 the value of the attribute to set - * \param n7 the name of the attribute to set - * \param v7 the value of the attribute to set - * - * All the attributes specified in this method should exist - * in the requested ack policy selector. - */ - void SetAckPolicySelectorForAc (AcIndex ac, std::string type, - std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), - std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), - std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), - std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), - std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), - std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), - std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), - std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); /** * \param type the type of ns3::ChannelScheduler to create. * \param n0 the name of the attribute to set @@ -277,7 +245,6 @@ public: protected: ObjectFactory m_stationManager; ///< station manager - ObjectFactory m_ackPolicySelector[4]; ///< ack policy selector for all ACs ObjectFactory m_channelScheduler; ///< channel scheduler std::vector m_macsForChannelNumber; ///< MACs for channel number uint32_t m_physNumber; ///< Phy number diff --git a/src/wifi/helper/wifi-helper.cc b/src/wifi/helper/wifi-helper.cc index 0cbcff6fc..917e10aa0 100644 --- a/src/wifi/helper/wifi-helper.cc +++ b/src/wifi/helper/wifi-helper.cc @@ -38,7 +38,6 @@ #include "ns3/vht-configuration.h" #include "ns3/he-configuration.h" #include "ns3/obss-pd-algorithm.h" -#include "ns3/wifi-ack-policy-selector.h" #include "wifi-helper.h" namespace ns3 { @@ -722,10 +721,6 @@ WifiHelper::WifiHelper () m_selectQueueCallback (&SelectQueueByDSField) { SetRemoteStationManager ("ns3::ArfWifiManager"); - SetAckPolicySelectorForAc (AC_BE, "ns3::ConstantWifiAckPolicySelector"); - SetAckPolicySelectorForAc (AC_BK, "ns3::ConstantWifiAckPolicySelector"); - SetAckPolicySelectorForAc (AC_VI, "ns3::ConstantWifiAckPolicySelector"); - SetAckPolicySelectorForAc (AC_VO, "ns3::ConstantWifiAckPolicySelector"); } void @@ -774,29 +769,6 @@ WifiHelper::SetObssPdAlgorithm (std::string type, m_obssPdAlgorithm.Set (n7, v7); } -void -WifiHelper::SetAckPolicySelectorForAc (AcIndex ac, std::string type, - std::string n0, const AttributeValue &v0, - std::string n1, const AttributeValue &v1, - std::string n2, const AttributeValue &v2, - std::string n3, const AttributeValue &v3, - std::string n4, const AttributeValue &v4, - std::string n5, const AttributeValue &v5, - std::string n6, const AttributeValue &v6, - std::string n7, const AttributeValue &v7) -{ - m_ackPolicySelector[ac] = ObjectFactory (); - m_ackPolicySelector[ac].SetTypeId (type); - m_ackPolicySelector[ac].Set (n0, v0); - m_ackPolicySelector[ac].Set (n1, v1); - m_ackPolicySelector[ac].Set (n2, v2); - m_ackPolicySelector[ac].Set (n3, v3); - m_ackPolicySelector[ac].Set (n4, v4); - m_ackPolicySelector[ac].Set (n5, v5); - m_ackPolicySelector[ac].Set (n6, v6); - m_ackPolicySelector[ac].Set (n7, v7); -} - void WifiHelper::SetStandard (WifiStandard standard) { @@ -907,9 +879,6 @@ WifiHelper::Install (const WifiPhyHelper &phyHelper, for (auto& ac : {AC_BE, AC_BK, AC_VI, AC_VO}) { Ptr qosTxop = rmac->GetQosTxop (ac); - auto ackSelector = m_ackPolicySelector[ac].Create (); - ackSelector->SetQosTxop (qosTxop); - qosTxop->SetAckPolicySelector (ackSelector); wmq = qosTxop->GetWifiMacQueue (); ndqi->GetTxQueue (static_cast (ac))->ConnectQueueTraces (wmq); } diff --git a/src/wifi/helper/wifi-helper.h b/src/wifi/helper/wifi-helper.h index b15888e2f..773802a9a 100644 --- a/src/wifi/helper/wifi-helper.h +++ b/src/wifi/helper/wifi-helper.h @@ -402,39 +402,6 @@ public: std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); - /** - * \param ac the Access Category to attach the ack policy selector to. - * \param type the type of ns3::WifiAckPolicySelector to create. - * \param n0 the name of the attribute to set - * \param v0 the value of the attribute to set - * \param n1 the name of the attribute to set - * \param v1 the value of the attribute to set - * \param n2 the name of the attribute to set - * \param v2 the value of the attribute to set - * \param n3 the name of the attribute to set - * \param v3 the value of the attribute to set - * \param n4 the name of the attribute to set - * \param v4 the value of the attribute to set - * \param n5 the name of the attribute to set - * \param v5 the value of the attribute to set - * \param n6 the name of the attribute to set - * \param v6 the value of the attribute to set - * \param n7 the name of the attribute to set - * \param v7 the value of the attribute to set - * - * All the attributes specified in this method should exist - * in the requested ack policy selector. - */ - void SetAckPolicySelectorForAc (AcIndex ac, std::string type, - std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), - std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), - std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), - std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), - std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), - std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), - std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), - std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); - /// Callback invoked to determine the MAC queue selected for a given packet typedef std::function)> SelectQueueCallback; diff --git a/src/wifi/model/constant-wifi-ack-policy-selector.cc b/src/wifi/model/constant-wifi-ack-policy-selector.cc deleted file mode 100644 index 3fc67dd69..000000000 --- a/src/wifi/model/constant-wifi-ack-policy-selector.cc +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2019 Universita' degli Studi di Napoli Federico II - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Stefano Avallone - */ - -#include "ns3/log.h" -#include "constant-wifi-ack-policy-selector.h" - -namespace ns3 { - -NS_LOG_COMPONENT_DEFINE ("ConstantWifiAckPolicySelector"); - -NS_OBJECT_ENSURE_REGISTERED (ConstantWifiAckPolicySelector); - -TypeId -ConstantWifiAckPolicySelector::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::ConstantWifiAckPolicySelector") - .SetParent () - .AddConstructor () - .SetGroupName("Wifi") - .AddAttribute ("UseExplicitBar", - "Specify whether to send Block Ack Requests (if true) or use" - " Implicit Block Ack Request ack policy (if false).", - BooleanValue (false), - MakeBooleanAccessor (&ConstantWifiAckPolicySelector::m_useExplicitBar), - MakeBooleanChecker ()) - .AddAttribute ("BaThreshold", - "Immediate acknowledgment is requested upon transmission of a frame " - "whose sequence number is distant at least BaThreshold multiplied " - "by the transmit window size from the starting sequence number of " - "the transmit window. Set to zero to request a response for every " - "transmitted frame.", - DoubleValue (0.0), - MakeDoubleAccessor (&ConstantWifiAckPolicySelector::m_baThreshold), - MakeDoubleChecker (0.0, 1.0)) - ; - return tid; -} - -ConstantWifiAckPolicySelector::ConstantWifiAckPolicySelector () -{ - NS_LOG_FUNCTION_NOARGS (); -} - -ConstantWifiAckPolicySelector::~ConstantWifiAckPolicySelector () -{ - NS_LOG_FUNCTION (this); -} - -void -ConstantWifiAckPolicySelector::UpdateTxParams (Ptr psdu, MacLowTransmissionParameters & params) -{ - NS_LOG_FUNCTION (this << psdu << params); - - std::set tids = psdu->GetTids (); - - if (tids.empty ()) - { - NS_LOG_DEBUG ("No QoS Data frame in the PSDU"); - return; - } - - if (tids.size () > 1) - { - NS_LOG_DEBUG ("Multi-TID A-MPDUs not supported"); - return; - } - - Mac48Address receiver = psdu->GetAddr1 (); - uint8_t tid = *tids.begin (); - - // Use Normal Ack if a BA agreement has not been established - if (!m_qosTxop->GetBaAgreementEstablished (receiver, tid)) - { - params.EnableAck (); - return; - } - - // If QosTxop forced the use of Block Ack QoS policy, do not make any change - if (params.MustSendBlockAckRequest ()) - { - NS_LOG_DEBUG ("Use Block Ack policy as requested"); - return; - } - - // find the maximum distance from the sequence number of an MPDU included in the - // PSDU to the starting sequence number of the transmit window. - uint16_t maxDistToStartingSeq = psdu->GetMaxDistFromStartingSeq (m_qosTxop->GetBaStartingSequence (receiver, tid)); - - // An immediate response (Ack or Block Ack) is needed if any of the following holds: - // * the maximum distance between the sequence number of an MPDU to transmit - // and the starting sequence number of the transmit window is greater than - // or equal to the window size multiplied by the BaThreshold - // * no other frame belonging to this BA agreement is queued (because, in such - // a case, a Block Ack is not going to be requested any time soon) - // * this is the initial frame of a transmission opportunity and it is not - // protected by RTS/CTS (see Annex G.3 of IEEE 802.11-2016) - bool isResponseNeeded = (maxDistToStartingSeq >= m_baThreshold * m_qosTxop->GetBaBufferSize (receiver, tid) - || m_qosTxop->PeekNextFrame (tid, receiver) == 0 - || (m_qosTxop->GetTxopLimit ().IsStrictlyPositive () - && m_qosTxop->GetTxopRemaining () == m_qosTxop->GetTxopLimit () - && !params.MustSendRts ())); - - if (!isResponseNeeded) - { - NS_LOG_DEBUG ("A response is not needed: no ack for now, use Block Ack policy"); - params.DisableAck (); - return; - } - // An immediate response is needed - if (maxDistToStartingSeq == 0) - { - NS_LOG_DEBUG ("Sending a single MPDU, no previous frame to ack: use Normal Ack policy"); - NS_ASSERT (psdu->GetNMpdus () == 1); - params.EnableAck (); - return; - } - // Multiple MPDUs are being/have been sent - if (psdu->GetNMpdus () == 1 || m_useExplicitBar) - { - // in case of single MPDU, there are previous unacknowledged frames, thus - // we cannot use Implicit Block Ack Request policy, otherwise we get a - // normal ack as response - NS_LOG_DEBUG ("Scheduling a Block Ack Request"); - params.EnableBlockAckRequest (m_qosTxop->GetBlockAckReqType (receiver, tid), - m_qosTxop->GetBlockAckType (receiver,tid)); - return; - } - // Implicit Block Ack Request policy - NS_LOG_DEBUG ("Implicitly requesting a Block Ack"); - params.EnableBlockAck (m_qosTxop->GetBlockAckType (receiver, tid)); -} - -} //namespace ns3 diff --git a/src/wifi/model/constant-wifi-ack-policy-selector.h b/src/wifi/model/constant-wifi-ack-policy-selector.h deleted file mode 100644 index e262de4f5..000000000 --- a/src/wifi/model/constant-wifi-ack-policy-selector.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2019 Universita' degli Studi di Napoli Federico II - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Stefano Avallone - */ - -#ifndef CONSTANT_WIFI_ACK_POLICY_SELECTOR_H -#define CONSTANT_WIFI_ACK_POLICY_SELECTOR_H - -#include "wifi-ack-policy-selector.h" - -namespace ns3 { - -/** - * \ingroup wifi - * - * A constant ack policy selector operating based on the values of its attributes. - */ -class ConstantWifiAckPolicySelector : public WifiAckPolicySelector -{ -public: - /** - * \brief Get the type ID. - * \return the object TypeId - */ - static TypeId GetTypeId (void); - - ConstantWifiAckPolicySelector (); - virtual ~ConstantWifiAckPolicySelector(); - - /** - * Update the transmission parameters related to the acknowledgment policy for - * the given PSDU. This method is typically called by the MPDU aggregator when - * trying to aggregate another MPDU to the current A-MPDU. In fact, the - * AckPolicySelector may switch to a different acknowledgment policy when a - * new MPDU is aggregated to an A-MPDU. - * Note that multi-TID A-MPDUs are currently not supported by this method. - * - * \param psdu the given PSDU. - * \param params the MacLow parameters to update. - */ - virtual void UpdateTxParams (Ptr psdu, MacLowTransmissionParameters & params); - -private: - bool m_useExplicitBar; //!< true for sending BARs, false for using Implicit BAR ack policy - double m_baThreshold; //!< Threshold to determine when a BlockAck must be requested -}; - -} //namespace ns3 - -#endif /* CONSTANT_WIFI_ACK_POLICY_SELECTOR_H */ diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index f69ad2172..8ebf799d3 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -42,7 +42,6 @@ #include "wifi-net-device.h" #include "wifi-mac.h" #include -#include "wifi-ack-policy-selector.h" #undef NS_LOG_APPEND_CONTEXT #define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] " @@ -540,11 +539,6 @@ MacLow::StartTransmission (Ptr mpdu, { m_currentPacket = Create (newMpdu, false); } - - // A QoS Txop must have an installed ack policy selector - NS_ASSERT (qosTxop->GetAckPolicySelector () != 0); - qosTxop->GetAckPolicySelector ()->UpdateTxParams (m_currentPacket, m_txParams); - qosTxop->GetAckPolicySelector ()->SetAckPolicy (m_currentPacket, m_txParams); } NS_LOG_DEBUG ("startTx size=" << m_currentPacket->GetSize () << diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 7d3965b24..594f751b0 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -38,7 +38,6 @@ #include "mpdu-aggregator.h" #include "ctrl-headers.h" #include "wifi-phy.h" -#include "wifi-ack-policy-selector.h" #include "wifi-psdu.h" #include "ht-frame-exchange-manager.h" #include "wifi-tx-parameters.h" @@ -120,7 +119,6 @@ void QosTxop::DoDispose (void) { NS_LOG_FUNCTION (this); - m_ackPolicySelector = 0; m_baManager = 0; m_qosBlockedDestinations = 0; m_qosFem = 0; @@ -209,19 +207,6 @@ QosTxop::SetWifiRemoteStationManager (const Ptr remote m_baManager->SetWifiRemoteStationManager (m_stationManager); } -void -QosTxop::SetAckPolicySelector (Ptr ackSelector) -{ - NS_LOG_FUNCTION (this << ackSelector); - m_ackPolicySelector = ackSelector; -} - -Ptr -QosTxop::GetAckPolicySelector (void) const -{ - return m_ackPolicySelector; -} - void QosTxop::SetTypeOfStation (TypeOfStation type) { diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 427d7af24..fb416c1c7 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -39,7 +39,6 @@ class MgtAddBaResponseHeader; class MgtDelBaHeader; class AggregationCapableTransmissionListener; class WifiTxVector; -class WifiAckPolicySelector; class QosFrameExchangeManager; class WifiTxParameters; @@ -133,18 +132,6 @@ public: bool NeedFragmentation (void) const; Ptr GetFragmentPacket (WifiMacHeader *hdr); - /** - * Set the ack policy selector. - * - * \param ackSelector the ack policy selector. - */ - void SetAckPolicySelector (Ptr ackSelector); - /** - * Return the ack policy selector. - * - * \return the ack policy selector. - */ - Ptr GetAckPolicySelector (void) const; /** * Set type of station with the given type. * @@ -667,7 +654,6 @@ private: AcIndex m_ac; //!< the access category TypeOfStation m_typeOfStation; //!< the type of station Ptr m_qosFem; //!< the QoS Frame Exchange Manager - Ptr m_ackPolicySelector; //!< the ack policy selector Ptr m_qosBlockedDestinations; //!< the QoS blocked destinations Ptr m_baManager; //!< the block ack manager uint8_t m_blockAckThreshold; /**< the block ack threshold (use BA mechanism if number of packets in queue reaches diff --git a/src/wifi/model/wifi-ack-policy-selector.cc b/src/wifi/model/wifi-ack-policy-selector.cc deleted file mode 100644 index 98e69e0d3..000000000 --- a/src/wifi/model/wifi-ack-policy-selector.cc +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2019 Universita' degli Studi di Napoli Federico II - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Stefano Avallone - */ - -#include "ns3/log.h" -#include "wifi-ack-policy-selector.h" -#include - -namespace ns3 { - -NS_LOG_COMPONENT_DEFINE ("WifiAckPolicySelector"); - -NS_OBJECT_ENSURE_REGISTERED (WifiAckPolicySelector); - -TypeId -WifiAckPolicySelector::GetTypeId (void) -{ - static TypeId tid = TypeId ("ns3::WifiAckPolicySelector") - .SetParent () - .SetGroupName("Wifi") - ; - return tid; -} - -WifiAckPolicySelector::~WifiAckPolicySelector () -{ - NS_LOG_FUNCTION (this); -} - -void -WifiAckPolicySelector::DoDispose () -{ - NS_LOG_FUNCTION (this); - m_qosTxop = 0; -} - -void -WifiAckPolicySelector::SetQosTxop (Ptr qosTxop) -{ - NS_LOG_FUNCTION (this << qosTxop); - m_qosTxop = qosTxop; -} - -Ptr -WifiAckPolicySelector::GetQosTxop (void) const -{ - return m_qosTxop; -} - -void -WifiAckPolicySelector::SetAckPolicy (Ptr psdu, const MacLowTransmissionParameters & params) -{ - NS_LOG_FUNCTION (psdu << params); - - std::set tids = psdu->GetTids (); - NS_ASSERT (tids.size () == 1); - uint8_t tid = *tids.begin (); - - if (params.MustWaitNormalAck () || params.MustWaitBlockAck ()) - { - // Normal Ack or Implicit Block Ack Request policy - psdu->SetAckPolicyForTid (tid, WifiMacHeader::NORMAL_ACK); - } - else - { - // Block Ack policy - psdu->SetAckPolicyForTid (tid, WifiMacHeader::BLOCK_ACK); - } -} - -} //namespace ns3 diff --git a/src/wifi/model/wifi-ack-policy-selector.h b/src/wifi/model/wifi-ack-policy-selector.h deleted file mode 100644 index 5b20125e4..000000000 --- a/src/wifi/model/wifi-ack-policy-selector.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ -/* - * Copyright (c) 2019 Universita' degli Studi di Napoli Federico II - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Stefano Avallone - */ - -#ifndef WIFI_ACK_POLICY_SELECTOR_H -#define WIFI_ACK_POLICY_SELECTOR_H - -#include "ns3/object.h" -#include "mac-low-transmission-parameters.h" -#include "qos-txop.h" -#include "wifi-psdu.h" - -namespace ns3 { - -/** - * \ingroup wifi - * - * WifiAckPolicySelector is in charge of selecting the acknowledgment policy - * for PSDUs containing QoS Data frames. - */ -class WifiAckPolicySelector : public Object -{ -public: - /** - * \brief Get the type ID. - * \return the object TypeId - */ - static TypeId GetTypeId (void); - virtual ~WifiAckPolicySelector(); - - virtual void DoDispose (void); - - /** - * Set the QoS Txop associated with this ack policy selector. - * - * \param qosTxop the QoS Txop. - */ - void SetQosTxop (Ptr qosTxop); - - /** - * Get the QoS Txop associated with this ack policy selector. - * - * \return the QoS Txop. - */ - Ptr GetQosTxop (void) const; - - /** - * Set the QoS Ack Policy for the QoS Data frames contained in the given PSDU - * according to the given MacLow transmission parameters. Only single-TID A-MPDUs - * are supported at the moment, hence it is expected that all the QoS Data frames - * contained in the given PSDU have the same TID. This function is typically - * called by MacLow before forwarding the PSDU down to the PHY layer. - * - * \param psdu the given PSDU. - * \param params the given MacLow transmission parameters. - */ - static void SetAckPolicy (Ptr psdu, const MacLowTransmissionParameters & params); - - /** - * Update the transmission parameters related to the acknowledgment policy for - * the given PSDU. This method is typically called by the MPDU aggregator when - * trying to aggregate another MPDU to the current A-MPDU. In fact, the - * AckPolicySelector may switch to a different acknowledgment policy when a - * new MPDU is aggregated to an A-MPDU. - * - * \param psdu the given PSDU. - * \param params the MacLow parameters to update. - */ - virtual void UpdateTxParams (Ptr psdu, MacLowTransmissionParameters & params) = 0; - -protected: - Ptr m_qosTxop; //!< the QoS Txop this selector is associated with -}; - -} //namespace ns3 - -#endif /* WIFI_ACK_POLICY_SELECTOR_H */ diff --git a/src/wifi/wscript b/src/wifi/wscript index 2e1cf105a..d0573fe5b 100644 --- a/src/wifi/wscript +++ b/src/wifi/wscript @@ -114,8 +114,6 @@ def build(bld): 'model/vht-configuration.cc', 'model/obss-pd-algorithm.cc', 'model/constant-obss-pd-algorithm.cc', - 'model/wifi-ack-policy-selector.cc', - 'model/constant-wifi-ack-policy-selector.cc', 'model/he-ru.cc', 'helper/wifi-radio-energy-model-helper.cc', 'helper/athstats-helper.cc', @@ -270,8 +268,6 @@ def build(bld): 'model/vht-configuration.h', 'model/obss-pd-algorithm.h', 'model/constant-obss-pd-algorithm.h', - 'model/wifi-ack-policy-selector.h', - 'model/constant-wifi-ack-policy-selector.h', 'model/he-ru.h', 'model/reference/error-rate-tables.h', 'helper/wifi-radio-energy-model-helper.h',