22 #include "ns3/simulator.h"
24 #include "ns3/uinteger.h"
25 #include "ns3/double.h"
27 #define Min(a,b) ((a < b) ? a : b)
54 .AddConstructor<AmrrWifiManager> ()
55 .AddAttribute (
"UpdatePeriod",
56 "The interval between decisions about rate control changes",
60 .AddAttribute (
"FailureRatio",
61 "Ratio of minimum erroneous transmissions needed to switch to a lower rate",
64 MakeDoubleChecker<double> (0.0, 1.0))
65 .AddAttribute (
"SuccessRatio",
66 "Ratio of maximum erroneous transmissions needed to switch to a higher rate",
69 MakeDoubleChecker<double> (0.0, 1.0))
70 .AddAttribute (
"MaxSuccessThreshold",
71 "Maximum number of consecutive success periods needed to switch to a higher rate",
74 MakeUintegerChecker<uint32_t> ())
75 .AddAttribute (
"MinSuccessThreshold",
76 "Minimum number of consecutive success periods needed to switch to a higher rate",
79 MakeUintegerChecker<uint32_t> ())
128 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
134 double ackSnr,
WifiMode ackMode,
double dataSnr)
218 bool needChange =
false;
266 if (
IsEnough (station) || needChange)
uint32_t m_minSuccessThreshold
uint32_t GetNSupported(const WifiRemoteStation *station) const
bool IsMinRate(AmrrWifiRemoteStation *station) const
keep track of time values and allow control of global simulation resolution
#define NS_LOG_FUNCTION(parameters)
AMRR Rate control algorithmThis class implements the AMRR rate control algorithm which was initially ...
virtual WifiRemoteStation * DoCreateStation(void) const
uint32_t m_successThreshold
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
void ResetCnt(AmrrWifiRemoteStation *station)
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
#define NS_ASSERT(condition)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
virtual void DoReportRtsFailed(WifiRemoteStation *station)
uint32_t GetNumberOfReceiveAntennas(const WifiRemoteStation *station) const
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
bool GetStbc(const WifiRemoteStation *station) const
virtual bool IsLowLatency(void) const
bool IsFailure(AmrrWifiRemoteStation *station) const
hold objects of type ns3::Time
Hold an unsigned integer type.
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
virtual void DoReportDataFailed(WifiRemoteStation *station)
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
void DecreaseRate(AmrrWifiRemoteStation *station)
hold a list of per-remote-station state.
void IncreaseRate(AmrrWifiRemoteStation *station)
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
virtual void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
static TypeId GetTypeId(void)
bool GetShortGuardInterval(const WifiRemoteStation *station) const
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)
bool IsSuccess(AmrrWifiRemoteStation *station) const
uint8_t GetDefaultTxPowerLevel(void) const
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
uint32_t m_maxSuccessThreshold
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
NS_LOG_COMPONENT_DEFINE("AmrrWifiRemoteStation")
#define NS_LOG_DEBUG(msg)
void UpdateMode(AmrrWifiRemoteStation *station)
bool IsMaxRate(AmrrWifiRemoteStation *station) const
bool IsEnough(AmrrWifiRemoteStation *station) const
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 GetNumberOfTransmitAntennas(void)
Hold an floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
hold per-remote-station state.