A Discrete-Event Network Simulator
API
ideal-wifi-manager.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "ideal-wifi-manager.h"
22 #include "wifi-phy.h"
23 #include "ns3/log.h"
24 
25 namespace ns3 {
26 
34 {
36  double m_lastSnrCached;
37  double m_nss;
39 };
40 
41 // To avoid using the cache before a valid value has been cached
42 static const double CACHE_INITIAL_VALUE = -100;
43 
45 
46 NS_LOG_COMPONENT_DEFINE ("IdealWifiManager");
47 
48 TypeId
50 {
51  static TypeId tid = TypeId ("ns3::IdealWifiManager")
53  .SetGroupName ("Wifi")
54  .AddConstructor<IdealWifiManager> ()
55  .AddAttribute ("BerThreshold",
56  "The maximum Bit Error Rate acceptable at any transmission mode",
57  DoubleValue (1e-5),
59  MakeDoubleChecker<double> ())
60  .AddTraceSource ("Rate",
61  "Traced value for rate changes (b/s)",
63  "ns3::TracedValueCallback::Uint64")
64  ;
65  return tid;
66 }
67 
69  : m_currentRate (0)
70 {
71 }
72 
74 {
75 }
76 
77 void
79 {
80  NS_LOG_FUNCTION (this << phy);
82 }
83 
84 uint8_t
86 {
92  {
93  return 22;
94  }
95  else
96  {
97  return 20;
98  }
99 }
100 
101 void
103 {
104  NS_LOG_FUNCTION (this);
105  WifiMode mode;
106  WifiTxVector txVector;
107  uint8_t nss = 1;
108  uint32_t nModes = GetPhy ()->GetNModes ();
109  for (uint32_t i = 0; i < nModes; i++)
110  {
111  mode = GetPhy ()->GetMode (i);
112  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
113  txVector.SetNss (nss);
114  txVector.SetMode (mode);
115  NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName ());
116  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
117  }
118  // Add all Ht and Vht MCSes
119  if (HasVhtSupported () == true || HasHtSupported () == true || HasHeSupported () == true)
120  {
121  nModes = GetPhy ()->GetNMcs ();
122  for (uint32_t i = 0; i < nModes; i++)
123  {
124  for (uint16_t j = 20; j <= GetPhy ()->GetChannelWidth (); j*=2)
125  {
126  txVector.SetChannelWidth (j);
127  mode = GetPhy ()->GetMcs (i);
128  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
129  {
130  uint16_t guardInterval = GetPhy ()->GetShortGuardInterval () ? 400 : 800;
131  txVector.SetGuardInterval (guardInterval);
132  //derive NSS from the MCS index
133  nss = (mode.GetMcsValue () / 8) + 1;
134  NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
135  " channel width " << (uint16_t) j <<
136  " nss " << (uint16_t) nss <<
137  " GI " << guardInterval);
138  NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
139  txVector.SetNss (nss);
140  txVector.SetMode (mode);
141  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
142  }
143  else //VHT or HE
144  {
145  uint16_t guardInterval;
146  if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
147  {
148  guardInterval = GetPhy ()->GetShortGuardInterval () ? 400 : 800;
149  }
150  else
151  {
152  guardInterval = GetPhy ()->GetGuardInterval ().GetNanoSeconds ();
153  }
154  for (uint8_t i = 1; i <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); i++)
155  {
156  NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
157  " channel width " << (uint16_t) j <<
158  " nss " << (uint16_t) i <<
159  " GI " << guardInterval);
160  NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
161  txVector.SetNss (i);
162  txVector.SetMode (mode);
163  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
164  }
165  }
166  }
167  }
168  }
169 }
170 
171 double
173 {
174  NS_LOG_FUNCTION (this << txVector.GetMode ().GetUniqueName ());
175  for (Thresholds::const_iterator i = m_thresholds.begin (); i != m_thresholds.end (); i++)
176  {
177  NS_LOG_DEBUG ("Checking " << i->second.GetMode ().GetUniqueName () <<
178  " nss " << (uint16_t) i->second.GetNss () <<
179  " GI " << i->second.GetGuardInterval () <<
180  " width " << (uint16_t) i->second.GetChannelWidth ());
181  NS_LOG_DEBUG ("against TxVector " << txVector.GetMode ().GetUniqueName () <<
182  " nss " << (uint16_t) txVector.GetNss () <<
183  " GI " << txVector.GetGuardInterval () <<
184  " width " << (uint16_t) txVector.GetChannelWidth ());
185  if (txVector.GetMode () == i->second.GetMode ()
186  && txVector.GetNss () == i->second.GetNss ()
187  && txVector.GetChannelWidth () == i->second.GetChannelWidth ())
188  {
189  return i->first;
190  }
191  }
192  NS_ASSERT (false);
193  return 0.0;
194 }
195 
196 void
198 {
199  NS_LOG_FUNCTION (this << txVector.GetMode ().GetUniqueName () << snr);
200  m_thresholds.push_back (std::make_pair (snr, txVector));
201 }
202 
205 {
206  NS_LOG_FUNCTION (this);
208  station->m_lastSnrObserved = 0.0;
210  station->m_lastMode = GetDefaultMode ();
211  station->m_nss = 1;
212  return station;
213 }
214 
215 
216 void
218  double rxSnr, WifiMode txMode)
219 {
220 }
221 
222 void
224 {
225 }
226 
227 void
229 {
230 }
231 
232 void
234  double ctsSnr, WifiMode ctsMode, double rtsSnr)
235 {
236  NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode.GetUniqueName () << rtsSnr);
238  station->m_lastSnrObserved = rtsSnr;
239 }
240 
241 void
243  double ackSnr, WifiMode ackMode, double dataSnr)
244 {
245  NS_LOG_FUNCTION (this << st << ackSnr << ackMode.GetUniqueName () << dataSnr);
247  if (dataSnr == 0)
248  {
249  NS_LOG_WARN ("DataSnr reported to be zero; not saving this report.");
250  return;
251  }
252  station->m_lastSnrObserved = dataSnr;
253 }
254 
255 void
256 IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
257 {
258  NS_LOG_FUNCTION (this << st << (uint16_t)nSuccessfulMpdus << (uint16_t)nFailedMpdus << rxSnr << dataSnr);
260  if (dataSnr == 0)
261  {
262  NS_LOG_WARN ("DataSnr reported to be zero; not saving this report.");
263  return;
264  }
265  station->m_lastSnrObserved = dataSnr;
266 }
267 
268 
269 void
271 {
272 }
273 
274 void
276 {
277 }
278 
281 {
282  NS_LOG_FUNCTION (this << st);
284  //We search within the Supported rate set the mode with the
285  //highest data rate for which the snr threshold is smaller than m_lastSnr
286  //to ensure correct packet delivery.
287  WifiMode maxMode = GetDefaultMode ();
288  WifiTxVector txVector;
289  WifiMode mode;
290  uint64_t bestRate = 0;
291  uint8_t selectedNss = 1;
292  uint16_t guardInterval;
293  uint8_t channelWidth = std::min (GetChannelWidth (station), GetPhy ()->GetChannelWidth ());
294  txVector.SetChannelWidth (channelWidth);
295  if (station->m_lastSnrCached != CACHE_INITIAL_VALUE && station->m_lastSnrObserved == station->m_lastSnrCached)
296  {
297  // SNR has not changed, so skip the search and use the last
298  // mode selected
299  maxMode = station->m_lastMode;
300  selectedNss = station->m_nss;
301  NS_LOG_DEBUG ("Using cached mode = " << maxMode.GetUniqueName () <<
302  " last snr observed " << station->m_lastSnrObserved <<
303  " cached " << station->m_lastSnrCached <<
304  " nss " << (uint16_t) selectedNss);
305  }
306  else
307  {
308  if ((HasVhtSupported () == true || HasHtSupported () == true || HasHeSupported () == true)
309  && (GetHtSupported (st) == true || GetVhtSupported (st) == true || GetHeSupported (st) == true))
310  {
311  for (uint32_t i = 0; i < GetNMcsSupported (station); i++)
312  {
313  mode = GetMcsSupported (station, i);
314  txVector.SetMode (mode);
315  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
316  {
317  guardInterval = std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800);
318  txVector.SetGuardInterval (guardInterval);
319  // If the node and peer are both VHT capable, only search VHT modes
320  if (HasVhtSupported () && GetVhtSupported (station))
321  {
322  continue;
323  }
324  // If the node and peer are both HE capable, only search HE modes
325  if (HasHeSupported () && GetHeSupported (station))
326  {
327  continue;
328  }
329  // Derive NSS from the MCS index. There is a different mode for each possible NSS value.
330  uint8_t nss = (mode.GetMcsValue () / 8) + 1;
331  txVector.SetNss (nss);
332  if (WifiPhy::IsValidTxVector (txVector) == false ||
334  {
335  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
336  " nss " << (uint16_t) nss << " width " <<
337  (uint16_t) txVector.GetChannelWidth ());
338  continue;
339  }
340  double threshold = GetSnrThreshold (txVector);
341  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
342  NS_LOG_DEBUG ("Testing mode " << mode.GetUniqueName () <<
343  " data rate " << dataRate <<
344  " threshold " << threshold << " last snr observed " <<
345  station->m_lastSnrObserved << " cached " <<
346  station->m_lastSnrCached);
347  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
348  {
349  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
350  " data rate " << dataRate <<
351  " threshold " << threshold <<
352  " last snr observed " <<
353  station->m_lastSnrObserved);
354  bestRate = dataRate;
355  maxMode = mode;
356  selectedNss = nss;
357  }
358  }
359  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
360  {
361  guardInterval = std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800);
362  txVector.SetGuardInterval (guardInterval);
363  // If the node and peer are both HE capable, only search HE modes
364  if (HasHeSupported () && GetHeSupported (station))
365  {
366  continue;
367  }
368  // If the node and peer are not both VHT capable, only search HT modes
369  if (!HasVhtSupported () || !GetVhtSupported (station))
370  {
371  continue;
372  }
373  for (uint8_t nss = 1; nss <= std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (station)); nss++)
374  {
375  txVector.SetNss (nss);
376  if (WifiPhy::IsValidTxVector (txVector) == false)
377  {
378  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
379  " nss " << (uint16_t) nss << " width " <<
380  (uint16_t) txVector.GetChannelWidth ());
381  continue;
382  }
383  double threshold = GetSnrThreshold (txVector);
384  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
385  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
386  " data rate " << dataRate <<
387  " threshold " << threshold << " last snr observed " <<
388  station->m_lastSnrObserved << " cached " <<
389  station->m_lastSnrCached);
390  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
391  {
392  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
393  " data rate " << dataRate <<
394  " threshold " << threshold <<
395  " last snr observed " <<
396  station->m_lastSnrObserved);
397  bestRate = dataRate;
398  maxMode = mode;
399  selectedNss = nss;
400  }
401  }
402  }
403  else //HE
404  {
405  guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));
406  txVector.SetGuardInterval (guardInterval);
407  // If the node and peer are not both HE capable, only search (V)HT modes
408  if (!HasHeSupported () || !GetHeSupported (station))
409  {
410  continue;
411  }
412  for (uint8_t nss = 1; nss <= GetNumberOfSupportedStreams (station); nss++)
413  {
414  txVector.SetNss (nss);
415  if (WifiPhy::IsValidTxVector (txVector) == false)
416  {
417  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
418  " nss " << (uint16_t) nss << " width " <<
419  (uint16_t) txVector.GetChannelWidth ());
420  continue;
421  }
422  double threshold = GetSnrThreshold (txVector);
423  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
424  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
425  " data rate " << dataRate <<
426  " threshold " << threshold << " last snr observed " <<
427  station->m_lastSnrObserved << " cached " <<
428  station->m_lastSnrCached);
429  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
430  {
431  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
432  " data rate " << dataRate <<
433  " threshold " << threshold <<
434  " last snr observed " <<
435  station->m_lastSnrObserved);
436  bestRate = dataRate;
437  maxMode = mode;
438  selectedNss = nss;
439  }
440  }
441  }
442  }
443  }
444  else
445  {
446  // Non-HT selection
447  selectedNss = 1;
448  for (uint32_t i = 0; i < GetNSupported (station); i++)
449  {
450  mode = GetSupported (station, i);
451  txVector.SetMode (mode);
452  txVector.SetNss (selectedNss);
453  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
454  double threshold = GetSnrThreshold (txVector);
455  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), txVector.GetNss ());
456  NS_LOG_DEBUG ("mode = " << mode.GetUniqueName () <<
457  " threshold " << threshold <<
458  " last snr observed " <<
459  station->m_lastSnrObserved);
460  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
461  {
462  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
463  " data rate " << dataRate <<
464  " threshold " << threshold <<
465  " last snr observed " <<
466  station->m_lastSnrObserved);
467  bestRate = dataRate;
468  maxMode = mode;
469  }
470  }
471  }
472  NS_LOG_DEBUG ("Updating cached values for station to " << maxMode.GetUniqueName () << " snr " << station->m_lastSnrObserved);
473  station->m_lastSnrCached = station->m_lastSnrObserved;
474  station->m_lastMode = maxMode;
475  station->m_nss = selectedNss;
476  }
477  NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << (uint16_t) channelWidth);
478  if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
479  {
480  guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));
481  }
482  else
483  {
484  guardInterval = std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800);
485  }
486  if (m_currentRate != maxMode.GetDataRate (channelWidth, guardInterval, selectedNss))
487  {
488  NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, guardInterval, selectedNss));
489  m_currentRate = maxMode.GetDataRate (channelWidth, guardInterval, selectedNss);
490  }
491  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetLongRetryCount (station), GetPreambleForTransmission (maxMode, GetAddress (station)), guardInterval, GetNumberOfAntennas (), selectedNss, 0, channelWidth, GetAggregation (station), false);
492 }
493 
496 {
497  NS_LOG_FUNCTION (this << st);
499  //We search within the Basic rate set the mode with the highest
500  //snr threshold possible which is smaller than m_lastSnr to
501  //ensure correct packet delivery.
502  double maxThreshold = 0.0;
503  WifiTxVector txVector;
504  WifiMode mode;
505  uint8_t nss = 1;
506  WifiMode maxMode = GetDefaultMode ();
507  //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac/ax
508  //RTS is sent in a legacy frame; RTS with HT/VHT/HE is not yet supported
509  for (uint32_t i = 0; i < GetNBasicModes (); i++)
510  {
511  mode = GetBasicMode (i);
512  txVector.SetMode (mode);
513  txVector.SetNss (nss);
514  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
515  double threshold = GetSnrThreshold (txVector);
516  if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
517  {
518  maxThreshold = threshold;
519  maxMode = mode;
520  }
521  }
522  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetShortRetryCount (station), GetPreambleForTransmission (maxMode, GetAddress (station)), 800, GetNumberOfAntennas (), nss, 0, GetChannelWidthForMode (maxMode), GetAggregation (station), false);
523 }
524 
525 bool
527 {
528  return true;
529 }
530 
531 } //namespace ns3
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
uint16_t GetGuardInterval(void) const
bool IsLowLatency(void) const
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static const double CACHE_INITIAL_VALUE
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
#define min(a, b)
Definition: 80211b.c:44
uint8_t GetChannelWidthForMode(WifiMode mode) const
Convenience function for selecting a channel width for legacy mode.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
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 GetShortGuardInterval(void) const
Return whether short guard interval is supported.
Definition: wifi-phy.cc:637
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
Definition: wifi-phy.cc:3553
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint32_t i) const
Return the WifiMode supported by the specified station at the specified index.
hold per-remote-station state for Ideal Wifi manager.
VHT PHY (Clause 22)
Definition: wifi-mode.h:60
HR/DSSS PHY (Clause 18)
Definition: wifi-mode.h:48
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
void DoInitialize(void)
Initialize() implementation.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
uint8_t GetChannelWidth(void) const
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
double GetSnrThreshold(WifiTxVector txVector) const
Return the minimum SNR needed to successfully transmit data with this WifiTxVector at the specified B...
static TypeId GetTypeId(void)
Get the type ID.
tuple phy
Definition: third.py:86
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
#define max(a, b)
Definition: 80211b.c:45
void DoReportAmpduTxStatus(WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
uint64_t GetDataRate(uint8_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:143
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
uint8_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
bool GetHeSupported(const WifiRemoteStation *station) const
Return whether the given station is HE capable.
Time GetGuardInterval(void) const
Definition: wifi-phy.cc:651
HT PHY (Clause 20)
Definition: wifi-mode.h:58
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:465
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:450
Thresholds m_thresholds
List of WifiTxVector and the minimum SNR pair.
double m_nss
SNR most recently used to select a rate.
double m_lastSnrObserved
SNR of most recently reported packet sent to the remote station.
uint8_t GetNumberOfSupportedStreams(const WifiRemoteStation *station) const
Return the number of supported streams the station has.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
uint32_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3541
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
hold a list of per-remote-station state.
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range.
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.
WifiRemoteStation * DoCreateStation(void) const
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
Definition: wifi-phy.cc:3559
TracedValue< uint64_t > m_currentRate
Trace rate changes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static bool IsValidTxVector(WifiTxVector txVector)
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
Definition: wifi-phy.cc:3479
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports HT/VHT short guard interval.
double m_lastSnrCached
SNR most recently used to select a rate.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1332
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: double.h:42
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:353
uint8_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1304
bool HasHeSupported(void) const
Return whether the device has HE capability support enabled.
uint8_t GetNss(void) const
uint32_t GetNBasicModes(void) const
Return the number of basic modes we support.
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
uint32_t GetNMcsSupported(const WifiRemoteStation *station) const
Return the number of MCS supported by the given station.
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:261
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:269
Ideal rate control algorithmThis class implements an 'ideal' rate control algorithm similar to RBAR i...
WifiMode m_lastMode
Mode most recently used to the remote station.
void SetChannelWidth(uint8_t channelWidth)
Sets the selected channelWidth (in MHz)
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:487
void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
WifiMode GetMode(void) const
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
a unique identifier for an interface.
Definition: type-id.h:58
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:914
HE PHY (Clause 26)
Definition: wifi-mode.h:62
hold per-remote-station state.
bool GetHtSupported(const WifiRemoteStation *station) const
Return whether the given station is HT capable.
DSSS PHY (Clause 15)
Definition: wifi-mode.h:46
void AddSnrThreshold(WifiTxVector txVector, double snr)
Adds a pair of WifiTxVector and the minimum SNR for that given vector to the list.
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
WifiMode GetMode(uint32_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3547