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 "ns3/log.h"
22 #include "ideal-wifi-manager.h"
23 #include "wifi-phy.h"
24 
25 namespace ns3 {
26 
34 {
36  double m_lastSnrCached;
37  uint8_t m_nss;
39 };
40 
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  NS_LOG_FUNCTION (this);
72 }
73 
75 {
76  NS_LOG_FUNCTION (this);
77 }
78 
79 void
81 {
82  NS_LOG_FUNCTION (this << phy);
84 }
85 
86 uint16_t
88 {
94  {
95  return 22;
96  }
97  else
98  {
99  return 20;
100  }
101 }
102 
103 void
105 {
106  NS_LOG_FUNCTION (this);
107  WifiMode mode;
108  WifiTxVector txVector;
109  uint8_t nss = 1;
110  uint8_t nModes = GetPhy ()->GetNModes ();
111  for (uint8_t i = 0; i < nModes; i++)
112  {
113  mode = GetPhy ()->GetMode (i);
115  txVector.SetNss (nss);
116  txVector.SetMode (mode);
117  NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName ());
118  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
119  }
120  // Add all MCSes
121  if (GetHtSupported ())
122  {
123  nModes = GetPhy ()->GetNMcs ();
124  for (uint8_t i = 0; i < nModes; i++)
125  {
126  for (uint16_t j = 20; j <= GetPhy ()->GetChannelWidth (); j *= 2)
127  {
128  txVector.SetChannelWidth (j);
129  mode = GetPhy ()->GetMcs (i);
130  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
131  {
132  uint16_t guardInterval = GetShortGuardIntervalSupported () ? 400 : 800;
133  txVector.SetGuardInterval (guardInterval);
134  //derive NSS from the MCS index
135  nss = (mode.GetMcsValue () / 8) + 1;
136  NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
137  " channel width " << j <<
138  " nss " << +nss <<
139  " GI " << guardInterval);
140  NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
141  txVector.SetNss (nss);
142  txVector.SetMode (mode);
143  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
144  }
145  else //VHT or HE
146  {
147  uint16_t guardInterval;
148  if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
149  {
150  guardInterval = GetShortGuardIntervalSupported () ? 400 : 800;
151  }
152  else
153  {
154  guardInterval = GetGuardInterval ();
155  }
156  txVector.SetGuardInterval (guardInterval);
157  for (uint8_t k = 1; k <= GetPhy ()->GetMaxSupportedTxSpatialStreams (); k++)
158  {
159  NS_LOG_DEBUG ("Initialize, adding mode = " << mode.GetUniqueName () <<
160  " channel width " << j <<
161  " nss " << +k <<
162  " GI " << guardInterval);
163  if (mode.IsAllowed (j, k))
164  {
165  NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
166  txVector.SetNss (k);
167  txVector.SetMode (mode);
168  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
169  }
170  else
171  {
172  NS_LOG_DEBUG ("In SetupPhy, mode = " << mode.GetUniqueName () << " disallowed");
173  }
174  }
175  }
176  }
177  }
178  }
179 }
180 
181 double
183 {
184  NS_LOG_FUNCTION (this << txVector.GetMode ().GetUniqueName ());
185  for (Thresholds::const_iterator i = m_thresholds.begin (); i != m_thresholds.end (); i++)
186  {
187  NS_LOG_DEBUG ("Checking " << i->second.GetMode ().GetUniqueName () <<
188  " nss " << +i->second.GetNss () <<
189  " GI " << i->second.GetGuardInterval () <<
190  " width " << i->second.GetChannelWidth ());
191  NS_LOG_DEBUG ("against TxVector " << txVector.GetMode ().GetUniqueName () <<
192  " nss " << +txVector.GetNss () <<
193  " GI " << txVector.GetGuardInterval () <<
194  " width " << txVector.GetChannelWidth ());
195  if (txVector.GetMode () == i->second.GetMode ()
196  && txVector.GetNss () == i->second.GetNss ()
197  && txVector.GetChannelWidth () == i->second.GetChannelWidth ())
198  {
199  return i->first;
200  }
201  }
202  NS_ASSERT (false);
203  return 0.0;
204 }
205 
206 void
208 {
209  NS_LOG_FUNCTION (this << txVector.GetMode ().GetUniqueName () << snr);
210  m_thresholds.push_back (std::make_pair (snr, txVector));
211 }
212 
215 {
216  NS_LOG_FUNCTION (this);
218  station->m_lastSnrObserved = 0.0;
220  station->m_lastMode = GetDefaultMode ();
221  station->m_nss = 1;
222  return station;
223 }
224 
225 
226 void
228 {
229  NS_LOG_FUNCTION (this << station << rxSnr << txMode);
230 }
231 
232 void
234 {
235  NS_LOG_FUNCTION (this << station);
236 }
237 
238 void
240 {
241  NS_LOG_FUNCTION (this << station);
242 }
243 
244 void
246  double ctsSnr, WifiMode ctsMode, double rtsSnr)
247 {
248  NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode.GetUniqueName () << rtsSnr);
250  station->m_lastSnrObserved = rtsSnr;
251 }
252 
253 void
255  double ackSnr, WifiMode ackMode, double dataSnr)
256 {
257  NS_LOG_FUNCTION (this << st << ackSnr << ackMode.GetUniqueName () << dataSnr);
259  if (dataSnr == 0)
260  {
261  NS_LOG_WARN ("DataSnr reported to be zero; not saving this report.");
262  return;
263  }
264  station->m_lastSnrObserved = dataSnr;
265 }
266 
267 void
268 IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
269 {
270  NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
272  if (dataSnr == 0)
273  {
274  NS_LOG_WARN ("DataSnr reported to be zero; not saving this report.");
275  return;
276  }
277  station->m_lastSnrObserved = dataSnr;
278 }
279 
280 
281 void
283 {
284  NS_LOG_FUNCTION (this << station);
285 }
286 
287 void
289 {
290  NS_LOG_FUNCTION (this << station);
291 }
292 
295 {
296  NS_LOG_FUNCTION (this << st);
298  //We search within the Supported rate set the mode with the
299  //highest data rate for which the snr threshold is smaller than m_lastSnr
300  //to ensure correct packet delivery.
301  WifiMode maxMode = GetDefaultMode ();
302  WifiTxVector txVector;
303  WifiMode mode;
304  uint64_t bestRate = 0;
305  uint8_t selectedNss = 1;
306  uint16_t guardInterval;
307  uint16_t channelWidth = std::min (GetChannelWidth (station), GetPhy ()->GetChannelWidth ());
308  txVector.SetChannelWidth (channelWidth);
309  if (station->m_lastSnrCached != CACHE_INITIAL_VALUE && station->m_lastSnrObserved == station->m_lastSnrCached)
310  {
311  // SNR has not changed, so skip the search and use the last
312  // mode selected
313  maxMode = station->m_lastMode;
314  selectedNss = station->m_nss;
315  NS_LOG_DEBUG ("Using cached mode = " << maxMode.GetUniqueName () <<
316  " last snr observed " << station->m_lastSnrObserved <<
317  " cached " << station->m_lastSnrCached <<
318  " nss " << +selectedNss);
319  }
320  else
321  {
322  if (GetHtSupported () && GetHtSupported (st))
323  {
324  for (uint8_t i = 0; i < GetNMcsSupported (station); i++)
325  {
326  mode = GetMcsSupported (station, i);
327  txVector.SetMode (mode);
328  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
329  {
330  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
331  txVector.SetGuardInterval (guardInterval);
332  // If the node and peer are both VHT capable, only search VHT modes
333  if (GetVhtSupported () && GetVhtSupported (station))
334  {
335  continue;
336  }
337  // If the node and peer are both HE capable, only search HE modes
338  if (GetHeSupported () && GetHeSupported (station))
339  {
340  continue;
341  }
342  // Derive NSS from the MCS index. There is a different mode for each possible NSS value.
343  uint8_t nss = (mode.GetMcsValue () / 8) + 1;
344  txVector.SetNss (nss);
345  if (!txVector.IsValid ()
347  {
348  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
349  " nss " << +nss <<
350  " width " << txVector.GetChannelWidth ());
351  continue;
352  }
353  double threshold = GetSnrThreshold (txVector);
354  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
355  NS_LOG_DEBUG ("Testing mode " << mode.GetUniqueName () <<
356  " data rate " << dataRate <<
357  " threshold " << threshold << " last snr observed " <<
358  station->m_lastSnrObserved << " cached " <<
359  station->m_lastSnrCached);
360  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
361  {
362  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
363  " data rate " << dataRate <<
364  " threshold " << threshold <<
365  " last snr observed " <<
366  station->m_lastSnrObserved);
367  bestRate = dataRate;
368  maxMode = mode;
369  selectedNss = nss;
370  }
371  }
372  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
373  {
374  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
375  txVector.SetGuardInterval (guardInterval);
376  // If the node and peer are both HE capable, only search HE modes
377  if (GetHeSupported () && GetHeSupported (station))
378  {
379  continue;
380  }
381  // If the node and peer are not both VHT capable, only search HT modes
382  if (!GetVhtSupported () || !GetVhtSupported (station))
383  {
384  continue;
385  }
386  for (uint8_t nss = 1; nss <= std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (station)); nss++)
387  {
388  txVector.SetNss (nss);
389  if (!txVector.IsValid ())
390  {
391  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
392  " nss " << +nss <<
393  " width " << txVector.GetChannelWidth ());
394  continue;
395  }
396  double threshold = GetSnrThreshold (txVector);
397  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
398  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
399  " data rate " << dataRate <<
400  " threshold " << threshold << " last snr observed " <<
401  station->m_lastSnrObserved << " cached " <<
402  station->m_lastSnrCached);
403  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
404  {
405  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
406  " data rate " << dataRate <<
407  " threshold " << threshold <<
408  " last snr observed " <<
409  station->m_lastSnrObserved);
410  bestRate = dataRate;
411  maxMode = mode;
412  selectedNss = nss;
413  }
414  }
415  }
416  else //HE
417  {
418  guardInterval = std::max (GetGuardInterval (station), GetGuardInterval ());
419  txVector.SetGuardInterval (guardInterval);
420  // If the node and peer are not both HE capable, only search (V)HT modes
421  if (!GetHeSupported () || !GetHeSupported (station))
422  {
423  continue;
424  }
425  for (uint8_t nss = 1; nss <= std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (station)); nss++)
426  {
427  txVector.SetNss (nss);
428  if (!txVector.IsValid ())
429  {
430  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
431  " nss " << +nss <<
432  " width " << +txVector.GetChannelWidth ());
433  continue;
434  }
435  double threshold = GetSnrThreshold (txVector);
436  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
437  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
438  " data rate " << dataRate <<
439  " threshold " << threshold << " last snr observed " <<
440  station->m_lastSnrObserved << " cached " <<
441  station->m_lastSnrCached);
442  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
443  {
444  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
445  " data rate " << dataRate <<
446  " threshold " << threshold <<
447  " last snr observed " <<
448  station->m_lastSnrObserved);
449  bestRate = dataRate;
450  maxMode = mode;
451  selectedNss = nss;
452  }
453  }
454  }
455  }
456  }
457  else
458  {
459  // Non-HT selection
460  selectedNss = 1;
461  for (uint8_t i = 0; i < GetNSupported (station); i++)
462  {
463  mode = GetSupported (station, i);
464  txVector.SetMode (mode);
465  txVector.SetNss (selectedNss);
467  double threshold = GetSnrThreshold (txVector);
468  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), txVector.GetNss ());
469  NS_LOG_DEBUG ("mode = " << mode.GetUniqueName () <<
470  " threshold " << threshold <<
471  " last snr observed " <<
472  station->m_lastSnrObserved);
473  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
474  {
475  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
476  " data rate " << dataRate <<
477  " threshold " << threshold <<
478  " last snr observed " <<
479  station->m_lastSnrObserved);
480  bestRate = dataRate;
481  maxMode = mode;
482  }
483  }
484  }
485  NS_LOG_DEBUG ("Updating cached values for station to " << maxMode.GetUniqueName () << " snr " << station->m_lastSnrObserved);
486  station->m_lastSnrCached = station->m_lastSnrObserved;
487  station->m_lastMode = maxMode;
488  station->m_nss = selectedNss;
489  }
490  NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << channelWidth);
491  if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
492  {
493  guardInterval = std::max (GetGuardInterval (station), GetGuardInterval ());
494  }
495  else if ((maxMode.GetModulationClass () == WIFI_MOD_CLASS_HT) || (maxMode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
496  {
497  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
498  }
499  else
500  {
501  guardInterval = 800;
502  }
503  if (m_currentRate != maxMode.GetDataRate (channelWidth, guardInterval, selectedNss))
504  {
505  NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, guardInterval, selectedNss));
506  m_currentRate = maxMode.GetDataRate (channelWidth, guardInterval, selectedNss);
507  }
508  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), guardInterval, GetNumberOfAntennas (), selectedNss, 0, GetChannelWidthForTransmission (maxMode, channelWidth), GetAggregation (station), false);
509 }
510 
513 {
514  NS_LOG_FUNCTION (this << st);
516  //We search within the Basic rate set the mode with the highest
517  //snr threshold possible which is smaller than m_lastSnr to
518  //ensure correct packet delivery.
519  double maxThreshold = 0.0;
520  WifiTxVector txVector;
521  WifiMode mode;
522  uint8_t nss = 1;
523  WifiMode maxMode = GetDefaultMode ();
524  //RTS is sent in a non-HT frame
525  for (uint8_t i = 0; i < GetNBasicModes (); i++)
526  {
527  mode = GetBasicMode (i);
528  txVector.SetMode (mode);
529  txVector.SetNss (nss);
531  double threshold = GetSnrThreshold (txVector);
532  if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
533  {
534  maxThreshold = threshold;
535  maxMode = mode;
536  }
537  }
539 }
540 
541 bool
543 {
544  return true;
545 }
546 
547 } //namespace ns3
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
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
To avoid using the cache before a valid value has been cached.
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:4090
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
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:42
bool IsAllowed(uint16_t channelWidth, uint8_t nss) const
Definition: wifi-mode.cc:85
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
#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:204
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.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
uint16_t GetGuardInterval(void) const
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
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield)
Return the preamble to be used for the transmission.
Definition: wifi-utils.cc:128
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
void DoInitialize(void)
Initialize() implementation.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
phy
Definition: third.py:93
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1357
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:4084
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PLCP preambles.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t GetChannelWidthForNonHtMode(WifiMode mode) const
Convenience function for selecting a channel width for non-HT mode.
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
#define max(a, b)
Definition: 80211b.c:43
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)
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
WifiMode GetMode(void) const
HT PHY (Clause 20)
Definition: wifi-mode.h:58
Thresholds m_thresholds
List of WifiTxVector and the minimum SNR pair.
double m_lastSnrObserved
SNR of most recently reported packet sent to the remote station.
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.
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:494
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:457
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
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.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY&#39;s default ...
Definition: wifi-utils.cc:109
bool UseGreenfieldForDestination(Mac48Address dest) const
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
WifiRemoteStation * DoCreateStation(void) const
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
double m_lastSnrCached
SNR most recently used to select a rate.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4072
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)
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4078
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:264
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:272
uint8_t m_nss
Number of spatial streams.
bool IsLowLatency(void) const
Ideal rate control algorithmThis class implements an &#39;ideal&#39; rate control algorithm similar to RBAR i...
WifiMode m_lastMode
Mode most recently used to the remote station.
uint16_t GetChannelWidth(void) const
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
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 GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
double GetSnrThreshold(WifiTxVector txVector) const
Return the minimum SNR needed to successfully transmit data with this WifiTxVector at the specified B...
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:472
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1390
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:915
HE PHY (Clause 26)
Definition: wifi-mode.h:62
hold per-remote-station state.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:150
DSSS PHY (Clause 15)
Definition: wifi-mode.h:46
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
void AddSnrThreshold(WifiTxVector txVector, double snr)
Adds a pair of WifiTxVector and the minimum SNR for that given vector to the list.
uint8_t GetNss(void) const
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.