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  //The standard is not clear on the correct queue for management
179  //frames if we are a QoS AP. The approach taken here is to always
180  //use the non-QoS for these regardless of whether we have a QoS
181  //association or not.
182  m_txop->Queue (packet, hdr);
183 }
184 
185 void
187 {
188  NS_LOG_FUNCTION (this << GetBssid () << isReassoc);
189  WifiMacHeader hdr;
191  hdr.SetAddr1 (GetBssid ());
192  hdr.SetAddr2 (GetAddress ());
193  hdr.SetAddr3 (GetBssid ());
194  hdr.SetDsNotFrom ();
195  hdr.SetDsNotTo ();
196  Ptr<Packet> packet = Create<Packet> ();
197  if (!isReassoc)
198  {
199  MgtAssocRequestHeader assoc;
200  assoc.SetSsid (GetSsid ());
202  assoc.SetCapabilities (GetCapabilities ());
203  assoc.SetListenInterval (0);
204  if (GetHtSupported ())
205  {
208  }
209  if (GetVhtSupported ())
210  {
212  }
213  if (GetHeSupported ())
214  {
216  }
217  packet->AddHeader (assoc);
218  }
219  else
220  {
221  MgtReassocRequestHeader reassoc;
222  reassoc.SetCurrentApAddress (GetBssid ());
223  reassoc.SetSsid (GetSsid ());
225  reassoc.SetCapabilities (GetCapabilities ());
226  reassoc.SetListenInterval (0);
227  if (GetHtSupported ())
228  {
231  }
232  if (GetVhtSupported ())
233  {
235  }
236  if (GetHeSupported ())
237  {
239  }
240  packet->AddHeader (reassoc);
241  }
242 
243  //The standard is not clear on the correct queue for management
244  //frames if we are a QoS AP. The approach taken here is to always
245  //use the non-QoS for these regardless of whether we have a QoS
246  //association or not.
247  m_txop->Queue (packet, hdr);
248 
250  {
252  }
255 }
256 
257 void
259 {
260  NS_LOG_FUNCTION (this);
261  switch (m_state)
262  {
263  case ASSOCIATED:
264  return;
265  break;
266  case WAIT_PROBE_RESP:
267  /* we have sent a probe request earlier so we
268  do not need to re-send a probe request immediately.
269  We just need to wait until probe-request-timeout
270  or until we get a probe response
271  */
272  break;
273  case WAIT_BEACON:
274  /* we have initiated passive scanning, continue to wait
275  and gather beacons
276  */
277  break;
278  case UNASSOCIATED:
279  /* we were associated but we missed a bunch of beacons
280  * so we should assume we are not associated anymore.
281  * We try to initiate a scan now.
282  */
283  m_linkDown ();
284  StartScanning ();
285  break;
286  case WAIT_ASSOC_RESP:
287  /* we have sent an association request so we do not need to
288  re-send an association request right now. We just need to
289  wait until either assoc-request-timeout or until
290  we get an association response.
291  */
292  break;
293  case REFUSED:
294  /* we have sent an association request and received a negative
295  association response. We wait until someone restarts an
296  association with a given SSID.
297  */
298  break;
299  }
300 }
301 
302 void
304 {
305  NS_LOG_FUNCTION (this);
306  m_candidateAps.clear ();
308  {
310  }
312  {
314  }
315  if (GetActiveProbing ())
316  {
318  SendProbeRequest ();
321  this);
322  }
323  else
324  {
328  this);
329  }
330 }
331 
332 void
334 {
335  NS_LOG_FUNCTION (this);
336  if (!m_candidateAps.empty ())
337  {
338  ApInfo bestAp = m_candidateAps.front();
339  m_candidateAps.erase(m_candidateAps.begin ());
340  NS_LOG_DEBUG ("Attempting to associate with BSSID " << bestAp.m_bssid);
341  Time beaconInterval;
342  if (bestAp.m_activeProbing)
343  {
344  UpdateApInfoFromProbeResp (bestAp.m_probeResp, bestAp.m_apAddr, bestAp.m_bssid);
345  beaconInterval = MicroSeconds (bestAp.m_probeResp.GetBeaconIntervalUs ());
346  }
347  else
348  {
349  UpdateApInfoFromBeacon (bestAp.m_beacon, bestAp.m_apAddr, bestAp.m_bssid);
350  beaconInterval = MicroSeconds (bestAp.m_beacon.GetBeaconIntervalUs ());
351  }
352 
353  Time delay = beaconInterval * m_maxMissedBeacons;
354  RestartBeaconWatchdog (delay);
356  SendAssociationRequest (false);
357  }
358  else
359  {
360  NS_LOG_DEBUG ("Exhausted list of candidate AP; restart scanning");
361  StartScanning ();
362  }
363 }
364 
365 void
367 {
368  NS_LOG_FUNCTION (this);
370  SendAssociationRequest (false);
371 }
372 
373 void
375 {
376  NS_LOG_FUNCTION (this);
378  {
380  {
382  }
385  return;
386  }
387  NS_LOG_DEBUG ("beacon missed");
388  // We need to switch to the UNASSOCIATED state. However, if we are receiving
389  // a frame, wait until the RX is completed (otherwise, crashes may occur if
390  // we are receiving a MU frame because its reception requires the STA-ID)
391  Time delay = Seconds (0);
392  if (m_phy->IsStateRx ())
393  {
394  delay = m_phy->GetDelayUntilIdle ();
395  }
398 }
399 
400 void
402 {
403  NS_LOG_FUNCTION (this << delay);
407  {
408  NS_LOG_DEBUG ("really restart watchdog.");
410  }
411 }
412 
413 bool
415 {
416  return m_state == ASSOCIATED;
417 }
418 
419 bool
421 {
422  return m_state == WAIT_ASSOC_RESP;
423 }
424 
425 void
427 {
428  NS_LOG_FUNCTION (this << packet << to);
429  if (!IsAssociated ())
430  {
431  NotifyTxDrop (packet);
433  return;
434  }
435  WifiMacHeader hdr;
436 
437  //If we are not a QoS AP then we definitely want to use AC_BE to
438  //transmit the packet. A TID of zero will map to AC_BE (through \c
439  //QosUtilsMapTidToAc()), so we use that as our default here.
440  uint8_t tid = 0;
441 
442  //For now, an AP that supports QoS does not support non-QoS
443  //associations, and vice versa. In future the AP model should
444  //support simultaneously associated QoS and non-QoS STAs, at which
445  //point there will need to be per-association QoS state maintained
446  //by the association state machine, and consulted here.
447  if (GetQosSupported ())
448  {
451  hdr.SetQosNoEosp ();
452  hdr.SetQosNoAmsdu ();
453  //Transmission of multiple frames in the same TXOP is not
454  //supported for now
455  hdr.SetQosTxopLimit (0);
456 
457  //Fill in the QoS control field in the MAC header
458  tid = QosUtilsGetTidForPacket (packet);
459  //Any value greater than 7 is invalid and likely indicates that
460  //the packet had no QoS tag, so we revert to zero, which'll
461  //mean that AC_BE is used.
462  if (tid > 7)
463  {
464  tid = 0;
465  }
466  hdr.SetQosTid (tid);
467  }
468  else
469  {
470  hdr.SetType (WIFI_MAC_DATA);
471  }
472  if (GetQosSupported ())
473  {
474  hdr.SetNoOrder (); // explicitly set to 0 for the time being since HT control field is not yet implemented (set it to 1 when implemented)
475  }
476 
477  hdr.SetAddr1 (GetBssid ());
478  hdr.SetAddr2 (GetAddress ());
479  hdr.SetAddr3 (to);
480  hdr.SetDsNotFrom ();
481  hdr.SetDsTo ();
482 
483  if (GetQosSupported ())
484  {
485  //Sanity check that the TID is valid
486  NS_ASSERT (tid < 8);
487  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
488  }
489  else
490  {
491  m_txop->Queue (packet, hdr);
492  }
493 }
494 
495 void
497 {
498  NS_LOG_FUNCTION (this << *mpdu);
499  const WifiMacHeader* hdr = &mpdu->GetHeader ();
500  Ptr<const Packet> packet = mpdu->GetPacket ();
501  NS_ASSERT (!hdr->IsCtl ());
502  if (hdr->GetAddr3 () == GetAddress ())
503  {
504  NS_LOG_LOGIC ("packet sent by us.");
505  return;
506  }
507  else if (hdr->GetAddr1 () != GetAddress ()
508  && !hdr->GetAddr1 ().IsGroup ())
509  {
510  NS_LOG_LOGIC ("packet is not for us");
511  NotifyRxDrop (packet);
512  return;
513  }
514  if (hdr->IsData ())
515  {
516  if (!IsAssociated ())
517  {
518  NS_LOG_LOGIC ("Received data frame while not associated: ignore");
519  NotifyRxDrop (packet);
520  return;
521  }
522  if (!(hdr->IsFromDs () && !hdr->IsToDs ()))
523  {
524  NS_LOG_LOGIC ("Received data frame not from the DS: ignore");
525  NotifyRxDrop (packet);
526  return;
527  }
528  if (hdr->GetAddr2 () != GetBssid ())
529  {
530  NS_LOG_LOGIC ("Received data frame not from the BSS we are associated with: ignore");
531  NotifyRxDrop (packet);
532  return;
533  }
534  if (hdr->IsQosData ())
535  {
536  if (hdr->IsQosAmsdu ())
537  {
538  NS_ASSERT (hdr->GetAddr3 () == GetBssid ());
540  packet = 0;
541  }
542  else
543  {
544  ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ());
545  }
546  }
547  else if (hdr->HasData ())
548  {
549  ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ());
550  }
551  return;
552  }
553  else if (hdr->IsProbeReq ()
554  || hdr->IsAssocReq ()
555  || hdr->IsReassocReq ())
556  {
557  //This is a frame aimed at an AP, so we can safely ignore it.
558  NotifyRxDrop (packet);
559  return;
560  }
561  else if (hdr->IsBeacon ())
562  {
563  NS_LOG_DEBUG ("Beacon received");
564  MgtBeaconHeader beacon;
565  Ptr<Packet> copy = packet->Copy ();
566  copy->RemoveHeader (beacon);
567  CapabilityInformation capabilities = beacon.GetCapabilities ();
568  NS_ASSERT (capabilities.IsEss ());
569  bool goodBeacon = false;
570  if (GetSsid ().IsBroadcast ()
571  || beacon.GetSsid ().IsEqual (GetSsid ()))
572  {
573  NS_LOG_LOGIC ("Beacon is for our SSID");
574  goodBeacon = true;
575  }
576  SupportedRates rates = beacon.GetSupportedRates ();
577  bool bssMembershipSelectorMatch = false;
578  auto selectorList = m_phy->GetBssMembershipSelectorList ();
579  for (const auto & selector : selectorList)
580  {
581  if (rates.IsBssMembershipSelectorRate (selector))
582  {
583  NS_LOG_LOGIC ("Beacon is matched to our BSS membership selector");
584  bssMembershipSelectorMatch = true;
585  }
586  }
587  if (selectorList.size () > 0 && bssMembershipSelectorMatch == false)
588  {
589  NS_LOG_LOGIC ("No match for BSS membership selector");
590  goodBeacon = false;
591  }
592  if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ())
593  {
594  NS_LOG_LOGIC ("Beacon is not for us");
595  goodBeacon = false;
596  }
597  if (goodBeacon && m_state == ASSOCIATED)
598  {
601  RestartBeaconWatchdog (delay);
602  UpdateApInfoFromBeacon (beacon, hdr->GetAddr2 (), hdr->GetAddr3 ());
603  }
604  if (goodBeacon && m_state == WAIT_BEACON)
605  {
606  NS_LOG_DEBUG ("Beacon received while scanning from " << hdr->GetAddr2 ());
607  SnrTag snrTag;
608  bool removed = copy->RemovePacketTag (snrTag);
609  NS_ASSERT (removed);
610  ApInfo apInfo;
611  apInfo.m_apAddr = hdr->GetAddr2 ();
612  apInfo.m_bssid = hdr->GetAddr3 ();
613  apInfo.m_activeProbing = false;
614  apInfo.m_snr = snrTag.Get ();
615  apInfo.m_beacon = beacon;
616  UpdateCandidateApList (apInfo);
617  }
618  return;
619  }
620  else if (hdr->IsProbeResp ())
621  {
622  if (m_state == WAIT_PROBE_RESP)
623  {
624  NS_LOG_DEBUG ("Probe response received while scanning from " << hdr->GetAddr2 ());
625  MgtProbeResponseHeader probeResp;
626  Ptr<Packet> copy = packet->Copy ();
627  copy->RemoveHeader (probeResp);
628  if (!probeResp.GetSsid ().IsEqual (GetSsid ()))
629  {
630  NS_LOG_DEBUG ("Probe response is not for our SSID");
631  return;
632  }
633  SnrTag snrTag;
634  bool removed = copy->RemovePacketTag (snrTag);
635  NS_ASSERT (removed);
636  ApInfo apInfo;
637  apInfo.m_apAddr = hdr->GetAddr2 ();
638  apInfo.m_bssid = hdr->GetAddr3 ();
639  apInfo.m_activeProbing = true;
640  apInfo.m_snr = snrTag.Get ();
641  apInfo.m_probeResp = probeResp;
642  UpdateCandidateApList (apInfo);
643  }
644  return;
645  }
646  else if (hdr->IsAssocResp () || hdr->IsReassocResp ())
647  {
648  if (m_state == WAIT_ASSOC_RESP)
649  {
650  MgtAssocResponseHeader assocResp;
651  packet->PeekHeader (assocResp);
653  {
655  }
656  if (assocResp.GetStatusCode ().IsSuccess ())
657  {
659  m_aid = assocResp.GetAssociationId ();
660  if (hdr->IsReassocResp ())
661  {
662  NS_LOG_DEBUG ("reassociation done");
663  }
664  else
665  {
666  NS_LOG_DEBUG ("association completed");
667  }
668  UpdateApInfoFromAssocResp (assocResp, hdr->GetAddr2 ());
669  if (!m_linkUp.IsNull ())
670  {
671  m_linkUp ();
672  }
673  }
674  else
675  {
676  NS_LOG_DEBUG ("association refused");
677  if (m_candidateAps.empty ())
678  {
679  SetState (REFUSED);
680  }
681  else
682  {
683  ScanningTimeout ();
684  }
685  }
686  }
687  return;
688  }
689 
690  //Invoke the receive handler of our parent class to deal with any
691  //other frames. Specifically, this will handle Block Ack-related
692  //Management Action frames.
693  RegularWifiMac::Receive (Create<WifiMacQueueItem> (packet, *hdr));
694 }
695 
696 void
698 {
699  NS_LOG_FUNCTION (this << newApInfo.m_bssid << newApInfo.m_apAddr << newApInfo.m_snr << newApInfo.m_activeProbing << newApInfo.m_beacon << newApInfo.m_probeResp);
700  // Remove duplicate ApInfo entry
701  for (std::vector<ApInfo>::iterator i = m_candidateAps.begin(); i != m_candidateAps.end(); ++i)
702  {
703  if (newApInfo.m_bssid == (*i).m_bssid)
704  {
705  m_candidateAps.erase(i);
706  break;
707  }
708  }
709  // Insert before the entry with lower SNR
710  for (std::vector<ApInfo>::iterator i = m_candidateAps.begin(); i != m_candidateAps.end(); ++i)
711  {
712  if (newApInfo.m_snr > (*i).m_snr)
713  {
714  m_candidateAps.insert (i, newApInfo);
715  return;
716  }
717  }
718  // If new ApInfo is the lowest, insert at back
719  m_candidateAps.push_back(newApInfo);
720 }
721 
722 void
724 {
725  NS_LOG_FUNCTION (this << beacon << apAddr << bssid);
726  SetBssid (bssid);
727  CapabilityInformation capabilities = beacon.GetCapabilities ();
728  SupportedRates rates = beacon.GetSupportedRates ();
729  for (const auto & mode : m_phy->GetModeList ())
730  {
731  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
732  {
733  m_stationManager->AddSupportedMode (apAddr, mode);
734  }
735  }
736  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
737  if (GetErpSupported ())
738  {
739  ErpInformation erpInformation = beacon.GetErpInformation ();
740  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
741  if (erpInformation.GetUseProtection () != 0)
742  {
744  }
745  else
746  {
748  }
749  if (capabilities.IsShortSlotTime () == true)
750  {
751  //enable short slot time
752  m_phy->SetSlot (MicroSeconds (9));
753  }
754  else
755  {
756  //disable short slot time
757  m_phy->SetSlot (MicroSeconds (20));
758  }
759  }
760  if (GetQosSupported ())
761  {
762  bool qosSupported = false;
763  EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
764  if (edcaParameters.IsQosSupported ())
765  {
766  qosSupported = true;
767  //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.
768  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTxopLimit ()));
769  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTxopLimit ()));
770  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTxopLimit ()));
771  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTxopLimit ()));
772  }
773  m_stationManager->SetQosSupport (apAddr, qosSupported);
774  }
775  if (GetHtSupported ())
776  {
777  HtCapabilities htCapabilities = beacon.GetHtCapabilities ();
778  if (!htCapabilities.IsSupportedMcs (0))
779  {
781  }
782  else
783  {
784  m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
785  }
786  }
787  if (GetVhtSupported ())
788  {
789  VhtCapabilities vhtCapabilities = beacon.GetVhtCapabilities ();
790  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
791  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
792  {
793  m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
794  VhtOperation vhtOperation = beacon.GetVhtOperation ();
795  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
796  {
797  if (vhtCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
798  {
799  m_stationManager->AddSupportedMcs (apAddr, mcs);
800  }
801  }
802  }
803  }
804  if (GetHtSupported ())
805  {
806  ExtendedCapabilities extendedCapabilities = beacon.GetExtendedCapabilities ();
807  //TODO: to be completed
808  }
809  if (GetHeSupported ())
810  {
811  HeCapabilities heCapabilities = beacon.GetHeCapabilities ();
812  if (heCapabilities.GetSupportedMcsAndNss () != 0)
813  {
814  m_stationManager->AddStationHeCapabilities (apAddr, heCapabilities);
815  HeOperation heOperation = beacon.GetHeOperation ();
816  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
817  {
818  if (heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
819  {
820  m_stationManager->AddSupportedMcs (apAddr, mcs);
821  }
822  }
823  }
824 
825  MuEdcaParameterSet muEdcaParameters = beacon.GetMuEdcaParameterSet ();
826  if (muEdcaParameters.IsPresent ())
827  {
828  SetMuEdcaParameters (AC_BE, muEdcaParameters.GetMuCwMin (AC_BE), muEdcaParameters.GetMuCwMax (AC_BE),
829  muEdcaParameters.GetMuAifsn (AC_BE), muEdcaParameters.GetMuEdcaTimer (AC_BE));
830  SetMuEdcaParameters (AC_BK, muEdcaParameters.GetMuCwMin (AC_BK), muEdcaParameters.GetMuCwMax (AC_BK),
831  muEdcaParameters.GetMuAifsn (AC_BK), muEdcaParameters.GetMuEdcaTimer (AC_BK));
832  SetMuEdcaParameters (AC_VI, muEdcaParameters.GetMuCwMin (AC_VI), muEdcaParameters.GetMuCwMax (AC_VI),
833  muEdcaParameters.GetMuAifsn (AC_VI), muEdcaParameters.GetMuEdcaTimer (AC_VI));
834  SetMuEdcaParameters (AC_VO, muEdcaParameters.GetMuCwMin (AC_VO), muEdcaParameters.GetMuCwMax (AC_VO),
835  muEdcaParameters.GetMuAifsn (AC_VO), muEdcaParameters.GetMuEdcaTimer (AC_VO));
836  }
837  }
838  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
840 }
841 
842 void
844 {
845  NS_LOG_FUNCTION (this << probeResp << apAddr << bssid);
846  CapabilityInformation capabilities = probeResp.GetCapabilities ();
847  SupportedRates rates = probeResp.GetSupportedRates ();
848  for (const auto & selector : m_phy->GetBssMembershipSelectorList ())
849  {
850  if (!rates.IsBssMembershipSelectorRate (selector))
851  {
852  NS_LOG_DEBUG ("Supported rates do not fit with the BSS membership selector");
853  return;
854  }
855  }
856  for (const auto & mode : m_phy->GetModeList ())
857  {
858  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
859  {
860  m_stationManager->AddSupportedMode (apAddr, mode);
861  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
862  {
864  }
865  }
866  }
867 
868  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
869  if (GetErpSupported ())
870  {
871  bool isErpAllowed = false;
872  for (const auto & mode : m_phy->GetModeList (WIFI_MOD_CLASS_ERP_OFDM))
873  {
874  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
875  {
876  isErpAllowed = true;
877  break;
878  }
879  }
880  if (!isErpAllowed)
881  {
882  //disable short slot time and set cwMin to 31
883  m_phy->SetSlot (MicroSeconds (20));
884  ConfigureContentionWindow (31, 1023);
885  }
886  else
887  {
888  ErpInformation erpInformation = probeResp.GetErpInformation ();
889  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
891  {
892  //enable short slot time
893  m_phy->SetSlot (MicroSeconds (9));
894  }
895  else
896  {
897  //disable short slot time
898  m_phy->SetSlot (MicroSeconds (20));
899  }
900  ConfigureContentionWindow (15, 1023);
901  }
902  }
903  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
905  SetBssid (bssid);
906 }
907 
908 void
910 {
911  NS_LOG_FUNCTION (this << assocResp << apAddr);
912  CapabilityInformation capabilities = assocResp.GetCapabilities ();
913  SupportedRates rates = assocResp.GetSupportedRates ();
914  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
915  if (GetErpSupported ())
916  {
917  bool isErpAllowed = false;
918  for (const auto & mode : m_phy->GetModeList (WIFI_MOD_CLASS_ERP_OFDM))
919  {
920  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
921  {
922  isErpAllowed = true;
923  break;
924  }
925  }
926  if (!isErpAllowed)
927  {
928  //disable short slot time and set cwMin to 31
929  m_phy->SetSlot (MicroSeconds (20));
930  ConfigureContentionWindow (31, 1023);
931  }
932  else
933  {
934  ErpInformation erpInformation = assocResp.GetErpInformation ();
935  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
937  {
938  //enable short slot time
939  m_phy->SetSlot (MicroSeconds (9));
940  }
941  else
942  {
943  //disable short slot time
944  m_phy->SetSlot (MicroSeconds (20));
945  }
946  ConfigureContentionWindow (15, 1023);
947  }
948  }
949  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
951  if (GetQosSupported ())
952  {
953  bool qosSupported = false;
954  EdcaParameterSet edcaParameters = assocResp.GetEdcaParameterSet ();
955  if (edcaParameters.IsQosSupported ())
956  {
957  qosSupported = true;
958  //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.
959  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTxopLimit ()));
960  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTxopLimit ()));
961  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTxopLimit ()));
962  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTxopLimit ()));
963  }
964  m_stationManager->SetQosSupport (apAddr, qosSupported);
965  }
966  if (GetHtSupported ())
967  {
968  HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
969  if (!htCapabilities.IsSupportedMcs (0))
970  {
972  }
973  else
974  {
975  m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
976  }
977  }
978  if (GetVhtSupported ())
979  {
980  VhtCapabilities vhtCapabilities = assocResp.GetVhtCapabilities ();
981  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
982  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
983  {
984  m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
985  VhtOperation vhtOperation = assocResp.GetVhtOperation ();
986  }
987  }
988  if (GetHeSupported ())
989  {
990  HeCapabilities hecapabilities = assocResp.GetHeCapabilities ();
991  if (hecapabilities.GetSupportedMcsAndNss () != 0)
992  {
993  m_stationManager->AddStationHeCapabilities (apAddr, hecapabilities);
994  HeOperation heOperation = assocResp.GetHeOperation ();
995  GetHeConfiguration ()->SetAttribute ("BssColor", UintegerValue (heOperation.GetBssColor ()));
996  }
997 
998  MuEdcaParameterSet muEdcaParameters = assocResp.GetMuEdcaParameterSet ();
999  if (muEdcaParameters.IsPresent ())
1000  {
1001  SetMuEdcaParameters (AC_BE, muEdcaParameters.GetMuCwMin (AC_BE), muEdcaParameters.GetMuCwMax (AC_BE),
1002  muEdcaParameters.GetMuAifsn (AC_BE), muEdcaParameters.GetMuEdcaTimer (AC_BE));
1003  SetMuEdcaParameters (AC_BK, muEdcaParameters.GetMuCwMin (AC_BK), muEdcaParameters.GetMuCwMax (AC_BK),
1004  muEdcaParameters.GetMuAifsn (AC_BK), muEdcaParameters.GetMuEdcaTimer (AC_BK));
1005  SetMuEdcaParameters (AC_VI, muEdcaParameters.GetMuCwMin (AC_VI), muEdcaParameters.GetMuCwMax (AC_VI),
1006  muEdcaParameters.GetMuAifsn (AC_VI), muEdcaParameters.GetMuEdcaTimer (AC_VI));
1007  SetMuEdcaParameters (AC_VO, muEdcaParameters.GetMuCwMin (AC_VO), muEdcaParameters.GetMuCwMax (AC_VO),
1008  muEdcaParameters.GetMuAifsn (AC_VO), muEdcaParameters.GetMuEdcaTimer (AC_VO));
1009  }
1010  }
1011  for (const auto & mode : m_phy->GetModeList ())
1012  {
1013  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1014  {
1015  m_stationManager->AddSupportedMode (apAddr, mode);
1016  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
1017  {
1019  }
1020  }
1021  }
1022  if (GetHtSupported ())
1023  {
1024  HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
1025  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HT))
1026  {
1027  if (htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1028  {
1029  m_stationManager->AddSupportedMcs (apAddr, mcs);
1030  //here should add a control to add basic MCS when it is implemented
1031  }
1032  }
1033  }
1034  if (GetVhtSupported ())
1035  {
1036  VhtCapabilities vhtcapabilities = assocResp.GetVhtCapabilities ();
1037  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
1038  {
1039  if (vhtcapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
1040  {
1041  m_stationManager->AddSupportedMcs (apAddr, mcs);
1042  //here should add a control to add basic MCS when it is implemented
1043  }
1044  }
1045  }
1046  if (GetHtSupported ())
1047  {
1048  ExtendedCapabilities extendedCapabilities = assocResp.GetExtendedCapabilities ();
1049  //TODO: to be completed
1050  }
1051  if (GetHeSupported ())
1052  {
1053  HeCapabilities heCapabilities = assocResp.GetHeCapabilities ();
1054  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
1055  {
1056  if (heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
1057  {
1058  m_stationManager->AddSupportedMcs (apAddr, mcs);
1059  //here should add a control to add basic MCS when it is implemented
1060  }
1061  }
1062  }
1063 }
1064 
1067 {
1068  SupportedRates rates;
1069  for (const auto & mode : m_phy->GetModeList ())
1070  {
1071  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
1072  NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
1073  rates.AddSupportedRate (modeDataRate);
1074  }
1075  if (GetHtSupported ())
1076  {
1077  for (const auto & selector : m_phy->GetBssMembershipSelectorList ())
1078  {
1079  rates.AddBssMembershipSelectorRate (selector);
1080  }
1081  }
1082  return rates;
1083 }
1084 
1087 {
1088  CapabilityInformation capabilities;
1091  return capabilities;
1092 }
1093 
1094 void
1096 {
1097  if (value == ASSOCIATED
1098  && m_state != ASSOCIATED)
1099  {
1100  m_assocLogger (GetBssid ());
1101  }
1102  else if (value != ASSOCIATED
1103  && m_state == ASSOCIATED)
1104  {
1106  }
1107  m_state = value;
1108 }
1109 
1110 void
1111 StaWifiMac::SetEdcaParameters (AcIndex ac, uint32_t cwMin, uint32_t cwMax, uint8_t aifsn, Time txopLimit)
1112 {
1113  Ptr<QosTxop> edca = GetQosTxop (ac);
1114  edca->SetMinCw (cwMin);
1115  edca->SetMaxCw (cwMax);
1116  edca->SetAifsn (aifsn);
1117  edca->SetTxopLimit (txopLimit);
1118 }
1119 
1120 void
1121 StaWifiMac::SetMuEdcaParameters (AcIndex ac, uint16_t cwMin, uint16_t cwMax, uint8_t aifsn, Time muEdcaTimer)
1122 {
1123  Ptr<QosTxop> edca = GetQosTxop (ac);
1124  edca->SetMuCwMin (cwMin);
1125  edca->SetMuCwMax (cwMax);
1126  edca->SetMuAifsn (aifsn);
1127  edca->SetMuEdcaTimer (muEdcaTimer);
1128 }
1129 
1130 void
1132 {
1133  NS_LOG_FUNCTION (this);
1134  if (IsAssociated ())
1135  {
1136  NS_LOG_DEBUG ("PHY capabilities changed: send reassociation request");
1138  SendAssociationRequest (true);
1139  }
1140 }
1141 
1142 } //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:57
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:123
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:374
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:1361
ns3::WifiMacHeader::IsToDs
bool IsToDs(void) const
Definition: wifi-mac-header.cc:552
ns3::RegularWifiMac::GetExtendedCapabilities
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities of the device.
Definition: regular-wifi-mac.cc:195
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:168
ns3::RegularWifiMac::GetSsid
Ssid GetSsid(void) const override
Definition: regular-wifi-mac.cc:685
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:1121
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:2118
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:125
ns3::WIFI_MOD_CLASS_HE
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Definition: wifi-phy-common.h:127
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:691
ns3::WifiPhy::GetDelayUntilIdle
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:2148
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:501
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:618
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::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:702
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:628
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:1066
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:557
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:51
ns3::WifiMacQueueItem::GetHeader
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Definition: wifi-mac-queue-item.cc:63
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:863
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:333
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:592
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:186
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:426
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:723
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:366
ns3::RegularWifiMac::ConfigureContentionWindow
void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
Definition: regular-wifi-mac.cc:1138
ns3::Txop::SetMinCw
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: txop.cc:156
ns3::RegularWifiMac::m_linkDown
Callback< void > m_linkDown
Callback when a link is down.
Definition: regular-wifi-mac.h:219
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:672
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:335
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:697
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:659
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::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:154
ns3::RegularWifiMac::m_edca
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
Definition: regular-wifi-mac.h:233
ns3::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:175
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:394
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:1292
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:771
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:608
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:909
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:1490
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:218
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:225
ns3::WifiMacHeader::HasData
bool HasData(void) const
Return true if the header type is DATA and is not DATA_NULL.
Definition: wifi-mac-header.cc:632
ns3::AC_BE
@ AC_BE
Best Effort.
Definition: qos-utils.h:73
ns3::RegularWifiMac::GetShortSlotTimeSupported
bool GetShortSlotTimeSupported(void) const override
Definition: regular-wifi-mac.cc:722
ns3::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:198
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:215
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:482
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:843
ns3::StaWifiMac::Receive
void Receive(Ptr< WifiMacQueueItem > mpdu) override
Handle a received packet.
Definition: sta-wifi-mac.cc:496
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:746
ns3::WifiRemoteStationManager::AddStationHtCapabilities
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htCapabilities)
Records HT capabilities of the remote station.
Definition: wifi-remote-station-manager.cc:1301
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:916
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:1327
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:1111
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:348
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:1095
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:1131
ns3::RegularWifiMac::GetHtCapabilities
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities of the device.
Definition: regular-wifi-mac.cc:206
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::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:345
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:537
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:414
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:1233
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:249
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:2015
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:1044
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:1427
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:303
ns3::WifiRemoteStationManager::AddSupportedMcs
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Definition: wifi-remote-station-manager.cc:403
ns3::UintegerValue
Hold an unsigned integer type.
Definition: uinteger.h:44
ns3::RegularWifiMac::GetVhtCapabilities
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities of the device.
Definition: regular-wifi-mac.cc:262
ns3::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::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:212
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:401
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:420
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:126
ns3::SupportedRates::AddBssMembershipSelectorRate
void AddBssMembershipSelectorRate(uint64_t bs)
Add a special value to the supported rate set, corresponding to a BSS membership selector.
Definition: supported-rates.cc:97
ns3::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::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:2064
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:168
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:598
ns3::Txop::Queue
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:289
ns3::MgtReassocRequestHeader
Implement the header for management frames of type reassociation request.
Definition: mgt-headers.h:182
ns3::RegularWifiMac::Receive
virtual void Receive(Ptr< WifiMacQueueItem > mpdu)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition: regular-wifi-mac.cc:753
ns3::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:161
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:258
ns3::HeCapabilities::IsSupportedRxMcs
bool IsSupportedRxMcs(uint8_t mcs) const
Is RX MCS supported.
Definition: he-capabilities.cc:396
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:1086
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:242
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