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 .AddConstructor<RraaWifiManager> ()
63 .AddAttribute (
"Basic",
64 "If true the RRAA-BASIC algorithm will be used, otherwise the RRAA wil be used",
68 .AddAttribute (
"Timeout",
69 "Timeout for the RRAA BASIC loss estimaton block (s)",
73 .AddAttribute (
"ewndFor54mbps",
74 "ewnd parameter for 54 Mbs data mode",
77 MakeUintegerChecker<uint32_t> ())
78 .AddAttribute (
"ewndFor48mbps",
79 "ewnd parameter for 48 Mbs data mode",
82 MakeUintegerChecker<uint32_t> ())
83 .AddAttribute (
"ewndFor36mbps",
84 "ewnd parameter for 36 Mbs data mode",
87 MakeUintegerChecker<uint32_t> ())
88 .AddAttribute (
"ewndFor24mbps",
89 "ewnd parameter for 24 Mbs data mode",
92 MakeUintegerChecker<uint32_t> ())
93 .AddAttribute (
"ewndFor18mbps",
94 "ewnd parameter for 18 Mbs data mode",
97 MakeUintegerChecker<uint32_t> ())
98 .AddAttribute (
"ewndFor12mbps",
99 "ewnd parameter for 12 Mbs data mode",
102 MakeUintegerChecker<uint32_t> ())
103 .AddAttribute (
"ewndFor9mbps",
104 "ewnd parameter for 9 Mbs data mode",
107 MakeUintegerChecker<uint32_t> ())
108 .AddAttribute (
"ewndFor6mbps",
109 "ewnd parameter for 6 Mbs data mode",
112 MakeUintegerChecker<uint32_t> ())
113 .AddAttribute (
"poriFor48mbps",
114 "Pori parameter for 48 Mbs data mode",
117 MakeDoubleChecker<double> ())
118 .AddAttribute (
"poriFor36mbps",
119 "Pori parameter for 36 Mbs data mode",
122 MakeDoubleChecker<double> ())
123 .AddAttribute (
"poriFor24mbps",
124 "Pori parameter for 24 Mbs data mode",
127 MakeDoubleChecker<double> ())
128 .AddAttribute (
"poriFor18mbps",
129 "Pori parameter for 18 Mbs data mode",
132 MakeDoubleChecker<double> ())
133 .AddAttribute (
"poriFor12mbps",
134 "Pori parameter for 12 Mbs data mode",
137 MakeDoubleChecker<double> ())
138 .AddAttribute (
"poriFor9mbps",
139 "Pori parameter for 9 Mbs data mode",
142 MakeDoubleChecker<double> ())
143 .AddAttribute (
"poriFor6mbps",
144 "Pori parameter for 6 Mbs data mode",
147 MakeDoubleChecker<double> ())
148 .AddAttribute (
"pmtlFor54mbps",
149 "Pmtl parameter for 54 Mbs data mode",
152 MakeDoubleChecker<double> ())
153 .AddAttribute (
"pmtlFor48mbps",
154 "Pmtl parameter for 48 Mbs data mode",
157 MakeDoubleChecker<double> ())
158 .AddAttribute (
"pmtlFor36mbps",
159 "Pmtl parameter for 36 Mbs data mode",
162 MakeDoubleChecker<double> ())
163 .AddAttribute (
"pmtlFor24mbps",
164 "Pmtl parameter for 24 Mbs data mode",
167 MakeDoubleChecker<double> ())
168 .AddAttribute (
"pmtlFor18mbps",
169 "Pmtl parameter for 18 Mbs data mode",
172 MakeDoubleChecker<double> ())
173 .AddAttribute (
"pmtlFor12mbps",
174 "Pmtl parameter for 12 Mbs data mode",
177 MakeDoubleChecker<double> ())
178 .AddAttribute (
"pmtlFor9mbps",
179 "Pmtl parameter for 9 Mbs data mode",
182 MakeDoubleChecker<double> ())
255 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
261 double ackSnr,
WifiMode ackMode,
double dataSnr)
322 double ploss = (double) station->
m_failed / (
double) thresholds.
ewnd;
324 || ploss > thresholds.
pmtl)
327 && ploss > thresholds.
pmtl)
332 && ploss < thresholds.
pori)
377 switch (mode.GetDataRate () / 1000000)
460 NS_ASSERT_MSG (
false,
"Thresholds for an unknown mode are asked (" << mode <<
")");
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.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
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.
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.
struct ThresholdsItem GetThresholds(WifiMode mode) const
Get a threshold for the given mode.
#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()
virtual bool DoNeedRts(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
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...
uint32_t GetNumberOfReceiveAntennas(const WifiRemoteStation *station) const
Return the number of receive antenna the station has.
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.
bool GetStbc(const WifiRemoteStation *station) const
Return whether the given station supports space-time block coding (STBC).
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
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.
hold a list of per-remote-station state.
uint32_t GetNess(const WifiRemoteStation *station) const
Robust Rate Adaptation AlgorithmThis is an implementation of RRAA as described in "Robust rate adapta...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.
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.
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 GetNumberOfTransmitAntennas(void)
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)
hold per-remote-station state.