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)
61 .SetGroupName (
"Wifi")
63 .AddAttribute (
"AttemptThreshold",
64 "The minimum number of transmission attempts to try a new power or rate.",
67 MakeUintegerChecker<uint32_t> ())
68 .AddAttribute (
"SuccessThreshold",
69 "The minimum number of successful transmissions to try a new power or rate.",
72 MakeUintegerChecker<uint32_t> ())
73 .AddTraceSource (
"PowerChange",
74 "The transmission power has change",
76 "ns3::WifiRemoteStationManager::PowerChangeTracedCallback")
77 .AddTraceSource (
"RateChange",
78 "The transmission rate has change",
80 "ns3::WifiRemoteStationManager::RateChangeTracedCallback")
201 if (((station->
m_nRetry - 1) % 2) == 1)
235 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
242 double ackSnr,
WifiMode ackMode,
double dataSnr)
298 if (channelWidth > 20 && channelWidth != 22)
315 if (channelWidth > 20 && channelWidth != 22)
345 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
355 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Hold per-remote-station state for PARF Wifi manager.
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...
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 an Object subclass with the TypeId system.
uint32_t m_maxPower
Maximal power level.
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void CheckInit(ParfWifiRemoteStation *station)
Check for initializations.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_currentRate
Current rate used by the remote station.
uint32_t m_nAttempt
Number of transmission attempts.
Mac48Address m_address
Mac48Address of the remote station.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
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...
virtual ~ParfWifiManager()
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
virtual void DoReportDataFailed(WifiRemoteStation *station)
WifiRemoteStationState * m_state
Remote station state.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
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 void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
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.
virtual void SetHtSupported(bool enable)
Enable or disable HT capability support.
uint32_t m_successThreshold
The minimum number of successful transmissions to try a new power or rate.
virtual WifiRemoteStation * DoCreateStation(void) const
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...
virtual void DoReportRtsFailed(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.
hold a list of per-remote-station state.
uint32_t m_minPower
Minimal power level.
TracedCallback< uint8_t, Mac48Address > m_powerChange
The trace source fired when the transmission power changes....
bool m_initialized
For initializing variables.
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
PARF Rate control algorithm.
uint32_t m_nSupported
Number of supported rates by the remote station.
uint32_t m_nRetry
Number of transmission retries.
TracedCallback< uint32_t, Mac48Address > m_rateChange
The trace source fired when the transmission rate changes.
virtual double GetTxPowerEnd(void) const =0
Return the maximum available transmission power level (dBm).
uint8_t GetDefaultTxPowerLevel(void) const
virtual double GetTxPowerStart(void) const =0
Return the minimum available transmission power level (dBm).
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
static TypeId GetTypeId(void)
Register this type.
uint32_t m_nFail
Number of failed transmission attempts.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t m_nSuccess
Number of successful transmission attempts.
uint8_t m_currentPower
Current power used by the remote station.
uint32_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
virtual bool IsLowLatency(void) const
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
bool m_usingRecoveryRate
If using recovery rate.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
bool m_usingRecoveryPower
If using recovery power.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
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.
uint32_t m_attemptThreshold
The minimum number of transmission attempts to try a new power or rate.