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 "wifi-mac-queue.h"
39 #include "ns3/ht-configuration.h"
40 #include "ns3/he-configuration.h"
41 
42 namespace ns3 {
43 
44 NS_LOG_COMPONENT_DEFINE ("ApWifiMac");
45 
46 NS_OBJECT_ENSURE_REGISTERED (ApWifiMac);
47 
48 TypeId
50 {
51  static TypeId tid = TypeId ("ns3::ApWifiMac")
53  .SetGroupName ("Wifi")
54  .AddConstructor<ApWifiMac> ()
55  .AddAttribute ("BeaconInterval",
56  "Delay between two beacons",
57  TimeValue (MicroSeconds (102400)),
60  MakeTimeChecker ())
61  .AddAttribute ("BeaconJitter",
62  "A uniform random variable to cause the initial beacon starting time (after simulation time 0) "
63  "to be distributed between 0 and the BeaconInterval.",
64  StringValue ("ns3::UniformRandomVariable"),
66  MakePointerChecker<UniformRandomVariable> ())
67  .AddAttribute ("EnableBeaconJitter",
68  "If beacons are enabled, whether to jitter the initial send event.",
69  BooleanValue (true),
72  .AddAttribute ("BeaconGeneration",
73  "Whether or not beacons are generated.",
74  BooleanValue (true),
77  .AddAttribute ("EnableNonErpProtection", "Whether or not protection mechanism should be used when non-ERP STAs are present within the BSS."
78  "This parameter is only used when ERP is supported by the AP.",
79  BooleanValue (true),
82  .AddAttribute ("BsrLifetime",
83  "Lifetime of Buffer Status Reports received from stations.",
84  TimeValue (MilliSeconds (20)),
86  MakeTimeChecker ())
87  .AddTraceSource ("AssociatedSta",
88  "A station associated with this access point.",
90  "ns3::ApWifiMac::AssociationCallback")
91  .AddTraceSource ("DeAssociatedSta",
92  "A station lost association with this access point.",
94  "ns3::ApWifiMac::AssociationCallback")
95  ;
96  return tid;
97 }
98 
100  : m_enableBeaconGeneration (false),
101  m_numNonErpStations (0),
102  m_numNonHtStations (0),
103  m_shortSlotTimeEnabled (false),
104  m_shortPreambleEnabled (false)
105 {
106  NS_LOG_FUNCTION (this);
107  m_beaconTxop = CreateObject<Txop> (CreateObject<WifiMacQueue> (AC_BEACON));
108  m_beaconTxop->SetWifiMac (this);
109  m_beaconTxop->SetAifsn (1);
110  m_beaconTxop->SetMinCw (0);
111  m_beaconTxop->SetMaxCw (0);
114 
115  //Let the lower layers know that we are acting as an AP.
117 }
118 
120 {
121  NS_LOG_FUNCTION (this);
122  m_staList.clear ();
123 }
124 
125 void
127 {
128  NS_LOG_FUNCTION (this);
129  m_beaconTxop->Dispose ();
130  m_beaconTxop = 0;
131  m_enableBeaconGeneration = false;
134 }
135 
136 void
138 {
139  NS_LOG_FUNCTION (this << address);
140  //As an AP, our MAC address is also the BSSID. Hence we are
141  //overriding this function and setting both in our parent class.
144 }
145 
148 {
149  if (ac == AC_BEACON)
150  {
151  return m_beaconTxop->GetWifiMacQueue ();
152  }
153  return RegularWifiMac::GetTxopQueue (ac);
154 }
155 
156 void
158 {
159  NS_LOG_FUNCTION (this << enable);
160  if (!enable)
161  {
163  }
164  else if (enable && !m_enableBeaconGeneration)
165  {
167  }
168  m_enableBeaconGeneration = enable;
169 }
170 
171 Time
173 {
174  NS_LOG_FUNCTION (this);
175  return m_beaconInterval;
176 }
177 
178 void
180 {
181  NS_LOG_FUNCTION (this << &linkUp);
183 
184  //The approach taken here is that, from the point of view of an AP,
185  //the link is always up, so we immediately invoke the callback if
186  //one is set
187  linkUp ();
188 }
189 
190 void
192 {
193  NS_LOG_FUNCTION (this << interval);
194  if ((interval.GetMicroSeconds () % 1024) != 0)
195  {
196  NS_FATAL_ERROR ("beacon interval should be multiple of 1024us (802.11 time unit), see IEEE Std. 802.11-2012");
197  }
198  if (interval.GetMicroSeconds () > (1024 * 65535))
199  {
200  NS_FATAL_ERROR ("beacon interval should be smaller then or equal to 65535 * 1024us (802.11 time unit)");
201  }
202  m_beaconInterval = interval;
203 }
204 
205 int64_t
206 ApWifiMac::AssignStreams (int64_t stream)
207 {
208  NS_LOG_FUNCTION (this << stream);
209  m_beaconJitter->SetStream (stream);
210  return 1;
211 }
212 
213 void
215 {
216  NS_LOG_FUNCTION (this);
218  {
219  for (const auto& sta : m_staList)
220  {
221  if (!m_stationManager->GetShortSlotTimeSupported (sta.second))
222  {
223  m_shortSlotTimeEnabled = false;
224  return;
225  }
226  }
227  m_shortSlotTimeEnabled = true;
228  }
229  else
230  {
231  m_shortSlotTimeEnabled = false;
232  }
233 }
234 
235 void
237 {
238  NS_LOG_FUNCTION (this);
240  {
241  for (const auto& sta : m_staList)
242  {
243  if (!m_stationManager->GetErpOfdmSupported (sta.second) ||
245  {
246  m_shortPreambleEnabled = false;
247  return;
248  }
249  }
250  m_shortPreambleEnabled = true;
251  }
252  else
253  {
254  m_shortPreambleEnabled = false;
255  }
256 }
257 
258 uint16_t
260 {
261  uint16_t channelWidth = m_phy->GetChannelWidth ();
262  for (const auto& sta : m_staList)
263  {
264  if (m_stationManager->GetVhtSupported (sta.second))
265  {
266  if (m_stationManager->GetChannelWidthSupported (sta.second) < channelWidth)
267  {
268  channelWidth = m_stationManager->GetChannelWidthSupported (sta.second);
269  }
270  }
271  }
272  return channelWidth;
273 }
274 
275 void
277  Mac48Address to)
278 {
279  NS_LOG_FUNCTION (this << packet << from << to);
280  //If we are not a QoS AP then we definitely want to use AC_BE to
281  //transmit the packet. A TID of zero will map to AC_BE (through \c
282  //QosUtilsMapTidToAc()), so we use that as our default here.
283  uint8_t tid = 0;
284 
285  //If we are a QoS AP then we attempt to get a TID for this packet
286  if (GetQosSupported ())
287  {
288  tid = QosUtilsGetTidForPacket (packet);
289  //Any value greater than 7 is invalid and likely indicates that
290  //the packet had no QoS tag, so we revert to zero, which'll
291  //mean that AC_BE is used.
292  if (tid > 7)
293  {
294  tid = 0;
295  }
296  }
297 
298  ForwardDown (packet, from, to, tid);
299 }
300 
301 void
303  Mac48Address to, uint8_t tid)
304 {
305  NS_LOG_FUNCTION (this << packet << from << to << +tid);
306  WifiMacHeader hdr;
307 
308  //For now, an AP that supports QoS does not support non-QoS
309  //associations, and vice versa. In future the AP model should
310  //support simultaneously associated QoS and non-QoS STAs, at which
311  //point there will need to be per-association QoS state maintained
312  //by the association state machine, and consulted here.
313  if (GetQosSupported ())
314  {
317  hdr.SetQosNoEosp ();
318  hdr.SetQosNoAmsdu ();
319  //Transmission of multiple frames in the same Polled TXOP is not supported for now
320  hdr.SetQosTxopLimit (0);
321  //Fill in the QoS control field in the MAC header
322  hdr.SetQosTid (tid);
323  }
324  else
325  {
326  hdr.SetType (WIFI_MAC_DATA);
327  }
328 
329  if (GetQosSupported ())
330  {
331  hdr.SetNoOrder (); // explicitly set to 0 for the time being since HT control field is not yet implemented (set it to 1 when implemented)
332  }
333  hdr.SetAddr1 (to);
334  hdr.SetAddr2 (GetAddress ());
335  hdr.SetAddr3 (from);
336  hdr.SetDsFrom ();
337  hdr.SetDsNotTo ();
338 
339  if (GetQosSupported ())
340  {
341  //Sanity check that the TID is valid
342  NS_ASSERT (tid < 8);
343  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
344  }
345  else
346  {
347  m_txop->Queue (packet, hdr);
348  }
349 }
350 
351 void
353 {
354  NS_LOG_FUNCTION (this << packet << to << from);
355  if (to.IsGroup () || m_stationManager->IsAssociated (to))
356  {
357  ForwardDown (packet, from, to);
358  }
359  else
360  {
361  NotifyTxDrop (packet);
362  }
363 }
364 
365 void
367 {
368  NS_LOG_FUNCTION (this << packet << to);
369  //We're sending this packet with a from address that is our own. We
370  //get that address from the lower MAC and make use of the
371  //from-spoofing Enqueue() method to avoid duplicated code.
372  Enqueue (packet, to, GetAddress ());
373 }
374 
375 bool
377 {
378  NS_LOG_FUNCTION (this);
379  return true;
380 }
381 
384 {
385  NS_LOG_FUNCTION (this);
386  SupportedRates rates;
387  //Send the set of supported rates and make sure that we indicate
388  //the Basic Rate set in this set of supported rates.
389  for (const auto & mode : m_phy->GetModeList ())
390  {
391  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
392  NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
393  rates.AddSupportedRate (modeDataRate);
394  //Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
395  //here we choose to add the mandatory rates to the BSSBasicRateSet,
396  //except for 802.11b where we assume that only the non HR-DSSS rates are part of the BSSBasicRateSet
397  if (mode.IsMandatory () && (mode.GetModulationClass () != WIFI_MOD_CLASS_HR_DSSS))
398  {
399  NS_LOG_DEBUG ("Adding basic mode " << mode.GetUniqueName ());
401  }
402  }
403  //set the basic rates
404  for (uint8_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
405  {
407  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
408  NS_LOG_DEBUG ("Setting basic rate " << mode.GetUniqueName ());
409  rates.SetBasicRate (modeDataRate);
410  }
411  //If it is a HT AP, then add the BSSMembershipSelectorSet
412  //The standard says that the BSSMembershipSelectorSet
413  //must have its MSB set to 1 (must be treated as a Basic Rate)
414  //Also the standard mentioned that at least 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
415  if (GetHtSupported ())
416  {
417  for (const auto & selector : m_phy->GetBssMembershipSelectorList ())
418  {
419  rates.AddBssMembershipSelectorRate (selector);
420  }
421  }
422  return rates;
423 }
424 
427 {
428  NS_LOG_FUNCTION (this);
429  DsssParameterSet dsssParameters;
430  if (GetDsssSupported ())
431  {
432  dsssParameters.SetDsssSupported (1);
433  dsssParameters.SetCurrentChannel (m_phy->GetChannelNumber ());
434  }
435  return dsssParameters;
436 }
437 
440 {
441  NS_LOG_FUNCTION (this);
442  CapabilityInformation capabilities;
445  capabilities.SetEss ();
446  return capabilities;
447 }
448 
451 {
452  NS_LOG_FUNCTION (this);
453  ErpInformation information;
454  information.SetErpSupported (1);
455  if (GetErpSupported ())
456  {
457  information.SetNonErpPresent (m_numNonErpStations > 0);
458  information.SetUseProtection (GetUseNonErpProtection ());
460  {
461  information.SetBarkerPreambleMode (0);
462  }
463  else
464  {
465  information.SetBarkerPreambleMode (1);
466  }
467  }
468  return information;
469 }
470 
473 {
474  NS_LOG_FUNCTION (this);
475  EdcaParameterSet edcaParameters;
476  if (GetQosSupported ())
477  {
478  edcaParameters.SetQosSupported (1);
479  Ptr<QosTxop> edca;
480  Time txopLimit;
481 
482  edca = m_edca.find (AC_BE)->second;
483  txopLimit = edca->GetTxopLimit ();
484  edcaParameters.SetBeAci (0);
485  edcaParameters.SetBeCWmin (edca->GetMinCw ());
486  edcaParameters.SetBeCWmax (edca->GetMaxCw ());
487  edcaParameters.SetBeAifsn (edca->GetAifsn ());
488  edcaParameters.SetBeTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
489 
490  edca = m_edca.find (AC_BK)->second;
491  txopLimit = edca->GetTxopLimit ();
492  edcaParameters.SetBkAci (1);
493  edcaParameters.SetBkCWmin (edca->GetMinCw ());
494  edcaParameters.SetBkCWmax (edca->GetMaxCw ());
495  edcaParameters.SetBkAifsn (edca->GetAifsn ());
496  edcaParameters.SetBkTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
497 
498  edca = m_edca.find (AC_VI)->second;
499  txopLimit = edca->GetTxopLimit ();
500  edcaParameters.SetViAci (2);
501  edcaParameters.SetViCWmin (edca->GetMinCw ());
502  edcaParameters.SetViCWmax (edca->GetMaxCw ());
503  edcaParameters.SetViAifsn (edca->GetAifsn ());
504  edcaParameters.SetViTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
505 
506  edca = m_edca.find (AC_VO)->second;
507  txopLimit = edca->GetTxopLimit ();
508  edcaParameters.SetVoAci (3);
509  edcaParameters.SetVoCWmin (edca->GetMinCw ());
510  edcaParameters.SetVoCWmax (edca->GetMaxCw ());
511  edcaParameters.SetVoAifsn (edca->GetAifsn ());
512  edcaParameters.SetVoTxopLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
513 
514  edcaParameters.SetQosInfo (0);
515  }
516  return edcaParameters;
517 }
518 
521 {
522  NS_LOG_FUNCTION (this);
523  MuEdcaParameterSet muEdcaParameters;
524  if (GetHeSupported ())
525  {
526  Ptr<HeConfiguration> heConfiguration = GetHeConfiguration ();
527  NS_ASSERT (heConfiguration != 0);
528 
529  muEdcaParameters.SetQosInfo (0);
530 
531  UintegerValue uintegerValue;
532  TimeValue timeValue;
533 
534  heConfiguration->GetAttribute ("MuBeAifsn", uintegerValue);
535  muEdcaParameters.SetMuAifsn (AC_BE, uintegerValue.Get ());
536  heConfiguration->GetAttribute ("MuBeCwMin", uintegerValue);
537  muEdcaParameters.SetMuCwMin (AC_BE, uintegerValue.Get ());
538  heConfiguration->GetAttribute ("MuBeCwMax", uintegerValue);
539  muEdcaParameters.SetMuCwMax (AC_BE, uintegerValue.Get ());
540  heConfiguration->GetAttribute ("BeMuEdcaTimer", timeValue);
541  muEdcaParameters.SetMuEdcaTimer (AC_BE, timeValue.Get ());
542 
543  heConfiguration->GetAttribute ("MuBkAifsn", uintegerValue);
544  muEdcaParameters.SetMuAifsn (AC_BK, uintegerValue.Get ());
545  heConfiguration->GetAttribute ("MuBkCwMin", uintegerValue);
546  muEdcaParameters.SetMuCwMin (AC_BK, uintegerValue.Get ());
547  heConfiguration->GetAttribute ("MuBkCwMax", uintegerValue);
548  muEdcaParameters.SetMuCwMax (AC_BK, uintegerValue.Get ());
549  heConfiguration->GetAttribute ("BkMuEdcaTimer", timeValue);
550  muEdcaParameters.SetMuEdcaTimer (AC_BK, timeValue.Get ());
551 
552  heConfiguration->GetAttribute ("MuViAifsn", uintegerValue);
553  muEdcaParameters.SetMuAifsn (AC_VI, uintegerValue.Get ());
554  heConfiguration->GetAttribute ("MuViCwMin", uintegerValue);
555  muEdcaParameters.SetMuCwMin (AC_VI, uintegerValue.Get ());
556  heConfiguration->GetAttribute ("MuViCwMax", uintegerValue);
557  muEdcaParameters.SetMuCwMax (AC_VI, uintegerValue.Get ());
558  heConfiguration->GetAttribute ("ViMuEdcaTimer", timeValue);
559  muEdcaParameters.SetMuEdcaTimer (AC_VI, timeValue.Get ());
560 
561  heConfiguration->GetAttribute ("MuVoAifsn", uintegerValue);
562  muEdcaParameters.SetMuAifsn (AC_VO, uintegerValue.Get ());
563  heConfiguration->GetAttribute ("MuVoCwMin", uintegerValue);
564  muEdcaParameters.SetMuCwMin (AC_VO, uintegerValue.Get ());
565  heConfiguration->GetAttribute ("MuVoCwMax", uintegerValue);
566  muEdcaParameters.SetMuCwMax (AC_VO, uintegerValue.Get ());
567  heConfiguration->GetAttribute ("VoMuEdcaTimer", timeValue);
568  muEdcaParameters.SetMuEdcaTimer (AC_VO, timeValue.Get ());
569  }
570  return muEdcaParameters;
571 }
572 
575 {
576  NS_LOG_FUNCTION (this);
577  HtOperation operation;
578  if (GetHtSupported ())
579  {
580  operation.SetHtSupported (1);
581  operation.SetPrimaryChannel (m_phy->GetChannelNumber ());
582  operation.SetRifsMode (false);
583  operation.SetNonGfHtStasPresent (true);
584  if (m_phy->GetChannelWidth () > 20)
585  {
586  operation.SetSecondaryChannelOffset (1);
587  operation.SetStaChannelWidth (1);
588  }
589  if (m_numNonHtStations == 0)
590  {
591  operation.SetHtProtection (NO_PROTECTION);
592  }
593  else
594  {
596  }
597  uint64_t maxSupportedRate = 0; //in bit/s
598  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HT))
599  {
600  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
601  NS_ASSERT (nss > 0 && nss < 5);
602  uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), GetHtConfiguration ()->GetShortGuardIntervalSupported () ? 400 : 800, nss);
603  if (dataRate > maxSupportedRate)
604  {
605  maxSupportedRate = dataRate;
606  NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
607  }
608  }
609  uint8_t maxSpatialStream = m_phy->GetMaxSupportedTxSpatialStreams ();
610  auto mcsList = m_phy->GetMcsList (WIFI_MOD_CLASS_HT);
611  uint8_t nMcs = mcsList.size ();
612  for (const auto& sta : m_staList)
613  {
614  if (m_stationManager->GetHtSupported (sta.second))
615  {
616  uint64_t maxSupportedRateByHtSta = 0; //in bit/s
617  auto itMcs = mcsList.begin ();
618  for (uint8_t j = 0; j < (std::min (nMcs, m_stationManager->GetNMcsSupported (sta.second))); j++)
619  {
620  WifiMode mcs = *itMcs++;
621  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
622  NS_ASSERT (nss > 0 && nss < 5);
623  uint64_t dataRate = mcs.GetDataRate (m_stationManager->GetChannelWidthSupported (sta.second),
624  m_stationManager->GetShortGuardIntervalSupported (sta.second) ? 400 : 800, nss);
625  if (dataRate > maxSupportedRateByHtSta)
626  {
627  maxSupportedRateByHtSta = dataRate;
628  }
629  }
630  if (maxSupportedRateByHtSta < maxSupportedRate)
631  {
632  maxSupportedRate = maxSupportedRateByHtSta;
633  }
634  if (m_stationManager->GetNMcsSupported (sta.second) < nMcs)
635  {
636  nMcs = m_stationManager->GetNMcsSupported (sta.second);
637  }
638  if (m_stationManager->GetNumberOfSupportedStreams (sta.second) < maxSpatialStream)
639  {
640  maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (sta.second);
641  }
642  }
643  }
644  operation.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
645  operation.SetTxMcsSetDefined (nMcs > 0);
646  operation.SetTxMaxNSpatialStreams (maxSpatialStream);
647  //To be filled in once supported
648  operation.SetObssNonHtStasPresent (0);
649  operation.SetDualBeacon (0);
650  operation.SetDualCtsProtection (0);
651  operation.SetStbcBeacon (0);
652  operation.SetLSigTxopProtectionFullSupport (0);
653  operation.SetPcoActive (0);
654  operation.SetPhase (0);
655  operation.SetRxMcsBitmask (0);
656  operation.SetTxRxMcsSetUnequal (0);
657  operation.SetTxUnequalModulation (0);
658  }
659  return operation;
660 }
661 
664 {
665  NS_LOG_FUNCTION (this);
666  VhtOperation operation;
667  if (GetVhtSupported ())
668  {
669  operation.SetVhtSupported (1);
670  uint16_t channelWidth = GetVhtOperationalChannelWidth ();
671  if (channelWidth == 160)
672  {
673  operation.SetChannelWidth (2);
674  }
675  else if (channelWidth == 80)
676  {
677  operation.SetChannelWidth (1);
678  }
679  else
680  {
681  operation.SetChannelWidth (0);
682  }
683  uint8_t maxSpatialStream = m_phy->GetMaxSupportedRxSpatialStreams ();
684  for (const auto& sta : m_staList)
685  {
686  if (m_stationManager->GetVhtSupported (sta.second))
687  {
688  if (m_stationManager->GetNumberOfSupportedStreams (sta.second) < maxSpatialStream)
689  {
690  maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (sta.second);
691  }
692  }
693  }
694  for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
695  {
696  uint8_t maxMcs = 9; //TBD: hardcode to 9 for now since we assume all MCS values are supported
697  operation.SetMaxVhtMcsPerNss (nss, maxMcs);
698  }
699  }
700  return operation;
701 }
702 
705 {
706  NS_LOG_FUNCTION (this);
707  HeOperation operation;
708  if (GetHeSupported ())
709  {
710  operation.SetHeSupported (1);
711  uint8_t maxSpatialStream = m_phy->GetMaxSupportedRxSpatialStreams ();
712  for (const auto& sta : m_staList)
713  {
714  if (m_stationManager->GetHeSupported (sta.second))
715  {
716  if (m_stationManager->GetNumberOfSupportedStreams (sta.second) < maxSpatialStream)
717  {
718  maxSpatialStream = m_stationManager->GetNumberOfSupportedStreams (sta.second);
719  }
720  }
721  }
722  for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
723  {
724  operation.SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
725  }
726  operation.SetBssColor (GetHeConfiguration ()->GetBssColor ());
727  }
728  return operation;
729 }
730 
731 void
733 {
734  NS_LOG_FUNCTION (this << to);
735  WifiMacHeader hdr;
737  hdr.SetAddr1 (to);
738  hdr.SetAddr2 (GetAddress ());
739  hdr.SetAddr3 (GetAddress ());
740  hdr.SetDsNotFrom ();
741  hdr.SetDsNotTo ();
742  Ptr<Packet> packet = Create<Packet> ();
744  probe.SetSsid (GetSsid ());
746  probe.SetBeaconIntervalUs (GetBeaconInterval ().GetMicroSeconds ());
747  probe.SetCapabilities (GetCapabilities ());
750  if (GetDsssSupported ())
751  {
753  }
754  if (GetErpSupported ())
755  {
757  }
758  if (GetQosSupported ())
759  {
761  }
762  if (GetHtSupported ())
763  {
766  probe.SetHtOperation (GetHtOperation ());
767  }
768  if (GetVhtSupported ())
769  {
771  probe.SetVhtOperation (GetVhtOperation ());
772  }
773  if (GetHeSupported ())
774  {
776  probe.SetHeOperation (GetHeOperation ());
778  }
779  packet->AddHeader (probe);
780 
781  if (!GetQosSupported ())
782  {
783  m_txop->Queue (packet, hdr);
784  }
785  // "A QoS STA that transmits a Management frame determines access category used
786  // for medium access in transmission of the Management frame as follows
787  // (If dot11QMFActivated is false or not present)
788  // — If the Management frame is individually addressed to a non-QoS STA, category
789  // AC_BE should be selected.
790  // — If category AC_BE was not selected by the previous step, category AC_VO
791  // shall be selected." (Sec. 10.2.3.2 of 802.11-2020)
792  else if (!m_stationManager->GetQosSupported (to))
793  {
794  GetBEQueue ()->Queue (packet, hdr);
795  }
796  else
797  {
798  GetVOQueue ()->Queue (packet, hdr);
799  }
800 }
801 
802 void
803 ApWifiMac::SendAssocResp (Mac48Address to, bool success, bool isReassoc)
804 {
805  NS_LOG_FUNCTION (this << to << success << isReassoc);
806  WifiMacHeader hdr;
808  hdr.SetAddr1 (to);
809  hdr.SetAddr2 (GetAddress ());
810  hdr.SetAddr3 (GetAddress ());
811  hdr.SetDsNotFrom ();
812  hdr.SetDsNotTo ();
813  Ptr<Packet> packet = Create<Packet> ();
815  StatusCode code;
816  if (success)
817  {
818  code.SetSuccess ();
819  uint16_t aid = 0;
820  bool found = false;
821  if (isReassoc)
822  {
823  for (const auto& sta : m_staList)
824  {
825  if (sta.second == to)
826  {
827  aid = sta.first;
828  found = true;
829  break;
830  }
831  }
832  }
833  if (!found)
834  {
835  aid = GetNextAssociationId ();
836  m_staList.insert (std::make_pair (aid, to));
837  m_assocLogger (aid, to);
840  {
842  }
843  if (!m_stationManager->GetHtSupported (to))
844  {
846  }
849  }
850  assoc.SetAssociationId (aid);
851  }
852  else
853  {
854  code.SetFailure ();
855  }
857  assoc.SetStatusCode (code);
858  assoc.SetCapabilities (GetCapabilities ());
859  if (GetErpSupported ())
860  {
862  }
863  if (GetQosSupported ())
864  {
866  }
867  if (GetHtSupported ())
868  {
871  assoc.SetHtOperation (GetHtOperation ());
872  }
873  if (GetVhtSupported ())
874  {
876  assoc.SetVhtOperation (GetVhtOperation ());
877  }
878  if (GetHeSupported ())
879  {
881  assoc.SetHeOperation (GetHeOperation ());
883  }
884  packet->AddHeader (assoc);
885 
886  if (!GetQosSupported ())
887  {
888  m_txop->Queue (packet, hdr);
889  }
890  // "A QoS STA that transmits a Management frame determines access category used
891  // for medium access in transmission of the Management frame as follows
892  // (If dot11QMFActivated is false or not present)
893  // — If the Management frame is individually addressed to a non-QoS STA, category
894  // AC_BE should be selected.
895  // — If category AC_BE was not selected by the previous step, category AC_VO
896  // shall be selected." (Sec. 10.2.3.2 of 802.11-2020)
897  else if (!m_stationManager->GetQosSupported (to))
898  {
899  GetBEQueue ()->Queue (packet, hdr);
900  }
901  else
902  {
903  GetVOQueue ()->Queue (packet, hdr);
904  }
905 }
906 
907 void
909 {
910  NS_LOG_FUNCTION (this);
911  WifiMacHeader hdr;
914  hdr.SetAddr2 (GetAddress ());
915  hdr.SetAddr3 (GetAddress ());
916  hdr.SetDsNotFrom ();
917  hdr.SetDsNotTo ();
918  Ptr<Packet> packet = Create<Packet> ();
919  MgtBeaconHeader beacon;
920  beacon.SetSsid (GetSsid ());
922  beacon.SetBeaconIntervalUs (GetBeaconInterval ().GetMicroSeconds ());
923  beacon.SetCapabilities (GetCapabilities ());
926  if (GetDsssSupported ())
927  {
929  }
930  if (GetErpSupported ())
931  {
933  }
934  if (GetQosSupported ())
935  {
937  }
938  if (GetHtSupported ())
939  {
942  beacon.SetHtOperation (GetHtOperation ());
943  }
944  if (GetVhtSupported ())
945  {
947  beacon.SetVhtOperation (GetVhtOperation ());
948  }
949  if (GetHeSupported ())
950  {
952  beacon.SetHeOperation (GetHeOperation ());
954  }
955  packet->AddHeader (beacon);
956 
957  //The beacon has it's own special queue, so we load it in there
958  m_beaconTxop->Queue (packet, hdr);
960 
961  //If a STA that does not support Short Slot Time associates,
962  //the AP shall use long slot time beginning at the first Beacon
963  //subsequent to the association of the long slot time STA.
964  if (GetErpSupported ())
965  {
967  {
968  //Enable short slot time
969  m_phy->SetSlot (MicroSeconds (9));
970  }
971  else
972  {
973  //Disable short slot time
974  m_phy->SetSlot (MicroSeconds (20));
975  }
976  }
977 }
978 
979 void
981 {
982  NS_LOG_FUNCTION (this << *mpdu);
983  const WifiMacHeader& hdr = mpdu->GetHeader ();
984  if ((hdr.IsAssocResp () || hdr.IsReassocResp ())
986  {
987  NS_LOG_DEBUG ("associated with sta=" << hdr.GetAddr1 ());
989  }
990 }
991 
992 void
994 {
995  NS_LOG_FUNCTION (this << +timeoutReason << *mpdu);
996  const WifiMacHeader& hdr = mpdu->GetHeader ();
997 
998  if ((hdr.IsAssocResp () || hdr.IsReassocResp ())
1000  {
1001  NS_LOG_DEBUG ("association failed with sta=" << hdr.GetAddr1 ());
1003  }
1004 }
1005 
1006 void
1008 {
1009  NS_LOG_FUNCTION (this << *mpdu);
1010  const WifiMacHeader* hdr = &mpdu->GetHeader ();
1011  Ptr<const Packet> packet = mpdu->GetPacket ();
1012  Mac48Address from = hdr->GetAddr2 ();
1013  if (hdr->IsData ())
1014  {
1015  Mac48Address bssid = hdr->GetAddr1 ();
1016  if (!hdr->IsFromDs ()
1017  && hdr->IsToDs ()
1018  && bssid == GetAddress ()
1019  && m_stationManager->IsAssociated (from))
1020  {
1021  Mac48Address to = hdr->GetAddr3 ();
1022  if (to == GetAddress ())
1023  {
1024  NS_LOG_DEBUG ("frame for me from=" << from);
1025  if (hdr->IsQosData ())
1026  {
1027  if (hdr->IsQosAmsdu ())
1028  {
1029  NS_LOG_DEBUG ("Received A-MSDU from=" << from << ", size=" << packet->GetSize ());
1031  packet = 0;
1032  }
1033  else
1034  {
1035  ForwardUp (packet, from, bssid);
1036  }
1037  }
1038  else if (hdr->HasData ())
1039  {
1040  ForwardUp (packet, from, bssid);
1041  }
1042  }
1043  else if (to.IsGroup ()
1044  || m_stationManager->IsAssociated (to))
1045  {
1046  NS_LOG_DEBUG ("forwarding frame from=" << from << ", to=" << to);
1047  Ptr<Packet> copy = packet->Copy ();
1048 
1049  //If the frame we are forwarding is of type QoS Data,
1050  //then we need to preserve the UP in the QoS control
1051  //header...
1052  if (hdr->IsQosData ())
1053  {
1054  ForwardDown (copy, from, to, hdr->GetQosTid ());
1055  }
1056  else
1057  {
1058  ForwardDown (copy, from, to);
1059  }
1060  ForwardUp (packet, from, to);
1061  }
1062  else
1063  {
1064  ForwardUp (packet, from, to);
1065  }
1066  }
1067  else if (hdr->IsFromDs ()
1068  && hdr->IsToDs ())
1069  {
1070  //this is an AP-to-AP frame
1071  //we ignore for now.
1072  NotifyRxDrop (packet);
1073  }
1074  else
1075  {
1076  //we can ignore these frames since
1077  //they are not targeted at the AP
1078  NotifyRxDrop (packet);
1079  }
1080  return;
1081  }
1082  else if (hdr->IsMgt ())
1083  {
1084  if (hdr->IsProbeReq ())
1085  {
1086  NS_ASSERT (hdr->GetAddr1 ().IsBroadcast ());
1087  MgtProbeRequestHeader probeRequestHeader;
1088  packet->PeekHeader (probeRequestHeader);
1089  Ssid ssid = probeRequestHeader.GetSsid ();
1090  if (ssid == GetSsid () || ssid.IsBroadcast ())
1091  {
1092  NS_LOG_DEBUG ("Probe request received from " << from << ": send probe response");
1093  SendProbeResp (from);
1094  }
1095  return;
1096  }
1097  else if (hdr->GetAddr1 () == GetAddress ())
1098  {
1099  if (hdr->IsAssocReq ())
1100  {
1101  NS_LOG_DEBUG ("Association request received from " << from);
1102  //first, verify that the the station's supported
1103  //rate set is compatible with our Basic Rate set
1104  MgtAssocRequestHeader assocReq;
1105  packet->PeekHeader (assocReq);
1106  CapabilityInformation capabilities = assocReq.GetCapabilities ();
1107  m_stationManager->AddSupportedPhyPreamble (from, capabilities.IsShortPreamble ());
1108  SupportedRates rates = assocReq.GetSupportedRates ();
1109  bool problem = false;
1110  if (rates.GetNRates () == 0)
1111  {
1112  problem = true;
1113  }
1114  if (GetHtSupported ())
1115  {
1116  //check whether the HT STA supports all MCSs in Basic MCS Set
1117  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
1118  if (htcapabilities.IsSupportedMcs (0))
1119  {
1120  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1121  {
1123  if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1124  {
1125  problem = true;
1126  break;
1127  }
1128  }
1129  }
1130  }
1131  if (GetVhtSupported ())
1132  {
1133  //check whether the VHT STA supports all MCSs in Basic MCS Set
1134  VhtCapabilities vhtcapabilities = assocReq.GetVhtCapabilities ();
1135  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
1136  {
1137  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1138  {
1140  if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1141  {
1142  problem = true;
1143  break;
1144  }
1145  }
1146  }
1147  }
1148  if (GetHeSupported ())
1149  {
1150  //check whether the HE STA supports all MCSs in Basic MCS Set
1151  HeCapabilities hecapabilities = assocReq.GetHeCapabilities ();
1152  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1153  {
1154  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1155  {
1157  if (!hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1158  {
1159  problem = true;
1160  break;
1161  }
1162  }
1163  }
1164  }
1165  if (problem)
1166  {
1167  NS_LOG_DEBUG ("One of the Basic Rate set mode is not supported by the station: send association response with an error status");
1168  SendAssocResp (hdr->GetAddr2 (), false, false);
1169  }
1170  else
1171  {
1172  NS_LOG_DEBUG ("The Basic Rate set modes are supported by the station");
1173  //record all its supported modes in its associated WifiRemoteStation
1174  for (const auto & mode : m_phy->GetModeList ())
1175  {
1176  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1177  {
1178  m_stationManager->AddSupportedMode (from, mode);
1179  }
1180  }
1181  if (GetErpSupported () && m_stationManager->GetErpOfdmSupported (from) && capabilities.IsShortSlotTime ())
1182  {
1184  }
1185  if (GetHtSupported ())
1186  {
1187  HtCapabilities htCapabilities = assocReq.GetHtCapabilities ();
1188  if (htCapabilities.IsSupportedMcs (0))
1189  {
1190  m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1191  }
1192  }
1193  if (GetVhtSupported ())
1194  {
1195  VhtCapabilities vhtCapabilities = assocReq.GetVhtCapabilities ();
1196  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1197  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1198  {
1199  m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1200  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
1201  {
1202  if (vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1203  {
1204  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1205  //here should add a control to add basic MCS when it is implemented
1206  }
1207  }
1208  }
1209  }
1210  if (GetHtSupported ())
1211  {
1212  ExtendedCapabilities extendedCapabilities = assocReq.GetExtendedCapabilities ();
1213  //TODO: to be completed
1214  }
1215  if (GetHeSupported ())
1216  {
1217  HeCapabilities heCapabilities = assocReq.GetHeCapabilities ();
1218  if (heCapabilities.GetSupportedMcsAndNss () != 0)
1219  {
1220  m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1221  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
1222  {
1223  if (heCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1224  {
1225  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1226  //here should add a control to add basic MCS when it is implemented
1227  }
1228  }
1229  }
1230  }
1232  NS_LOG_DEBUG ("Send association response with success status");
1233  SendAssocResp (hdr->GetAddr2 (), true, false);
1234  }
1235  return;
1236  }
1237  else if (hdr->IsReassocReq ())
1238  {
1239  NS_LOG_DEBUG ("Reassociation request received from " << from);
1240  //first, verify that the the station's supported
1241  //rate set is compatible with our Basic Rate set
1242  MgtReassocRequestHeader reassocReq;
1243  packet->PeekHeader (reassocReq);
1244  CapabilityInformation capabilities = reassocReq.GetCapabilities ();
1245  m_stationManager->AddSupportedPhyPreamble (from, capabilities.IsShortPreamble ());
1246  SupportedRates rates = reassocReq.GetSupportedRates ();
1247  bool problem = false;
1248  if (rates.GetNRates () == 0)
1249  {
1250  problem = true;
1251  }
1252  if (GetHtSupported ())
1253  {
1254  //check whether the HT STA supports all MCSs in Basic MCS Set
1255  HtCapabilities htcapabilities = reassocReq.GetHtCapabilities ();
1256  if (htcapabilities.IsSupportedMcs (0))
1257  {
1258  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1259  {
1261  if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1262  {
1263  problem = true;
1264  break;
1265  }
1266  }
1267  }
1268  }
1269  if (GetVhtSupported ())
1270  {
1271  //check whether the VHT STA supports all MCSs in Basic MCS Set
1272  VhtCapabilities vhtcapabilities = reassocReq.GetVhtCapabilities ();
1273  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
1274  {
1275  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1276  {
1278  if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1279  {
1280  problem = true;
1281  break;
1282  }
1283  }
1284  }
1285  }
1286  if (GetHeSupported ())
1287  {
1288  //check whether the HE STA supports all MCSs in Basic MCS Set
1289  HeCapabilities hecapabilities = reassocReq.GetHeCapabilities ();
1290  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1291  {
1292  for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1293  {
1295  if (!hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1296  {
1297  problem = true;
1298  break;
1299  }
1300  }
1301  }
1302  }
1303  if (problem)
1304  {
1305  NS_LOG_DEBUG ("One of the Basic Rate set mode is not supported by the station: send reassociation response with an error status");
1306  SendAssocResp (hdr->GetAddr2 (), false, true);
1307  }
1308  else
1309  {
1310  NS_LOG_DEBUG ("The Basic Rate set modes are supported by the station");
1311  //update all its supported modes in its associated WifiRemoteStation
1312  for (const auto & mode : m_phy->GetModeList ())
1313  {
1314  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1315  {
1316  m_stationManager->AddSupportedMode (from, mode);
1317  }
1318  }
1319  if (GetErpSupported () && m_stationManager->GetErpOfdmSupported (from) && capabilities.IsShortSlotTime ())
1320  {
1322  }
1323  if (GetHtSupported ())
1324  {
1325  HtCapabilities htCapabilities = reassocReq.GetHtCapabilities ();
1326  if (htCapabilities.IsSupportedMcs (0))
1327  {
1328  m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1329  }
1330  }
1331  if (GetVhtSupported ())
1332  {
1333  VhtCapabilities vhtCapabilities = reassocReq.GetVhtCapabilities ();
1334  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1335  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1336  {
1337  m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1338  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
1339  {
1340  if (vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1341  {
1342  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1343  //here should add a control to add basic MCS when it is implemented
1344  }
1345  }
1346  }
1347  }
1348  if (GetHtSupported ())
1349  {
1350  ExtendedCapabilities extendedCapabilities = reassocReq.GetExtendedCapabilities ();
1351  //TODO: to be completed
1352  }
1353  if (GetHeSupported ())
1354  {
1355  HeCapabilities heCapabilities = reassocReq.GetHeCapabilities ();
1356  if (heCapabilities.GetSupportedMcsAndNss () != 0)
1357  {
1358  m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1359  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
1360  {
1361  if (heCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1362  {
1363  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1364  //here should add a control to add basic MCS when it is implemented
1365  }
1366  }
1367  }
1368  }
1370  NS_LOG_DEBUG ("Send reassociation response with success status");
1371  SendAssocResp (hdr->GetAddr2 (), true, true);
1372  }
1373  return;
1374  }
1375  else if (hdr->IsDisassociation ())
1376  {
1377  NS_LOG_DEBUG ("Disassociation received from " << from);
1379  for (auto it = m_staList.begin (); it != m_staList.end (); ++it)
1380  {
1381  if (it->second == from)
1382  {
1383  m_staList.erase (it);
1384  m_deAssocLogger (it->first, it->second);
1386  {
1388  }
1389  if (!m_stationManager->GetHtSupported (from))
1390  {
1392  }
1395  break;
1396  }
1397  }
1398  return;
1399  }
1400  }
1401  }
1402 
1403  //Invoke the receive handler of our parent class to deal with any
1404  //other frames. Specifically, this will handle Block Ack-related
1405  //Management Action frames.
1406  RegularWifiMac::Receive (Create<WifiMacQueueItem> (packet, *hdr));
1407 }
1408 
1409 void
1411 {
1412  NS_LOG_FUNCTION (this << *mpdu);
1413  for (auto& i : *PeekPointer (mpdu))
1414  {
1415  if (i.second.GetDestinationAddr () == GetAddress ())
1416  {
1417  ForwardUp (i.first, i.second.GetSourceAddr (),
1418  i.second.GetDestinationAddr ());
1419  }
1420  else
1421  {
1422  Mac48Address from = i.second.GetSourceAddr ();
1423  Mac48Address to = i.second.GetDestinationAddr ();
1424  NS_LOG_DEBUG ("forwarding QoS frame from=" << from << ", to=" << to);
1425  ForwardDown (i.first->Copy (), from, to, mpdu->GetHeader ().GetQosTid ());
1426  }
1427  }
1428 }
1429 
1430 void
1432 {
1433  NS_LOG_FUNCTION (this);
1435  m_beaconEvent.Cancel ();
1437  {
1439  {
1440  Time jitter = MicroSeconds (static_cast<int64_t> (m_beaconJitter->GetValue (0, 1) * (GetBeaconInterval ().GetMicroSeconds ())));
1441  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time " << jitter);
1443  }
1444  else
1445  {
1446  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time 0");
1448  }
1449  }
1455 }
1456 
1457 bool
1459 {
1460  bool useProtection = (m_numNonErpStations > 0) && m_enableNonErpProtection;
1461  m_stationManager->SetUseNonErpProtection (useProtection);
1462  return useProtection;
1463 }
1464 
1465 uint16_t
1467 {
1468  //Return the first free AID value between 1 and 2007
1469  for (uint16_t nextAid = 1; nextAid <= 2007; nextAid++)
1470  {
1471  if (m_staList.find (nextAid) == m_staList.end ())
1472  {
1473  return nextAid;
1474  }
1475  }
1476  NS_FATAL_ERROR ("No free association ID available!");
1477  return 0;
1478 }
1479 
1480 const std::map<uint16_t, Mac48Address>&
1482 {
1483  return m_staList;
1484 }
1485 
1486 uint16_t
1488 {
1489  return m_stationManager->GetAssociationId (addr);
1490 }
1491 
1492 uint8_t
1494 {
1495  auto it = m_bufferStatus.find (WifiAddressTidPair (address, tid));
1496  if (it == m_bufferStatus.end ()
1497  || it->second.timestamp + m_bsrLifetime < Simulator::Now ())
1498  {
1499  return 255;
1500  }
1501  return it->second.value;
1502 }
1503 
1504 void
1506 {
1507  if (size == 255)
1508  {
1509  // no point in storing an unspecified size
1510  m_bufferStatus.erase (WifiAddressTidPair (address, tid));
1511  }
1512  else
1513  {
1515  }
1516 }
1517 
1518 uint8_t
1520 {
1521  uint8_t maxSize = 0;
1522  bool found = false;
1523 
1524  for (uint8_t tid = 0; tid < 8; tid++)
1525  {
1526  uint8_t size = GetBufferStatus (tid, address);
1527  if (size != 255)
1528  {
1529  maxSize = std::max (maxSize, size);
1530  found = true;
1531  }
1532  }
1533 
1534  if (found)
1535  {
1536  return maxSize;
1537  }
1538  return 255;
1539 }
1540 
1541 } //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:1431
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:383
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:66
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:99
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:187
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:119
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:173
ns3::WifiMacDropReason
WifiMacDropReason
The reason why an MPDU was dropped.
Definition: wifi-mac.h:55
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:734
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:1410
ns3::ApWifiMac::GetHeOperation
HeOperation GetHeOperation(void) const
Return the HE operation of the current AP.
Definition: ap-wifi-mac.cc:704
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:122
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:574
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:130
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:132
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:740
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::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:667
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:1481
ns3::ApWifiMac::GetDsssParameterSet
DsssParameterSet GetDsssParameterSet(void) const
Return the DSSS Parameter Set that we support.
Definition: ap-wifi-mac.cc:426
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:980
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:677
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::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::AC_BEACON
@ AC_BEACON
Beacon queue.
Definition: qos-utils.h:83
ns3::Simulator::Schedule
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:556
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:598
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:52
ns3::WifiMacQueueItem::GetHeader
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Definition: wifi-mac-queue-item.cc:72
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:280
ns3::RegularWifiMac::GetQosSupported
bool GetQosSupported() const
Return whether the device supports QoS.
Definition: regular-wifi-mac.cc:641
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:191
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
wifi-mac-queue.h
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:161
ns3::ApWifiMac::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: ap-wifi-mac.cc:49
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:721
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:127
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
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
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::WifiRemoteStationManager::GetQosSupported
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
Definition: wifi-remote-station-manager.cc:432
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:241
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:233
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:439
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:657
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:714
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:83
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::ApWifiMac::GetTxopQueue
Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const override
Get the wifi MAC queue of the (Qos)Txop associated with the given AC.
Definition: ap-wifi-mac.cc:147
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:908
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::Txop::GetWifiMacQueue
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
Definition: txop.cc:154
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:233
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:771
ns3::WifiMacHeader::NORMAL_ACK
@ NORMAL_ACK
Definition: wifi-mac-header.h:92
ns3::WifiMac::GetHeConfiguration
Ptr< HeConfiguration > GetHeConfiguration(void) const
Definition: wifi-mac.cc:201
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:223
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:732
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:157
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:497
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:803
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:259
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:1519
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:663
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:795
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:1493
ns3::ApWifiMac::SetLinkUpCallback
void SetLinkUpCallback(Callback< void > linkUp) override
Definition: ap-wifi-mac.cc:179
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::RegularWifiMac::GetTxopQueue
virtual Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const
Get the wifi MAC queue of the (Qos)Txop associated with the given AC.
Definition: regular-wifi-mac.cc:552
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:1487
ns3::ApWifiMac::UpdateShortPreambleEnabled
void UpdateShortPreambleEnabled(void)
Update whether short preamble should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:236
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:211
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:172
ns3::WifiMac::GetHtConfiguration
Ptr< HtConfiguration > GetHtConfiguration(void) const
Definition: wifi-mac.cc:187
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:1007
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:198
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:136
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:276
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:337
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:137
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:222
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:214
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:68
ns3::AcIndex
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:71
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:218
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:520
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:219
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::ApWifiMac::TxFailed
void TxFailed(WifiMacDropReason timeoutReason, Ptr< const WifiMacQueueItem > mpdu)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:993
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:701
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:254
ns3::ApWifiMac::SupportsSendFrom
bool SupportsSendFrom(void) const override
Definition: ap-wifi-mac.cc:376
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::RegularWifiMac::GetBEQueue
Ptr< QosTxop > GetBEQueue(void) const
Accessor for the AC_BE channel access function.
Definition: regular-wifi-mac.cc:540
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:220
ns3::ApWifiMac::GetEdcaParameterSet
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set of the current AP.
Definition: ap-wifi-mac.cc:472
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:450
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:126
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:131
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::RegularWifiMac::GetVOQueue
Ptr< QosTxop > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
Definition: regular-wifi-mac.cc:528
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:129
ns3::ApWifiMac::GetUseNonErpProtection
bool GetUseNonErpProtection(void) const
Return whether protection for non-ERP stations is used in the BSS.
Definition: ap-wifi-mac.cc:1458
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:206
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:647
ns3::Txop::Queue
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:294
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:1505
ns3::Simulator::ScheduleNow
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:587
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:802
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:247
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:366
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:1466
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