23 #include "ns3/assert.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/trace-source-accessor.h"
28 #define Min(a,b) ((a < b) ? a : b)
63 .SetGroupName (
"Wifi")
65 .AddAttribute (
"SuccessThreshold1",
66 "The minimum number of successful transmissions in \"High\" state to try a new power or rate.",
69 MakeUintegerChecker<uint32_t> ())
70 .AddAttribute (
"SuccessThreshold2",
71 "The minimum number of successful transmissions in \"Low\" state to try a new power or rate.",
74 MakeUintegerChecker<uint32_t> ())
75 .AddAttribute (
"FailThreshold",
76 "The minimum number of failed transmissions to try a new power or rate.",
79 MakeUintegerChecker<uint32_t> ())
80 .AddAttribute (
"PowerThreshold",
81 "The maximum number of power changes.",
84 MakeUintegerChecker<uint32_t> ())
85 .AddAttribute (
"PowerDecrementStep",
86 "Step size for decrement the power.",
89 MakeUintegerChecker<uint32_t> ())
90 .AddAttribute (
"PowerIncrementStep",
91 "Step size for increment the power.",
94 MakeUintegerChecker<uint32_t> ())
95 .AddAttribute (
"RateDecrementStep",
96 "Step size for decrement the rate.",
99 MakeUintegerChecker<uint32_t> ())
100 .AddAttribute (
"RateIncrementStep",
101 "Step size for increment the rate.",
104 MakeUintegerChecker<uint32_t> ())
105 .AddTraceSource (
"PowerChange",
106 "The transmission power has change",
108 "ns3::WifiRemoteStationManager::PowerChangeTracedCallback")
109 .AddTraceSource (
"RateChange",
110 "The transmission rate has change",
112 "ns3::WifiRemoteStationManager::RateChangeTracedCallback")
150 <<
", power=" << (
int)station->
m_power);
183 <<
", power=" << (
int)station->
m_power);
326 if (channelWidth > 20 && channelWidth != 22)
343 if (channelWidth > 20 && channelWidth != 22)
373 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
383 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
uint32_t m_succesMax2
The minimum number of successful transmissions in "Low" state to try a new power or rate...
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
uint32_t m_nSuccess
Number of successful transmission attempts.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
APARF Power and rate control algorithm.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint32_t m_rateInc
Step size for increment the rate.
uint32_t m_minPower
Minimal power level.
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
static TypeId GetTypeId(void)
Register this type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Mac48Address m_address
Mac48Address of the remote station.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
AparfWifiManager::State m_aparfState
The estimated state of the channel.
uint32_t m_failThreshold
The minimum number of failed transmissions to try a new power or rate.
uint32_t m_successThreshold
The minimum number of successful transmissions to try a new power or rate.
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
uint32_t m_powerDec
Step size for decrement the power.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
WifiRemoteStationState * m_state
Remote station state.
bool m_initialized
For initializing variables.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
uint32_t m_rateDec
Step size for decrement the rate.
uint32_t m_powerInc
Step size for increment the power.
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.
TracedCallback< uint32_t, Mac48Address > m_rateChange
The trace source fired when the transmission rate change.
uint32_t m_maxPower
Maximal power level.
Hold an unsigned integer type.
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
uint32_t m_nFailed
Number of failed transmission attempts.
void CheckInit(AparfWifiRemoteStation *station)
Check for initializations.
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.
virtual WifiRemoteStation * DoCreateStation(void) const
hold a list of per-remote-station state.
virtual bool IsLowLatency(void) const
uint32_t m_nSupported
Number of supported rates by the remote station.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
Hold per-remote-station state for APARF Wifi manager.
uint32_t m_failMax
The minimum number of failed transmissions to try a new power or rate.
uint32_t m_rateCrit
Critical rate.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
State
Enumeration of the possible states of the channel.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
virtual void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_succesMax1
The minimum number of successful transmissions in "High" state to try a new power or rate...
uint8_t GetDefaultTxPowerLevel(void) const
uint32_t m_powerMax
The maximum number of power changes.
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t m_pCount
Number of power changes.
virtual void SetHtSupported(bool enable)
Enable or disable HT capability support.
TracedCallback< uint8_t, Mac48Address > m_powerChange
The trace source fired when the transmission power change.
uint32_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
uint32_t m_rate
Current rate.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
hold per-remote-station state.
virtual double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
virtual ~AparfWifiManager()
virtual void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
uint8_t m_power
Current power.