12#include "ns3/wifi-tx-vector.h"
42 TypeId(
"ns3::ArfWifiManager")
46 .AddAttribute(
"TimerThreshold",
47 "The 'timer' threshold in the ARF algorithm.",
51 .AddAttribute(
"SuccessThreshold",
52 "The minimum number of successful transmissions to try a new rate.",
56 .AddTraceSource(
"Rate",
57 "Traced value for rate changes (b/s)",
59 "ns3::TracedValueCallback::Uint64");
81 NS_FATAL_ERROR(
"WifiRemoteStationManager selected does not support HT rates");
85 NS_FATAL_ERROR(
"WifiRemoteStationManager selected does not support VHT rates");
89 NS_FATAL_ERROR(
"WifiRemoteStationManager selected does not support HE rates");
102 station->m_success = 0;
103 station->m_failed = 0;
104 station->m_recovery =
false;
105 station->m_timer = 0;
134 station->m_success = 0;
136 if (station->m_recovery)
139 if (station->m_failed == 1)
142 if (station->m_rate != 0)
147 station->m_timer = 0;
152 if (((station->m_failed - 1) % 2) == 1)
155 if (station->m_rate != 0)
160 if (station->m_failed >= 2)
162 station->m_timer = 0;
188 MHz_u dataChannelWidth,
191 NS_LOG_FUNCTION(
this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
194 station->m_success++;
195 station->m_failed = 0;
196 station->m_recovery =
false;
197 NS_LOG_DEBUG(
"station=" << station <<
" data ok success=" << station->m_success
198 <<
", timer=" << station->m_timer);
200 (station->m_rate < (station->m_state->m_operationalRateSet.size() - 1)))
204 station->m_timer = 0;
205 station->m_success = 0;
206 station->m_recovery =
true;
228 if (channelWidth >
MHz_u{20} && channelWidth !=
MHz_u{22})
230 channelWidth =
MHz_u{20};
259 if (channelWidth >
MHz_u{20} && channelWidth !=
MHz_u{22})
261 channelWidth =
MHz_u{20};
ARF Rate control algorithm.
static TypeId GetTypeId()
Get the type ID.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportRtsFailed(WifiRemoteStation *station) 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 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.
uint32_t m_successThreshold
success threshold
void DoInitialize() override
Initialize() implementation.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, MHz_u allowedWidth) override
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_timerThreshold
timer threshold
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
~ArfWifiManager() override
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataFailed(WifiRemoteStation *station) override
It is important to realize that "recovery" mode starts after failure of the first transmission after ...
TracedValue< uint64_t > m_currentRate
Trace rate changes.
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
uint8_t GetDefaultTxPowerLevel() const
MHz_u GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
WifiRemoteStationManager()
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 > 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.
double MHz_u
MHz weak type.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
hold per-remote-station state for ARF Wifi manager.
uint32_t m_timer
timer value
uint32_t m_failed
failed count
uint32_t m_timerTimeout
timer timeout
uint32_t m_successThreshold
success threshold
uint32_t m_success
success count
hold per-remote-station state.