A Discrete-Event Network Simulator
API
sta-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 "sta-wifi-mac.h"
27 #include "wifi-phy.h"
28 #include "mgt-headers.h"
29 #include "snr-tag.h"
30 #include "wifi-net-device.h"
31 #include "ns3/ht-configuration.h"
32 #include "ns3/he-configuration.h"
33 
34 namespace ns3 {
35 
36 NS_LOG_COMPONENT_DEFINE ("StaWifiMac");
37 
38 NS_OBJECT_ENSURE_REGISTERED (StaWifiMac);
39 
40 TypeId
42 {
43  static TypeId tid = TypeId ("ns3::StaWifiMac")
45  .SetGroupName ("Wifi")
46  .AddConstructor<StaWifiMac> ()
47  .AddAttribute ("ProbeRequestTimeout", "The duration to actively probe the channel.",
48  TimeValue (Seconds (0.05)),
50  MakeTimeChecker ())
51  .AddAttribute ("WaitBeaconTimeout", "The duration to dwell on a channel while passively scanning for beacon",
52  TimeValue (MilliSeconds (120)),
54  MakeTimeChecker ())
55  .AddAttribute ("AssocRequestTimeout", "The interval between two consecutive association request attempts.",
56  TimeValue (Seconds (0.5)),
58  MakeTimeChecker ())
59  .AddAttribute ("MaxMissedBeacons",
60  "Number of beacons which much be consecutively missed before "
61  "we attempt to restart association.",
62  UintegerValue (10),
64  MakeUintegerChecker<uint32_t> ())
65  .AddAttribute ("ActiveProbing",
66  "If true, we send probe requests. If false, we don't."
67  "NOTE: if more than one STA in your simulation is using active probing, "
68  "you should enable it at a different simulation time for each STA, "
69  "otherwise all the STAs will start sending probes at the same time resulting in collisions. "
70  "See bug 1060 for more info.",
71  BooleanValue (false),
74  .AddTraceSource ("Assoc", "Associated with an access point.",
76  "ns3::Mac48Address::TracedCallback")
77  .AddTraceSource ("DeAssoc", "Association with an access point lost.",
79  "ns3::Mac48Address::TracedCallback")
80  .AddTraceSource ("BeaconArrival",
81  "Time of beacons arrival from associated AP",
83  "ns3::Time::TracedCallback")
84  ;
85  return tid;
86 }
87 
89  : m_state (UNASSOCIATED),
90  m_aid (0),
91  m_waitBeaconEvent (),
92  m_probeRequestEvent (),
93  m_assocRequestEvent (),
94  m_beaconWatchdogEnd (Seconds (0))
95 {
96  NS_LOG_FUNCTION (this);
97 
98  //Let the lower layers know that we are acting as a non-AP STA in
99  //an infrastructure BSS.
101 }
102 
103 void
105 {
106  NS_LOG_FUNCTION (this);
107  StartScanning ();
108 }
109 
111 {
112  NS_LOG_FUNCTION (this);
113 }
114 
115 uint16_t
117 {
118  NS_ASSERT_MSG (IsAssociated (), "This station is not associated to any AP");
119  return m_aid;
120 }
121 
122 void
124 {
125  NS_LOG_FUNCTION (this << enable);
126  m_activeProbing = enable;
128  {
129  NS_LOG_DEBUG ("STA is still scanning, reset scanning process");
130  StartScanning ();
131  }
132 }
133 
134 bool
136 {
137  return m_activeProbing;
138 }
139 
140 void
142 {
143  NS_LOG_FUNCTION (this << phy);
146 }
147 
148 void
150 {
151  NS_LOG_FUNCTION (this);
152  WifiMacHeader hdr;
155  hdr.SetAddr2 (GetAddress ());
157  hdr.SetDsNotFrom ();
158  hdr.SetDsNotTo ();
159  Ptr<Packet> packet = Create<Packet> ();
160  MgtProbeRequestHeader probe;
161  probe.SetSsid (GetSsid ());
163  if (GetHtSupported ())
164  {
167  }
168  if (GetVhtSupported ())
169  {
171  }
172  if (GetHeSupported ())
173  {
175  }
176  packet->AddHeader (probe);
177 
178  if (!GetQosSupported ())
179  {
180  m_txop->Queue (packet, hdr);
181  }
182  // "A QoS STA that transmits a Management frame determines access category used
183  // for medium access in transmission of the Management frame as follows
184  // (If dot11QMFActivated is false or not present)
185  // — If the Management frame is individually addressed to a non-QoS STA, category
186  // AC_BE should be selected.
187  // — If category AC_BE was not selected by the previous step, category AC_VO
188  // shall be selected." (Sec. 10.2.3.2 of 802.11-2020)
189  else
190  {
191  GetVOQueue ()->Queue (packet, hdr);
192  }
193 }
194 
195 void
197 {
198  NS_LOG_FUNCTION (this << GetBssid () << isReassoc);
199  WifiMacHeader hdr;
201  hdr.SetAddr1 (GetBssid ());
202  hdr.SetAddr2 (GetAddress ());
203  hdr.SetAddr3 (GetBssid ());
204  hdr.SetDsNotFrom ();
205  hdr.SetDsNotTo ();
206  Ptr<Packet> packet = Create<Packet> ();
207  if (!isReassoc)
208  {
209  MgtAssocRequestHeader assoc;
210  assoc.SetSsid (GetSsid ());
212  assoc.SetCapabilities (GetCapabilities ());
213  assoc.SetListenInterval (0);
214  if (GetHtSupported ())
215  {
218  }
219  if (GetVhtSupported ())
220  {
222  }
223  if (GetHeSupported ())
224  {
226  }
227  packet->AddHeader (assoc);
228  }
229  else
230  {
231  MgtReassocRequestHeader reassoc;
232  reassoc.SetCurrentApAddress (GetBssid ());
233  reassoc.SetSsid (GetSsid ());
235  reassoc.SetCapabilities (GetCapabilities ());
236  reassoc.SetListenInterval (0);
237  if (GetHtSupported ())
238  {
241  }
242  if (GetVhtSupported ())
243  {
245  }
246  if (GetHeSupported ())
247  {
249  }
250  packet->AddHeader (reassoc);
251  }
252 
253  if (!GetQosSupported ())
254  {
255  m_txop->Queue (packet, hdr);
256  }
257  // "A QoS STA that transmits a Management frame determines access category used
258  // for medium access in transmission of the Management frame as follows
259  // (If dot11QMFActivated is false or not present)
260  // — If the Management frame is individually addressed to a non-QoS STA, category
261  // AC_BE should be selected.
262  // — If category AC_BE was not selected by the previous step, category AC_VO
263  // shall be selected." (Sec. 10.2.3.2 of 802.11-2020)
264  else if (!m_stationManager->GetQosSupported (GetBssid ()))
265  {
266  GetBEQueue ()->Queue (packet, hdr);
267  }
268  else
269  {
270  GetVOQueue ()->Queue (packet, hdr);
271  }
272 
274  {
276  }
279 }
280 
281 void
283 {
284  NS_LOG_FUNCTION (this);
285  switch (m_state)
286  {
287  case ASSOCIATED:
288  return;
289  break;
290  case WAIT_PROBE_RESP:
291  /* we have sent a probe request earlier so we
292  do not need to re-send a probe request immediately.
293  We just need to wait until probe-request-timeout
294  or until we get a probe response
295  */
296  break;
297  case WAIT_BEACON:
298  /* we have initiated passive scanning, continue to wait
299  and gather beacons
300  */
301  break;
302  case UNASSOCIATED:
303  /* we were associated but we missed a bunch of beacons
304  * so we should assume we are not associated anymore.
305  * We try to initiate a scan now.
306  */
307  m_linkDown ();
308  StartScanning ();
309  break;
310  case WAIT_ASSOC_RESP:
311  /* we have sent an association request so we do not need to
312  re-send an association request right now. We just need to
313  wait until either assoc-request-timeout or until
314  we get an association response.
315  */
316  break;
317  case REFUSED:
318  /* we have sent an association request and received a negative
319  association response. We wait until someone restarts an
320  association with a given SSID.
321  */
322  break;
323  }
324 }
325 
326 void
328 {
329  NS_LOG_FUNCTION (this);
330  m_candidateAps.clear ();
332  {
334  }
336  {
338  }
339  if (GetActiveProbing ())
340  {
342  SendProbeRequest ();
345  this);
346  }
347  else
348  {
352  this);
353  }
354 }
355 
356 void
358 {
359  NS_LOG_FUNCTION (this);
360  if (!m_candidateAps.empty ())
361  {
362  ApInfo bestAp = m_candidateAps.front();
363  m_candidateAps.erase(m_candidateAps.begin ());
364  NS_LOG_DEBUG ("Attempting to associate with BSSID " << bestAp.m_bssid);
365  Time beaconInterval;
366  if (bestAp.m_activeProbing)
367  {
368  UpdateApInfoFromProbeResp (bestAp.m_probeResp, bestAp.m_apAddr, bestAp.m_bssid);
369  beaconInterval = MicroSeconds (bestAp.m_probeResp.GetBeaconIntervalUs ());
370  }
371  else
372  {
373  UpdateApInfoFromBeacon (bestAp.m_beacon, bestAp.m_apAddr, bestAp.m_bssid);
374  beaconInterval = MicroSeconds (bestAp.m_beacon.GetBeaconIntervalUs ());
375  }
376 
377  Time delay = beaconInterval * m_maxMissedBeacons;
378  RestartBeaconWatchdog (delay);
380  SendAssociationRequest (false);
381  }
382  else
383  {
384  NS_LOG_DEBUG ("Exhausted list of candidate AP; restart scanning");
385  StartScanning ();
386  }
387 }
388 
389 void
391 {
392  NS_LOG_FUNCTION (this);
394  SendAssociationRequest (false);
395 }
396 
397 void
399 {
400  NS_LOG_FUNCTION (this);
402  {
404  {
406  }
409  return;
410  }
411  NS_LOG_DEBUG ("beacon missed");
412  // We need to switch to the UNASSOCIATED state. However, if we are receiving
413  // a frame, wait until the RX is completed (otherwise, crashes may occur if
414  // we are receiving a MU frame because its reception requires the STA-ID)
415  Time delay = Seconds (0);
416  if (m_phy->IsStateRx ())
417  {
418  delay = m_phy->GetDelayUntilIdle ();
419  }
422 }
423 
424 void
426 {
427  NS_LOG_FUNCTION (this << delay);
431  {
432  NS_LOG_DEBUG ("really restart watchdog.");
434  }
435 }
436 
437 bool
439 {
440  return m_state == ASSOCIATED;
441 }
442 
443 bool
445 {
446  return m_state == WAIT_ASSOC_RESP;
447 }
448 
449 void
451 {
452  NS_LOG_FUNCTION (this << packet << to);
453  if (!IsAssociated ())
454  {
455  NotifyTxDrop (packet);
457  return;
458  }
459  WifiMacHeader hdr;
460 
461  //If we are not a QoS AP then we definitely want to use AC_BE to
462  //transmit the packet. A TID of zero will map to AC_BE (through \c
463  //QosUtilsMapTidToAc()), so we use that as our default here.
464  uint8_t tid = 0;
465 
466  //For now, an AP that supports QoS does not support non-QoS
467  //associations, and vice versa. In future the AP model should
468  //support simultaneously associated QoS and non-QoS STAs, at which
469  //point there will need to be per-association QoS state maintained
470  //by the association state machine, and consulted here.
471  if (GetQosSupported ())
472  {
475  hdr.SetQosNoEosp ();
476  hdr.SetQosNoAmsdu ();
477  //Transmission of multiple frames in the same TXOP is not
478  //supported for now
479  hdr.SetQosTxopLimit (0);
480 
481  //Fill in the QoS control field in the MAC header
482  tid = QosUtilsGetTidForPacket (packet);
483  //Any value greater than 7 is invalid and likely indicates that
484  //the packet had no QoS tag, so we revert to zero, which'll
485  //mean that AC_BE is used.
486  if (tid > 7)
487  {
488  tid = 0;
489  }
490  hdr.SetQosTid (tid);
491  }
492  else
493  {
494  hdr.SetType (WIFI_MAC_DATA);
495  }
496  if (GetQosSupported ())
497  {
498  hdr.SetNoOrder (); // explicitly set to 0 for the time being since HT control field is not yet implemented (set it to 1 when implemented)
499  }
500 
501  hdr.SetAddr1 (GetBssid ());
502  hdr.SetAddr2 (GetAddress ());
503  hdr.SetAddr3 (to);
504  hdr.SetDsNotFrom ();
505  hdr.SetDsTo ();
506 
507  if (GetQosSupported ())
508  {
509  //Sanity check that the TID is valid
510  NS_ASSERT (tid < 8);
511  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
512  }
513  else
514  {
515  m_txop->Queue (packet, hdr);
516  }
517 }
518 
519 void
521 {
522  NS_LOG_FUNCTION (this << *mpdu);
523  const WifiMacHeader* hdr = &mpdu->GetHeader ();
524  Ptr<const Packet> packet = mpdu->GetPacket ();
525  NS_ASSERT (!hdr->IsCtl ());
526  if (hdr->GetAddr3 () == GetAddress ())
527  {
528  NS_LOG_LOGIC ("packet sent by us.");
529  return;
530  }
531  else if (hdr->GetAddr1 () != GetAddress ()
532  && !hdr->GetAddr1 ().IsGroup ())
533  {
534  NS_LOG_LOGIC ("packet is not for us");
535  NotifyRxDrop (packet);
536  return;
537  }
538  if (hdr->IsData ())
539  {
540  if (!IsAssociated ())
541  {
542  NS_LOG_LOGIC ("Received data frame while not associated: ignore");
543  NotifyRxDrop (packet);
544  return;
545  }
546  if (!(hdr->IsFromDs () && !hdr->IsToDs ()))
547  {
548  NS_LOG_LOGIC ("Received data frame not from the DS: ignore");
549  NotifyRxDrop (packet);
550  return;
551  }
552  if (hdr->GetAddr2 () != GetBssid ())
553  {
554  NS_LOG_LOGIC ("Received data frame not from the BSS we are associated with: ignore");
555  NotifyRxDrop (packet);
556  return;
557  }
558  if (hdr->IsQosData ())
559  {
560  if (hdr->IsQosAmsdu ())
561  {
562  NS_ASSERT (hdr->GetAddr3 () == GetBssid ());
564  packet = 0;
565  }
566  else
567  {
568  ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ());
569  }
570  }
571  else if (hdr->HasData ())
572  {
573  ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ());
574  }
575  return;
576  }
577  else if (hdr->IsProbeReq ()
578  || hdr->IsAssocReq ()
579  || hdr->IsReassocReq ())
580  {
581  //This is a frame aimed at an AP, so we can safely ignore it.
582  NotifyRxDrop (packet);
583  return;
584  }
585  else if (hdr->IsBeacon ())
586  {
587  NS_LOG_DEBUG ("Beacon received");
588  MgtBeaconHeader beacon;
589  Ptr<Packet> copy = packet->Copy ();
590  copy->RemoveHeader (beacon);
591  CapabilityInformation capabilities = beacon.GetCapabilities ();
592  NS_ASSERT (capabilities.IsEss ());
593  bool goodBeacon = false;
594  if (GetSsid ().IsBroadcast ()
595  || beacon.GetSsid ().IsEqual (GetSsid ()))
596  {
597  NS_LOG_LOGIC ("Beacon is for our SSID");
598  goodBeacon = true;
599  }
600  SupportedRates rates = beacon.GetSupportedRates ();
601  bool bssMembershipSelectorMatch = false;
602  auto selectorList = m_phy->GetBssMembershipSelectorList ();
603  for (const auto & selector : selectorList)
604  {
605  if (rates.IsBssMembershipSelectorRate (selector))
606  {
607  NS_LOG_LOGIC ("Beacon is matched to our BSS membership selector");
608  bssMembershipSelectorMatch = true;
609  }
610  }
611  if (selectorList.size () > 0 && bssMembershipSelectorMatch == false)
612  {
613  NS_LOG_LOGIC ("No match for BSS membership selector");
614  goodBeacon = false;
615  }
616  if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ())
617  {
618  NS_LOG_LOGIC ("Beacon is not for us");
619  goodBeacon = false;
620  }
621  if (goodBeacon && m_state == ASSOCIATED)
622  {
625  RestartBeaconWatchdog (delay);
626  UpdateApInfoFromBeacon (beacon, hdr->GetAddr2 (), hdr->GetAddr3 ());
627  }
628  if (goodBeacon && m_state == WAIT_BEACON)
629  {
630  NS_LOG_DEBUG ("Beacon received while scanning from " << hdr->GetAddr2 ());
631  SnrTag snrTag;
632  bool removed = copy->RemovePacketTag (snrTag);
633  NS_ASSERT (removed);
634  ApInfo apInfo;
635  apInfo.m_apAddr = hdr->GetAddr2 ();
636  apInfo.m_bssid = hdr->GetAddr3 ();
637  apInfo.m_activeProbing = false;
638  apInfo.m_snr = snrTag.Get ();
639  apInfo.m_beacon = beacon;
640  UpdateCandidateApList (apInfo);
641  }
642  return;
643  }
644  else if (hdr->IsProbeResp ())
645  {
646  if (m_state == WAIT_PROBE_RESP)
647  {
648  NS_LOG_DEBUG ("Probe response received while scanning from " << hdr->GetAddr2 ());
649  MgtProbeResponseHeader probeResp;
650  Ptr<Packet> copy = packet->Copy ();
651  copy->RemoveHeader (probeResp);
652  if (!probeResp.GetSsid ().IsEqual (GetSsid ()))
653  {
654  NS_LOG_DEBUG ("Probe response is not for our SSID");
655  return;
656  }
657  SnrTag snrTag;
658  bool removed = copy->RemovePacketTag (snrTag);
659  NS_ASSERT (removed);
660  ApInfo apInfo;
661  apInfo.m_apAddr = hdr->GetAddr2 ();
662  apInfo.m_bssid = hdr->GetAddr3 ();
663  apInfo.m_activeProbing = true;
664  apInfo.m_snr = snrTag.Get ();
665  apInfo.m_probeResp = probeResp;
666  UpdateCandidateApList (apInfo);
667  }
668  return;
669  }
670  else if (hdr->IsAssocResp () || hdr->IsReassocResp ())
671  {
672  if (m_state == WAIT_ASSOC_RESP)
673  {
674  MgtAssocResponseHeader assocResp;
675  packet->PeekHeader (assocResp);
677  {
679  }
680  if (assocResp.GetStatusCode ().IsSuccess ())
681  {
683  m_aid = assocResp.GetAssociationId ();
684  if (hdr->IsReassocResp ())
685  {
686  NS_LOG_DEBUG ("reassociation done");
687  }
688  else
689  {
690  NS_LOG_DEBUG ("association completed");
691  }
692  UpdateApInfoFromAssocResp (assocResp, hdr->GetAddr2 ());
693  if (!m_linkUp.IsNull ())
694  {
695  m_linkUp ();
696  }
697  }
698  else
699  {
700  NS_LOG_DEBUG ("association refused");
701  if (m_candidateAps.empty ())
702  {
703  SetState (REFUSED);
704  }
705  else
706  {
707  ScanningTimeout ();
708  }
709  }
710  }
711  return;
712  }
713 
714  //Invoke the receive handler of our parent class to deal with any
715  //other frames. Specifically, this will handle Block Ack-related
716  //Management Action frames.
717  RegularWifiMac::Receive (Create<WifiMacQueueItem> (packet, *hdr));
718 }
719 
720 void
722 {
723  NS_LOG_FUNCTION (this << newApInfo.m_bssid << newApInfo.m_apAddr << newApInfo.m_snr << newApInfo.m_activeProbing << newApInfo.m_beacon << newApInfo.m_probeResp);
724  // Remove duplicate ApInfo entry
725  for (std::vector<ApInfo>::iterator i = m_candidateAps.begin(); i != m_candidateAps.end(); ++i)
726  {
727  if (newApInfo.m_bssid == (*i).m_bssid)
728  {
729  m_candidateAps.erase(i);
730  break;
731  }
732  }
733  // Insert before the entry with lower SNR
734  for (std::vector<ApInfo>::iterator i = m_candidateAps.begin(); i != m_candidateAps.end(); ++i)
735  {
736  if (newApInfo.m_snr > (*i).m_snr)
737  {
738  m_candidateAps.insert (i, newApInfo);
739  return;
740  }
741  }
742  // If new ApInfo is the lowest, insert at back
743  m_candidateAps.push_back(newApInfo);
744 }
745 
746 void
748 {
749  NS_LOG_FUNCTION (this << beacon << apAddr << bssid);
750  SetBssid (bssid);
751  CapabilityInformation capabilities = beacon.GetCapabilities ();
752  SupportedRates rates = beacon.GetSupportedRates ();
753  for (const auto & mode : m_phy->GetModeList ())
754  {
755  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
756  {
757  m_stationManager->AddSupportedMode (apAddr, mode);
758  }
759  }
760  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
761  if (GetErpSupported ())
762  {
763  ErpInformation erpInformation = beacon.GetErpInformation ();
764  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
765  if (erpInformation.GetUseProtection () != 0)
766  {
768  }
769  else
770  {
772  }
773  if (capabilities.IsShortSlotTime () == true)
774  {
775  //enable short slot time
776  m_phy->SetSlot (MicroSeconds (9));
777  }
778  else
779  {
780  //disable short slot time
781  m_phy->SetSlot (MicroSeconds (20));
782  }
783  }
784  if (GetQosSupported ())
785  {
786  bool qosSupported = false;
787  EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
788  if (edcaParameters.IsQosSupported ())
789  {
790  qosSupported = true;
791  //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
792  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTxopLimit ()));
793  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTxopLimit ()));
794  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTxopLimit ()));
795  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTxopLimit ()));
796  }
797  m_stationManager->SetQosSupport (apAddr, qosSupported);
798  }
799  if (GetHtSupported ())
800  {
801  HtCapabilities htCapabilities = beacon.GetHtCapabilities ();
802  if (!htCapabilities.IsSupportedMcs (0))
803  {
805  }
806  else
807  {
808  m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
809  }
810  }
811  if (GetVhtSupported ())
812  {
813  VhtCapabilities vhtCapabilities = beacon.GetVhtCapabilities ();
814  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
815  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
816  {
817  m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
818  VhtOperation vhtOperation = beacon.GetVhtOperation ();
819  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
820  {
821  if (vhtCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
822  {
823  m_stationManager->AddSupportedMcs (apAddr, mcs);
824  }
825  }
826  }
827  }
828  if (GetHtSupported ())
829  {
830  ExtendedCapabilities extendedCapabilities = beacon.GetExtendedCapabilities ();
831  //TODO: to be completed
832  }
833  if (GetHeSupported ())
834  {
835  HeCapabilities heCapabilities = beacon.GetHeCapabilities ();
836  if (heCapabilities.GetSupportedMcsAndNss () != 0)
837  {
838  m_stationManager->AddStationHeCapabilities (apAddr, heCapabilities);
839  HeOperation heOperation = beacon.GetHeOperation ();
840  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
841  {
842  if (heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
843  {
844  m_stationManager->AddSupportedMcs (apAddr, mcs);
845  }
846  }
847  }
848 
849  MuEdcaParameterSet muEdcaParameters = beacon.GetMuEdcaParameterSet ();
850  if (muEdcaParameters.IsPresent ())
851  {
852  SetMuEdcaParameters (AC_BE, muEdcaParameters.GetMuCwMin (AC_BE), muEdcaParameters.GetMuCwMax (AC_BE),
853  muEdcaParameters.GetMuAifsn (AC_BE), muEdcaParameters.GetMuEdcaTimer (AC_BE));
854  SetMuEdcaParameters (AC_BK, muEdcaParameters.GetMuCwMin (AC_BK), muEdcaParameters.GetMuCwMax (AC_BK),
855  muEdcaParameters.GetMuAifsn (AC_BK), muEdcaParameters.GetMuEdcaTimer (AC_BK));
856  SetMuEdcaParameters (AC_VI, muEdcaParameters.GetMuCwMin (AC_VI), muEdcaParameters.GetMuCwMax (AC_VI),
857  muEdcaParameters.GetMuAifsn (AC_VI), muEdcaParameters.GetMuEdcaTimer (AC_VI));
858  SetMuEdcaParameters (AC_VO, muEdcaParameters.GetMuCwMin (AC_VO), muEdcaParameters.GetMuCwMax (AC_VO),
859  muEdcaParameters.GetMuAifsn (AC_VO), muEdcaParameters.GetMuEdcaTimer (AC_VO));
860  }
861  }
862  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
864 }
865 
866 void
868 {
869  NS_LOG_FUNCTION (this << probeResp << apAddr << bssid);
870  CapabilityInformation capabilities = probeResp.GetCapabilities ();
871  SupportedRates rates = probeResp.GetSupportedRates ();
872  for (const auto & selector : m_phy->GetBssMembershipSelectorList ())
873  {
874  if (!rates.IsBssMembershipSelectorRate (selector))
875  {
876  NS_LOG_DEBUG ("Supported rates do not fit with the BSS membership selector");
877  return;
878  }
879  }
880  for (const auto & mode : m_phy->GetModeList ())
881  {
882  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
883  {
884  m_stationManager->AddSupportedMode (apAddr, mode);
885  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
886  {
888  }
889  }
890  }
891 
892  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
893  if (GetErpSupported ())
894  {
895  bool isErpAllowed = false;
896  for (const auto & mode : m_phy->GetModeList (WIFI_MOD_CLASS_ERP_OFDM))
897  {
898  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
899  {
900  isErpAllowed = true;
901  break;
902  }
903  }
904  if (!isErpAllowed)
905  {
906  //disable short slot time and set cwMin to 31
907  m_phy->SetSlot (MicroSeconds (20));
908  ConfigureContentionWindow (31, 1023);
909  }
910  else
911  {
912  ErpInformation erpInformation = probeResp.GetErpInformation ();
913  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
915  {
916  //enable short slot time
917  m_phy->SetSlot (MicroSeconds (9));
918  }
919  else
920  {
921  //disable short slot time
922  m_phy->SetSlot (MicroSeconds (20));
923  }
924  ConfigureContentionWindow (15, 1023);
925  }
926  }
927  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
929  SetBssid (bssid);
930 }
931 
932 void
934 {
935  NS_LOG_FUNCTION (this << assocResp << apAddr);
936  CapabilityInformation capabilities = assocResp.GetCapabilities ();
937  SupportedRates rates = assocResp.GetSupportedRates ();
938  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
939  if (GetErpSupported ())
940  {
941  bool isErpAllowed = false;
942  for (const auto & mode : m_phy->GetModeList (WIFI_MOD_CLASS_ERP_OFDM))
943  {
944  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
945  {
946  isErpAllowed = true;
947  break;
948  }
949  }
950  if (!isErpAllowed)
951  {
952  //disable short slot time and set cwMin to 31
953  m_phy->SetSlot (MicroSeconds (20));
954  ConfigureContentionWindow (31, 1023);
955  }
956  else
957  {
958  ErpInformation erpInformation = assocResp.GetErpInformation ();
959  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
961  {
962  //enable short slot time
963  m_phy->SetSlot (MicroSeconds (9));
964  }
965  else
966  {
967  //disable short slot time
968  m_phy->SetSlot (MicroSeconds (20));
969  }
970  ConfigureContentionWindow (15, 1023);
971  }
972  }
973  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
975  if (GetQosSupported ())
976  {
977  bool qosSupported = false;
978  EdcaParameterSet edcaParameters = assocResp.GetEdcaParameterSet ();
979  if (edcaParameters.IsQosSupported ())
980  {
981  qosSupported = true;
982  //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
983  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTxopLimit ()));
984  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTxopLimit ()));
985  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTxopLimit ()));
986  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTxopLimit ()));
987  }
988  m_stationManager->SetQosSupport (apAddr, qosSupported);
989  }
990  if (GetHtSupported ())
991  {
992  HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
993  if (!htCapabilities.IsSupportedMcs (0))
994  {
996  }
997  else
998  {
999  m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
1000  }
1001  }
1002  if (GetVhtSupported ())
1003  {
1004  VhtCapabilities vhtCapabilities = assocResp.GetVhtCapabilities ();
1005  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1006  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1007  {
1008  m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
1009  VhtOperation vhtOperation = assocResp.GetVhtOperation ();
1010  }
1011  }
1012  if (GetHeSupported ())
1013  {
1014  HeCapabilities hecapabilities = assocResp.GetHeCapabilities ();
1015  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1016  {
1017  m_stationManager->AddStationHeCapabilities (apAddr, hecapabilities);
1018  HeOperation heOperation = assocResp.GetHeOperation ();
1019  GetHeConfiguration ()->SetAttribute ("BssColor", UintegerValue (heOperation.GetBssColor ()));
1020  }
1021 
1022  MuEdcaParameterSet muEdcaParameters = assocResp.GetMuEdcaParameterSet ();
1023  if (muEdcaParameters.IsPresent ())
1024  {
1025  SetMuEdcaParameters (AC_BE, muEdcaParameters.GetMuCwMin (AC_BE), muEdcaParameters.GetMuCwMax (AC_BE),
1026  muEdcaParameters.GetMuAifsn (AC_BE), muEdcaParameters.GetMuEdcaTimer (AC_BE));
1027  SetMuEdcaParameters (AC_BK, muEdcaParameters.GetMuCwMin (AC_BK), muEdcaParameters.GetMuCwMax (AC_BK),
1028  muEdcaParameters.GetMuAifsn (AC_BK), muEdcaParameters.GetMuEdcaTimer (AC_BK));
1029  SetMuEdcaParameters (AC_VI, muEdcaParameters.GetMuCwMin (AC_VI), muEdcaParameters.GetMuCwMax (AC_VI),
1030  muEdcaParameters.GetMuAifsn (AC_VI), muEdcaParameters.GetMuEdcaTimer (AC_VI));
1031  SetMuEdcaParameters (AC_VO, muEdcaParameters.GetMuCwMin (AC_VO), muEdcaParameters.GetMuCwMax (AC_VO),
1032  muEdcaParameters.GetMuAifsn (AC_VO), muEdcaParameters.GetMuEdcaTimer (AC_VO));
1033  }
1034  }
1035  for (const auto & mode : m_phy->GetModeList ())
1036  {
1037  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1038  {
1039  m_stationManager->AddSupportedMode (apAddr, mode);
1040  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1041  {
1043  }
1044  }
1045  }
1046  if (GetHtSupported ())
1047  {
1048  HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
1049  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HT))
1050  {
1051  if (htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1052  {
1053  m_stationManager->AddSupportedMcs (apAddr, mcs);
1054  //here should add a control to add basic MCS when it is implemented
1055  }
1056  }
1057  }
1058  if (GetVhtSupported ())
1059  {
1060  VhtCapabilities vhtcapabilities = assocResp.GetVhtCapabilities ();
1061  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
1062  {
1063  if (vhtcapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
1064  {
1065  m_stationManager->AddSupportedMcs (apAddr, mcs);
1066  //here should add a control to add basic MCS when it is implemented
1067  }
1068  }
1069  }
1070  if (GetHtSupported ())
1071  {
1072  ExtendedCapabilities extendedCapabilities = assocResp.GetExtendedCapabilities ();
1073  //TODO: to be completed
1074  }
1075  if (GetHeSupported ())
1076  {
1077  HeCapabilities heCapabilities = assocResp.GetHeCapabilities ();
1078  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
1079  {
1080  if (heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
1081  {
1082  m_stationManager->AddSupportedMcs (apAddr, mcs);
1083  //here should add a control to add basic MCS when it is implemented
1084  }
1085  }
1086  }
1087 }
1088 
1091 {
1092  SupportedRates rates;
1093  for (const auto & mode : m_phy->GetModeList ())
1094  {
1095  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
1096  NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
1097  rates.AddSupportedRate (modeDataRate);
1098  }
1099  if (GetHtSupported ())
1100  {
1101  for (const auto & selector : m_phy->GetBssMembershipSelectorList ())
1102  {
1103  rates.AddBssMembershipSelectorRate (selector);
1104  }
1105  }
1106  return rates;
1107 }
1108 
1111 {
1112  CapabilityInformation capabilities;
1115  return capabilities;
1116 }
1117 
1118 void
1120 {
1121  if (value == ASSOCIATED
1122  && m_state != ASSOCIATED)
1123  {
1124  m_assocLogger (GetBssid ());
1125  }
1126  else if (value != ASSOCIATED
1127  && m_state == ASSOCIATED)
1128  {
1130  }
1131  m_state = value;
1132 }
1133 
1134 void
1135 StaWifiMac::SetEdcaParameters (AcIndex ac, uint32_t cwMin, uint32_t cwMax, uint8_t aifsn, Time txopLimit)
1136 {
1137  Ptr<QosTxop> edca = GetQosTxop (ac);
1138  edca->SetMinCw (cwMin);
1139  edca->SetMaxCw (cwMax);
1140  edca->SetAifsn (aifsn);
1141  edca->SetTxopLimit (txopLimit);
1142 }
1143 
1144 void
1145 StaWifiMac::SetMuEdcaParameters (AcIndex ac, uint16_t cwMin, uint16_t cwMax, uint8_t aifsn, Time muEdcaTimer)
1146 {
1147  Ptr<QosTxop> edca = GetQosTxop (ac);
1148  edca->SetMuCwMin (cwMin);
1149  edca->SetMuCwMax (cwMax);
1150  edca->SetMuAifsn (aifsn);
1151  edca->SetMuEdcaTimer (muEdcaTimer);
1152 }
1153 
1154 void
1156 {
1157  NS_LOG_FUNCTION (this);
1158  if (IsAssociated ())
1159  {
1160  NS_LOG_DEBUG ("PHY capabilities changed: send reassociation request");
1162  SendAssociationRequest (true);
1163  }
1164 }
1165 
1166 } //namespace ns3
ns3::MgtProbeResponseHeader::GetHeOperation
HeOperation GetHeOperation(void) const
Return the HE operation.
Definition: mgt-headers.cc:310
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
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
ns3::StaWifiMac::m_waitBeaconTimeout
Time m_waitBeaconTimeout
wait beacon timeout
Definition: sta-wifi-mac.h:319
ns3::SupportedRates::IsBssMembershipSelectorRate
bool IsBssMembershipSelectorRate(uint64_t bs) const
Check if the given rate is a BSS membership selector value.
Definition: supported-rates.cc:149
ns3::MgtAssocResponseHeader::GetSupportedRates
SupportedRates GetSupportedRates(void)
Return the supported rates.
Definition: mgt-headers.cc:920
ns3::MgtAssocResponseHeader::GetStatusCode
StatusCode GetStatusCode(void)
Return the status code.
Definition: mgt-headers.cc:914
ns3::EdcaParameterSet::GetBkCWmin
uint32_t GetBkCWmin(void) const
Return the AC_BK CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:228
ns3::VhtCapabilities
The IEEE 802.11ac VHT Capabilities.
Definition: vht-capabilities.h:35
ns3::StaWifiMac::UNASSOCIATED
@ UNASSOCIATED
Definition: sta-wifi-mac.h:163
ns3::StaWifiMac::m_probeRequestTimeout
Time m_probeRequestTimeout
probe request timeout
Definition: sta-wifi-mac.h:320
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::StaWifiMac::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: sta-wifi-mac.cc:41
ns3::WifiMacQueueItem::GetPacket
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
Definition: wifi-mac-queue-item.cc:66
ns3::MgtProbeResponseHeader::GetErpInformation
ErpInformation GetErpInformation(void) const
Return the ERP information.
Definition: mgt-headers.cc:352
ns3::WIFI_MOD_CLASS_ERP_OFDM
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
Definition: wifi-phy-common.h:128
ns3::MgtReassocRequestHeader::SetExtendedCapabilities
void SetExtendedCapabilities(ExtendedCapabilities extendedCapabilities)
Set the Extended Capabilities.
Definition: mgt-headers.cc:747
ns3::StaWifiMac::MissedBeacons
void MissedBeacons(void)
This method is called after we have not received a beacon from the AP.
Definition: sta-wifi-mac.cc:398
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::EdcaParameterSet::GetBkTxopLimit
uint16_t GetBkTxopLimit(void) const
Return the AC_BK TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:242
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::WifiRemoteStationManager::AddStationHeCapabilities
void AddStationHeCapabilities(Mac48Address from, HeCapabilities heCapabilities)
Records HE capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1339
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
ns3::MgtAssocResponseHeader::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:968
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::IsBeacon
bool IsBeacon(void) const
Return true if the header is a Beacon header.
Definition: wifi-mac-header.cc:705
ns3::WifiMacHeader::IsData
bool IsData(void) const
Return true if the Type is DATA.
Definition: wifi-mac-header.cc:558
ns3::MgtAssocRequestHeader::SetListenInterval
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:542
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::RegularWifiMac::GetSsid
Ssid GetSsid(void) const override
Definition: regular-wifi-mac.cc:731
ns3::StaWifiMac::SetMuEdcaParameters
void SetMuEdcaParameters(AcIndex ac, uint16_t cwMin, uint16_t cwMax, uint8_t aifsn, Time muEdcaTimer)
Set the MU EDCA parameters.
Definition: sta-wifi-mac.cc:1145
ns3::ApInfo::m_snr
double m_snr
SNR in linear scale.
Definition: sta-wifi-mac.h:48
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiPhy::IsStateRx
bool IsStateRx(void) const
Definition: wifi-phy.cc:2119
ns3::WifiRemoteStationManager::SetShortSlotTimeEnabled
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
Definition: wifi-remote-station-manager.cc:213
ns3::MgtAssocRequestHeader::SetVhtCapabilities
void SetVhtCapabilities(VhtCapabilities vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:584
ns3::WifiMacHeader::SetDsTo
void SetDsTo(void)
Set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:96
ns3::MgtAssocResponseHeader::GetVhtOperation
VhtOperation GetVhtOperation(void) const
Return the VHT operation.
Definition: mgt-headers.cc:1004
ns3::Callback::IsNull
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1386
ns3::WIFI_MOD_CLASS_HT
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Definition: wifi-phy-common.h:130
ns3::WIFI_MOD_CLASS_HE
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Definition: wifi-phy-common.h:132
ns3::CapabilityInformation::IsEss
bool IsEss(void) const
Check if the Extended Service Set (ESS) bit in the capability information field is set to 1.
Definition: capability-information.cc:69
ns3::WifiMacHeader::IsProbeResp
bool IsProbeResp(void) const
Return true if the header is a Probe Response header.
Definition: wifi-mac-header.cc:699
ns3::RegularWifiMac::SetBssid
void SetBssid(Mac48Address bssid)
Definition: regular-wifi-mac.cc:737
ns3::WifiPhy::GetDelayUntilIdle
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:2149
ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
Definition: wifi-mac-header.h:49
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
ns3::Simulator::GetDelayLeft
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Definition: simulator.cc:204
ns3::StaWifiMac::m_assocRequestTimeout
Time m_assocRequestTimeout
association request timeout
Definition: sta-wifi-mac.h:321
ns3::MgtProbeResponseHeader::GetSsid
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:202
ns3::MgtAssocResponseHeader::GetHeOperation
HeOperation GetHeOperation(void) const
Return the HE operation.
Definition: mgt-headers.cc:1028
ns3::RegularWifiMac::GetQosTxop
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Definition: regular-wifi-mac.cc:513
snr-tag.h
ns3::ApInfo::m_activeProbing
bool m_activeProbing
Flag whether active probing is used or not.
Definition: sta-wifi-mac.h:49
ns3::RegularWifiMac::GetHeSupported
bool GetHeSupported() const
Return whether the device supports HE.
Definition: regular-wifi-mac.cc:664
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::WIFI_MAC_MGT_REASSOCIATION_REQUEST
@ WIFI_MAC_MGT_REASSOCIATION_REQUEST
Definition: wifi-mac-header.h:52
ns3::HeCapabilities
The IEEE 802.11ax HE Capabilities.
Definition: he-capabilities.h:34
ns3::MgtAssocRequestHeader::SetHtCapabilities
void SetHtCapabilities(HtCapabilities htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:572
ns3::MgtProbeResponseHeader::GetEdcaParameterSet
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set.
Definition: mgt-headers.cc:370
ns3::MgtAssocResponseHeader::GetErpInformation
ErpInformation GetErpInformation(void) const
Return the ERP information.
Definition: mgt-headers.cc:1052
ns3::MgtAssocResponseHeader::GetExtendedCapabilities
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities.
Definition: mgt-headers.cc:956
ns3::RegularWifiMac::GetBssid
Mac48Address GetBssid(void) const override
Definition: regular-wifi-mac.cc:748
ns3::MgtProbeRequestHeader::SetHeCapabilities
void SetHeCapabilities(HeCapabilities heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:94
ns3::RegularWifiMac::GetErpSupported
bool GetErpSupported() const
Return whether the device supports ERP.
Definition: regular-wifi-mac.cc:674
ns3::MgtAssocRequestHeader::SetSupportedRates
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:536
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::MgtReassocRequestHeader::SetSupportedRates
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:723
ns3::StaWifiMac::m_deAssocLogger
TracedCallback< Mac48Address > m_deAssocLogger
disassociation logger
Definition: sta-wifi-mac.h:336
wifi-phy.h
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
ns3::WifiMacHeader::SetAddr3
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
Definition: wifi-mac-header.cc:120
ns3::MuEdcaParameterSet::IsPresent
bool IsPresent(void) const
Return true if a valid MU EDCA Parameter Set is present in this object.
Definition: mu-edca-parameter-set.cc:46
ns3::StaWifiMac::GetSupportedRates
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates.
Definition: sta-wifi-mac.cc:1090
ns3::MgtAssocResponseHeader::GetHeCapabilities
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities.
Definition: mgt-headers.cc:1016
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::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::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::RegularWifiMac::DeaggregateAmsduAndForward
virtual void DeaggregateAmsduAndForward(Ptr< WifiMacQueueItem > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
Definition: regular-wifi-mac.cc:909
ns3::MgtProbeResponseHeader::GetMuEdcaParameterSet
MuEdcaParameterSet GetMuEdcaParameterSet(void) const
Return the MU EDCA Parameter Set.
Definition: mgt-headers.cc:376
ns3::MgtAssocRequestHeader::SetExtendedCapabilities
void SetExtendedCapabilities(ExtendedCapabilities extendedCapabilities)
Set the Extended Capabilities.
Definition: mgt-headers.cc:560
ns3::StaWifiMac::ScanningTimeout
void ScanningTimeout(void)
This method is called after wait beacon timeout or wait probe request timeout has occurred.
Definition: sta-wifi-mac.cc:357
ns3::MgtReassocRequestHeader::SetHeCapabilities
void SetHeCapabilities(HeCapabilities heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:783
ns3::RegularWifiMac::GetQosSupported
bool GetQosSupported() const
Return whether the device supports QoS.
Definition: regular-wifi-mac.cc:638
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::MgtProbeResponseHeader::GetBeaconIntervalUs
uint64_t GetBeaconIntervalUs(void) const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:208
ns3::StaWifiMac::SendAssociationRequest
void SendAssociationRequest(bool isReassoc)
Forward an association or reassociation request packet to the DCF.
Definition: sta-wifi-mac.cc:196
ns3::StaWifiMac::m_aid
uint16_t m_aid
Association AID.
Definition: sta-wifi-mac.h:318
ns3::ApInfo::m_apAddr
Mac48Address m_apAddr
AP MAC address.
Definition: sta-wifi-mac.h:47
ns3::StaWifiMac::m_state
MacState m_state
MAC state.
Definition: sta-wifi-mac.h:317
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::VhtOperation
The VHT Operation Information Element.
Definition: vht-operation.h:36
ns3::StaWifiMac::m_probeRequestEvent
EventId m_probeRequestEvent
probe request event
Definition: sta-wifi-mac.h:323
ns3::CapabilityInformation::SetShortPreamble
void SetShortPreamble(bool shortPreamble)
Set the short preamble bit in the capability information field.
Definition: capability-information.cc:45
ns3::MgtProbeRequestHeader::SetVhtCapabilities
void SetVhtCapabilities(VhtCapabilities vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:82
ns3::StaWifiMac::Enqueue
void Enqueue(Ptr< Packet > packet, Mac48Address to) override
Definition: sta-wifi-mac.cc:450
ns3::MgtAssocRequestHeader::SetSsid
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:530
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::StaWifiMac::UpdateApInfoFromBeacon
void UpdateApInfoFromBeacon(MgtBeaconHeader beacon, Mac48Address apAddr, Mac48Address bssid)
Update associated AP's information from beacon.
Definition: sta-wifi-mac.cc:747
ns3::StaWifiMac::m_candidateAps
std::vector< ApInfo > m_candidateAps
list of candidate APs to associate to
Definition: sta-wifi-mac.h:329
ns3::StaWifiMac::AssocRequestTimeout
void AssocRequestTimeout(void)
This method is called after the association timeout occurred.
Definition: sta-wifi-mac.cc:390
ns3::RegularWifiMac::ConfigureContentionWindow
void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
Definition: regular-wifi-mac.cc:1185
ns3::Txop::SetMinCw
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: txop.cc:161
ns3::RegularWifiMac::m_linkDown
Callback< void > m_linkDown
Callback when a link is down.
Definition: regular-wifi-mac.h:227
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::ApInfo::m_bssid
Mac48Address m_bssid
BSSID.
Definition: sta-wifi-mac.h:46
ns3::RegularWifiMac::GetAddress
Mac48Address GetAddress(void) const override
Definition: regular-wifi-mac.cc:718
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
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:314
mgt-headers.h
ns3::EdcaParameterSet::GetVoTxopLimit
uint16_t GetVoTxopLimit(void) const
Return the AC_VO TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:294
ns3::StaWifiMac::UpdateCandidateApList
void UpdateCandidateApList(ApInfo newApInfo)
Update list of candidate AP to associate.
Definition: sta-wifi-mac.cc:721
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< WifiPhy >
ns3::WifiPhy::SetCapabilitiesChangedCallback
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:660
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition: mac48-address.cc:170
ns3::MgtReassocRequestHeader::SetHtCapabilities
void SetHtCapabilities(HtCapabilities htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:759
ns3::EdcaParameterSet::IsQosSupported
uint8_t IsQosSupported(void) const
Is QOS supported function.
Definition: edca-parameter-set.cc:50
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:411
ns3::QosTxop::SetMuCwMin
void SetMuCwMin(uint16_t cwMin)
Set the minimum contention window size to use while the MU EDCA Timer is running.
Definition: qos-txop.cc:158
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::StaWifiMac::MacState
MacState
The current MAC state of the STA.
Definition: sta-wifi-mac.h:158
ns3::EventId::IsRunning
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:71
ns3::AC_VI
@ AC_VI
Video.
Definition: qos-utils.h:77
ns3::QosTxop::SetMuEdcaTimer
void SetMuEdcaTimer(Time timer)
Set the MU EDCA Timer.
Definition: qos-txop.cc:179
ns3::MuEdcaParameterSet::GetMuEdcaTimer
Time GetMuEdcaTimer(uint8_t aci) const
Get the MU EDCA Timer value encoded in the MU AC Parameter Record field corresponding to the given AC...
Definition: mu-edca-parameter-set.cc:144
ns3::EdcaParameterSet::GetVoCWmax
uint32_t GetVoCWmax(void) const
Return the AC_VO CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:287
ns3::WifiRemoteStationManager::RemoveAllSupportedMcs
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
Definition: wifi-remote-station-manager.cc:373
max
#define max(a, b)
Definition: 80211b.c:43
ns3::WifiRemoteStationManager::SetQosSupport
void SetQosSupport(Mac48Address from, bool qosSupported)
Records QoS support of the remote station.
Definition: wifi-remote-station-manager.cc:1270
ns3::StaWifiMac::m_maxMissedBeacons
uint32_t m_maxMissedBeacons
maximum missed beacons
Definition: sta-wifi-mac.h:327
ns3::MuEdcaParameterSet::GetMuAifsn
uint8_t GetMuAifsn(uint8_t aci) const
Get the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
Definition: mu-edca-parameter-set.cc:121
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:772
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::MgtProbeRequestHeader::SetHtCapabilities
void SetHtCapabilities(HtCapabilities htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:70
ns3::EdcaParameterSet::GetBkCWmax
uint32_t GetBkCWmax(void) const
Return the AC_BK CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:235
ns3::StaWifiMac::WAIT_PROBE_RESP
@ WAIT_PROBE_RESP
Definition: sta-wifi-mac.h:161
ns3::StaWifiMac::m_beaconWatchdog
EventId m_beaconWatchdog
beacon watchdog
Definition: sta-wifi-mac.h:325
ns3::MgtAssocRequestHeader::SetCapabilities
void SetCapabilities(CapabilityInformation capabilities)
Set the Capability information.
Definition: mgt-headers.cc:548
ns3::MgtAssocResponseHeader::GetMuEdcaParameterSet
MuEdcaParameterSet GetMuEdcaParameterSet(void) const
Return the MU EDCA Parameter Set.
Definition: mgt-headers.cc:1076
ns3::RegularWifiMac::GetVhtSupported
bool GetVhtSupported() const
Return whether the device supports VHT.
Definition: regular-wifi-mac.cc:654
wifi-net-device.h
ns3::HtCapabilities
The HT Capabilities Information Element.
Definition: ht-capabilities.h:42
ns3::StaWifiMac::m_waitBeaconEvent
EventId m_waitBeaconEvent
wait beacon event
Definition: sta-wifi-mac.h:322
ns3::StaWifiMac::UpdateApInfoFromAssocResp
void UpdateApInfoFromAssocResp(MgtAssocResponseHeader assocResp, Mac48Address apAddr)
Update AP's information from association response.
Definition: sta-wifi-mac.cc:933
ns3::QosUtilsMapTidToAc
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:126
ns3::EdcaParameterSet::GetVoAifsn
uint8_t GetVoAifsn(void) const
Return the AC_VO AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:274
ns3::ApInfo::m_beacon
MgtBeaconHeader m_beacon
Beacon header.
Definition: sta-wifi-mac.h:50
ns3::ApInfo
Struct to hold information regarding observed AP through active/passive scanning.
Definition: sta-wifi-mac.h:45
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
ns3::MgtReassocRequestHeader::SetVhtCapabilities
void SetVhtCapabilities(VhtCapabilities vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:771
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:1465
ns3::Ssid::IsEqual
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition: ssid.cc:55
ns3::StaWifiMac::SetWifiPhy
void SetWifiPhy(const Ptr< WifiPhy > phy) override
Definition: sta-wifi-mac.cc:141
ns3::RegularWifiMac::m_linkUp
Callback< void > m_linkUp
Callback when a link is up.
Definition: regular-wifi-mac.h:226
sta-wifi-mac.h
ns3::Packet::RemoveHeader
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
ns3::EventId::Cancel
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
ns3::RegularWifiMac::m_txop
Ptr< Txop > m_txop
This holds a pointer to the TXOP instance for this WifiMac - used for transmission of frames to non-Q...
Definition: regular-wifi-mac.h:233
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:768
ns3::EdcaParameterSet::GetViTxopLimit
uint16_t GetViTxopLimit(void) const
Return the AC_VI TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:268
ns3::WifiMacHeader::NORMAL_ACK
@ NORMAL_ACK
Definition: wifi-mac-header.h:92
ns3::MgtProbeRequestHeader::SetSsid
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:40
ns3::WifiMac::GetHeConfiguration
Ptr< HeConfiguration > GetHeConfiguration(void) const
Definition: wifi-mac.cc:199
ns3::EdcaParameterSet::GetViCWmin
uint32_t GetViCWmin(void) const
Return the AC_VI CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:254
ns3::StaWifiMac::SendProbeRequest
void SendProbeRequest(void)
Forward a probe request packet to the DCF.
Definition: sta-wifi-mac.cc:149
ns3::StaWifiMac::m_activeProbing
bool m_activeProbing
active probing
Definition: sta-wifi-mac.h:328
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::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
ns3::EdcaParameterSet::GetBeTxopLimit
uint16_t GetBeTxopLimit(void) const
Return the AC_BE TXOP Limit field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:216
ns3::HeOperation::GetBssColor
uint8_t GetBssColor(void) const
Get the BSS color.
Definition: he-operation.cc:131
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::StaWifiMac::m_assocRequestEvent
EventId m_assocRequestEvent
association request event
Definition: sta-wifi-mac.h:324
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::SupportedRates::IsBasicRate
bool IsBasicRate(uint64_t bs) const
Check if the given rate is a basic rate.
Definition: supported-rates.cc:118
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:494
ns3::StatusCode::IsSuccess
bool IsSuccess(void) const
Return whether the status code is success.
Definition: status-code.cc:42
ns3::StaWifiMac::UpdateApInfoFromProbeResp
void UpdateApInfoFromProbeResp(MgtProbeResponseHeader probeResp, Mac48Address apAddr, Mac48Address bssid)
Update AP's information from probe response.
Definition: sta-wifi-mac.cc:867
ns3::StaWifiMac::Receive
void Receive(Ptr< WifiMacQueueItem > mpdu) override
Handle a received packet.
Definition: sta-wifi-mac.cc:520
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::WifiRemoteStationManager::GetShortSlotTimeEnabled
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
Definition: wifi-remote-station-manager.cc:220
ns3::WifiRemoteStationManager::SetShortPreambleEnabled
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
Definition: wifi-remote-station-manager.cc:206
ns3::MgtAssocResponseHeader::GetCapabilities
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:944
ns3::MgtBeaconHeader
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:862
ns3::ApInfo::m_probeResp
MgtProbeResponseHeader m_probeResp
Probe Response header.
Definition: sta-wifi-mac.h:51
ns3::StaWifiMac::ASSOCIATED
@ ASSOCIATED
Definition: sta-wifi-mac.h:159
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:792
ns3::WifiRemoteStationManager::AddStationHtCapabilities
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htCapabilities)
Records HT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1279
ns3::MgtProbeResponseHeader::GetHeCapabilities
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities.
Definition: mgt-headers.cc:298
ns3::CapabilityInformation
Capability information.
Definition: capability-information.h:34
ns3::SnrTag
Introspection did not find any typical Config paths.
Definition: snr-tag.h:35
ns3::StaWifiMac::WAIT_BEACON
@ WAIT_BEACON
Definition: sta-wifi-mac.h:160
ns3::WifiPhy::SetSlot
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:917
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::WifiRemoteStationManager::AddStationVhtCapabilities
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtCapabilities)
Records VHT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1305
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
ns3::MgtReassocRequestHeader::SetListenInterval
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:729
ns3::MgtProbeResponseHeader::GetVhtOperation
VhtOperation GetVhtOperation(void) const
Return the VHT operation.
Definition: mgt-headers.cc:286
ns3::MuEdcaParameterSet::GetMuCwMax
uint16_t GetMuCwMax(uint8_t aci) const
Get the CWmax value encoded by the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter ...
Definition: mu-edca-parameter-set.cc:136
ns3::StaWifiMac::SetEdcaParameters
void SetEdcaParameters(AcIndex ac, uint32_t cwMin, uint32_t cwMax, uint8_t aifsn, Time txopLimit)
Set the EDCA parameters.
Definition: sta-wifi-mac.cc:1135
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::HeCapabilities::GetSupportedMcsAndNss
uint16_t GetSupportedMcsAndNss() const
Return the MCS and NSS field in the HE Capabilities information element.
Definition: he-capabilities.cc:473
ns3::EdcaParameterSet::GetBeAifsn
uint8_t GetBeAifsn(void) const
Return the AC_BE AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:196
ns3::STA
@ STA
Definition: wifi-mac.h:42
ns3::ExtendedCapabilities
The Extended Capabilities Information Element.
Definition: extended-capabilities.h:35
ns3::WifiMacHeader::IsReassocResp
bool IsReassocResp(void) const
Return true if the header is a Reassociation Response header.
Definition: wifi-mac-header.cc:687
ns3::StaWifiMac::SetState
void SetState(MacState value)
Set the current MAC state.
Definition: sta-wifi-mac.cc:1119
ns3::MgtAssocRequestHeader::SetHeCapabilities
void SetHeCapabilities(HeCapabilities heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:596
ns3::StaWifiMac::~StaWifiMac
virtual ~StaWifiMac()
Definition: sta-wifi-mac.cc:110
ns3::WIFI_MAC_MGT_PROBE_REQUEST
@ WIFI_MAC_MGT_PROBE_REQUEST
Definition: wifi-mac-header.h:54
ns3::StaWifiMac::PhyCapabilitiesChanged
void PhyCapabilitiesChanged(void)
Indicate that PHY capabilities have changed.
Definition: sta-wifi-mac.cc:1155
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::VhtCapabilities::IsSupportedRxMcs
bool IsSupportedRxMcs(uint8_t mcs) const
Returns true if receive MCS is supported.
Definition: vht-capabilities.cc:315
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::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::MgtReassocRequestHeader::SetSsid
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:717
ns3::WifiMacHeader::IsProbeReq
bool IsProbeReq(void) const
Return true if the header is a Probe Request header.
Definition: wifi-mac-header.cc:693
ns3::Packet::Copy
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
ns3::RegularWifiMac::SetWifiPhy
void SetWifiPhy(const Ptr< WifiPhy > phy) override
Definition: regular-wifi-mac.cc:561
ns3::MgtProbeResponseHeader::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:250
ns3::WIFI_MAC_DATA
@ WIFI_MAC_DATA
Definition: wifi-mac-header.h:62
ns3::StaWifiMac::StaWifiMac
StaWifiMac()
Definition: sta-wifi-mac.cc:88
ns3::StaWifiMac::DoInitialize
void DoInitialize(void) override
Initialize() implementation.
Definition: sta-wifi-mac.cc:104
ns3::WIFI_MAC_QOSDATA
@ WIFI_MAC_QOSDATA
Definition: wifi-mac-header.h:70
ns3::StaWifiMac::IsAssociated
bool IsAssociated(void) const
Return whether we are associated with an AP.
Definition: sta-wifi-mac.cc:438
ns3::WifiMacHeader::SetQosTxopLimit
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
Definition: wifi-mac-header.cc:396
ns3::SnrTag::Get
double Get(void) const
Return the SNR value.
Definition: snr-tag.cc:89
ns3::Packet::RemovePacketTag
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
Definition: packet.cc:963
ns3::TimeValue
AttributeValue implementation for Time.
Definition: nstime.h:1353
ns3::StaWifiMac::SetActiveProbing
void SetActiveProbing(bool enable)
Enable or disable active probing.
Definition: sta-wifi-mac.cc:123
ns3::WifiPhy::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1234
ns3::MgtProbeResponseHeader::GetCapabilities
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:226
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::EdcaParameterSet::GetBeCWmax
uint32_t GetBeCWmax(void) const
Return the AC_BE CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:209
ns3::Txop::SetTxopLimit
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: txop.cc:254
ns3::MgtAssocResponseHeader::GetEdcaParameterSet
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set.
Definition: mgt-headers.cc:1070
ns3::MgtProbeResponseHeader::GetExtendedCapabilities
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities.
Definition: mgt-headers.cc:238
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:2016
ns3::StaWifiMac::WAIT_ASSOC_RESP
@ WAIT_ASSOC_RESP
Definition: sta-wifi-mac.h:162
ns3::WifiRemoteStationManager::SetUseNonErpProtection
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
Definition: wifi-remote-station-manager.cc:1022
ns3::StaWifiMac
The Wifi MAC high model for a non-AP STA in a BSS.
Definition: sta-wifi-mac.h:107
ns3::WifiMacHeader::IsCtl
bool IsCtl(void) const
Return true if the Type is Control.
Definition: wifi-mac-header.cc:571
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::MgtReassocRequestHeader::SetCapabilities
void SetCapabilities(CapabilityInformation capabilities)
Set the Capability information.
Definition: mgt-headers.cc:735
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:1428
ns3::StaWifiMac::StartScanning
void StartScanning(void)
Start the scanning process which trigger active or passive scanning based on the active probing flag.
Definition: sta-wifi-mac.cc:327
ns3::WifiRemoteStationManager::AddSupportedMcs
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Definition: wifi-remote-station-manager.cc:382
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::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:537
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::RegularWifiMac::m_phy
Ptr< WifiPhy > m_phy
Wifi PHY.
Definition: regular-wifi-mac.h:220
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::StaWifiMac::RestartBeaconWatchdog
void RestartBeaconWatchdog(Time delay)
Restarts the beacon timer.
Definition: sta-wifi-mac.cc:425
ns3::StaWifiMac::m_beaconArrival
TracedCallback< Time > m_beaconArrival
beacon arrival logger
Definition: sta-wifi-mac.h:337
ns3::StaWifiMac::m_assocLogger
TracedCallback< Mac48Address > m_assocLogger
association logger
Definition: sta-wifi-mac.h:335
ns3::WifiMacHeader::IsReassocReq
bool IsReassocReq(void) const
Return true if the header is a Reassociation Request header.
Definition: wifi-mac-header.cc:681
ns3::EdcaParameterSet::GetViCWmax
uint32_t GetViCWmax(void) const
Return the AC_VI CWmax field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:261
ns3::MuEdcaParameterSet::GetMuCwMin
uint16_t GetMuCwMin(uint8_t aci) const
Get the CWmin value encoded by the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter ...
Definition: mu-edca-parameter-set.cc:128
ns3::ErpInformation
The ErpInformation Information Element.
Definition: erp-information.h:35
ns3::MgtProbeRequestHeader::SetSupportedRates
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:52
ns3::MgtProbeResponseHeader::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:274
ns3::StaWifiMac::IsWaitAssocResp
bool IsWaitAssocResp(void) const
Return whether we are waiting for an association response from an AP.
Definition: sta-wifi-mac.cc:444
ns3::StaWifiMac::m_beaconWatchdogEnd
Time m_beaconWatchdogEnd
beacon watchdog end
Definition: sta-wifi-mac.h:326
ns3::MgtProbeRequestHeader::SetExtendedCapabilities
void SetExtendedCapabilities(ExtendedCapabilities extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:58
ns3::MakeUintegerAccessor
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: uinteger.h:45
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::EdcaParameterSet::GetViAifsn
uint8_t GetViAifsn(void) const
Return the AC_VI AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:248
ns3::MgtAssocResponseHeader::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:992
ns3::HtCapabilities::IsSupportedMcs
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
Definition: ht-capabilities.cc:230
ns3::EdcaParameterSet::GetVoCWmin
uint32_t GetVoCWmin(void) const
Return the AC_VO CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:280
ns3::RegularWifiMac::GetVOQueue
Ptr< QosTxop > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
Definition: regular-wifi-mac.cc:525
ns3::MgtAssocResponseHeader::GetAssociationId
uint16_t GetAssociationId(void) const
Return the association ID.
Definition: mgt-headers.cc:1040
ns3::MgtProbeResponseHeader::GetSupportedRates
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:214
ns3::ErpInformation::GetBarkerPreambleMode
uint8_t GetBarkerPreambleMode(void) const
Return the Barker_Preamble_Mode field in the ErpInformation information element.
Definition: erp-information.cc:62
ns3::WifiMacHeader::SetQosTid
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
Definition: wifi-mac-header.cc:352
ns3::StaWifiMac::REFUSED
@ REFUSED
Definition: sta-wifi-mac.h:164
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
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:2065
ns3::StaWifiMac::GetActiveProbing
bool GetActiveProbing(void) const
Return whether active probing is enabled.
Definition: sta-wifi-mac.cc:135
ns3::MgtReassocRequestHeader::SetCurrentApAddress
void SetCurrentApAddress(Mac48Address currentApAddr)
Set the address of the current access point.
Definition: mgt-headers.cc:813
ns3::QosTxop::SetMuAifsn
void SetMuAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS while the MU EDCA Timer is running.
Definition: qos-txop.cc:172
ns3::EdcaParameterSet::GetBeCWmin
uint32_t GetBeCWmin(void) const
Return the AC_BE CWmin field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:202
ns3::RegularWifiMac::GetHtSupported
bool GetHtSupported() const
Return whether the device supports HT.
Definition: regular-wifi-mac.cc:644
ns3::Txop::Queue
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:294
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:799
ns3::StaWifiMac::GetAssociationId
uint16_t GetAssociationId(void) const
Return the association ID.
Definition: sta-wifi-mac.cc:116
ns3::QosTxop::SetMuCwMax
void SetMuCwMax(uint16_t cwMax)
Set the maximum contention window size to use while the MU EDCA Timer is running.
Definition: qos-txop.cc:165
ns3::StaWifiMac::TryToEnsureAssociated
void TryToEnsureAssociated(void)
Try to ensure that we are associated with an AP by taking an appropriate action depending on the curr...
Definition: sta-wifi-mac.cc:282
ns3::HeCapabilities::IsSupportedRxMcs
bool IsSupportedRxMcs(uint8_t mcs) const
Is RX MCS supported.
Definition: he-capabilities.cc:521
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
third.phy
phy
Definition: third.py:93
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::StaWifiMac::GetCapabilities
CapabilityInformation GetCapabilities(void) const
Return the Capability information of the current STA.
Definition: sta-wifi-mac.cc:1110
ns3::EventId::IsExpired
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition: event-id.cc:65
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::EdcaParameterSet::GetBkAifsn
uint8_t GetBkAifsn(void) const
Return the AC_BK AIFSN field in the EdcaParameterSet information element.
Definition: edca-parameter-set.cc:222
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::CapabilityInformation::SetShortSlotTime
void SetShortSlotTime(bool shortSlotTime)
Set the short slot time bit in the capability information field.
Definition: capability-information.cc:54
ns3::ErpInformation::GetUseProtection
uint8_t GetUseProtection(void) const
Return the Use_Protection field in the ErpInformation information element.
Definition: erp-information.cc:68