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)
56 .AddConstructor<RraaWifiManager> ()
57 .AddAttribute (
"Basic",
58 "If true the RRAA-BASIC algorithm will be used, otherwise the RRAA wil be used",
61 MakeBooleanChecker ())
62 .AddAttribute (
"Timeout",
63 "Timeout for the RRAA BASIC loss estimaton block (s)",
67 .AddAttribute (
"ewndFor54mbps",
68 "ewnd parameter for 54 Mbs data mode",
71 MakeUintegerChecker<uint32_t> ())
72 .AddAttribute (
"ewndFor48mbps",
73 "ewnd parameter for 48 Mbs data mode",
76 MakeUintegerChecker<uint32_t> ())
77 .AddAttribute (
"ewndFor36mbps",
78 "ewnd parameter for 36 Mbs data mode",
81 MakeUintegerChecker<uint32_t> ())
82 .AddAttribute (
"ewndFor24mbps",
83 "ewnd parameter for 24 Mbs data mode",
86 MakeUintegerChecker<uint32_t> ())
87 .AddAttribute (
"ewndFor18mbps",
88 "ewnd parameter for 18 Mbs data mode",
91 MakeUintegerChecker<uint32_t> ())
92 .AddAttribute (
"ewndFor12mbps",
93 "ewnd parameter for 12 Mbs data mode",
96 MakeUintegerChecker<uint32_t> ())
97 .AddAttribute (
"ewndFor9mbps",
98 "ewnd parameter for 9 Mbs data mode",
101 MakeUintegerChecker<uint32_t> ())
102 .AddAttribute (
"ewndFor6mbps",
103 "ewnd parameter for 6 Mbs data mode",
106 MakeUintegerChecker<uint32_t> ())
107 .AddAttribute (
"poriFor48mbps",
108 "Pori parameter for 48 Mbs data mode",
111 MakeDoubleChecker<double> ())
112 .AddAttribute (
"poriFor36mbps",
113 "Pori parameter for 36 Mbs data mode",
116 MakeDoubleChecker<double> ())
117 .AddAttribute (
"poriFor24mbps",
118 "Pori parameter for 24 Mbs data mode",
121 MakeDoubleChecker<double> ())
122 .AddAttribute (
"poriFor18mbps",
123 "Pori parameter for 18 Mbs data mode",
126 MakeDoubleChecker<double> ())
127 .AddAttribute (
"poriFor12mbps",
128 "Pori parameter for 12 Mbs data mode",
131 MakeDoubleChecker<double> ())
132 .AddAttribute (
"poriFor9mbps",
133 "Pori parameter for 9 Mbs data mode",
136 MakeDoubleChecker<double> ())
137 .AddAttribute (
"poriFor6mbps",
138 "Pori parameter for 6 Mbs data mode",
141 MakeDoubleChecker<double> ())
142 .AddAttribute (
"pmtlFor54mbps",
143 "Pmtl parameter for 54 Mbs data mode",
146 MakeDoubleChecker<double> ())
147 .AddAttribute (
"pmtlFor48mbps",
148 "Pmtl parameter for 48 Mbs data mode",
151 MakeDoubleChecker<double> ())
152 .AddAttribute (
"pmtlFor36mbps",
153 "Pmtl parameter for 36 Mbs data mode",
156 MakeDoubleChecker<double> ())
157 .AddAttribute (
"pmtlFor24mbps",
158 "Pmtl parameter for 24 Mbs data mode",
161 MakeDoubleChecker<double> ())
162 .AddAttribute (
"pmtlFor18mbps",
163 "Pmtl parameter for 18 Mbs data mode",
166 MakeDoubleChecker<double> ())
167 .AddAttribute (
"pmtlFor12mbps",
168 "Pmtl parameter for 12 Mbs data mode",
171 MakeDoubleChecker<double> ())
172 .AddAttribute (
"pmtlFor9mbps",
173 "Pmtl parameter for 9 Mbs data mode",
176 MakeDoubleChecker<double> ())
249 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
255 double ackSnr,
WifiMode ackMode,
double dataSnr)
316 double ploss = (double) station->
m_failed / (
double) thresholds.
ewnd;
318 || ploss > thresholds.
pmtl)
321 && ploss > thresholds.
pmtl)
326 && ploss < thresholds.
pori)
371 switch (mode.GetDataRate () / 1000000)
454 NS_ASSERT_MSG (
false,
"Thresholds for an unknown mode are asked (" << mode <<
")");
uint32_t GetNSupported(const WifiRemoteStation *station) const
uint32_t GetMaxRate(RraaWifiRemoteStation *station)
keep track of time values and allow control of global simulation resolution
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
static TypeId GetTypeId(void)
virtual void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)
struct ThresholdsItem GetThresholds(WifiMode mode) const
void RunBasicAlgorithm(RraaWifiRemoteStation *station)
virtual ~RraaWifiManager()
virtual bool DoNeedRts(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
virtual bool IsLowLatency(void) const
virtual void DoReportRtsFailed(WifiRemoteStation *station)
void ResetCountersBasic(RraaWifiRemoteStation *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
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
virtual WifiRemoteStation * DoCreateStation(void) const
bool GetStbc(const WifiRemoteStation *station) const
void CheckTimeout(RraaWifiRemoteStation *station)
NS_LOG_COMPONENT_DEFINE("RraaWifiManager")
hold objects of type ns3::Time
virtual void DoReportDataFailed(WifiRemoteStation *station)
Hold an unsigned integer type.
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
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
void ARts(RraaWifiRemoteStation *station)
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)
#define NS_ASSERT_MSG(condition, message)
uint8_t GetDefaultTxPowerLevel(void) const
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
#define NS_LOG_DEBUG(msg)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. Both limits are inclusive.
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
uint32_t GetNumberOfTransmitAntennas(void)
uint32_t GetMinRate(RraaWifiRemoteStation *station)
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
Hold an floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
hold per-remote-station state.