A Discrete-Event Network Simulator
API
ap-wifi-mac.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
23 #include "ns3/log.h"
24 #include "ns3/packet.h"
25 #include "ns3/simulator.h"
26 #include "ns3/pointer.h"
27 #include "ns3/string.h"
28 #include "ns3/random-variable-stream.h"
29 #include "ap-wifi-mac.h"
30 #include "channel-access-manager.h"
31 #include "mac-tx-middle.h"
32 #include "mac-rx-middle.h"
33 #include "mgt-headers.h"
34 #include "msdu-aggregator.h"
35 #include "amsdu-subframe-header.h"
36 #include "wifi-phy.h"
37 #include "wifi-net-device.h"
38 #include "ns3/ht-configuration.h"
39 #include "ns3/he-configuration.h"
40 
41 namespace ns3 {
42 
43 NS_LOG_COMPONENT_DEFINE ("ApWifiMac");
44 
45 NS_OBJECT_ENSURE_REGISTERED (ApWifiMac);
46 
47 TypeId
49 {
50  static TypeId tid = TypeId ("ns3::ApWifiMac")
52  .SetGroupName ("Wifi")
53  .AddConstructor<ApWifiMac> ()
54  .AddAttribute ("BeaconInterval",
55  "Delay between two beacons",
56  TimeValue (MicroSeconds (102400)),
59  MakeTimeChecker ())
60  .AddAttribute ("BeaconJitter",
61  "A uniform random variable to cause the initial beacon starting time (after simulation time 0) "
62  "to be distributed between 0 and the BeaconInterval.",
63  StringValue ("ns3::UniformRandomVariable"),
65  MakePointerChecker<UniformRandomVariable> ())
66  .AddAttribute ("EnableBeaconJitter",
67  "If beacons are enabled, whether to jitter the initial send event.",
68  BooleanValue (true),
71  .AddAttribute ("BeaconGeneration",
72  "Whether or not beacons are generated.",
73  BooleanValue (true),
76  .AddAttribute ("EnableNonErpProtection", "Whether or not protection mechanism should be used when non-ERP STAs are present within the BSS."
77  "This parameter is only used when ERP is supported by the AP.",
78  BooleanValue (true),
81  .AddAttribute ("BsrLifetime",
82  "Lifetime of Buffer Status Reports received from stations.",
83  TimeValue (MilliSeconds (20)),
85  MakeTimeChecker ())
86  .AddTraceSource ("AssociatedSta",
87  "A station associated with this access point.",
89  "ns3::ApWifiMac::AssociationCallback")
90  .AddTraceSource ("DeAssociatedSta",
91  "A station lost association with this access point.",
93  "ns3::ApWifiMac::AssociationCallback")
94  ;
95  return tid;
96 }
97 
99  : m_enableBeaconGeneration (false),
100  m_numNonErpStations (0),
101  m_numNonHtStations (0),
102  m_shortSlotTimeEnabled (false),
103  m_shortPreambleEnabled (false)
104 {
105  NS_LOG_FUNCTION (this);
106  m_beaconTxop = CreateObject<Txop> ();
107  m_beaconTxop->SetWifiMac (this);
108  m_beaconTxop->SetAifsn (1);
109  m_beaconTxop->SetMinCw (0);
110  m_beaconTxop->SetMaxCw (0);
113 
114  //Let the lower layers know that we are acting as an AP.
116 }
117 
119 {
120  NS_LOG_FUNCTION (this);
121  m_staList.clear ();
122 }
123 
124 void
126 {
127  NS_LOG_FUNCTION (this);
128  m_beaconTxop->Dispose ();
129  m_beaconTxop = 0;
130  m_enableBeaconGeneration = false;
133 }
134 
135 void
137 {
138  NS_LOG_FUNCTION (this << address);
139  //As an AP, our MAC address is also the BSSID. Hence we are
140  //overriding this function and setting both in our parent class.
143 }
144 
145 void
147 {
148  NS_LOG_FUNCTION (this << enable);
149  if (!enable)
150  {
152  }
153  else if (enable && !m_enableBeaconGeneration)
154  {
156  }
157  m_enableBeaconGeneration = enable;
158 }
159 
160 Time
162 {
163  NS_LOG_FUNCTION (this);
164  return m_beaconInterval;
165 }
166 
167 void
169 {
170  NS_LOG_FUNCTION (this << &linkUp);
172 
173  //The approach taken here is that, from the point of view of an AP,
174  //the link is always up, so we immediately invoke the callback if
175  //one is set
176  linkUp ();
177 }
178 
179 void
181 {
182  NS_LOG_FUNCTION (this << interval);
183  if ((interval.GetMicroSeconds () % 1024) != 0)
184  {
185  NS_FATAL_ERROR ("beacon interval should be multiple of 1024us (802.11 time unit), see IEEE Std. 802.11-2012");
186  }
187  if (interval.GetMicroSeconds () > (1024 * 65535))
188  {
189  NS_FATAL_ERROR ("beacon interval should be smaller then or equal to 65535 * 1024us (802.11 time unit)");
190  }
191  m_beaconInterval = interval;
192 }
193 
194 int64_t
195 ApWifiMac::AssignStreams (int64_t stream)
196 {
197  NS_LOG_FUNCTION (this << stream);
198  m_beaconJitter->SetStream (stream);
199  return 1;
200 }
201 
202 void
204 {
205  NS_LOG_FUNCTION (this);
207  {
208  for (const auto& sta : m_staList)
209  {
210  if (!m_stationManager->GetShortSlotTimeSupported (sta.second))
211  {
212  m_shortSlotTimeEnabled = false;
213  return;
214  }
215  }
216  m_shortSlotTimeEnabled = true;
217  }
218  else
219  {
220  m_shortSlotTimeEnabled = false;
221  }
222 }
223 
224 void
226 {
227  NS_LOG_FUNCTION (this);
229  {
230  for (const auto& sta : m_staList)
231  {
232  if (!m_stationManager->GetErpOfdmSupported (sta.second) ||
234  {
235  m_shortPreambleEnabled = false;
236  return;
237  }
238  }
239  m_shortPreambleEnabled = true;
240  }
241  else
242  {
243  m_shortPreambleEnabled = false;
244  }
245 }
246 
247 uint16_t
249 {
250  uint16_t channelWidth = m_phy->GetChannelWidth ();
251  for (const auto& sta : m_staList)
252  {
253  if (m_stationManager->GetVhtSupported (sta.second))
254  {
255  if (m_stationManager->GetChannelWidthSupported (sta.second) < channelWidth)
256  {
257  channelWidth = m_stationManager->GetChannelWidthSupported (sta.second);
258  }
259  }
260  }
261  return channelWidth;
262 }
263 
264 void
266  Mac48Address to)
267 {
268  NS_LOG_FUNCTION (this << packet << from << to);
269  //If we are not a QoS AP then we definitely want to use AC_BE to
270  //transmit the packet. A TID of zero will map to AC_BE (through \c
271  //QosUtilsMapTidToAc()), so we use that as our default here.
272  uint8_t tid = 0;
273 
274  //If we are a QoS AP then we attempt to get a TID for this packet
275  if (GetQosSupported ())
276  {
277  tid = QosUtilsGetTidForPacket (packet);
278  //Any value greater than 7 is invalid and likely indicates that
279  //the packet had no QoS tag, so we revert to zero, which'll
280  //mean that AC_BE is used.
281  if (tid > 7)
282  {
283  tid = 0;
284  }
285  }
286 
287  ForwardDown (packet, from, to, tid);
288 }
289 
290 void
292  Mac48Address to, uint8_t tid)
293 {
294  NS_LOG_FUNCTION (this << packet << from << to << +tid);
295  WifiMacHeader hdr;
296 
297  //For now, an AP that supports QoS does not support non-QoS
298  //associations, and vice versa. In future the AP model should
299  //support simultaneously associated QoS and non-QoS STAs, at which
300  //point there will need to be per-association QoS state maintained
301  //by the association state machine, and consulted here.
302  if (GetQosSupported ())
303  {
306  hdr.SetQosNoEosp ();
307  hdr.SetQosNoAmsdu ();
308  //Transmission of multiple frames in the same Polled TXOP is not supported for now
309  hdr.SetQosTxopLimit (0);
310  //Fill in the QoS control field in the MAC header
311  hdr.SetQosTid (tid);
312  }
313  else
314  {
315  hdr.SetType (WIFI_MAC_DATA);
316  }
317 
318  if (GetQosSupported ())
319  {
320  hdr.SetNoOrder (); // explicitly set to 0 for the time being since HT control field is not yet implemented (set it to 1 when implemented)
321  }
322  hdr.SetAddr1 (to);
323  hdr.SetAddr2 (GetAddress ());
324  hdr.SetAddr3 (from);
325  hdr.SetDsFrom ();
326  hdr.SetDsNotTo ();
327 
328  if (GetQosSupported ())
329  {
330  //Sanity check that the TID is valid
331  NS_ASSERT (tid < 8);
332  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
333  }
334  else
335  {
336  m_txop->Queue (packet, hdr);
337  }
338 }
339 
340 void
342 {
343  NS_LOG_FUNCTION (this << packet << to << from);
344  if (to.IsGroup () || m_stationManager->IsAssociated (to))
345  {
346  ForwardDown (packet, from, to);
347  }
348  else
349  {
350  NotifyTxDrop (packet);
351  }
352 }
353 
354 void
356 {
357  NS_LOG_FUNCTION (this << packet << to);
358  //We're sending this packet with a from address that is our own. We
359  //get that address from the lower MAC and make use of the
360  //from-spoofing Enqueue() method to avoid duplicated code.
361  Enqueue (packet, to, GetAddress ());
362 }
363 
364 bool
366 {
367  NS_LOG_FUNCTION (this);
368  return true;
369 }
370 
373 {
374  NS_LOG_FUNCTION (this);
375  SupportedRates rates;
376  //Send the set of supported rates and make sure that we indicate
377  //the Basic Rate set in this set of supported rates.
378  for (const auto & mode : m_phy->GetModeList ())
379  {
380  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
381  NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
382  rates.AddSupportedRate (modeDataRate);
383  //Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
384  //here we choose to add the mandatory rates to the BSSBasicRateSet,
385  //except for 802.11b where we assume that only the non HR-DSSS rates are part of the BSSBasicRateSet
386  if (mode.IsMandatory () && (mode.GetModulationClass () != WIFI_MOD_CLASS_HR_DSSS))
387  {
388  NS_LOG_DEBUG ("Adding basic mode " << mode.GetUniqueName ());
390  }
391  }
392  //set the basic rates
393  for (uint8_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
394  {
396  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
397  NS_LOG_DEBUG ("Setting basic rate " << mode.GetUniqueName ());
398  rates.SetBasicRate (modeDataRate);
399  }
400  //If it is a HT AP, then add the BSSMembershipSelectorSet
401  //The standard says that the BSSMembershipSelectorSet
402  //must have its MSB set to 1 (must be treated as a Basic Rate)
403  //Also the standard mentioned that at least 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
404  if (GetHtSupported ())
405  {
406  for (const auto & selector : m_phy->GetBssMembershipSelectorList ())
407  {
408  rates.AddBssMembershipSelectorRate (selector);
409  }
410  }
411  return rates;
412 }
413 
416 {
417  NS_LOG_FUNCTION (this);
418  DsssParameterSet dsssParameters;
419  if (GetDsssSupported ())
420  {
421  dsssParameters.SetDsssSupported (1);
422  dsssParameters.SetCurrentChannel (m_phy->GetChannelNumber ());
423  }
424  return dsssParameters;
425 }
426 
429 {
430  NS_LOG_FUNCTION (this);
431  CapabilityInformation capabilities;
434  capabilities.SetEss ();
435  return capabilities;
436 }
437 
440 {
441  NS_LOG_FUNCTION (this);
442  ErpInformation information;
443  information.SetErpSupported (1);
444  if (GetErpSupported ())
445  {
446  information.SetNonErpPresent (m_numNonErpStations > 0);
447  information.SetUseProtection (GetUseNonErpProtection ());
449  {
450  information.SetBarkerPreambleMode (0);
451  }
452  else
453  {
454  information.SetBarkerPreambleMode (1);
455  }
456  }
457  return information;
458 }
459 
462 {
463  NS_LOG_FUNCTION (this);
464  EdcaParameterSet edcaParameters;
465  if (GetQosSupported ())
466  {
467  edcaParameters.SetQosSupported (1);
468  Ptr<QosTxop> edca;
469  Time txopLimit;
470 
471  edca = m_edca.find (AC_BE)->second;
472  txopLimit = edca->GetTxopLimit ();
473  edcaParameters.SetBeAci (0);
474  edcaParameters.SetBeCWmin (edca->GetMinCw ());
475  edcaParameters.SetBeCWmax (edca->GetMaxCw ());
476  edcaParameters.SetBeAifsn (edca->GetAifsn ());
477  edcaParameters.SetBeTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
478 
479  edca = m_edca.find (AC_BK)->second;
480  txopLimit = edca->GetTxopLimit ();
481  edcaParameters.SetBkAci (1);
482  edcaParameters.SetBkCWmin (edca->GetMinCw ());
483  edcaParameters.SetBkCWmax (edca->GetMaxCw ());
484  edcaParameters.SetBkAifsn (edca->GetAifsn ());
485  edcaParameters.SetBkTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
486 
487  edca = m_edca.find (AC_VI)->second;
488  txopLimit = edca->GetTxopLimit ();
489  edcaParameters.SetViAci (2);
490  edcaParameters.SetViCWmin (edca->GetMinCw ());
491  edcaParameters.SetViCWmax (edca->GetMaxCw ());
492  edcaParameters.SetViAifsn (edca->GetAifsn ());
493  edcaParameters.SetViTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
494 
495  edca = m_edca.find (AC_VO)->second;
496  txopLimit = edca->GetTxopLimit ();
497  edcaParameters.SetVoAci (3);
498  edcaParameters.SetVoCWmin (edca->GetMinCw ());
499  edcaParameters.SetVoCWmax (edca->GetMaxCw ());
500  edcaParameters.SetVoAifsn (edca->GetAifsn ());
501  edcaParameters.SetVoTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
502 
503  edcaParameters.SetQosInfo (0);
504  }
505  return edcaParameters;
506 }
507 
510 {
511  NS_LOG_FUNCTION (this);
512  MuEdcaParameterSet muEdcaParameters;
513  if (GetHeSupported ())
514  {
515  Ptr<HeConfiguration> heConfiguration = GetHeConfiguration ();
516  NS_ASSERT (heConfiguration != 0);
517 
518  muEdcaParameters.SetQosInfo (0);
519 
520  UintegerValue uintegerValue;
521  TimeValue timeValue;
522 
523  heConfiguration->GetAttribute ("MuBeAifsn", uintegerValue);
524  muEdcaParameters.SetMuAifsn (AC_BE, uintegerValue.Get ());
525  heConfiguration->GetAttribute ("MuBeCwMin", uintegerValue);
526  muEdcaParameters.SetMuCwMin (AC_BE, uintegerValue.Get ());
527  heConfiguration->GetAttribute ("MuBeCwMax", uintegerValue);
528  muEdcaParameters.SetMuCwMax (AC_BE, uintegerValue.Get ());
529  heConfiguration->GetAttribute ("BeMuEdcaTimer", timeValue);
530  muEdcaParameters.SetMuEdcaTimer (AC_BE, timeValue.Get ());
531 
532  heConfiguration->GetAttribute ("MuBkAifsn", uintegerValue);
533  muEdcaParameters.SetMuAifsn (AC_BK, uintegerValue.Get ());
534  heConfiguration->GetAttribute ("MuBkCwMin", uintegerValue);
535  muEdcaParameters.SetMuCwMin (AC_BK, uintegerValue.Get ());
536  heConfiguration->GetAttribute ("MuBkCwMax", uintegerValue);
537  muEdcaParameters.SetMuCwMax (AC_BK, uintegerValue.Get ());
538  heConfiguration->GetAttribute ("BkMuEdcaTimer", timeValue);
539  muEdcaParameters.SetMuEdcaTimer (AC_BK, timeValue.Get ());
540 
541  heConfiguration->GetAttribute ("MuViAifsn", uintegerValue);
542  muEdcaParameters.SetMuAifsn (AC_VI, uintegerValue.Get ());
543  heConfiguration->GetAttribute ("MuViCwMin", uintegerValue);
544  muEdcaParameters.SetMuCwMin (AC_VI, uintegerValue.Get ());
545  heConfiguration->GetAttribute ("MuViCwMax", uintegerValue);
546  muEdcaParameters.SetMuCwMax (AC_VI, uintegerValue.Get ());
547  heConfiguration->GetAttribute ("ViMuEdcaTimer", timeValue);
548  muEdcaParameters.SetMuEdcaTimer (AC_VI, timeValue.Get ());
549 
550  heConfiguration->GetAttribute ("MuVoAifsn", uintegerValue);
551  muEdcaParameters.SetMuAifsn (AC_VO, uintegerValue.Get ());
552  heConfiguration->GetAttribute ("MuVoCwMin", uintegerValue);
553  muEdcaParameters.SetMuCwMin (AC_VO, uintegerValue.Get ());
554  heConfiguration->GetAttribute ("MuVoCwMax", uintegerValue);
555  muEdcaParameters.SetMuCwMax (AC_VO, uintegerValue.Get ());
556  heConfiguration->GetAttribute ("VoMuEdcaTimer", timeValue);
557  muEdcaParameters.SetMuEdcaTimer (AC_VO, timeValue.Get ());
558  }
559  return muEdcaParameters;
560 }
561 
564 {
565  NS_LOG_FUNCTION (this);
566  HtOperation operation;
567  if (GetHtSupported ())
568  {
569  operation.SetHtSupported (1);
570  operation.SetPrimaryChannel (m_phy->GetChannelNumber ());
571  operation.SetRifsMode (false);
572  operation.SetNonGfHtStasPresent (true);
573  if (m_phy->GetChannelWidth () > 20)
574  {
575  operation.SetSecondaryChannelOffset (1);
576  operation.SetStaChannelWidth (1);
577  }
578  if (m_numNonHtStations == 0)
579  {
580  operation.SetHtProtection (NO_PROTECTION);
581  }
582  else
583  {
585  }
586  uint64_t maxSupportedRate = 0; //in bit/s
587  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HT))
588  {
589  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
590  NS_ASSERT (nss > 0 && nss < 5);
591  uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), GetHtConfiguration ()->GetShortGuardIntervalSupported () ? 400 : 800, nss);
592  if (dataRate > maxSupportedRate)
593  {
594  maxSupportedRate = dataRate;
595  NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
596  }
597  }
598  uint8_t maxSpatialStream = m_phy->GetMaxSupportedTxSpatialStreams ();
599  auto mcsList = m_phy->GetMcsList (WIFI_MOD_CLASS_HT);
600  uint8_t nMcs = mcsList.size ();
601  for (const auto& sta : m_staList)
602  {
603  if (m_stationManager->GetHtSupported (sta.second))
604  {
605  uint64_t maxSupportedRateByHtSta = 0; //in bit/s
606  auto itMcs = mcsList.begin ();
607  for (uint8_t j = 0; j < (std::min (nMcs, m_stationManager->GetNMcsSupported (sta.second))); j++)
608  {
609  WifiMode mcs = *itMcs++;
610  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
611  NS_ASSERT (nss > 0 && nss < 5);
612  uint64_t dataRate = mcs.GetDataRate (m_stationManager->GetChannelWidthSupported (sta.second),
613  m_stationManager->GetShortGuardIntervalSupported (sta.second) ? 400 : 800, nss);
614  if (dataRate > maxSupportedRateByHtSta)
615  {
616  maxSupportedRateByHtSta = dataRate;
617  }
618  }
619  if (maxSupportedRateByHtSta < maxSupportedRate)
620  {
621  maxSupportedRate = maxSupportedRateByHtSta;
622  }
623  if (m_stationManager->GetNMcsSupported (sta.second) < nMcs)
624  {
625  nMcs = m_stationManager->GetNMcsSupported (sta.second);
626  }
627  if (m_stationManager->GetNumberOfSupportedStreams (sta.second) < maxSpatialStream)
628  {
629  maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (sta.second);
630  }
631  }
632  }
633  operation.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
634  operation.SetTxMcsSetDefined (nMcs > 0);
635  operation.SetTxMaxNSpatialStreams (maxSpatialStream);
636  //To be filled in once supported
637  operation.SetObssNonHtStasPresent (0);
638  operation.SetDualBeacon (0);
639  operation.SetDualCtsProtection (0);
640  operation.SetStbcBeacon (0);
641  operation.SetLSigTxopProtectionFullSupport (0);
642  operation.SetPcoActive (0);
643  operation.SetPhase (0);
644  operation.SetRxMcsBitmask (0);
645  operation.SetTxRxMcsSetUnequal (0);
646  operation.SetTxUnequalModulation (0);
647  }
648  return operation;
649 }
650 
653 {
654  NS_LOG_FUNCTION (this);
655  VhtOperation operation;
656  if (GetVhtSupported ())
657  {
658  operation.SetVhtSupported (1);
659  uint16_t channelWidth = GetVhtOperationalChannelWidth ();
660  if (channelWidth == 160)
661  {
662  operation.SetChannelWidth (2);
663  }
664  else if (channelWidth == 80)
665  {
666  operation.SetChannelWidth (1);
667  }
668  else
669  {
670  operation.SetChannelWidth (0);
671  }
672  uint8_t maxSpatialStream = m_phy->GetMaxSupportedRxSpatialStreams ();
673  for (const auto& sta : m_staList)
674  {
675  if (m_stationManager->GetVhtSupported (sta.second))
676  {
677  if (m_stationManager->GetNumberOfSupportedStreams (sta.second) < maxSpatialStream)
678  {
679  maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (sta.second);
680  }
681  }
682  }
683  for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
684  {
685  uint8_t maxMcs = 9; //TBD: hardcode to 9 for now since we assume all MCS values are supported
686  operation.SetMaxVhtMcsPerNss (nss, maxMcs);
687  }
688  }
689  return operation;
690 }
691 
694 {
695  NS_LOG_FUNCTION (this);
696  HeOperation operation;
697  if (GetHeSupported ())
698  {
699  operation.SetHeSupported (1);
700  uint8_t maxSpatialStream = m_phy->GetMaxSupportedRxSpatialStreams ();
701  for (const auto& sta : m_staList)
702  {
703  if (m_stationManager->GetHeSupported (sta.second))
704  {
705  if (m_stationManager->GetNumberOfSupportedStreams (sta.second) < maxSpatialStream)
706  {
707  maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (sta.second);
708  }
709  }
710  }
711  for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
712  {
713  operation.SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
714  }
715  operation.SetBssColor (GetHeConfiguration ()->GetBssColor ());
716  }
717  return operation;
718 }
719 
720 void
722 {
723  NS_LOG_FUNCTION (this << to);
724  WifiMacHeader hdr;
726  hdr.SetAddr1 (to);
727  hdr.SetAddr2 (GetAddress ());
728  hdr.SetAddr3 (GetAddress ());
729  hdr.SetDsNotFrom ();
730  hdr.SetDsNotTo ();
731  Ptr<Packet> packet = Create<Packet> ();
733  probe.SetSsid (GetSsid ());
735  probe.SetBeaconIntervalUs (GetBeaconInterval ().GetMicroSeconds ());
736  probe.SetCapabilities (GetCapabilities ());
739  if (GetDsssSupported ())
740  {
742  }
743  if (GetErpSupported ())
744  {
746  }
747  if (GetQosSupported ())
748  {
750  }
751  if (GetHtSupported ())
752  {
755  probe.SetHtOperation (GetHtOperation ());
756  }
757  if (GetVhtSupported ())
758  {
760  probe.SetVhtOperation (GetVhtOperation ());
761  }
762  if (GetHeSupported ())
763  {
765  probe.SetHeOperation (GetHeOperation ());
767  }
768  packet->AddHeader (probe);
769 
770  //The standard is not clear on the correct queue for management
771  //frames if we are a QoS AP. The approach taken here is to always
772  //use the DCF for these regardless of whether we have a QoS
773  //association or not.
774  m_txop->Queue (packet, hdr);
775 }
776 
777 void
778 ApWifiMac::SendAssocResp (Mac48Address to, bool success, bool isReassoc)
779 {
780  NS_LOG_FUNCTION (this << to << success << isReassoc);
781  WifiMacHeader hdr;
783  hdr.SetAddr1 (to);
784  hdr.SetAddr2 (GetAddress ());
785  hdr.SetAddr3 (GetAddress ());
786  hdr.SetDsNotFrom ();
787  hdr.SetDsNotTo ();
788  Ptr<Packet> packet = Create<Packet> ();
790  StatusCode code;
791  if (success)
792  {
793  code.SetSuccess ();
794  uint16_t aid = 0;
795  bool found = false;
796  if (isReassoc)
797  {
798  for (const auto& sta : m_staList)
799  {
800  if (sta.second == to)
801  {
802  aid = sta.first;
803  found = true;
804  break;
805  }
806  }
807  }
808  if (!found)
809  {
810  aid = GetNextAssociationId ();
811  m_staList.insert (std::make_pair (aid, to));
812  m_assocLogger (aid, to);
815  {
817  }
818  if (!m_stationManager->GetHtSupported (to))
819  {
821  }
824  }
825  assoc.SetAssociationId (aid);
826  }
827  else
828  {
829  code.SetFailure ();
830  }
832  assoc.SetStatusCode (code);
833  assoc.SetCapabilities (GetCapabilities ());
834  if (GetErpSupported ())
835  {
837  }
838  if (GetQosSupported ())
839  {
841  }
842  if (GetHtSupported ())
843  {
846  assoc.SetHtOperation (GetHtOperation ());
847  }
848  if (GetVhtSupported ())
849  {
851  assoc.SetVhtOperation (GetVhtOperation ());
852  }
853  if (GetHeSupported ())
854  {
856  assoc.SetHeOperation (GetHeOperation ());
858  }
859  packet->AddHeader (assoc);
860 
861  //The standard is not clear on the correct queue for management
862  //frames if we are a QoS AP. The approach taken here is to always
863  //use the DCF for these regardless of whether we have a QoS
864  //association or not.
865  m_txop->Queue (packet, hdr);
866 }
867 
868 void
870 {
871  NS_LOG_FUNCTION (this);
872  WifiMacHeader hdr;
875  hdr.SetAddr2 (GetAddress ());
876  hdr.SetAddr3 (GetAddress ());
877  hdr.SetDsNotFrom ();
878  hdr.SetDsNotTo ();
879  Ptr<Packet> packet = Create<Packet> ();
880  MgtBeaconHeader beacon;
881  beacon.SetSsid (GetSsid ());
883  beacon.SetBeaconIntervalUs (GetBeaconInterval ().GetMicroSeconds ());
884  beacon.SetCapabilities (GetCapabilities ());
887  if (GetDsssSupported ())
888  {
890  }
891  if (GetErpSupported ())
892  {
894  }
895  if (GetQosSupported ())
896  {
898  }
899  if (GetHtSupported ())
900  {
903  beacon.SetHtOperation (GetHtOperation ());
904  }
905  if (GetVhtSupported ())
906  {
908  beacon.SetVhtOperation (GetVhtOperation ());
909  }
910  if (GetHeSupported ())
911  {
913  beacon.SetHeOperation (GetHeOperation ());
915  }
916  packet->AddHeader (beacon);
917 
918  //The beacon has it's own special queue, so we load it in there
919  m_beaconTxop->Queue (packet, hdr);
921 
922  //If a STA that does not support Short Slot Time associates,
923  //the AP shall use long slot time beginning at the first Beacon
924  //subsequent to the association of the long slot time STA.
925  if (GetErpSupported ())
926  {
928  {
929  //Enable short slot time
930  m_phy->SetSlot (MicroSeconds (9));
931  }
932  else
933  {
934  //Disable short slot time
935  m_phy->SetSlot (MicroSeconds (20));
936  }
937  }
938 }
939 
940 void
942 {
943  NS_LOG_FUNCTION (this << *mpdu);
944  const WifiMacHeader& hdr = mpdu->GetHeader ();
945  if ((hdr.IsAssocResp () || hdr.IsReassocResp ())
947  {
948  NS_LOG_DEBUG ("associated with sta=" << hdr.GetAddr1 ());
950  }
951 }
952 
953 void
954 ApWifiMac::TxFailed (uint8_t timeoutReason, Ptr<const WifiMacQueueItem> mpdu, const WifiTxVector& txVector)
955 {
956  NS_LOG_FUNCTION (this << +timeoutReason << *mpdu << txVector);
957  const WifiMacHeader& hdr = mpdu->GetHeader ();
958 
959  if ((hdr.IsAssocResp () || hdr.IsReassocResp ())
961  {
962  NS_LOG_DEBUG ("association failed with sta=" << hdr.GetAddr1 ());
964  }
965 }
966 
967 void
969 {
970  NS_LOG_FUNCTION (this << *mpdu);
971  const WifiMacHeader* hdr = &mpdu->GetHeader ();
972  Ptr<const Packet> packet = mpdu->GetPacket ();
973  Mac48Address from = hdr->GetAddr2 ();
974  if (hdr->IsData ())
975  {
976  Mac48Address bssid = hdr->GetAddr1 ();
977  if (!hdr->IsFromDs ()
978  && hdr->IsToDs ()
979  && bssid == GetAddress ()
980  && m_stationManager->IsAssociated (from))
981  {
982  Mac48Address to = hdr->GetAddr3 ();
983  if (to == GetAddress ())
984  {
985  NS_LOG_DEBUG ("frame for me from=" << from);
986  if (hdr->IsQosData ())
987  {
988  if (hdr->IsQosAmsdu ())
989  {
990  NS_LOG_DEBUG ("Received A-MSDU from=" << from << ", size=" << packet->GetSize ());
992  packet = 0;
993  }
994  else
995  {
996  ForwardUp (packet, from, bssid);
997  }
998  }
999  else if (hdr->HasData ())
1000  {
1001  ForwardUp (packet, from, bssid);
1002  }
1003  }
1004  else if (to.IsGroup ()
1005  || m_stationManager->IsAssociated (to))
1006  {
1007  NS_LOG_DEBUG ("forwarding frame from=" << from << ", to=" << to);
1008  Ptr<Packet> copy = packet->Copy ();
1009 
1010  //If the frame we are forwarding is of type QoS Data,
1011  //then we need to preserve the UP in the QoS control
1012  //header...
1013  if (hdr->IsQosData ())
1014  {
1015  ForwardDown (copy, from, to, hdr->GetQosTid ());
1016  }
1017  else
1018  {
1019  ForwardDown (copy, from, to);
1020  }
1021  ForwardUp (packet, from, to);
1022  }
1023  else
1024  {
1025  ForwardUp (packet, from, to);
1026  }
1027  }
1028  else if (hdr->IsFromDs ()
1029  && hdr->IsToDs ())
1030  {
1031  //this is an AP-to-AP frame
1032  //we ignore for now.
1033  NotifyRxDrop (packet);
1034  }
1035  else
1036  {
1037  //we can ignore these frames since
1038  //they are not targeted at the AP
1039  NotifyRxDrop (packet);
1040  }
1041  return;
1042  }
1043  else if (hdr->IsMgt ())
1044  {
1045  if (hdr->IsProbeReq ())
1046  {
1047  NS_ASSERT (hdr->GetAddr1 ().IsBroadcast ());
1048  MgtProbeRequestHeader probeRequestHeader;
1049  packet->PeekHeader (probeRequestHeader);
1050  Ssid ssid = probeRequestHeader.GetSsid ();
1051  if (ssid == GetSsid () || ssid.IsBroadcast ())
1052  {
1053  NS_LOG_DEBUG ("Probe request received from " << from << ": send probe response");
1054  SendProbeResp (from);
1055  }
1056  return;
1057  }
1058  else if (hdr->GetAddr1 () == GetAddress ())
1059  {
1060  if (hdr->IsAssocReq ())
1061  {
1062  NS_LOG_DEBUG ("Association request received from " << from);
1063  //first, verify that the the station's supported
1064  //rate set is compatible with our Basic Rate set
1065  MgtAssocRequestHeader assocReq;
1066  packet->PeekHeader (assocReq);
1067  CapabilityInformation capabilities = assocReq.GetCapabilities ();
1068  m_stationManager->AddSupportedPhyPreamble (from, capabilities.IsShortPreamble ());
1069  SupportedRates rates = assocReq.GetSupportedRates ();
1070  bool problem = false;
1071  if (rates.GetNRates () == 0)
1072  {
1073  problem = true;
1074  }
1075  if (GetHtSupported ())
1076  {
1077  //check whether the HT STA supports all MCSs in Basic MCS Set
1078  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
1079  if (htcapabilities.IsSupportedMcs (0))
1080  {
1081  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1082  {
1084  if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1085  {
1086  problem = true;
1087  break;
1088  }
1089  }
1090  }
1091  }
1092  if (GetVhtSupported ())
1093  {
1094  //check whether the VHT STA supports all MCSs in Basic MCS Set
1095  VhtCapabilities vhtcapabilities = assocReq.GetVhtCapabilities ();
1096  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
1097  {
1098  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1099  {
1101  if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1102  {
1103  problem = true;
1104  break;
1105  }
1106  }
1107  }
1108  }
1109  if (GetHeSupported ())
1110  {
1111  //check whether the HE STA supports all MCSs in Basic MCS Set
1112  HeCapabilities hecapabilities = assocReq.GetHeCapabilities ();
1113  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1114  {
1115  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1116  {
1118  if (!hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1119  {
1120  problem = true;
1121  break;
1122  }
1123  }
1124  }
1125  }
1126  if (problem)
1127  {
1128  NS_LOG_DEBUG ("One of the Basic Rate set mode is not supported by the station: send association response with an error status");
1129  SendAssocResp (hdr->GetAddr2 (), false, false);
1130  }
1131  else
1132  {
1133  NS_LOG_DEBUG ("The Basic Rate set modes are supported by the station");
1134  //record all its supported modes in its associated WifiRemoteStation
1135  for (const auto & mode : m_phy->GetModeList ())
1136  {
1137  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1138  {
1139  m_stationManager->AddSupportedMode (from, mode);
1140  }
1141  }
1142  if (GetErpSupported () && m_stationManager->GetErpOfdmSupported (from) && capabilities.IsShortSlotTime ())
1143  {
1145  }
1146  if (GetHtSupported ())
1147  {
1148  HtCapabilities htCapabilities = assocReq.GetHtCapabilities ();
1149  if (htCapabilities.IsSupportedMcs (0))
1150  {
1151  m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1152  }
1153  }
1154  if (GetVhtSupported ())
1155  {
1156  VhtCapabilities vhtCapabilities = assocReq.GetVhtCapabilities ();
1157  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1158  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1159  {
1160  m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1161  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
1162  {
1163  if (vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1164  {
1165  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1166  //here should add a control to add basic MCS when it is implemented
1167  }
1168  }
1169  }
1170  }
1171  if (GetHtSupported ())
1172  {
1173  ExtendedCapabilities extendedCapabilities = assocReq.GetExtendedCapabilities ();
1174  //TODO: to be completed
1175  }
1176  if (GetHeSupported ())
1177  {
1178  HeCapabilities heCapabilities = assocReq.GetHeCapabilities ();
1179  if (heCapabilities.GetSupportedMcsAndNss () != 0)
1180  {
1181  m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1182  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
1183  {
1184  if (heCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1185  {
1186  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1187  //here should add a control to add basic MCS when it is implemented
1188  }
1189  }
1190  }
1191  }
1193  NS_LOG_DEBUG ("Send association response with success status");
1194  SendAssocResp (hdr->GetAddr2 (), true, false);
1195  }
1196  return;
1197  }
1198  else if (hdr->IsReassocReq ())
1199  {
1200  NS_LOG_DEBUG ("Reassociation request received from " << from);
1201  //first, verify that the the station's supported
1202  //rate set is compatible with our Basic Rate set
1203  MgtReassocRequestHeader reassocReq;
1204  packet->PeekHeader (reassocReq);
1205  CapabilityInformation capabilities = reassocReq.GetCapabilities ();
1206  m_stationManager->AddSupportedPhyPreamble (from, capabilities.IsShortPreamble ());
1207  SupportedRates rates = reassocReq.GetSupportedRates ();
1208  bool problem = false;
1209  if (rates.GetNRates () == 0)
1210  {
1211  problem = true;
1212  }
1213  if (GetHtSupported ())
1214  {
1215  //check whether the HT STA supports all MCSs in Basic MCS Set
1216  HtCapabilities htcapabilities = reassocReq.GetHtCapabilities ();
1217  if (htcapabilities.IsSupportedMcs (0))
1218  {
1219  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1220  {
1222  if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1223  {
1224  problem = true;
1225  break;
1226  }
1227  }
1228  }
1229  }
1230  if (GetVhtSupported ())
1231  {
1232  //check whether the VHT STA supports all MCSs in Basic MCS Set
1233  VhtCapabilities vhtcapabilities = reassocReq.GetVhtCapabilities ();
1234  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
1235  {
1236  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1237  {
1239  if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1240  {
1241  problem = true;
1242  break;
1243  }
1244  }
1245  }
1246  }
1247  if (GetHeSupported ())
1248  {
1249  //check whether the HE STA supports all MCSs in Basic MCS Set
1250  HeCapabilities hecapabilities = reassocReq.GetHeCapabilities ();
1251  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1252  {
1253  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1254  {
1256  if (!hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1257  {
1258  problem = true;
1259  break;
1260  }
1261  }
1262  }
1263  }
1264  if (problem)
1265  {
1266  NS_LOG_DEBUG ("One of the Basic Rate set mode is not supported by the station: send reassociation response with an error status");
1267  SendAssocResp (hdr->GetAddr2 (), false, true);
1268  }
1269  else
1270  {
1271  NS_LOG_DEBUG ("The Basic Rate set modes are supported by the station");
1272  //update all its supported modes in its associated WifiRemoteStation
1273  for (const auto & mode : m_phy->GetModeList ())
1274  {
1275  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1276  {
1277  m_stationManager->AddSupportedMode (from, mode);
1278  }
1279  }
1280  if (GetErpSupported () && m_stationManager->GetErpOfdmSupported (from) && capabilities.IsShortSlotTime ())
1281  {
1283  }
1284  if (GetHtSupported ())
1285  {
1286  HtCapabilities htCapabilities = reassocReq.GetHtCapabilities ();
1287  if (htCapabilities.IsSupportedMcs (0))
1288  {
1289  m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1290  }
1291  }
1292  if (GetVhtSupported ())
1293  {
1294  VhtCapabilities vhtCapabilities = reassocReq.GetVhtCapabilities ();
1295  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1296  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1297  {
1298  m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1299  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
1300  {
1301  if (vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1302  {
1303  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1304  //here should add a control to add basic MCS when it is implemented
1305  }
1306  }
1307  }
1308  }
1309  if (GetHtSupported ())
1310  {
1311  ExtendedCapabilities extendedCapabilities = reassocReq.GetExtendedCapabilities ();
1312  //TODO: to be completed
1313  }
1314  if (GetHeSupported ())
1315  {
1316  HeCapabilities heCapabilities = reassocReq.GetHeCapabilities ();
1317  if (heCapabilities.GetSupportedMcsAndNss () != 0)
1318  {
1319  m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1320  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
1321  {
1322  if (heCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1323  {
1324  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1325  //here should add a control to add basic MCS when it is implemented
1326  }
1327  }
1328  }
1329  }
1331  NS_LOG_DEBUG ("Send reassociation response with success status");
1332  SendAssocResp (hdr->GetAddr2 (), true, true);
1333  }
1334  return;
1335  }
1336  else if (hdr->IsDisassociation ())
1337  {
1338  NS_LOG_DEBUG ("Disassociation received from " << from);
1340  for (auto it = m_staList.begin (); it != m_staList.end (); ++it)
1341  {
1342  if (it->second == from)
1343  {
1344  m_staList.erase (it);
1345  m_deAssocLogger (it->first, it->second);
1347  {
1349  }
1350  if (!m_stationManager->GetHtSupported (from))
1351  {
1353  }
1356  break;
1357  }
1358  }
1359  return;
1360  }
1361  }
1362  }
1363 
1364  //Invoke the receive handler of our parent class to deal with any
1365  //other frames. Specifically, this will handle Block Ack-related
1366  //Management Action frames.
1367  RegularWifiMac::Receive (Create<WifiMacQueueItem> (packet, *hdr));
1368 }
1369 
1370 void
1372 {
1373  NS_LOG_FUNCTION (this << *mpdu);
1374  for (auto& i : *PeekPointer (mpdu))
1375  {
1376  if (i.second.GetDestinationAddr () == GetAddress ())
1377  {
1378  ForwardUp (i.first, i.second.GetSourceAddr (),
1379  i.second.GetDestinationAddr ());
1380  }
1381  else
1382  {
1383  Mac48Address from = i.second.GetSourceAddr ();
1384  Mac48Address to = i.second.GetDestinationAddr ();
1385  NS_LOG_DEBUG ("forwarding QoS frame from=" << from << ", to=" << to);
1386  ForwardDown (i.first->Copy (), from, to, mpdu->GetHeader ().GetQosTid ());
1387  }
1388  }
1389 }
1390 
1391 void
1393 {
1394  NS_LOG_FUNCTION (this);
1396  m_beaconEvent.Cancel ();
1398  {
1400  {
1401  Time jitter = MicroSeconds (static_cast<int64_t> (m_beaconJitter->GetValue (0, 1) * (GetBeaconInterval ().GetMicroSeconds ())));
1402  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time " << jitter);
1404  }
1405  else
1406  {
1407  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time 0");
1409  }
1410  }
1412  NS_ABORT_IF (!TraceConnectWithoutContext ("MpduResponseTimeout", MakeCallback (&ApWifiMac::TxFailed, this)));
1416 }
1417 
1418 bool
1420 {
1421  bool useProtection = (m_numNonErpStations > 0) && m_enableNonErpProtection;
1422  m_stationManager->SetUseNonErpProtection (useProtection);
1423  return useProtection;
1424 }
1425 
1426 uint16_t
1428 {
1429  //Return the first free AID value between 1 and 2007
1430  for (uint16_t nextAid = 1; nextAid <= 2007; nextAid++)
1431  {
1432  if (m_staList.find (nextAid) == m_staList.end ())
1433  {
1434  return nextAid;
1435  }
1436  }
1437  NS_FATAL_ERROR ("No free association ID available!");
1438  return 0;
1439 }
1440 
1441 const std::map<uint16_t, Mac48Address>&
1443 {
1444  return m_staList;
1445 }
1446 
1447 uint16_t
1449 {
1450  return m_stationManager->GetAssociationId (addr);
1451 }
1452 
1453 uint8_t
1455 {
1456  auto it = m_bufferStatus.find (WifiAddressTidPair (address, tid));
1457  if (it == m_bufferStatus.end ()
1458  || it->second.timestamp + m_bsrLifetime < Simulator::Now ())
1459  {
1460  return 255;
1461  }
1462  return it->second.value;
1463 }
1464 
1465 void
1467 {
1468  if (size == 255)
1469  {
1470  // no point in storing an unspecified size
1471  m_bufferStatus.erase (WifiAddressTidPair (address, tid));
1472  }
1473  else
1474  {
1476  }
1477 }
1478 
1479 uint8_t
1481 {
1482  uint8_t maxSize = 0;
1483  bool found = false;
1484 
1485  for (uint8_t tid = 0; tid < 8; tid++)
1486  {
1487  uint8_t size = GetBufferStatus (tid, address);
1488  if (size != 255)
1489  {
1490  maxSize = std::max (maxSize, size);
1491  found = true;
1492  }
1493  }
1494 
1495  if (found)
1496  {
1497  return maxSize;
1498  }
1499  return 255;
1500 }
1501 
1502 } //namespace ns3
ns3::ApWifiMac::m_beaconTxop
Ptr< Txop > m_beaconTxop
Dedicated Txop for beacons.
Definition: ap-wifi-mac.h:309
ns3::MgtProbeResponseHeader::SetErpInformation
void SetErpInformation(ErpInformation erpInformation)
Set the ERP information.
Definition: mgt-headers.cc:346
ns3::WifiRemoteStationManager::IsAssociated
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
Definition: wifi-remote-station-manager.cc:448
ns3::ApWifiMac::DoInitialize
void DoInitialize(void) override
Initialize() implementation.
Definition: ap-wifi-mac.cc:1392
ns3::MgtProbeResponseHeader::SetExtendedCapabilities
void SetExtendedCapabilities(ExtendedCapabilities extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:232
ns3::EdcaParameterSet::SetVoAci
void SetVoAci(uint8_t aci)
Set the AC_VO ACI field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:164
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::DsssParameterSet::SetCurrentChannel
void SetCurrentChannel(uint8_t currentChannel)
Set the Current Channel field in the DsssParameterSet information element.
Definition: dsss-parameter-set.cc:44
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::ApWifiMac::GetSupportedRates
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates.
Definition: ap-wifi-mac.cc:372
ns3::WifiMacHeader::SetQosNoEosp
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
Definition: wifi-mac-header.cc:362
mac-tx-middle.h
ns3::VhtCapabilities
The IEEE 802.11ac VHT Capabilities.
Definition: vht-capabilities.h:35
ns3::EdcaParameterSet::SetQosInfo
void SetQosInfo(uint8_t qosInfo)
Set the QoS Info field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:56
ns3::Object::Dispose
void Dispose(void)
Dispose of this Object.
Definition: object.cc:214
ns3::WifiRemoteStationManager::GetNBasicMcs
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
Definition: wifi-remote-station-manager.cc:1575
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#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
ns3::MgtAssocRequestHeader::GetSupportedRates
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:614
ns3::WifiMacQueueItem::GetPacket
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
Definition: wifi-mac-queue-item.cc:57
ns3::ApWifiMac::m_bufferStatus
std::unordered_map< WifiAddressTidPair, bsrType, WifiAddressTidHash > m_bufferStatus
Per (MAC address, TID) buffer status reports.
Definition: ap-wifi-mac.h:329
ns3::MakeTimeChecker
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition: boolean.h:37
ns3::Packet::PeekHeader
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:290
ns3::MgtProbeResponseHeader::SetDsssParameterSet
void SetDsssParameterSet(DsssParameterSet dsssParameterSet)
Set the DSSS Parameter Set.
Definition: mgt-headers.cc:334
ns3::WifiRemoteStationManager::AddStationHeCapabilities
void AddStationHeCapabilities(Mac48Address from, HeCapabilities heCapabilities)
Records HE capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1361
ap-wifi-mac.h
ns3::ApWifiMac::ApWifiMac
ApWifiMac()
Definition: ap-wifi-mac.cc:98
ns3::WifiMacHeader::IsToDs
bool IsToDs(void) const
Definition: wifi-mac-header.cc:552
ns3::RegularWifiMac::GetExtendedCapabilities
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities of the device.
Definition: regular-wifi-mac.cc:195
min
#define min(a, b)
Definition: 80211b.c:42
ns3::MuEdcaParameterSet::SetMuCwMax
void SetMuCwMax(uint8_t aci, uint16_t cwMax)
Set the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
Definition: mu-edca-parameter-set.cc:89
ns3::ApWifiMac::~ApWifiMac
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:118
ns3::WifiMac::NotifyTxDrop
void NotifyTxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:103
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::WifiMacHeader::IsData
bool IsData(void) const
Return true if the Type is DATA.
Definition: wifi-mac-header.cc:558
ns3::Packet::GetSize
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:852
ns3::CapabilityInformation::SetEss
void SetEss(void)
Set the Extended Service Set (ESS) bit in the capability information field.
Definition: capability-information.cc:31
ns3::Packet::AddHeader
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
ns3::Txop::SetMaxCw
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: txop.cc:168
ns3::Callback< void >
ns3::MgtReassocRequestHeader::GetCapabilities
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:741
ns3::RegularWifiMac::GetSsid
Ssid GetSsid(void) const override
Definition: regular-wifi-mac.cc:685
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3::ApWifiMac::DeaggregateAmsduAndForward
void DeaggregateAmsduAndForward(Ptr< WifiMacQueueItem > mpdu) override
This method is called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
Definition: ap-wifi-mac.cc:1371
ns3::ApWifiMac::GetHeOperation
HeOperation GetHeOperation(void) const
Return the HE operation of the current AP.
Definition: ap-wifi-mac.cc:693
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Txop::SetChannelAccessManager
void SetChannelAccessManager(const Ptr< ChannelAccessManager > manager)
Set ChannelAccessManager this Txop is associated to.
Definition: txop.cc:117
ns3::WifiRemoteStationManager::SetShortSlotTimeEnabled
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
Definition: wifi-remote-station-manager.cc:213
ns3::VhtOperation::SetChannelWidth
void SetChannelWidth(uint8_t channelWidth)
Set the Channel Width field in the VHT Operation information element.
Definition: vht-operation.cc:55
ns3::MgtProbeResponseHeader::SetVhtOperation
void SetVhtOperation(VhtOperation vhtOperation)
Set the VHT operation.
Definition: mgt-headers.cc:280
amsdu-subframe-header.h
ns3::WifiMacHeader::IsDisassociation
bool IsDisassociation(void) const
Return true if the header is a Disassociation header.
Definition: wifi-mac-header.cc:711
ns3::ApWifiMac::GetHtOperation
HtOperation GetHtOperation(void) const
Return the HT operation of the current AP.
Definition: ap-wifi-mac.cc:563
ns3::WifiRemoteStationManager::GetShortGuardIntervalSupported
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
Definition: wifi-remote-station-manager.cc:281
ns3::WIFI_MOD_CLASS_HT
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Definition: wifi-phy-common.h:125
ns3::HtOperation::SetPhase
void SetPhase(uint8_t pcoPhase)
Set the PCO phase.
Definition: ht-operation.cc:153
ns3::WIFI_MOD_CLASS_HE
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Definition: wifi-phy-common.h:127
ns3::VhtCapabilities::IsSupportedTxMcs
bool IsSupportedTxMcs(uint8_t mcs) const
Returns true if transmit MCS is supported.
Definition: vht-capabilities.cc:296
ns3::MgtProbeResponseHeader::SetCapabilities
void SetCapabilities(CapabilityInformation capabilities)
Set the Capability information.
Definition: mgt-headers.cc:220
ns3::RegularWifiMac::SetBssid
void SetBssid(Mac48Address bssid)
Definition: regular-wifi-mac.cc:691
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
ns3::WIFI_MAC_MGT_REASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_REASSOCIATION_RESPONSE
Definition: wifi-mac-header.h:53
ns3::HtOperation::SetStbcBeacon
void SetStbcBeacon(uint8_t stbcBeacon)
Set the STBC beacon.
Definition: ht-operation.cc:135
ns3::ApWifiMac::TxFailed
void TxFailed(uint8_t timeoutReason, Ptr< const WifiMacQueueItem > mpdu, const WifiTxVector &txVector)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:954
ns3::MgtAssocRequestHeader::GetCapabilities
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:554
ns3::RegularWifiMac::GetHeSupported
bool GetHeSupported() const
Return whether the device supports HE.
Definition: regular-wifi-mac.cc:618
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::WifiPhy::GetChannelNumber
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1199
ns3::HeCapabilities
The IEEE 802.11ax HE Capabilities.
Definition: he-capabilities.h:34
ns3::MgtAssocRequestHeader::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:578
ns3::EdcaParameterSet::SetBkAci
void SetBkAci(uint8_t aci)
Set the AC_BK ACI field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:100
ns3::WifiRemoteStationManager::RecordGotAssocTxFailed
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:482
ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_ASSOCIATION_RESPONSE
Definition: wifi-mac-header.h:50
ns3::DsssParameterSet
The DSSS Parameter Set.
Definition: dsss-parameter-set.h:35
ns3::WifiRemoteStationManager::GetNBasicModes
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
Definition: wifi-remote-station-manager.cc:1508
ns3::WifiRemoteStationManager::SetAssociationId
void SetAssociationId(Mac48Address remoteAddress, uint16_t aid)
Record the AID of a remote station.
Definition: wifi-remote-station-manager.cc:1285
ns3::ApWifiMac::GetStaList
const std::map< uint16_t, Mac48Address > & GetStaList(void) const
Get a const reference to the map of associated stations.
Definition: ap-wifi-mac.cc:1442
ns3::ApWifiMac::GetDsssParameterSet
DsssParameterSet GetDsssParameterSet(void) const
Return the DSSS Parameter Set that we support.
Definition: ap-wifi-mac.cc:415
ns3::NO_PROTECTION
@ NO_PROTECTION
Definition: ht-operation.h:37
ns3::WifiRemoteStationManager::GetHtSupported
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
Definition: wifi-remote-station-manager.cc:232
ns3::ApWifiMac::TxOk
void TxOk(Ptr< const WifiMacQueueItem > mpdu)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:941
ns3::HtOperation::SetTxMaxNSpatialStreams
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum number spatial streams.
Definition: ht-operation.cc:183
ns3::RegularWifiMac::GetErpSupported
bool GetErpSupported() const
Return whether the device supports ERP.
Definition: regular-wifi-mac.cc:628
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiMacHeader::GetAddr3
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
Definition: wifi-mac-header.cc:436
ns3::WifiRemoteStationManager::GetVhtSupported
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
Definition: wifi-remote-station-manager.cc:244
ns3::HtOperation::SetTxUnequalModulation
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
Definition: ht-operation.cc:189
ns3::HeOperation::SetBssColor
void SetBssColor(uint8_t bssColor)
Set the BSS color.
Definition: he-operation.cc:123
ns3::HtOperation::SetRxHighestSupportedDataRate
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
Definition: ht-operation.cc:165
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::HeCapabilities::IsSupportedTxMcs
bool IsSupportedTxMcs(uint8_t mcs) const
Is RX MCS supported.
Definition: he-capabilities.cc:369
wifi-phy.h
ns3::MgtReassocRequestHeader::GetExtendedCapabilities
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities.
Definition: mgt-headers.cc:753
ns3::EdcaParameterSet::SetViAci
void SetViAci(uint8_t aci)
Set the AC_VI ACI field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:132
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
ns3::WifiRemoteStationManager::GetChannelWidthSupported
uint16_t GetChannelWidthSupported(Mac48Address address) const
Return the channel width supported by the station.
Definition: wifi-remote-station-manager.cc:1794
ns3::WifiMacHeader::SetAddr3
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
Definition: wifi-mac-header.cc:120
ns3::EdcaParameterSet::SetBeCWmax
void SetBeCWmax(uint32_t cwMax)
Set the AC_BE CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:81
ns3::Simulator::Schedule
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:557
ns3::MgtAssocResponseHeader::SetHtCapabilities
void SetHtCapabilities(HtCapabilities htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:962
ns3::RegularWifiMac::SetLinkUpCallback
void SetLinkUpCallback(Callback< void > linkUp) override
Definition: regular-wifi-mac.cc:571
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: boolean.h:85
ns3::EdcaParameterSet::SetBkTxopLimit
void SetBkTxopLimit(uint16_t txop)
Set the AC_BK TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:120
ns3::RegularWifiMac
base class for all MAC-level wifi objects.
Definition: regular-wifi-mac.h:51
ns3::WifiMacQueueItem::GetHeader
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Definition: wifi-mac-queue-item.cc:63
ns3::WifiRemoteStationManager::GetShortPreambleSupported
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
Definition: wifi-remote-station-manager.cc:420
ns3::SupportedRates::SetBasicRate
void SetBasicRate(uint64_t bs)
Set the given rate to basic rates.
Definition: supported-rates.cc:74
ns3::StatusCode::SetFailure
void SetFailure(void)
Set success bit to 1 (failure).
Definition: status-code.cc:36
ns3::MgtAssocRequestHeader::GetExtendedCapabilities
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities.
Definition: mgt-headers.cc:566
ns3::Txop::GetTxopLimit
Time GetTxopLimit(void) const
Return the TXOP limit.
Definition: txop.cc:275
ns3::RegularWifiMac::GetQosSupported
bool GetQosSupported() const
Return whether the device supports QoS.
Definition: regular-wifi-mac.cc:592
ns3::EdcaParameterSet::SetBeAifsn
void SetBeAifsn(uint8_t aifsn)
Set the AC_BE AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:62
ns3::PeekPointer
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:415
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::ApWifiMac::SetBeaconInterval
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:180
ns3::AP
@ AP
Definition: wifi-mac.h:43
ns3::EdcaParameterSet::SetVoCWmin
void SetVoCWmin(uint32_t cwMin)
Set the AC_VO CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:170
ns3::Ssid
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
ns3::MakeTraceSourceAccessor
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Definition: trace-source-accessor.h:202
ns3::ApWifiMac::m_shortPreambleEnabled
bool m_shortPreambleEnabled
Flag whether short preamble is enabled in the BSS.
Definition: ap-wifi-mac.h:319
ns3::VhtOperation
The VHT Operation Information Element.
Definition: vht-operation.h:36
ns3::EdcaParameterSet::SetViTxopLimit
void SetViTxopLimit(uint16_t txop)
Set the AC_VI TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:152
ns3::CapabilityInformation::SetShortPreamble
void SetShortPreamble(bool shortPreamble)
Set the short preamble bit in the capability information field.
Definition: capability-information.cc:45
ns3::HtOperation::SetRifsMode
void SetRifsMode(uint8_t rifsMode)
Set the RIFS mode.
Definition: ht-operation.cc:99
ns3::ErpInformation::SetErpSupported
void SetErpSupported(uint8_t erpSupported)
Set the ERP supported field.
Definition: erp-information.cc:38
ns3::HtOperation::SetHtSupported
void SetHtSupported(uint8_t htSupported)
Set the HT Supported.
Definition: ht-operation.cc:67
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::Txop::SetMinCw
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: txop.cc:156
ns3::ApWifiMac::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: ap-wifi-mac.cc:48
ns3::MgtProbeRequestHeader
Implement the header for management frames of type probe request.
Definition: mgt-headers.h:529
ns3::EdcaParameterSet
The EDCA Parameter Set.
Definition: edca-parameter-set.h:35
ns3::RegularWifiMac::GetAddress
Mac48Address GetAddress(void) const override
Definition: regular-wifi-mac.cc:672
ns3::TimeValue::Get
Time Get(void) const
Definition: time.cc:530
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::ApWifiMac::m_enableBeaconGeneration
bool m_enableBeaconGeneration
Flag whether beacons are being generated.
Definition: ap-wifi-mac.h:310
ns3::WifiRemoteStationManager::AddSupportedMode
void AddSupportedMode(Mac48Address address, WifiMode mode)
Invoked in a STA or AP to store the set of modes supported by a destination which is also supported l...
Definition: wifi-remote-station-manager.cc:335
mgt-headers.h
ns3::WIFI_MOD_CLASS_HR_DSSS
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
Definition: wifi-phy-common.h:122
ns3::MgtAssocResponseHeader::SetVhtOperation
void SetVhtOperation(VhtOperation vhtOperation)
Set the VHT operation.
Definition: mgt-headers.cc:998
ns3::ApWifiMac::m_shortSlotTimeEnabled
bool m_shortSlotTimeEnabled
Flag whether short slot time is enabled within the BSS.
Definition: ap-wifi-mac.h:318
ns3::SupportedRates::IsSupportedRate
bool IsSupportedRate(uint64_t bs) const
Check if the given rate is supported.
Definition: supported-rates.cc:133
ns3::SupportedRates
The Supported Rates Information Element.
Definition: supported-rates.h:96
ns3::Ptr< Packet >
ns3::ApWifiMac::m_numNonHtStations
uint16_t m_numNonHtStations
Number of non-HT stations currently associated to the AP.
Definition: ap-wifi-mac.h:317
ns3::MgtProbeResponseHeader::SetHeCapabilities
void SetHeCapabilities(HeCapabilities heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:292
ns3::WifiPhy::GetMaxSupportedTxSpatialStreams
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1403
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::HtOperation::SetTxMcsSetDefined
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
Definition: ht-operation.cc:171
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition: mac48-address.cc:170
ns3::EdcaParameterSet::SetVoCWmax
void SetVoCWmax(uint32_t cwMax)
Set the AC_VO CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:177
ns3::WifiMacHeader::SetQosAckPolicy
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.
Definition: wifi-mac-header.cc:367
ns3::VhtOperation::SetMaxVhtMcsPerNss
void SetMaxVhtMcsPerNss(uint8_t nss, uint8_t maxVhtMcs)
Set the Basic VHT-MCS and NSS field in the VHT Operation information element by specifying the tuple ...
Definition: vht-operation.cc:73
ns3::ErpInformation::SetNonErpPresent
void SetNonErpPresent(uint8_t nonErpPresent)
Set the Non_Erp_Present field in the ErpInformation information element.
Definition: erp-information.cc:56
ns3::RegularWifiMac::m_edca
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
Definition: regular-wifi-mac.h:233
ns3::ErpInformation::SetUseProtection
void SetUseProtection(uint8_t useProtection)
Set the Use_Protection field in the ErpInformation information element.
Definition: erp-information.cc:50
ns3::WifiRemoteStationManager::GetNumberOfSupportedStreams
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
Definition: wifi-remote-station-manager.cc:1812
ns3::AC_VI
@ AC_VI
Video.
Definition: qos-utils.h:77
ns3::HtOperation::SetDualBeacon
void SetDualBeacon(uint8_t dualBeacon)
Set the dual beacon.
Definition: ht-operation.cc:123
ns3::QosTxop::GetAifsn
uint8_t GetAifsn(void) const override
Return the number of slots that make up an AIFS according to the EDCA Parameter Set or the MU EDCA Pa...
Definition: qos-txop.cc:229
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::MgtProbeResponseHeader::SetHtCapabilities
void SetHtCapabilities(HtCapabilities htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:244
ns3::MgtReassocRequestHeader::GetSupportedRates
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:801
ns3::EdcaParameterSet::SetBkCWmax
void SetBkCWmax(uint32_t cwMax)
Set the AC_BK CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:113
ns3::MgtProbeResponseHeader::SetVhtCapabilities
void SetVhtCapabilities(VhtCapabilities vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:268
max
#define max(a, b)
Definition: 80211b.c:43
ns3::HeOperation::SetMaxHeMcsPerNss
void SetMaxHeMcsPerNss(uint8_t nss, uint8_t maxHeMcs)
Set the Basic HE-MCS and NSS field in the HE Operation information element by specifying the tuple (n...
Definition: he-operation.cc:97
ns3::MgtProbeResponseHeader::SetHtOperation
void SetHtOperation(HtOperation htOperation)
Set the HT operation.
Definition: mgt-headers.cc:256
ns3::WifiMacHeader::IsFromDs
bool IsFromDs(void) const
Definition: wifi-mac-header.cc:546
ns3::WifiPhy::GetShortPhyPreambleSupported
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:771
ns3::Time::GetMicroSeconds
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:388
ns3::WifiRemoteStationManager::AddSupportedErpSlotTime
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
Definition: wifi-remote-station-manager.cc:326
ns3::MgtAssocRequestHeader::GetHeCapabilities
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities.
Definition: mgt-headers.cc:602
ns3::WifiMacHeader::IsQosAmsdu
bool IsQosAmsdu(void) const
Check if the A-MSDU present bit is set in the QoS control field.
Definition: wifi-mac-header.cc:855
ns3::MgtAssocResponseHeader::SetEdcaParameterSet
void SetEdcaParameterSet(EdcaParameterSet edcaParameterSet)
Set the EDCA Parameter Set.
Definition: mgt-headers.cc:1058
ns3::ApWifiMac::GetCapabilities
CapabilityInformation GetCapabilities(void) const
Return the Capability information of the current AP.
Definition: ap-wifi-mac.cc:428
ns3::ApWifiMac::m_beaconInterval
Time m_beaconInterval
Beacon interval.
Definition: ap-wifi-mac.h:311
ns3::MgtAssocResponseHeader::SetHeCapabilities
void SetHeCapabilities(HeCapabilities heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:1010
ns3::RegularWifiMac::GetVhtSupported
bool GetVhtSupported() const
Return whether the device supports VHT.
Definition: regular-wifi-mac.cc:608
ns3::WifiRemoteStationManager::GetShortSlotTimeSupported
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
Definition: wifi-remote-station-manager.cc:426
ns3::RegularWifiMac::SetAddress
void SetAddress(Mac48Address address) override
Definition: regular-wifi-mac.cc:665
wifi-net-device.h
ns3::HtCapabilities
The HT Capabilities Information Element.
Definition: ht-capabilities.h:42
ns3::MgtAssocResponseHeader::SetExtendedCapabilities
void SetExtendedCapabilities(ExtendedCapabilities extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:950
ns3::QosUtilsMapTidToAc
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:126
ns3::RegularWifiMac::DoDispose
void DoDispose() override
Destructor implementation.
Definition: regular-wifi-mac.cc:94
ns3::MgtProbeRequestHeader::GetSsid
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:46
ns3::HtOperation::SetRxMcsBitmask
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
Definition: ht-operation.cc:159
ns3::Mac48Address::IsBroadcast
bool IsBroadcast(void) const
Definition: mac48-address.cc:158
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
ns3::StatusCode::SetSuccess
void SetSuccess(void)
Set success bit to 0 (success).
Definition: status-code.cc:30
ns3::WifiRemoteStationManager::AddBasicMode
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
Definition: wifi-remote-station-manager.cc:1490
ns3::ApWifiMac::SendOneBeacon
void SendOneBeacon(void)
Forward a beacon packet to the beacon special DCF.
Definition: ap-wifi-mac.cc:869
ns3::MgtProbeResponseHeader::SetSsid
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:316
ns3::EventId::Cancel
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
ns3::RegularWifiMac::m_txop
Ptr< Txop > m_txop
This holds a pointer to the TXOP instance for this WifiMac - used for transmission of frames to non-Q...
Definition: regular-wifi-mac.h:225
ns3::EdcaParameterSet::SetBeCWmin
void SetBeCWmin(uint32_t cwMin)
Set the AC_BE CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:74
ns3::WifiMacHeader::HasData
bool HasData(void) const
Return true if the header type is DATA and is not DATA_NULL.
Definition: wifi-mac-header.cc:632
ns3::AC_BE
@ AC_BE
Best Effort.
Definition: qos-utils.h:73
ns3::RegularWifiMac::GetShortSlotTimeSupported
bool GetShortSlotTimeSupported(void) const override
Definition: regular-wifi-mac.cc:722
ns3::WifiMacHeader::NORMAL_ACK
@ NORMAL_ACK
Definition: wifi-mac-header.h:92
ns3::WifiMac::GetHeConfiguration
Ptr< HeConfiguration > GetHeConfiguration(void) const
Definition: wifi-mac.cc:198
ns3::ApWifiMac::m_beaconEvent
EventId m_beaconEvent
Event to generate one beacon.
Definition: ap-wifi-mac.h:312
ns3::RegularWifiMac::m_stationManager
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
Definition: regular-wifi-mac.h:215
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
ns3::ApWifiMac::SendProbeResp
void SendProbeResp(Mac48Address to)
Forward a probe response packet to the DCF.
Definition: ap-wifi-mac.cc:721
ns3::AC_BK
@ AC_BK
Background.
Definition: qos-utils.h:75
ns3::HeOperation
The HE Operation Information Element.
Definition: he-operation.h:36
ns3::WifiMacHeader::IsQosData
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
Definition: wifi-mac-header.cc:565
first.address
address
Definition: first.py:44
ns3::EdcaParameterSet::SetBeTxopLimit
void SetBeTxopLimit(uint16_t txop)
Set the AC_BE TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:88
ns3::WifiMode::GetUniqueName
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:122
mac-rx-middle.h
ns3::MgtAssocResponseHeader::SetHeOperation
void SetHeOperation(HeOperation heOperation)
Set the HE operation.
Definition: mgt-headers.cc:1022
ns3::WifiMacHeader::SetNoOrder
void SetNoOrder(void)
Unset order bit in the frame control field.
Definition: wifi-mac-header.cc:337
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::ApWifiMac::SetBeaconGeneration
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
Definition: ap-wifi-mac.cc:146
ns3::WifiMacHeader::IsAssocReq
bool IsAssocReq(void) const
Return true if the header is an Association Request header.
Definition: wifi-mac-header.cc:669
ns3::VhtCapabilities::GetRxHighestSupportedLgiDataRate
uint16_t GetRxHighestSupportedLgiDataRate() const
Get the receive highest supported LGI data rate.
Definition: vht-capabilities.cc:413
ns3::RegularWifiMac::SetTypeOfStation
void SetTypeOfStation(TypeOfStation type) override
This method is invoked by a subclass to specify what type of station it is implementing.
Definition: regular-wifi-mac.cc:482
ns3::MgtAssocResponseHeader::SetVhtCapabilities
void SetVhtCapabilities(VhtCapabilities vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:986
ns3::ApWifiMac::SendAssocResp
void SendAssocResp(Mac48Address to, bool success, bool isReassoc)
Forward an association or a reassociation response packet to the DCF.
Definition: ap-wifi-mac.cc:778
ns3::WifiRemoteStationManager::GetErpOfdmSupported
bool GetErpOfdmSupported(const Mac48Address &address) const
Return whether the station supports ERP OFDM or not.
Definition: wifi-remote-station-manager.cc:1836
ns3::SupportedRates::GetNRates
uint8_t GetNRates(void) const
Return the number of supported rates.
Definition: supported-rates.cc:162
ns3::WifiRemoteStationManager::AddSupportedPhyPreamble
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
Definition: wifi-remote-station-manager.cc:317
ns3::WifiRemoteStationManager::SetShortPreambleEnabled
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
Definition: wifi-remote-station-manager.cc:206
ns3::WifiRemoteStationManager::GetBasicMcs
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
Definition: wifi-remote-station-manager.cc:1581
ns3::ApWifiMac::GetVhtOperationalChannelWidth
uint16_t GetVhtOperationalChannelWidth(void) const
Determine the VHT operational channel width (in MHz).
Definition: ap-wifi-mac.cc:248
ns3::ApWifiMac::GetMaxBufferStatus
uint8_t GetMaxBufferStatus(Mac48Address address) const
Return the maximum among the values of the Queue Size subfield of the last QoS Data or QoS Null frame...
Definition: ap-wifi-mac.cc:1480
ns3::MgtBeaconHeader
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:862
ns3::ApWifiMac::GetVhtOperation
VhtOperation GetVhtOperation(void) const
Return the VHT operation of the current AP.
Definition: ap-wifi-mac.cc:652
ns3::WifiRemoteStationManager::RecordWaitAssocTxOk
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:468
ns3::MgtAssocResponseHeader::SetMuEdcaParameterSet
void SetMuEdcaParameterSet(MuEdcaParameterSet muEdcaParameterSet)
Set the MU EDCA Parameter Set.
Definition: mgt-headers.cc:1064
ns3::MuEdcaParameterSet::SetMuAifsn
void SetMuAifsn(uint8_t aci, uint8_t aifsn)
Set the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
Definition: mu-edca-parameter-set.cc:67
ns3::HtOperation::SetPcoActive
void SetPcoActive(uint8_t pcoActive)
Set the PCO active.
Definition: ht-operation.cc:147
ns3::RegularWifiMac::ForwardUp
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
Definition: regular-wifi-mac.cc:746
ns3::StatusCode
Status code for association response.
Definition: status-code.h:32
ns3::ApWifiMac::m_beaconJitter
Ptr< UniformRandomVariable > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
Definition: ap-wifi-mac.h:313
ns3::WifiRemoteStationManager::AddStationHtCapabilities
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htCapabilities)
Records HT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1301
msdu-aggregator.h
ns3::CapabilityInformation
Capability information.
Definition: capability-information.h:34
ns3::ApWifiMac::m_staList
std::map< uint16_t, Mac48Address > m_staList
Map of all stations currently associated to the AP with their association ID.
Definition: ap-wifi-mac.h:315
ns3::EdcaParameterSet::SetViCWmin
void SetViCWmin(uint32_t cwMin)
Set the AC_VI CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:138
ns3::WifiPhy::SetSlot
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:916
ns3::WifiMacHeader::IsMgt
bool IsMgt(void) const
Return true if the Type is Management.
Definition: wifi-mac-header.cc:577
ns3::MgtAssocRequestHeader
Implement the header for management frames of type association request.
Definition: mgt-headers.h:50
ns3::MakeCallback
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
ns3::ApWifiMac::GetBufferStatus
uint8_t GetBufferStatus(uint8_t tid, Mac48Address address) const
Return the value of the Queue Size subfield of the last QoS Data or QoS Null frame received from the ...
Definition: ap-wifi-mac.cc:1454
ns3::ApWifiMac::SetLinkUpCallback
void SetLinkUpCallback(Callback< void > linkUp) override
Definition: ap-wifi-mac.cc:168
ns3::WifiRemoteStationManager::AddStationVhtCapabilities
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtCapabilities)
Records VHT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1327
ns3::MgtAssocResponseHeader::SetAssociationId
void SetAssociationId(uint16_t aid)
Set the association ID.
Definition: mgt-headers.cc:1034
ns3::MakePointerAccessor
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: pointer.h:227
ns3::StringValue
Hold variables of type string.
Definition: string.h:41
ns3::EdcaParameterSet::SetQosSupported
void SetQosSupported(uint8_t qosSupported)
Set QOS supported function.
Definition: edca-parameter-set.cc:44
NS_ABORT_IF
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:77
ns3::VhtCapabilities::GetVhtCapabilitiesInfo
uint32_t GetVhtCapabilitiesInfo() const
Return the VHT Capabilities Info field in the VHT Capabilities information element.
Definition: vht-capabilities.cc:147
ns3::EdcaParameterSet::SetBkCWmin
void SetBkCWmin(uint32_t cwMin)
Set the AC_BK CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:106
ns3::MgtAssocResponseHeader::SetErpInformation
void SetErpInformation(ErpInformation erpInformation)
Set the ERP information.
Definition: mgt-headers.cc:1046
ns3::WifiMacHeader::SetAddr2
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
Definition: wifi-mac-header.cc:114
ns3::WifiMac::NotifyRxDrop
void NotifyRxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:121
ns3::AC_VO
@ AC_VO
Voice.
Definition: qos-utils.h:79
ns3::WifiMacHeader::GetQosTid
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Definition: wifi-mac-header.cc:862
ns3::HeCapabilities::GetSupportedMcsAndNss
uint16_t GetSupportedMcsAndNss() const
Return the MCS and NSS field in the HE Capabilities information element.
Definition: he-capabilities.cc:348
ns3::ApWifiMac::GetAssociationId
uint16_t GetAssociationId(Mac48Address addr) const
Definition: ap-wifi-mac.cc:1448
ns3::ApWifiMac::UpdateShortPreambleEnabled
void UpdateShortPreambleEnabled(void)
Update whether short preamble should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:225
ns3::ApWifiMac::m_enableBeaconJitter
bool m_enableBeaconJitter
Flag whether the first beacon should be generated at random time.
Definition: ap-wifi-mac.h:314
ns3::HtOperation::SetLSigTxopProtectionFullSupport
void SetLSigTxopProtectionFullSupport(uint8_t lSigTxopProtectionFullSupport)
Set the LSIG TXOP protection full support.
Definition: ht-operation.cc:141
ns3::ExtendedCapabilities
The Extended Capabilities Information Element.
Definition: extended-capabilities.h:35
ns3::HtOperation::SetTxRxMcsSetUnequal
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
Definition: ht-operation.cc:177
ns3::WifiMacHeader::IsReassocResp
bool IsReassocResp(void) const
Return true if the header is a Reassociation Response header.
Definition: wifi-mac-header.cc:687
ns3::QosTxop::GetMinCw
uint32_t GetMinCw(void) const override
Return the minimum contention window size from the EDCA Parameter Set or the MU EDCA Parameter Set,...
Definition: qos-txop.cc:207
ns3::WifiRemoteStationManager::RecordDisassociated
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
Definition: wifi-remote-station-manager.cc:489
ns3::MgtProbeResponseHeader::SetBeaconIntervalUs
void SetBeaconIntervalUs(uint64_t us)
Set the beacon interval in microseconds unit.
Definition: mgt-headers.cc:322
ns3::ApWifiMac::GetBeaconInterval
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:161
ns3::WifiMac::GetHtConfiguration
Ptr< HtConfiguration > GetHtConfiguration(void) const
Definition: wifi-mac.cc:184
ns3::WifiAddressTidPair
std::pair< Mac48Address, uint8_t > WifiAddressTidPair
(MAC address, TID) pair
Definition: qos-utils.h:32
ns3::ApWifiMac::Receive
void Receive(Ptr< WifiMacQueueItem > mpdu) override
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition: ap-wifi-mac.cc:968
ns3::MuEdcaParameterSet::SetQosInfo
void SetQosInfo(uint8_t qosInfo)
Set the QoS Info field in the MuEdcaParameterSet information element.
Definition: mu-edca-parameter-set.cc:61
ns3::RegularWifiMac::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities of the device.
Definition: regular-wifi-mac.cc:206
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::Txop::SetWifiMac
virtual void SetWifiMac(const Ptr< RegularWifiMac > mac)
Set the wifi MAC this Txop is associated to.
Definition: txop.cc:131
ns3::ApWifiMac::ForwardDown
void ForwardDown(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet down to DCF/EDCAF (enqueue the packet).
Definition: ap-wifi-mac.cc:265
ns3::MgtProbeResponseHeader
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:633
ns3::RegularWifiMac::GetHeCapabilities
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities of the device.
Definition: regular-wifi-mac.cc:345
ns3::ApWifiMac
Wi-Fi AP state machine.
Definition: ap-wifi-mac.h:50
ns3::WifiMacHeader::IsProbeReq
bool IsProbeReq(void) const
Return true if the header is a Probe Request header.
Definition: wifi-mac-header.cc:693
ns3::DsssParameterSet::SetDsssSupported
void SetDsssSupported(uint8_t dsssSupported)
Set DSSS supported.
Definition: dsss-parameter-set.cc:38
ns3::ApWifiMac::m_numNonErpStations
uint16_t m_numNonErpStations
Number of non-ERP stations currently associated to the AP.
Definition: ap-wifi-mac.h:316
ns3::EdcaParameterSet::SetBeAci
void SetBeAci(uint8_t aci)
Set the AC_BE ACI field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:68
ns3::Packet::Copy
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
ns3::ApWifiMac::SetAddress
void SetAddress(Mac48Address address) override
Definition: ap-wifi-mac.cc:136
ns3::ErpInformation::SetBarkerPreambleMode
void SetBarkerPreambleMode(uint8_t barkerPreambleMode)
Set the Barker_Preamble_Mode field in the ErpInformation information element.
Definition: erp-information.cc:44
ns3::WIFI_MAC_DATA
@ WIFI_MAC_DATA
Definition: wifi-mac-header.h:62
ns3::QosTxop::GetMaxCw
uint32_t GetMaxCw(void) const override
Return the maximum contention window size from the EDCA Parameter Set or the MU EDCA Parameter Set,...
Definition: qos-txop.cc:218
ns3::MgtProbeResponseHeader::SetHeOperation
void SetHeOperation(HeOperation heOperation)
Set the HE operation.
Definition: mgt-headers.cc:304
ns3::WIFI_MAC_QOSDATA
@ WIFI_MAC_QOSDATA
Definition: wifi-mac-header.h:70
ns3::WifiRemoteStationManager::RecordGotAssocTxOk
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:475
ns3::ApWifiMac::UpdateShortSlotTimeEnabled
void UpdateShortSlotTimeEnabled(void)
Update whether short slot time should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:203
ns3::WifiMacHeader::SetQosTxopLimit
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
Definition: wifi-mac-header.cc:396
third.ssid
ssid
Definition: third.py:100
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1353
ns3::WifiPhy::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1233
ns3::RegularWifiMac::DoInitialize
void DoInitialize() override
Initialize() implementation.
Definition: regular-wifi-mac.cc:82
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::RegularWifiMac::m_txMiddle
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
Definition: regular-wifi-mac.h:210
ns3::MgtAssocResponseHeader::SetHtOperation
void SetHtOperation(HtOperation htOperation)
Set the HT operation.
Definition: mgt-headers.cc:974
ns3::MgtReassocRequestHeader::GetHeCapabilities
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities.
Definition: mgt-headers.cc:789
ns3::MuEdcaParameterSet::SetMuCwMin
void SetMuCwMin(uint8_t aci, uint16_t cwMin)
Set the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
Definition: mu-edca-parameter-set.cc:77
ns3::MuEdcaParameterSet::SetMuEdcaTimer
void SetMuEdcaTimer(uint8_t aci, Time timer)
Set the MU EDCA Timer field in the MU AC Parameter Record field corresponding to the given AC Index (...
Definition: mu-edca-parameter-set.cc:101
ns3::MIXED_MODE_PROTECTION
@ MIXED_MODE_PROTECTION
Definition: ht-operation.h:40
ns3::HtOperation::SetPrimaryChannel
void SetPrimaryChannel(uint8_t ctrl)
Set the Primary Channel field in the HT Operation information element.
Definition: ht-operation.cc:81
ns3::WifiPhy::GetMaxSupportedRxSpatialStreams
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1421
ns3::WifiPhy::GetModeList
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition: wifi-phy.cc:2015
ns3::ApWifiMac::GetMuEdcaParameterSet
MuEdcaParameterSet GetMuEdcaParameterSet(void) const
Return the MU EDCA Parameter Set of the current AP.
Definition: ap-wifi-mac.cc:509
ns3::WifiRemoteStationManager::GetNMcsSupported
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
Definition: wifi-remote-station-manager.cc:1824
ns3::HtOperation::SetSecondaryChannelOffset
void SetSecondaryChannelOffset(uint8_t secondaryChannelOffset)
Set the secondary channel offset.
Definition: ht-operation.cc:87
ns3::WifiRemoteStationManager::SetUseNonErpProtection
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
Definition: wifi-remote-station-manager.cc:1044
ns3::RegularWifiMac::m_channelAccessManager
Ptr< ChannelAccessManager > m_channelAccessManager
channel access manager
Definition: regular-wifi-mac.h:211
ns3::WifiMacHeader::SetType
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Definition: wifi-mac-header.cc:132
ns3::HeOperation::SetHeSupported
void SetHeSupported(uint8_t heSupported)
Set the HE supported information element.
Definition: he-operation.cc:53
ns3::MgtAssocResponseHeader::SetCapabilities
void SetCapabilities(CapabilityInformation capabilities)
Set the Capability information.
Definition: mgt-headers.cc:938
ns3::EdcaParameterSet::SetBkAifsn
void SetBkAifsn(uint8_t aifsn)
Set the AC_BK AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:94
ns3::RandomVariableStream::SetStream
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Definition: random-variable-stream.cc:100
ns3::EdcaParameterSet::SetViCWmax
void SetViCWmax(uint32_t cwMax)
Set the AC_VI CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:145
ns3::WifiRemoteStationManager::GetDsssSupported
bool GetDsssSupported(const Mac48Address &address) const
Return whether the station supports DSSS or not.
Definition: wifi-remote-station-manager.cc:1830
ns3::WifiPhy::GetBssMembershipSelectorList
std::list< uint8_t > GetBssMembershipSelectorList(void) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1427
ns3::RegularWifiMac::GetDsssSupported
bool GetDsssSupported() const
Return whether the device supports DSSS.
Definition: regular-wifi-mac.cc:652
ns3::HtOperation::SetHtProtection
void SetHtProtection(uint8_t htProtection)
Set the HT protection.
Definition: ht-operation.cc:105
ns3::MgtAssocResponseHeader::SetSupportedRates
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:932
ns3::WifiRemoteStationManager::AddSupportedMcs
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Definition: wifi-remote-station-manager.cc:403
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::RegularWifiMac::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities of the device.
Definition: regular-wifi-mac.cc:262
ns3::ApWifiMac::SupportsSendFrom
bool SupportsSendFrom(void) const override
Definition: ap-wifi-mac.cc:365
ns3::CapabilityInformation::IsShortPreamble
bool IsShortPreamble(void) const
Check if the short preamble bit in the capability information field is set to 1.
Definition: capability-information.cc:81
ns3::WIFI_MAC_MGT_PROBE_RESPONSE
@ WIFI_MAC_MGT_PROBE_RESPONSE
Definition: wifi-mac-header.h:55
ns3::SupportedRates::AddSupportedRate
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
Definition: supported-rates.cc:59
ns3::CapabilityInformation::IsShortSlotTime
bool IsShortSlotTime(void) const
Check if the short slot time in the capability information field is set to 1.
Definition: capability-information.cc:87
ns3::HtOperation
The HT Operation Information Element.
Definition: ht-operation.h:51
ns3::ApWifiMac::m_deAssocLogger
TracedCallback< uint16_t, Mac48Address > m_deAssocLogger
deassociation logger
Definition: ap-wifi-mac.h:340
ns3::RegularWifiMac::m_phy
Ptr< WifiPhy > m_phy
Wifi PHY.
Definition: regular-wifi-mac.h:212
ns3::ApWifiMac::GetEdcaParameterSet
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set of the current AP.
Definition: ap-wifi-mac.cc:461
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::HtOperation::SetNonGfHtStasPresent
void SetNonGfHtStasPresent(uint8_t nonGfHtStasPresent)
Set the non GF HT STAs present.
Definition: ht-operation.cc:111
ns3::EdcaParameterSet::SetVoTxopLimit
void SetVoTxopLimit(uint16_t txop)
Set the AC_VO TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:184
ns3::ObjectBase::TraceConnectWithoutContext
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Definition: object-base.cc:293
ns3::WifiMacHeader::IsReassocReq
bool IsReassocReq(void) const
Return true if the header is a Reassociation Request header.
Definition: wifi-mac-header.cc:681
ns3::ApWifiMac::GetErpInformation
ErpInformation GetErpInformation(void) const
Return the ERP information of the current AP.
Definition: ap-wifi-mac.cc:439
ns3::ErpInformation
The ErpInformation Information Element.
Definition: erp-information.h:35
ns3::ApWifiMac::DoDispose
void DoDispose(void) override
Destructor implementation.
Definition: ap-wifi-mac.cc:125
ns3::ApWifiMac::m_assocLogger
TracedCallback< uint16_t, Mac48Address > m_assocLogger
association logger
Definition: ap-wifi-mac.h:339
ns3::HtOperation::SetDualCtsProtection
void SetDualCtsProtection(uint8_t dualCtsProtection)
Set the dual CTS protection.
Definition: ht-operation.cc:129
ns3::WifiRemoteStationManager::GetBasicMode
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
Definition: wifi-remote-station-manager.cc:1514
ns3::ApWifiMac::m_bsrLifetime
Time m_bsrLifetime
Lifetime of Buffer Status Reports.
Definition: ap-wifi-mac.h:321
ns3::WifiMode::GetDataRate
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:100
ns3::WIFI_MOD_CLASS_VHT
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
Definition: wifi-phy-common.h:126
ns3::SupportedRates::AddBssMembershipSelectorRate
void AddBssMembershipSelectorRate(uint64_t bs)
Add a special value to the supported rate set, corresponding to a BSS membership selector.
Definition: supported-rates.cc:97
ns3::HtCapabilities::IsSupportedMcs
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
Definition: ht-capabilities.cc:230
ns3::MgtProbeResponseHeader::SetEdcaParameterSet
void SetEdcaParameterSet(EdcaParameterSet edcaParameterSet)
Set the EDCA Parameter Set.
Definition: mgt-headers.cc:358
ns3::Object::Initialize
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:183
ns3::WifiRemoteStationManager::GetAssociationId
uint16_t GetAssociationId(Mac48Address remoteAddress) const
Get the AID of a remote station.
Definition: wifi-remote-station-manager.cc:496
ns3::Txop::SetTxMiddle
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
Definition: txop.cc:124
ns3::ApWifiMac::GetUseNonErpProtection
bool GetUseNonErpProtection(void) const
Return whether protection for non-ERP stations is used in the BSS.
Definition: ap-wifi-mac.cc:1419
ns3::WifiMacHeader::SetQosTid
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
Definition: wifi-mac-header.cc:352
ns3::ApWifiMac::m_enableNonErpProtection
bool m_enableNonErpProtection
Flag whether protection mechanism is used or not when non-ERP STAs are present within the BSS.
Definition: ap-wifi-mac.h:320
ns3::UintegerValue::Get
uint64_t Get(void) const
Definition: uinteger.cc:35
ns3::ApWifiMac::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: ap-wifi-mac.cc:195
ns3::WifiRemoteStationManager::IsWaitAssocTxOk
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
Definition: wifi-remote-station-manager.cc:458
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
ns3::MgtReassocRequestHeader::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:777
ns3::WifiPhy::GetMcsList
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Definition: wifi-phy.cc:2064
ns3::MgtProbeResponseHeader::SetMuEdcaParameterSet
void SetMuEdcaParameterSet(MuEdcaParameterSet muEdcaParameterSet)
Set the MU EDCA Parameter Set.
Definition: mgt-headers.cc:364
ns3::WIFI_MAC_MGT_BEACON
@ WIFI_MAC_MGT_BEACON
Definition: wifi-mac-header.h:48
ns3::UniformRandomVariable::GetValue
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
Definition: random-variable-stream.cc:182
ns3::EdcaParameterSet::SetViAifsn
void SetViAifsn(uint8_t aifsn)
Set the AC_VI AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:126
ns3::RegularWifiMac::GetHtSupported
bool GetHtSupported() const
Return whether the device supports HT.
Definition: regular-wifi-mac.cc:598
ns3::Txop::Queue
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:289
channel-access-manager.h
ns3::ApWifiMac::SetBufferStatus
void SetBufferStatus(uint8_t tid, Mac48Address address, uint8_t size)
Store the value of the Queue Size subfield of the last QoS Data or QoS Null frame received from the s...
Definition: ap-wifi-mac.cc:1466
ns3::Simulator::ScheduleNow
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:588
ns3::MgtReassocRequestHeader
Implement the header for management frames of type reassociation request.
Definition: mgt-headers.h:182
ns3::RegularWifiMac::Receive
virtual void Receive(Ptr< WifiMacQueueItem > mpdu)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition: regular-wifi-mac.cc:753
ns3::WifiMacHeader::SetDsFrom
void SetDsFrom(void)
Set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:84
ns3::HtOperation::SetObssNonHtStasPresent
void SetObssNonHtStasPresent(uint8_t obssNonHtStasPresent)
Set the OBSS non HT STAs present.
Definition: ht-operation.cc:117
ns3::MgtAssocResponseHeader::SetStatusCode
void SetStatusCode(StatusCode code)
Set the status code.
Definition: mgt-headers.cc:926
ns3::EdcaParameterSet::SetVoAifsn
void SetVoAifsn(uint8_t aifsn)
Set the AC_VO AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:158
ns3::MgtProbeResponseHeader::SetSupportedRates
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:328
ns3::HtOperation::SetStaChannelWidth
void SetStaChannelWidth(uint8_t staChannelWidth)
Set the STA channel width.
Definition: ht-operation.cc:93
ns3::WifiRemoteStationManager::GetHeSupported
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
Definition: wifi-remote-station-manager.cc:256
ns3::QosUtilsGetTidForPacket
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
If a QoS tag is attached to the packet, returns a value < 8.
Definition: qos-utils.cc:152
ns3::MakeTimeAccessor
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1354
ns3::Txop::SetAifsn
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Definition: txop.cc:242
ns3::MgtAssocResponseHeader
Implement the header for management frames of type association and reassociation response.
Definition: mgt-headers.h:320
ns3::VhtOperation::SetVhtSupported
void SetVhtSupported(uint8_t vhtSupported)
Set the VHT supported information element.
Definition: vht-operation.cc:41
ns3::WifiMacHeader::SetQosNoAmsdu
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
Definition: wifi-mac-header.cc:391
ns3::WifiMacHeader::IsAssocResp
bool IsAssocResp(void) const
Return true if the header is an Association Response header.
Definition: wifi-mac-header.cc:675
ns3::MuEdcaParameterSet
The MU EDCA Parameter Set.
Definition: mu-edca-parameter-set.h:37
ns3::ApWifiMac::Enqueue
void Enqueue(Ptr< Packet > packet, Mac48Address to) override
Definition: ap-wifi-mac.cc:355
ns3::WifiMode::GetMcsValue
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:137
ns3::ApWifiMac::GetNextAssociationId
uint16_t GetNextAssociationId(void)
Definition: ap-wifi-mac.cc:1427
ns3::CapabilityInformation::SetShortSlotTime
void SetShortSlotTime(bool shortSlotTime)
Set the short slot time bit in the capability information field.
Definition: capability-information.cc:54
ns3::MgtAssocRequestHeader::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:590
ns3::MgtReassocRequestHeader::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:765