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)
63 .AddConstructor<RraaWifiManager> ()
64 .AddAttribute (
"Basic",
65 "If true the RRAA-BASIC algorithm will be used, otherwise the RRAA wil be used",
68 MakeBooleanChecker ())
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> ())
256 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
262 double ackSnr,
WifiMode ackMode,
double dataSnr)
323 double ploss = (double) station->
m_failed / (
double) thresholds.
ewnd;
325 || ploss > thresholds.
pmtl)
328 && ploss > thresholds.
pmtl)
333 && ploss < thresholds.
pori)
378 switch (mode.GetDataRate () / 1000000)
461 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.
keep track of time values and allow control of global simulation resolution
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
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.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
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
bool GetStbc(const WifiRemoteStation *station) const
Return whether the given station supports space-time block coding (STBC).
void CheckTimeout(RraaWifiRemoteStation *station)
Check if the counter should be resetted.
NS_LOG_COMPONENT_DEFINE("RraaWifiManager")
hold objects of type ns3::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.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
hold a list of per-remote-station state.
Robust Rate Adaptation AlgorithmThis is an implementation of RRAA as described in "Robust rate adapta...
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports short guard interval.
static Time Now(void)
Return the "current simulation 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)
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)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
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.
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
hold per-remote-station state.