23 #include "ns3/boolean.h"
24 #include "ns3/double.h"
25 #include "ns3/uinteger.h"
27 #define Min(a,b) ((a < b) ? a : b)
28 #define Max(a,b) ((a > b) ? a : b)
64 .SetGroupName (
"Wifi")
66 .AddAttribute (
"SuccessK",
"Multiplication factor for the success threshold in the AARF algorithm.",
69 MakeDoubleChecker<double> ())
70 .AddAttribute (
"TimerK",
71 "Multiplication factor for the timer threshold in the AARF algorithm.",
74 MakeDoubleChecker<double> ())
75 .AddAttribute (
"MaxSuccessThreshold",
76 "Maximum value of the success threshold in the AARF algorithm.",
79 MakeUintegerChecker<uint32_t> ())
80 .AddAttribute (
"MinTimerThreshold",
81 "The minimum value for the 'timer' threshold in the AARF algorithm.",
84 MakeUintegerChecker<uint32_t> ())
85 .AddAttribute (
"MinSuccessThreshold",
86 "The minimum value for the success threshold in the AARF algorithm.",
89 MakeUintegerChecker<uint32_t> ())
90 .AddAttribute (
"MinRtsWnd",
91 "Minimum value for Rts window of Aarf-CD",
94 MakeUintegerChecker<uint32_t> ())
95 .AddAttribute (
"MaxRtsWnd",
96 "Maximum value for Rts window of Aarf-CD",
99 MakeUintegerChecker<uint32_t> ())
100 .AddAttribute (
"TurnOffRtsAfterRateDecrease",
101 "If true the RTS mechanism will be turned off when the rate will be decreased",
105 .AddAttribute (
"TurnOnRtsAfterRateIncrease",
106 "If true the RTS mechanism will be turned on when the rate will be increased",
110 .AddTraceSource (
"Rate",
111 "Traced value for rate changes (b/s)",
113 "ns3::TracedValueCallback::Uint64")
219 if (((station->
m_retry - 1) % 2) == 1)
251 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
261 double ackSnr,
WifiMode ackMode,
double dataSnr)
311 if (channelWidth > 20 && channelWidth != 22)
322 return WifiTxVector (mode,
GetDefaultTxPowerLevel (),
GetLongRetryCount (station),
GetPreambleForTransmission (mode,
GetAddress (station)), 800, 1, 1, 0, channelWidth,
GetAggregation (station),
false);
333 if (channelWidth > 20 && channelWidth != 22)
348 rtsTxVector =
WifiTxVector (mode,
GetDefaultTxPowerLevel (),
GetShortRetryCount (station),
GetPreambleForTransmission (mode,
GetAddress (station)), 800, 1, 1, 0, channelWidth,
GetAggregation (station),
false);
424 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
434 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
444 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HE rates");
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
void DoReportDataFailed(WifiRemoteStation *station)
It is important to realize that "recovery" mode starts after failure of the first transmission after ...
uint32_t m_successThreshold
success threshold
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
AttributeValue implementation for Boolean.
double m_timerK
Multiplication factor for the timer threshold.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
bool m_justModifyRate
just modify rate
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint32_t m_rtsCounter
RTS counter.
bool m_haveASuccess
have a success
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t m_maxSuccessThreshold
maximum success threshold
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)
This method is a pure virtual method that must be implemented by the sub-class.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
uint32_t m_maxRtsWnd
maximum RTS window
uint32_t m_minRtsWnd
minimum RTS window
bool m_turnOnRtsAfterRateIncrease
turn on RTS after rate increase
void SetHeSupported(bool enable)
Enable or disable HE capability support.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void TurnOnRts(AarfcdWifiRemoteStation *station)
Turn on RTS for the given station.
void TurnOffRts(AarfcdWifiRemoteStation *station)
Turn off RTS for the given station.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Hold an unsigned integer type.
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
uint64_t GetDataRate(uint8_t channelWidth, uint16_t guardInterval, uint8_t nss) const
uint8_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
Maximum.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
void ResetRtsWnd(AarfcdWifiRemoteStation *station)
Reset the RTS window of the given station.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
hold a list of per-remote-station state.
void CheckRts(AarfcdWifiRemoteStation *station)
Check if the use of RTS for the given station can be turned off.
virtual ~AarfcdWifiManager()
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
bool IsLowLatency(void) const
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_minSuccessThreshold
minimum success threshold
WifiRemoteStation * DoCreateStation(void) const
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
hold per-remote-station state for AARF-CD Wifi manager.
uint8_t GetDefaultTxPowerLevel(void) const
void SetHtSupported(bool enable)
Enable or disable HT capability support.
uint32_t m_minTimerThreshold
minimum timer threshold
bool m_turnOffRtsAfterRateDecrease
turn off RTS after rate decrease
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
double m_successK
Multiplication factor for the success threshold.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t m_rtsWnd
RTS window.
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
uint32_t m_success
success
static TypeId GetTypeId(void)
Get the type ID.
an implementation of the AARF-CD algorithmThis algorithm was first described in "Efficient Collision ...
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)
This method is a pure virtual method that must be implemented by the sub-class.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void IncreaseRtsWnd(AarfcdWifiRemoteStation *station)
Increase the RTS window size of the given station.
uint32_t m_timerTimeout
timer timeout
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
hold per-remote-station state.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)