22 #include "ns3/assert.h" 
   24 #include "ns3/simulator.h" 
   25 #include "ns3/boolean.h" 
   26 #include "ns3/double.h" 
   27 #include "ns3/uinteger.h" 
   30 #define Min(a,b) ((a < b) ? a : b) 
   31 #define Max(a,b) ((a > b) ? a : b) 
   70     .AddConstructor<AarfcdWifiManager> ()
 
   71     .AddAttribute (
"SuccessK", 
"Multiplication factor for the success threshold in the AARF algorithm.",
 
   74                    MakeDoubleChecker<double> ())
 
   75     .AddAttribute (
"TimerK",
 
   76                    "Multiplication factor for the timer threshold in the AARF algorithm.",
 
   79                    MakeDoubleChecker<double> ())
 
   80     .AddAttribute (
"MaxSuccessThreshold",
 
   81                    "Maximum value of the success threshold in the AARF algorithm.",
 
   84                    MakeUintegerChecker<uint32_t> ())
 
   85     .AddAttribute (
"MinTimerThreshold",
 
   86                    "The minimum value for the 'timer' threshold in the AARF algorithm.",
 
   89                    MakeUintegerChecker<uint32_t> ())
 
   90     .AddAttribute (
"MinSuccessThreshold",
 
   91                    "The minimum value for the success threshold in the AARF algorithm.",
 
   94                    MakeUintegerChecker<uint32_t> ())
 
   95     .AddAttribute (
"MinRtsWnd",
 
   96                    "Minimum value for Rts window of Aarf-CD",
 
   99                    MakeUintegerChecker<uint32_t> ())
 
  100     .AddAttribute (
"MaxRtsWnd",
 
  101                    "Maximum value for Rts window of Aarf-CD",
 
  104                    MakeUintegerChecker<uint32_t> ())
 
  105     .AddAttribute (
"TurnOffRtsAfterRateDecrease",
 
  106                    "If true the RTS mechanism will be turned off when the rate will be decreased",
 
  109                    MakeBooleanChecker ())
 
  110     .AddAttribute (
"TurnOnRtsAfterRateIncrease",
 
  111                    "If true the RTS mechanism will be turned on when the rate will be increased",
 
  114                    MakeBooleanChecker ())
 
  215       if (((station->
m_retry - 1) % 2) == 1)
 
  245                                   double ctsSnr, 
WifiMode ctsMode, 
double rtsSnr)
 
  254                                    double ackSnr, 
WifiMode ackMode, 
double dataSnr)
 
uint32_t GetNSupported(const WifiRemoteStation *station) const 
Return the number of modes supported by the given station. 
virtual void DoReportDataFailed(WifiRemoteStation *station)
It is important to realize that "recovery" mode starts after failure of the first transmission after ...
uint32_t m_successThreshold
#define NS_LOG_FUNCTION(parameters)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
uint32_t m_maxSuccessThreshold
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
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. 
bool m_turnOnRtsAfterRateIncrease
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
virtual void DoReportFinalDataFailed(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. ...
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class. 
bool GetStbc(const WifiRemoteStation *station) const 
Return whether the given station supports space-time block coding (STBC). 
void TurnOnRts(AarfcdWifiRemoteStation *station)
Turn on RTS for the given station. 
void TurnOffRts(AarfcdWifiRemoteStation *station)
Turn off RTS for the given station. 
Hold an unsigned integer type. 
void ResetRtsWnd(AarfcdWifiRemoteStation *station)
Reset the RTS window of the given station. 
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
NS_LOG_COMPONENT_DEFINE("Aarfcd")
int64x64_t Max(const int64x64_t &a, const int64x64_t &b)
hold a list of per-remote-station state. 
void CheckRts(AarfcdWifiRemoteStation *station)
Check if the use of RTS for the given station can be turned off. 
virtual ~AarfcdWifiManager()
virtual bool IsLowLatency(void) const 
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class. 
bool GetShortGuardInterval(const WifiRemoteStation *station) const 
Return whether the given station supports short guard interval. 
uint32_t m_minSuccessThreshold
virtual WifiRemoteStation * DoCreateStation(void) const 
hold per-remote-station state for AARF-CD Wifi manager. 
uint8_t GetDefaultTxPowerLevel(void) const 
uint32_t m_minTimerThreshold
bool m_turnOffRtsAfterRateDecrease
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const 
Return the long retry limit of the given station. 
#define NS_LOG_DEBUG(msg)
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const 
Return the short retry limit of the given station. 
uint32_t GetNumberOfTransmitAntennas(void)
static TypeId GetTypeId(void)
an implementation of the AARF-CD algorithmThis algorithm was first described in "Efficient Collision ...
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 DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)
This method is a pure virtual method that must be implemented by the sub-class. 
Hold a floating point type. 
void IncreaseRtsWnd(AarfcdWifiRemoteStation *station)
Increase the RTS window size of the given station. 
a unique identifier for an interface. 
TypeId SetParent(TypeId tid)
hold per-remote-station state. 
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)