21 #include "arf-wifi-manager.h"
22 #include "ns3/assert.h"
24 #include "ns3/uinteger.h"
39 uint32_t m_timerTimeout;
40 uint32_t m_successThreshold;
48 ArfWifiManager::GetTypeId (
void)
52 .AddConstructor<ArfWifiManager> ()
53 .AddAttribute (
"TimerThreshold",
"The 'timer' threshold in the ARF algorithm.",
55 MakeUintegerAccessor (&ArfWifiManager::m_timerThreshold),
56 MakeUintegerChecker<uint32_t> ())
57 .AddAttribute (
"SuccessThreshold",
58 "The minimum number of sucessfull transmissions to try a new rate.",
60 MakeUintegerAccessor (&ArfWifiManager::m_successThreshold),
61 MakeUintegerChecker<uint32_t> ())
66 ArfWifiManager::ArfWifiManager ()
70 ArfWifiManager::~ArfWifiManager ()
80 station->m_successThreshold = m_successThreshold;
81 station->m_timerTimeout = m_timerThreshold;
83 station->m_success = 0;
84 station->m_failed = 0;
85 station->m_recovery =
false;
114 station->m_success = 0;
116 if (station->m_recovery)
119 if (station->m_retry == 1)
122 if (station->m_rate != 0)
127 station->m_timer = 0;
132 if (((station->m_retry - 1) % 2) == 1)
135 if (station->m_rate != 0)
140 if (station->m_retry >= 2)
142 station->m_timer = 0;
152 void ArfWifiManager::DoReportRtsOk (WifiRemoteStation *station,
153 double ctsSnr, WifiMode ctsMode,
double rtsSnr)
158 void ArfWifiManager::DoReportDataOk (WifiRemoteStation *st,
159 double ackSnr, WifiMode ackMode,
double dataSnr)
162 ArfWifiRemoteStation *station = (ArfWifiRemoteStation *) st;
164 station->m_success++;
165 station->m_failed = 0;
166 station->m_recovery =
false;
167 station->m_retry = 0;
168 NS_LOG_DEBUG (
"station=" << station <<
" data ok success=" << station->m_success <<
", timer=" << station->m_timer);
169 if ((station->m_success == m_successThreshold
170 || station->m_timer == m_timerThreshold)
171 && (station->m_rate < (station->m_state->m_operationalRateSet.size () - 1)))
175 station->m_timer = 0;
176 station->m_success = 0;
177 station->m_recovery =
true;
181 ArfWifiManager::DoReportFinalRtsFailed (WifiRemoteStation *station)
186 ArfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station)
196 return GetSupported (station, station->m_rate);
205 return GetSupported (station, 0);
#define NS_LOG_FUNCTION(parameters)
virtual WifiRemoteStation * DoCreateStation(void) const
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
virtual bool IsLowLatency(void) const
Hold an unsigned integer type.
virtual WifiMode DoGetRtsMode(WifiRemoteStation *station)
hold a list of per-remote-station state.
virtual void DoReportDataFailed(WifiRemoteStation *station)
ARF Rate control algorithm.
#define NS_LOG_DEBUG(msg)
virtual WifiMode DoGetDataMode(WifiRemoteStation *station, uint32_t size)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
hold per-remote-station state.