12#include "ns3/wifi-tx-vector.h" 
   14#define Min(a, b) ((a < b) ? a : b) 
   15#define Max(a, b) ((a > b) ? a : b) 
   45        TypeId(
"ns3::AarfWifiManager")
 
   49            .AddAttribute(
"SuccessK",
 
   50                          "Multiplication factor for the success threshold in the AARF algorithm.",
 
   54            .AddAttribute(
"TimerK",
 
   55                          "Multiplication factor for the timer threshold in the AARF algorithm.",
 
   59            .AddAttribute(
"MaxSuccessThreshold",
 
   60                          "Maximum value of the success threshold in the AARF algorithm.",
 
   64            .AddAttribute(
"MinTimerThreshold",
 
   65                          "The minimum value for the 'timer' threshold in the AARF algorithm.",
 
   69            .AddAttribute(
"MinSuccessThreshold",
 
   70                          "The minimum value for the success threshold in the AARF algorithm.",
 
   74            .AddTraceSource(
"Rate",
 
   75                            "Traced value for rate changes (b/s)",
 
   77                            "ns3::TracedValueCallback::Uint64");
 
 
   99        NS_FATAL_ERROR(
"WifiRemoteStationManager selected does not support HT rates");
 
  103        NS_FATAL_ERROR(
"WifiRemoteStationManager selected does not support VHT rates");
 
  107        NS_FATAL_ERROR(
"WifiRemoteStationManager selected does not support HE rates");
 
 
  120    station->m_success = 0;
 
  121    station->m_failed = 0;
 
  122    station->m_recovery = 
false;
 
  123    station->m_timer = 0;
 
 
  152    station->m_success = 0;
 
  154    if (station->m_recovery)
 
  157        if (station->m_failed == 1)
 
  160            station->m_successThreshold =
 
  162            station->m_timerTimeout =
 
  164            if (station->m_rate != 0)
 
  169        station->m_timer = 0;
 
  174        if (((station->m_failed - 1) % 2) == 1)
 
  179            if (station->m_rate != 0)
 
  184        if (station->m_failed >= 2)
 
  186            station->m_timer = 0;
 
 
  212                                MHz_u dataChannelWidth,
 
  215    NS_LOG_FUNCTION(
this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
 
  218    station->m_success++;
 
  219    station->m_failed = 0;
 
  220    station->m_recovery = 
false;
 
  221    NS_LOG_DEBUG(
"station=" << station << 
" data ok success=" << station->m_success
 
  222                            << 
", timer=" << station->m_timer);
 
  223    if ((station->m_success == station->m_successThreshold ||
 
  224         station->m_timer == station->m_timerTimeout) &&
 
  229        station->m_timer = 0;
 
  230        station->m_success = 0;
 
  231        station->m_recovery = 
true;
 
 
  253    if (channelWidth > 
MHz_u{20} && channelWidth != 
MHz_u{22})
 
  255        channelWidth = 
MHz_u{20};
 
 
  284    if (channelWidth > 
MHz_u{20} && channelWidth != 
MHz_u{22})
 
  286        channelWidth = 
MHz_u{20};
 
 
AARF Rate control algorithm.
void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr) override
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_minSuccessThreshold
minimum success threshold
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiRemoteStation * DoCreateStation() const override
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, MHz_u allowedWidth) override
void DoInitialize() override
Initialize() implementation.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
double m_successK
Multiplication factor for the success threshold.
void DoReportDataFailed(WifiRemoteStation *station) override
It is important to realize that "recovery" mode starts after failure of the first transmission after ...
double m_timerK
Multiplication factor for the timer threshold.
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
static TypeId GetTypeId()
Get the type ID.
uint32_t m_maxSuccessThreshold
maximum success threshold
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_minTimerThreshold
minimum timer threshold
TracedValue< uint64_t > m_currentRate
Trace rate changes.
~AarfWifiManager() override
This class can be used to hold variables of floating point type such as 'double' or 'float'.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
represent a single transmission mode
WifiModulationClass GetModulationClass() const
uint64_t GetDataRate(MHz_u channelWidth, Time guardInterval, uint8_t nss) const
hold a list of per-remote-station state.
uint8_t GetDefaultTxPowerLevel() const
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
MHz_u GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
bool GetHtSupported() const
Return whether the device has HT capability support enabled on the link this manager is associated wi...
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index.
bool GetUseNonErpProtection() const
Return whether the device supports protection of non-ERP stations.
bool GetVhtSupported() const
Return whether the device has VHT capability support enabled on the link this manager is associated w...
bool GetShortPreambleEnabled() const
Return whether the device uses short PHY preambles.
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index.
bool GetHeSupported() const
Return whether the device has HE capability support enabled.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
hold per-remote-station state for AARF Wifi manager.
uint32_t m_success
success
uint32_t m_timerTimeout
timer timeout
uint32_t m_successThreshold
success threshold
hold per-remote-station state.