|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/simulator.h"
24 #include "ns3/wifi-tx-vector.h"
26 #define Min(a,b) ((a < b) ? a : b)
59 .SetGroupName (
"Wifi")
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> ())
86 .AddTraceSource (
"Rate",
87 "Traced value for rate changes (b/s)",
89 "ns3::TracedValueCallback::Uint64")
112 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
116 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
120 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HE rates");
165 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
172 double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
174 NS_LOG_FUNCTION (
this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
266 bool needChange =
false;
314 if (
IsEnough (station) || needChange)
367 if (channelWidth > 20 && channelWidth != 22)
386 if (channelWidth > 20 && channelWidth != 22)
static TypeId GetTypeId(void)
Get the type ID.
a unique identifier for an interface.
uint8_t GetDefaultTxPowerLevel(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_success
success
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void DoInitialize(void) override
Initialize() implementation.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void DecreaseRate(AmrrWifiRemoteStation *station)
Decrease the transmission rate to the given station.
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index.
WifiRemoteStation * DoCreateStation(void) const override
TracedValue< uint64_t > m_currentRate
Trace rate changes.
void IncreaseRate(AmrrWifiRemoteStation *station)
Increase the transmission rate to the given station.
WifiModulationClass GetModulationClass() const
bool IsEnough(AmrrWifiRemoteStation *station) const
Check if the number of retransmission, transmission error, and successful transmission are greater th...
hold a list of per-remote-station state.
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
Time m_nextModeUpdate
next mode update time
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
hold per-remote-station state for AMRR Wifi manager.
bool IsSuccess(AmrrWifiRemoteStation *station) const
Check if the number of retransmission and transmission error is less than the number of successful tr...
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
AMRR Rate control algorithm.
uint32_t m_tx_retr
transmit retry
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
bool IsMaxRate(AmrrWifiRemoteStation *station) const
Check if the current rate for the given station is the maximum rate.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
double m_successRatio
success ratio
represent a single transmission mode
Time m_updatePeriod
update period
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_maxSuccessThreshold
maximum success threshold
Simulation virtual time values and global simulation resolution.
void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr) override
This method is a pure virtual method that must be implemented by the sub-class.
bool IsFailure(AmrrWifiRemoteStation *station) const
Check if the number of retransmission and transmission error is greater than the number of successful...
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override
This method is a pure virtual method that must be implemented by the sub-class.
bool IsMinRate(AmrrWifiRemoteStation *station) const
Check if the current rate for the given station is the minimum rate.
void ResetCnt(AmrrWifiRemoteStation *station)
Reset transmission statistics of the given station.
void UpdateMode(AmrrWifiRemoteStation *station)
Update the mode used to send to the given station.
uint8_t m_txrate
transmit rate
uint32_t m_tx_ok
transmit OK
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
hold per-remote-station state.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
#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.
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index.
virtual ~AmrrWifiManager()
uint32_t m_minSuccessThreshold
minimum success threshold
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
uint32_t m_tx_err
transmit error
Hold an unsigned integer type.
double m_failureRatio
failure ratio
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint32_t m_successThreshold
success threshold
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.