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);
114  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
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 HT, VHT and HE MCSes
121  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
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 () || GetVhtSupported () || GetHeSupported ())
323  && (GetHtSupported (st) || GetVhtSupported (st) || GetHeSupported (st)))
324  {
325  for (uint8_t i = 0; i < GetNMcsSupported (station); i++)
326  {
327  mode = GetMcsSupported (station, i);
328  txVector.SetMode (mode);
329  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
330  {
331  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
332  txVector.SetGuardInterval (guardInterval);
333  // If the node and peer are both VHT capable, only search VHT modes
334  if (GetVhtSupported () && GetVhtSupported (station))
335  {
336  continue;
337  }
338  // If the node and peer are both HE capable, only search HE modes
339  if (GetHeSupported () && GetHeSupported (station))
340  {
341  continue;
342  }
343  // Derive NSS from the MCS index. There is a different mode for each possible NSS value.
344  uint8_t nss = (mode.GetMcsValue () / 8) + 1;
345  txVector.SetNss (nss);
346  if (!txVector.IsValid ()
348  {
349  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
350  " nss " << +nss <<
351  " width " << txVector.GetChannelWidth ());
352  continue;
353  }
354  double threshold = GetSnrThreshold (txVector);
355  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
356  NS_LOG_DEBUG ("Testing mode " << mode.GetUniqueName () <<
357  " data rate " << dataRate <<
358  " threshold " << threshold << " last snr observed " <<
359  station->m_lastSnrObserved << " cached " <<
360  station->m_lastSnrCached);
361  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
362  {
363  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
364  " data rate " << dataRate <<
365  " threshold " << threshold <<
366  " last snr observed " <<
367  station->m_lastSnrObserved);
368  bestRate = dataRate;
369  maxMode = mode;
370  selectedNss = nss;
371  }
372  }
373  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
374  {
375  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
376  txVector.SetGuardInterval (guardInterval);
377  // If the node and peer are both HE capable, only search HE modes
378  if (GetHeSupported () && GetHeSupported (station))
379  {
380  continue;
381  }
382  // If the node and peer are not both VHT capable, only search HT modes
383  if (!GetVhtSupported () || !GetVhtSupported (station))
384  {
385  continue;
386  }
387  for (uint8_t nss = 1; nss <= std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (station)); nss++)
388  {
389  txVector.SetNss (nss);
390  if (!txVector.IsValid ())
391  {
392  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
393  " nss " << +nss <<
394  " width " << txVector.GetChannelWidth ());
395  continue;
396  }
397  double threshold = GetSnrThreshold (txVector);
398  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
399  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
400  " data rate " << dataRate <<
401  " threshold " << threshold << " last snr observed " <<
402  station->m_lastSnrObserved << " cached " <<
403  station->m_lastSnrCached);
404  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
405  {
406  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
407  " data rate " << dataRate <<
408  " threshold " << threshold <<
409  " last snr observed " <<
410  station->m_lastSnrObserved);
411  bestRate = dataRate;
412  maxMode = mode;
413  selectedNss = nss;
414  }
415  }
416  }
417  else //HE
418  {
419  guardInterval = std::max (GetGuardInterval (station), GetGuardInterval ());
420  txVector.SetGuardInterval (guardInterval);
421  // If the node and peer are not both HE capable, only search (V)HT modes
422  if (!GetHeSupported () || !GetHeSupported (station))
423  {
424  continue;
425  }
426  for (uint8_t nss = 1; nss <= std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (station)); nss++)
427  {
428  txVector.SetNss (nss);
429  if (!txVector.IsValid ())
430  {
431  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
432  " nss " << +nss <<
433  " width " << +txVector.GetChannelWidth ());
434  continue;
435  }
436  double threshold = GetSnrThreshold (txVector);
437  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
438  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
439  " data rate " << dataRate <<
440  " threshold " << threshold << " last snr observed " <<
441  station->m_lastSnrObserved << " cached " <<
442  station->m_lastSnrCached);
443  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
444  {
445  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
446  " data rate " << dataRate <<
447  " threshold " << threshold <<
448  " last snr observed " <<
449  station->m_lastSnrObserved);
450  bestRate = dataRate;
451  maxMode = mode;
452  selectedNss = nss;
453  }
454  }
455  }
456  }
457  }
458  else
459  {
460  // Non-HT selection
461  selectedNss = 1;
462  for (uint8_t i = 0; i < GetNSupported (station); i++)
463  {
464  mode = GetSupported (station, i);
465  txVector.SetMode (mode);
466  txVector.SetNss (selectedNss);
467  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
468  double threshold = GetSnrThreshold (txVector);
469  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), txVector.GetNss ());
470  NS_LOG_DEBUG ("mode = " << mode.GetUniqueName () <<
471  " threshold " << threshold <<
472  " last snr observed " <<
473  station->m_lastSnrObserved);
474  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
475  {
476  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
477  " data rate " << dataRate <<
478  " threshold " << threshold <<
479  " last snr observed " <<
480  station->m_lastSnrObserved);
481  bestRate = dataRate;
482  maxMode = mode;
483  }
484  }
485  }
486  NS_LOG_DEBUG ("Updating cached values for station to " << maxMode.GetUniqueName () << " snr " << station->m_lastSnrObserved);
487  station->m_lastSnrCached = station->m_lastSnrObserved;
488  station->m_lastMode = maxMode;
489  station->m_nss = selectedNss;
490  }
491  NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << channelWidth);
492  if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
493  {
494  guardInterval = std::max (GetGuardInterval (station), GetGuardInterval ());
495  }
496  else if ((maxMode.GetModulationClass () == WIFI_MOD_CLASS_HT) || (maxMode.GetModulationClass () == WIFI_MOD_CLASS_VHT))
497  {
498  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardIntervalSupported (station) ? 400 : 800, GetShortGuardIntervalSupported () ? 400 : 800));
499  }
500  else
501  {
502  guardInterval = 800;
503  }
504  if (m_currentRate != maxMode.GetDataRate (channelWidth, guardInterval, selectedNss))
505  {
506  NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, guardInterval, selectedNss));
507  m_currentRate = maxMode.GetDataRate (channelWidth, guardInterval, selectedNss);
508  }
509  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (GetAddress (station))), guardInterval, GetNumberOfAntennas (), selectedNss, 0, GetChannelWidthForTransmission (maxMode, channelWidth), GetAggregation (station), false);
510 }
511 
514 {
515  NS_LOG_FUNCTION (this << st);
517  //We search within the Basic rate set the mode with the highest
518  //snr threshold possible which is smaller than m_lastSnr to
519  //ensure correct packet delivery.
520  double maxThreshold = 0.0;
521  WifiTxVector txVector;
522  WifiMode mode;
523  uint8_t nss = 1;
524  WifiMode maxMode = GetDefaultMode ();
525  //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac/ax
526  //RTS is sent in a legacy frame; RTS with HT/VHT/HE is not yet supported
527  for (uint8_t i = 0; i < GetNBasicModes (); i++)
528  {
529  mode = GetBasicMode (i);
530  txVector.SetMode (mode);
531  txVector.SetNss (nss);
532  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
533  double threshold = GetSnrThreshold (txVector);
534  if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
535  {
536  maxThreshold = threshold;
537  maxMode = mode;
538  }
539  }
541 }
542 
543 bool
545 {
546  return true;
547 }
548 
549 } //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:86
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.
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.
uint16_t GetChannelWidthForMode(WifiMode mode) const
Convenience function for selecting a channel width for legacy mode.
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.