wifi: Remove the WifiAckPolicySelector

This commit is contained in:
Stefano Avallone
2020-12-03 09:16:25 +01:00
parent 1b3c743b0f
commit da674b9139
14 changed files with 0 additions and 641 deletions

View File

@@ -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> node, uin
device->SetRemoteStationManager (manager);
node->AddDevice (device);
mac->SwitchFrequencyChannel (channelId);
// Install ack policy selector
PointerValue ptr;
Ptr<WifiAckPolicySelector> ackSelector;
mac->GetAttributeFailSafe ("BE_Txop", ptr);
ackSelector = m_ackPolicySelector[AC_BE].Create<WifiAckPolicySelector> ();
ackSelector->SetQosTxop (ptr.Get<QosTxop> ());
ptr.Get<QosTxop> ()->SetAckPolicySelector (ackSelector);
mac->GetAttributeFailSafe ("BK_Txop", ptr);
ackSelector = m_ackPolicySelector[AC_BK].Create<WifiAckPolicySelector> ();
ackSelector->SetQosTxop (ptr.Get<QosTxop> ());
ptr.Get<QosTxop> ()->SetAckPolicySelector (ackSelector);
mac->GetAttributeFailSafe ("VI_Txop", ptr);
ackSelector = m_ackPolicySelector[AC_VI].Create<WifiAckPolicySelector> ();
ackSelector->SetQosTxop (ptr.Get<QosTxop> ());
ptr.Get<QosTxop> ()->SetAckPolicySelector (ackSelector);
mac->GetAttributeFailSafe ("VO_Txop", ptr);
ackSelector = m_ackPolicySelector[AC_VO].Create<WifiAckPolicySelector> ();
ackSelector->SetQosTxop (ptr.Get<QosTxop> ());
ptr.Get<QosTxop> ()->SetAckPolicySelector (ackSelector);
return device;
}

View File

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

View File

@@ -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,

View File

@@ -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<uint32_t> m_macsForChannelNumber; ///< MACs for channel number
uint32_t m_physNumber; ///< Phy number

View File

@@ -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> qosTxop = rmac->GetQosTxop (ac);
auto ackSelector = m_ackPolicySelector[ac].Create<WifiAckPolicySelector> ();
ackSelector->SetQosTxop (qosTxop);
qosTxop->SetAckPolicySelector (ackSelector);
wmq = qosTxop->GetWifiMacQueue ();
ndqi->GetTxQueue (static_cast<std::size_t> (ac))->ConnectQueueTraces (wmq);
}

View File

@@ -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<std::size_t (Ptr<QueueItem>)> SelectQueueCallback;

View File

@@ -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 <stavallo@unina.it>
*/
#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<WifiAckPolicySelector> ()
.AddConstructor<ConstantWifiAckPolicySelector> ()
.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<double> (0.0, 1.0))
;
return tid;
}
ConstantWifiAckPolicySelector::ConstantWifiAckPolicySelector ()
{
NS_LOG_FUNCTION_NOARGS ();
}
ConstantWifiAckPolicySelector::~ConstantWifiAckPolicySelector ()
{
NS_LOG_FUNCTION (this);
}
void
ConstantWifiAckPolicySelector::UpdateTxParams (Ptr<WifiPsdu> psdu, MacLowTransmissionParameters & params)
{
NS_LOG_FUNCTION (this << psdu << params);
std::set<uint8_t> 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

View File

@@ -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 <stavallo@unina.it>
*/
#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<WifiPsdu> 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 */

View File

@@ -42,7 +42,6 @@
#include "wifi-net-device.h"
#include "wifi-mac.h"
#include <algorithm>
#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<WifiMacQueueItem> mpdu,
{
m_currentPacket = Create<WifiPsdu> (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 () <<

View File

@@ -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<WifiRemoteStationManager> remote
m_baManager->SetWifiRemoteStationManager (m_stationManager);
}
void
QosTxop::SetAckPolicySelector (Ptr<WifiAckPolicySelector> ackSelector)
{
NS_LOG_FUNCTION (this << ackSelector);
m_ackPolicySelector = ackSelector;
}
Ptr<WifiAckPolicySelector>
QosTxop::GetAckPolicySelector (void) const
{
return m_ackPolicySelector;
}
void
QosTxop::SetTypeOfStation (TypeOfStation type)
{

View File

@@ -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<Packet> GetFragmentPacket (WifiMacHeader *hdr);
/**
* Set the ack policy selector.
*
* \param ackSelector the ack policy selector.
*/
void SetAckPolicySelector (Ptr<WifiAckPolicySelector> ackSelector);
/**
* Return the ack policy selector.
*
* \return the ack policy selector.
*/
Ptr<WifiAckPolicySelector> 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<QosFrameExchangeManager> m_qosFem; //!< the QoS Frame Exchange Manager
Ptr<WifiAckPolicySelector> m_ackPolicySelector; //!< the ack policy selector
Ptr<QosBlockedDestinations> m_qosBlockedDestinations; //!< the QoS blocked destinations
Ptr<BlockAckManager> m_baManager; //!< the block ack manager
uint8_t m_blockAckThreshold; /**< the block ack threshold (use BA mechanism if number of packets in queue reaches

View File

@@ -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 <stavallo@unina.it>
*/
#include "ns3/log.h"
#include "wifi-ack-policy-selector.h"
#include <set>
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("WifiAckPolicySelector");
NS_OBJECT_ENSURE_REGISTERED (WifiAckPolicySelector);
TypeId
WifiAckPolicySelector::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::WifiAckPolicySelector")
.SetParent<Object> ()
.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> qosTxop)
{
NS_LOG_FUNCTION (this << qosTxop);
m_qosTxop = qosTxop;
}
Ptr<QosTxop>
WifiAckPolicySelector::GetQosTxop (void) const
{
return m_qosTxop;
}
void
WifiAckPolicySelector::SetAckPolicy (Ptr<WifiPsdu> psdu, const MacLowTransmissionParameters & params)
{
NS_LOG_FUNCTION (psdu << params);
std::set<uint8_t> 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

View File

@@ -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 <stavallo@unina.it>
*/
#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> qosTxop);
/**
* Get the QoS Txop associated with this ack policy selector.
*
* \return the QoS Txop.
*/
Ptr<QosTxop> 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<WifiPsdu> 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<WifiPsdu> psdu, MacLowTransmissionParameters & params) = 0;
protected:
Ptr<QosTxop> m_qosTxop; //!< the QoS Txop this selector is associated with
};
} //namespace ns3
#endif /* WIFI_ACK_POLICY_SELECTOR_H */

View File

@@ -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',