22 #include "ns3/assert.h"
24 #include "ns3/boolean.h"
25 #include "ns3/double.h"
26 #include "ns3/uinteger.h"
27 #include "ns3/simulator.h"
29 #define Min(a,b) ((a < b) ? a : b)
62 .SetGroupName (
"Wifi")
64 .AddAttribute (
"Basic",
65 "If true the RRAA-BASIC algorithm will be used, otherwise the RRAA wil be used",
69 .AddAttribute (
"Timeout",
70 "Timeout for the RRAA BASIC loss estimaton block (s)",
74 .AddAttribute (
"ewndFor54mbps",
75 "ewnd parameter for 54 Mbs data mode",
78 MakeUintegerChecker<uint32_t> ())
79 .AddAttribute (
"ewndFor48mbps",
80 "ewnd parameter for 48 Mbs data mode",
83 MakeUintegerChecker<uint32_t> ())
84 .AddAttribute (
"ewndFor36mbps",
85 "ewnd parameter for 36 Mbs data mode",
88 MakeUintegerChecker<uint32_t> ())
89 .AddAttribute (
"ewndFor24mbps",
90 "ewnd parameter for 24 Mbs data mode",
93 MakeUintegerChecker<uint32_t> ())
94 .AddAttribute (
"ewndFor18mbps",
95 "ewnd parameter for 18 Mbs data mode",
98 MakeUintegerChecker<uint32_t> ())
99 .AddAttribute (
"ewndFor12mbps",
100 "ewnd parameter for 12 Mbs data mode",
103 MakeUintegerChecker<uint32_t> ())
104 .AddAttribute (
"ewndFor9mbps",
105 "ewnd parameter for 9 Mbs data mode",
108 MakeUintegerChecker<uint32_t> ())
109 .AddAttribute (
"ewndFor6mbps",
110 "ewnd parameter for 6 Mbs data mode",
113 MakeUintegerChecker<uint32_t> ())
114 .AddAttribute (
"poriFor48mbps",
115 "Pori parameter for 48 Mbs data mode",
118 MakeDoubleChecker<double> ())
119 .AddAttribute (
"poriFor36mbps",
120 "Pori parameter for 36 Mbs data mode",
123 MakeDoubleChecker<double> ())
124 .AddAttribute (
"poriFor24mbps",
125 "Pori parameter for 24 Mbs data mode",
128 MakeDoubleChecker<double> ())
129 .AddAttribute (
"poriFor18mbps",
130 "Pori parameter for 18 Mbs data mode",
133 MakeDoubleChecker<double> ())
134 .AddAttribute (
"poriFor12mbps",
135 "Pori parameter for 12 Mbs data mode",
138 MakeDoubleChecker<double> ())
139 .AddAttribute (
"poriFor9mbps",
140 "Pori parameter for 9 Mbs data mode",
143 MakeDoubleChecker<double> ())
144 .AddAttribute (
"poriFor6mbps",
145 "Pori parameter for 6 Mbs data mode",
148 MakeDoubleChecker<double> ())
149 .AddAttribute (
"pmtlFor54mbps",
150 "Pmtl parameter for 54 Mbs data mode",
153 MakeDoubleChecker<double> ())
154 .AddAttribute (
"pmtlFor48mbps",
155 "Pmtl parameter for 48 Mbs data mode",
158 MakeDoubleChecker<double> ())
159 .AddAttribute (
"pmtlFor36mbps",
160 "Pmtl parameter for 36 Mbs data mode",
163 MakeDoubleChecker<double> ())
164 .AddAttribute (
"pmtlFor24mbps",
165 "Pmtl parameter for 24 Mbs data mode",
168 MakeDoubleChecker<double> ())
169 .AddAttribute (
"pmtlFor18mbps",
170 "Pmtl parameter for 18 Mbs data mode",
173 MakeDoubleChecker<double> ())
174 .AddAttribute (
"pmtlFor12mbps",
175 "Pmtl parameter for 12 Mbs data mode",
178 MakeDoubleChecker<double> ())
179 .AddAttribute (
"pmtlFor9mbps",
180 "Pmtl parameter for 9 Mbs data mode",
183 MakeDoubleChecker<double> ())
258 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
265 double ackSnr,
WifiMode ackMode,
double dataSnr)
289 if (channelWidth > 20 && channelWidth != 22)
306 if (channelWidth > 20 && channelWidth != 22)
350 double ploss = (double) station->
m_failed / (
double) thresholds.
ewnd;
352 || ploss > thresholds.
pmtl)
355 && ploss > thresholds.
pmtl)
360 && ploss < thresholds.
pori)
489 NS_ASSERT_MSG (
false,
"Thresholds for an unknown mode are asked (" << mode <<
")");
505 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
515 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
uint32_t GetMaxRate(RraaWifiRemoteStation *station)
Return the index for the maximum transmission rate for the given station.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Boolean.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
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...
static TypeId GetTypeId(void)
virtual 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_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void RunBasicAlgorithm(RraaWifiRemoteStation *station)
Find an appropriate rate for the given station, using a basic algorithm.
virtual ~RraaWifiManager()
struct ThresholdsItem GetThresholds(WifiMode mode, RraaWifiRemoteStation *station) const
Get a threshold for the given mode.
virtual bool DoNeedRts(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual bool IsLowLatency(void) const
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void ResetCountersBasic(RraaWifiRemoteStation *station)
Reset the counters of the given station.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
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. ...
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
virtual WifiRemoteStation * DoCreateStation(void) const
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
void CheckTimeout(RraaWifiRemoteStation *station)
Check if the counter should be resetted.
AttributeValue implementation for Time.
virtual void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
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...
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
virtual void SetHtSupported(bool enable)
Enable or disable HT capability support.
hold a list of per-remote-station state.
Robust Rate Adaptation AlgorithmThis is an implementation of RRAA as described in "Robust rate adapta...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports short guard interval.
static Time Now(void)
Return the current simulation virtual time.
virtual void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
void ARts(RraaWifiRemoteStation *station)
Activate the use of RTS for the given station if the conditions are met.
virtual 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.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint8_t GetDefaultTxPowerLevel(void) const
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
uint32_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
hold per-remote-station state for RRAA Wifi manager.
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
uint32_t GetMinRate(RraaWifiRemoteStation *station)
Return the index for the minimum transmission rate for the given station.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
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'...
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.