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 and Vht MCSes
121  if (HasVhtSupported () == true || HasHtSupported () == true || HasHeSupported () == true)
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 = GetPhy ()->GetShortGuardInterval () ? 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 = GetPhy ()->GetShortGuardInterval () ? 400 : 800;
151  }
152  else
153  {
154  guardInterval = static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ());
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  NS_LOG_DEBUG ("In SetupPhy, adding mode = " << mode.GetUniqueName ());
164  txVector.SetNss (k);
165  txVector.SetMode (mode);
166  AddSnrThreshold (txVector, GetPhy ()->CalculateSnr (txVector, m_ber));
167  }
168  }
169  }
170  }
171  }
172 }
173 
174 double
176 {
177  NS_LOG_FUNCTION (this << txVector.GetMode ().GetUniqueName ());
178  for (Thresholds::const_iterator i = m_thresholds.begin (); i != m_thresholds.end (); i++)
179  {
180  NS_LOG_DEBUG ("Checking " << i->second.GetMode ().GetUniqueName () <<
181  " nss " << +i->second.GetNss () <<
182  " GI " << i->second.GetGuardInterval () <<
183  " width " << i->second.GetChannelWidth ());
184  NS_LOG_DEBUG ("against TxVector " << txVector.GetMode ().GetUniqueName () <<
185  " nss " << +txVector.GetNss () <<
186  " GI " << txVector.GetGuardInterval () <<
187  " width " << txVector.GetChannelWidth ());
188  if (txVector.GetMode () == i->second.GetMode ()
189  && txVector.GetNss () == i->second.GetNss ()
190  && txVector.GetChannelWidth () == i->second.GetChannelWidth ())
191  {
192  return i->first;
193  }
194  }
195  NS_ASSERT (false);
196  return 0.0;
197 }
198 
199 void
201 {
202  NS_LOG_FUNCTION (this << txVector.GetMode ().GetUniqueName () << snr);
203  m_thresholds.push_back (std::make_pair (snr, txVector));
204 }
205 
208 {
209  NS_LOG_FUNCTION (this);
211  station->m_lastSnrObserved = 0.0;
213  station->m_lastMode = GetDefaultMode ();
214  station->m_nss = 1;
215  return station;
216 }
217 
218 
219 void
221 {
222  NS_LOG_FUNCTION (this << station << rxSnr << txMode);
223 }
224 
225 void
227 {
228  NS_LOG_FUNCTION (this << station);
229 }
230 
231 void
233 {
234  NS_LOG_FUNCTION (this << station);
235 }
236 
237 void
239  double ctsSnr, WifiMode ctsMode, double rtsSnr)
240 {
241  NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode.GetUniqueName () << rtsSnr);
243  station->m_lastSnrObserved = rtsSnr;
244 }
245 
246 void
248  double ackSnr, WifiMode ackMode, double dataSnr)
249 {
250  NS_LOG_FUNCTION (this << st << ackSnr << ackMode.GetUniqueName () << dataSnr);
252  if (dataSnr == 0)
253  {
254  NS_LOG_WARN ("DataSnr reported to be zero; not saving this report.");
255  return;
256  }
257  station->m_lastSnrObserved = dataSnr;
258 }
259 
260 void
261 IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
262 {
263  NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
265  if (dataSnr == 0)
266  {
267  NS_LOG_WARN ("DataSnr reported to be zero; not saving this report.");
268  return;
269  }
270  station->m_lastSnrObserved = dataSnr;
271 }
272 
273 
274 void
276 {
277  NS_LOG_FUNCTION (this << station);
278 }
279 
280 void
282 {
283  NS_LOG_FUNCTION (this << station);
284 }
285 
288 {
289  NS_LOG_FUNCTION (this << st);
291  //We search within the Supported rate set the mode with the
292  //highest data rate for which the snr threshold is smaller than m_lastSnr
293  //to ensure correct packet delivery.
294  WifiMode maxMode = GetDefaultMode ();
295  WifiTxVector txVector;
296  WifiMode mode;
297  uint64_t bestRate = 0;
298  uint8_t selectedNss = 1;
299  uint16_t guardInterval;
300  uint16_t channelWidth = std::min (GetChannelWidth (station), GetPhy ()->GetChannelWidth ());
301  txVector.SetChannelWidth (channelWidth);
302  if (station->m_lastSnrCached != CACHE_INITIAL_VALUE && station->m_lastSnrObserved == station->m_lastSnrCached)
303  {
304  // SNR has not changed, so skip the search and use the last
305  // mode selected
306  maxMode = station->m_lastMode;
307  selectedNss = station->m_nss;
308  NS_LOG_DEBUG ("Using cached mode = " << maxMode.GetUniqueName () <<
309  " last snr observed " << station->m_lastSnrObserved <<
310  " cached " << station->m_lastSnrCached <<
311  " nss " << +selectedNss);
312  }
313  else
314  {
315  if ((HasVhtSupported () == true || HasHtSupported () == true || HasHeSupported () == true)
316  && (GetHtSupported (st) == true || GetVhtSupported (st) == true || GetHeSupported (st) == true))
317  {
318  for (uint8_t i = 0; i < GetNMcsSupported (station); i++)
319  {
320  mode = GetMcsSupported (station, i);
321  txVector.SetMode (mode);
322  if (mode.GetModulationClass () == WIFI_MOD_CLASS_HT)
323  {
324  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800));
325  txVector.SetGuardInterval (guardInterval);
326  // If the node and peer are both VHT capable, only search VHT modes
327  if (HasVhtSupported () && GetVhtSupported (station))
328  {
329  continue;
330  }
331  // If the node and peer are both HE capable, only search HE modes
332  if (HasHeSupported () && GetHeSupported (station))
333  {
334  continue;
335  }
336  // Derive NSS from the MCS index. There is a different mode for each possible NSS value.
337  uint8_t nss = (mode.GetMcsValue () / 8) + 1;
338  txVector.SetNss (nss);
339  if (!txVector.IsValid ()
341  {
342  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
343  " nss " << +nss <<
344  " width " << txVector.GetChannelWidth ());
345  continue;
346  }
347  double threshold = GetSnrThreshold (txVector);
348  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
349  NS_LOG_DEBUG ("Testing mode " << mode.GetUniqueName () <<
350  " data rate " << dataRate <<
351  " threshold " << threshold << " last snr observed " <<
352  station->m_lastSnrObserved << " cached " <<
353  station->m_lastSnrCached);
354  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
355  {
356  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
357  " data rate " << dataRate <<
358  " threshold " << threshold <<
359  " last snr observed " <<
360  station->m_lastSnrObserved);
361  bestRate = dataRate;
362  maxMode = mode;
363  selectedNss = nss;
364  }
365  }
366  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)
367  {
368  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800));
369  txVector.SetGuardInterval (guardInterval);
370  // If the node and peer are both HE capable, only search HE modes
371  if (HasHeSupported () && GetHeSupported (station))
372  {
373  continue;
374  }
375  // If the node and peer are not both VHT capable, only search HT modes
376  if (!HasVhtSupported () || !GetVhtSupported (station))
377  {
378  continue;
379  }
380  for (uint8_t nss = 1; nss <= std::min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (station)); nss++)
381  {
382  txVector.SetNss (nss);
383  if (!txVector.IsValid ())
384  {
385  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
386  " nss " << +nss <<
387  " width " << txVector.GetChannelWidth ());
388  continue;
389  }
390  double threshold = GetSnrThreshold (txVector);
391  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
392  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
393  " data rate " << dataRate <<
394  " threshold " << threshold << " last snr observed " <<
395  station->m_lastSnrObserved << " cached " <<
396  station->m_lastSnrCached);
397  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
398  {
399  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
400  " data rate " << dataRate <<
401  " threshold " << threshold <<
402  " last snr observed " <<
403  station->m_lastSnrObserved);
404  bestRate = dataRate;
405  maxMode = mode;
406  selectedNss = nss;
407  }
408  }
409  }
410  else //HE
411  {
412  guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));
413  txVector.SetGuardInterval (guardInterval);
414  // If the node and peer are not both HE capable, only search (V)HT modes
415  if (!HasHeSupported () || !GetHeSupported (station))
416  {
417  continue;
418  }
419  for (uint8_t nss = 1; nss <= GetNumberOfSupportedStreams (station); nss++)
420  {
421  txVector.SetNss (nss);
422  if (!txVector.IsValid ())
423  {
424  NS_LOG_DEBUG ("Skipping mode " << mode.GetUniqueName () <<
425  " nss " << +nss <<
426  " width " << +txVector.GetChannelWidth ());
427  continue;
428  }
429  double threshold = GetSnrThreshold (txVector);
430  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), nss);
431  NS_LOG_DEBUG ("Testing mode = " << mode.GetUniqueName () <<
432  " data rate " << dataRate <<
433  " threshold " << threshold << " last snr observed " <<
434  station->m_lastSnrObserved << " cached " <<
435  station->m_lastSnrCached);
436  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
437  {
438  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
439  " data rate " << dataRate <<
440  " threshold " << threshold <<
441  " last snr observed " <<
442  station->m_lastSnrObserved);
443  bestRate = dataRate;
444  maxMode = mode;
445  selectedNss = nss;
446  }
447  }
448  }
449  }
450  }
451  else
452  {
453  // Non-HT selection
454  selectedNss = 1;
455  for (uint8_t i = 0; i < GetNSupported (station); i++)
456  {
457  mode = GetSupported (station, i);
458  txVector.SetMode (mode);
459  txVector.SetNss (selectedNss);
460  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
461  double threshold = GetSnrThreshold (txVector);
462  uint64_t dataRate = mode.GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), txVector.GetNss ());
463  NS_LOG_DEBUG ("mode = " << mode.GetUniqueName () <<
464  " threshold " << threshold <<
465  " last snr observed " <<
466  station->m_lastSnrObserved);
467  if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
468  {
469  NS_LOG_DEBUG ("Candidate mode = " << mode.GetUniqueName () <<
470  " data rate " << dataRate <<
471  " threshold " << threshold <<
472  " last snr observed " <<
473  station->m_lastSnrObserved);
474  bestRate = dataRate;
475  maxMode = mode;
476  }
477  }
478  }
479  NS_LOG_DEBUG ("Updating cached values for station to " << maxMode.GetUniqueName () << " snr " << station->m_lastSnrObserved);
480  station->m_lastSnrCached = station->m_lastSnrObserved;
481  station->m_lastMode = maxMode;
482  station->m_nss = selectedNss;
483  }
484  NS_LOG_DEBUG ("Found maxMode: " << maxMode << " channelWidth: " << channelWidth);
485  if (maxMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
486  {
487  guardInterval = std::max (GetGuardInterval (station), static_cast<uint16_t> (GetPhy ()->GetGuardInterval ().GetNanoSeconds ()));
488  }
489  else
490  {
491  guardInterval = static_cast<uint16_t> (std::max (GetShortGuardInterval (station) ? 400 : 800, GetPhy ()->GetShortGuardInterval () ? 400 : 800));
492  }
493  if (m_currentRate != maxMode.GetDataRate (channelWidth, guardInterval, selectedNss))
494  {
495  NS_LOG_DEBUG ("New datarate: " << maxMode.GetDataRate (channelWidth, guardInterval, selectedNss));
496  m_currentRate = maxMode.GetDataRate (channelWidth, guardInterval, selectedNss);
497  }
498  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode, GetAddress (station)), guardInterval, GetNumberOfAntennas (), selectedNss, 0, GetChannelWidthForTransmission (maxMode, channelWidth), GetAggregation (station), false);
499 }
500 
503 {
504  NS_LOG_FUNCTION (this << st);
506  //We search within the Basic rate set the mode with the highest
507  //snr threshold possible which is smaller than m_lastSnr to
508  //ensure correct packet delivery.
509  double maxThreshold = 0.0;
510  WifiTxVector txVector;
511  WifiMode mode;
512  uint8_t nss = 1;
513  WifiMode maxMode = GetDefaultMode ();
514  //avoid to use legacy rate adaptation algorithms for IEEE 802.11n/ac/ax
515  //RTS is sent in a legacy frame; RTS with HT/VHT/HE is not yet supported
516  for (uint8_t i = 0; i < GetNBasicModes (); i++)
517  {
518  mode = GetBasicMode (i);
519  txVector.SetMode (mode);
520  txVector.SetNss (nss);
521  txVector.SetChannelWidth (GetChannelWidthForMode (mode));
522  double threshold = GetSnrThreshold (txVector);
523  if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
524  {
525  maxThreshold = threshold;
526  maxMode = mode;
527  }
528  }
529  return WifiTxVector (maxMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (maxMode, GetAddress (station)), 800, GetNumberOfAntennas (), nss, 0, GetChannelWidthForMode (maxMode), GetAggregation (station), false);
530 }
531 
532 bool
534 {
535  return true;
536 }
537 
538 } //namespace ns3
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
uint16_t GetGuardInterval(void) const
bool GetShortGuardInterval(Mac48Address address) const
Return whether the station supports HT/VHT short guard interval.
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 "...
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:156
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.
#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
uint16_t GetChannelWidth(void) const
#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:202
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:609
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:3507
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.
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.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
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.
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
#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)
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1255
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
uint16_t GetChannelWidthForMode(WifiMode mode) const
Convenience function for selecting a channel width for legacy mode.
bool GetHeSupported(const WifiRemoteStation *station) const
Return whether the given station is HE capable.
Time GetGuardInterval(void) const
Definition: wifi-phy.cc:623
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3501
HT PHY (Clause 20)
Definition: wifi-mode.h:58
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:478
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:463
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.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the 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.
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:3513
TracedValue< uint64_t > m_currentRate
Trace rate changes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
double m_lastSnrCached
SNR most recently used to select a rate.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1288
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
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:367
bool HasHeSupported(void) const
Return whether the device has HE capability support enabled.
uint8_t GetNss(void) const
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:262
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:270
uint8_t m_nss
Number of spacial streams.
Ideal rate control algorithmThis class implements an &#39;ideal&#39; rate control algorithm similar to RBAR i...
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
WifiMode m_lastMode
Mode most recently used to the remote station.
bool GetHtSupported(Mac48Address address) const
Return whether the station supports HT or not.
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:500
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
static 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 ...
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
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
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.
DSSS PHY (Clause 15)
Definition: wifi-mode.h:46
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3495
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.
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.