22 #include "ns3/simulator.h"
24 #include "ns3/uinteger.h"
25 #include "ns3/double.h"
27 #define Min(a,b) ((a < b) ? a : b)
60 .AddConstructor<AmrrWifiManager> ()
61 .AddAttribute (
"UpdatePeriod",
62 "The interval between decisions about rate control changes",
66 .AddAttribute (
"FailureRatio",
67 "Ratio of minimum erroneous transmissions needed to switch to a lower rate",
70 MakeDoubleChecker<double> (0.0, 1.0))
71 .AddAttribute (
"SuccessRatio",
72 "Ratio of maximum erroneous transmissions needed to switch to a higher rate",
75 MakeDoubleChecker<double> (0.0, 1.0))
76 .AddAttribute (
"MaxSuccessThreshold",
77 "Maximum number of consecutive success periods needed to switch to a higher rate",
80 MakeUintegerChecker<uint32_t> ())
81 .AddAttribute (
"MinSuccessThreshold",
82 "Minimum number of consecutive success periods needed to switch to a higher rate",
85 MakeUintegerChecker<uint32_t> ())
134 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
140 double ackSnr,
WifiMode ackMode,
double dataSnr)
224 bool needChange =
false;
272 if (
IsEnough (station) || needChange)
uint32_t m_minSuccessThreshold
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
bool IsMinRate(AmrrWifiRemoteStation *station) const
Check if the current rate for the given station is the minimum rate.
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
AMRR Rate control algorithmThis class implements the AMRR rate control algorithm which was initially ...
virtual WifiRemoteStation * DoCreateStation(void) const
uint32_t m_successThreshold
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 the class in the ns-3 factory.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void ResetCnt(AmrrWifiRemoteStation *station)
Reset transmission statistics of the given station.
hold per-remote-station state for AMRR Wifi manager.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
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. ...
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.
virtual bool IsLowLatency(void) const
bool IsFailure(AmrrWifiRemoteStation *station) const
Check if the number of retransmission and transmission error is greater than the number of successful...
Attribute for objects of type ns3::Time.
Hold an unsigned integer type.
virtual void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void DecreaseRate(AmrrWifiRemoteStation *station)
Decrease the transmission rate to the given station.
hold a list of per-remote-station state.
void IncreaseRate(AmrrWifiRemoteStation *station)
Increase the transmission rate to the given station.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
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.
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)
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports short guard interval.
static Time Now(void)
Return the "current simulation time".
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.
bool IsSuccess(AmrrWifiRemoteStation *station) const
Check if the number of retransmission and transmission error is less than the number of successful tr...
uint8_t GetDefaultTxPowerLevel(void) const
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
uint32_t m_maxSuccessThreshold
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
#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.
void UpdateMode(AmrrWifiRemoteStation *station)
Update the mode used to send to the given station.
bool IsMaxRate(AmrrWifiRemoteStation *station) const
Check if the current rate for the given station is the maximum rate.
bool IsEnough(AmrrWifiRemoteStation *station) const
Check if the number of retransmission, transmission error, and successful transmission are greater th...
uint32_t GetNumberOfTransmitAntennas(void)
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
hold per-remote-station state.