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 "sta-wifi-mac.h"
24 #include "ns3/log.h"
25 #include "ns3/simulator.h"
26 #include "mac-low.h"
27 
28 /*
29  * The state machine for this STA is:
30  -------------- -----------
31  | Associated | <-------------------- -------> | Refused |
32  -------------- \ / -----------
33  \ \ /
34  \ ----------------- -----------------------------
35  \-> | Beacon Missed | --> | Wait Association Response |
36  ----------------- -----------------------------
37  \ ^
38  \ |
39  \ -----------------------
40  \-> | Wait Probe Response |
41  -----------------------
42  */
43 
44 namespace ns3 {
45 
46 NS_LOG_COMPONENT_DEFINE ("StaWifiMac");
47 
48 NS_OBJECT_ENSURE_REGISTERED (StaWifiMac);
49 
50 TypeId
52 {
53  static TypeId tid = TypeId ("ns3::StaWifiMac")
55  .SetGroupName ("Wifi")
56  .AddConstructor<StaWifiMac> ()
57  .AddAttribute ("ProbeRequestTimeout", "The interval between two consecutive probe request attempts.",
58  TimeValue (Seconds (0.05)),
60  MakeTimeChecker ())
61  .AddAttribute ("AssocRequestTimeout", "The interval between two consecutive assoc request attempts.",
62  TimeValue (Seconds (0.5)),
64  MakeTimeChecker ())
65  .AddAttribute ("MaxMissedBeacons",
66  "Number of beacons which much be consecutively missed before "
67  "we attempt to restart association.",
68  UintegerValue (10),
70  MakeUintegerChecker<uint32_t> ())
71  .AddAttribute ("ActiveProbing",
72  "If true, we send probe requests. If false, we don't."
73  "NOTE: if more than one STA in your simulation is using active probing, "
74  "you should enable it at a different simulation time for each STA, "
75  "otherwise all the STAs will start sending probes at the same time resulting in collisions. "
76  "See bug 1060 for more info.",
77  BooleanValue (false),
80  .AddTraceSource ("Assoc", "Associated with an access point.",
82  "ns3::Mac48Address::TracedCallback")
83  .AddTraceSource ("DeAssoc", "Association with an access point lost.",
85  "ns3::Mac48Address::TracedCallback")
86  ;
87  return tid;
88 }
89 
91  : m_state (BEACON_MISSED),
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 
104 {
105  NS_LOG_FUNCTION (this);
106 }
107 
108 void
110 {
111  NS_LOG_FUNCTION (this << missed);
112  m_maxMissedBeacons = missed;
113 }
114 
115 void
117 {
118  NS_LOG_FUNCTION (this << timeout);
120 }
121 
122 void
124 {
125  NS_LOG_FUNCTION (this << timeout);
127 }
128 
129 void
131 {
132  NS_LOG_FUNCTION (this);
134 }
135 
136 void
138 {
139  NS_LOG_FUNCTION (this << enable);
140  if (enable)
141  {
143  }
144  else
145  {
147  }
148  m_activeProbing = enable;
149 }
150 
152 {
153  return m_activeProbing;
154 }
155 
156 void
158 {
159  NS_LOG_FUNCTION (this);
160  WifiMacHeader hdr;
161  hdr.SetProbeReq ();
163  hdr.SetAddr2 (GetAddress ());
165  hdr.SetDsNotFrom ();
166  hdr.SetDsNotTo ();
167  hdr.SetNoOrder ();
168  Ptr<Packet> packet = Create<Packet> ();
169  MgtProbeRequestHeader probe;
170  probe.SetSsid (GetSsid ());
171  probe.SetSupportedRates (GetSupportedRates ());
173  {
174  probe.SetHtCapabilities (GetHtCapabilities ());
175  }
177  {
178  probe.SetVhtCapabilities (GetVhtCapabilities ());
179  }
180  if (m_heSupported)
181  {
182  probe.SetHeCapabilities (GetHeCapabilities ());
183  }
184  packet->AddHeader (probe);
185 
186  //The standard is not clear on the correct queue for management
187  //frames if we are a QoS AP. The approach taken here is to always
188  //use the DCF for these regardless of whether we have a QoS
189  //association or not.
190  m_dca->Queue (packet, hdr);
191 
193  {
195  }
198 }
199 
200 void
202 {
203  NS_LOG_FUNCTION (this << GetBssid ());
204  WifiMacHeader hdr;
205  hdr.SetAssocReq ();
206  hdr.SetAddr1 (GetBssid ());
207  hdr.SetAddr2 (GetAddress ());
208  hdr.SetAddr3 (GetBssid ());
209  hdr.SetDsNotFrom ();
210  hdr.SetDsNotTo ();
211  hdr.SetNoOrder ();
212  Ptr<Packet> packet = Create<Packet> ();
213  MgtAssocRequestHeader assoc;
214  assoc.SetSsid (GetSsid ());
215  assoc.SetSupportedRates (GetSupportedRates ());
216  assoc.SetCapabilities (GetCapabilities ());
218  {
219  assoc.SetHtCapabilities (GetHtCapabilities ());
220  }
222  {
223  assoc.SetVhtCapabilities (GetVhtCapabilities ());
224  }
225  if (m_heSupported)
226  {
227  assoc.SetHeCapabilities (GetHeCapabilities ());
228  }
229  packet->AddHeader (assoc);
230 
231  //The standard is not clear on the correct queue for management
232  //frames if we are a QoS AP. The approach taken here is to always
233  //use the DCF for these regardless of whether we have a QoS
234  //association or not.
235  m_dca->Queue (packet, hdr);
236 
238  {
240  }
243 }
244 
245 void
247 {
248  NS_LOG_FUNCTION (this);
249  switch (m_state)
250  {
251  case ASSOCIATED:
252  return;
253  break;
254  case WAIT_PROBE_RESP:
255  /* we have sent a probe request earlier so we
256  do not need to re-send a probe request immediately.
257  We just need to wait until probe-request-timeout
258  or until we get a probe response
259  */
260  break;
261  case BEACON_MISSED:
262  /* we were associated but we missed a bunch of beacons
263  * so we should assume we are not associated anymore.
264  * We try to initiate a probe request now.
265  */
266  m_linkDown ();
267  if (m_activeProbing)
268  {
270  SendProbeRequest ();
271  }
272  break;
273  case WAIT_ASSOC_RESP:
274  /* we have sent an assoc request so we do not need to
275  re-send an assoc request right now. We just need to
276  wait until either assoc-request-timeout or until
277  we get an assoc response.
278  */
279  break;
280  case REFUSED:
281  /* we have sent an assoc request and received a negative
282  assoc resp. We wait until someone restarts an
283  association with a given ssid.
284  */
285  break;
286  }
287 }
288 
289 void
291 {
292  NS_LOG_FUNCTION (this);
295 }
296 
297 void
299 {
300  NS_LOG_FUNCTION (this);
302  SendProbeRequest ();
303 }
304 
305 void
307 {
308  NS_LOG_FUNCTION (this);
310  {
312  {
314  }
317  return;
318  }
319  NS_LOG_DEBUG ("beacon missed");
322 }
323 
324 void
326 {
327  NS_LOG_FUNCTION (this << delay);
331  {
332  NS_LOG_DEBUG ("really restart watchdog.");
334  }
335 }
336 
337 bool
339 {
340  return m_state == ASSOCIATED;
341 }
342 
343 bool
345 {
346  return m_state == WAIT_ASSOC_RESP;
347 }
348 
349 void
351 {
352  NS_LOG_FUNCTION (this << packet << to);
353  if (!IsAssociated ())
354  {
355  NotifyTxDrop (packet);
357  return;
358  }
359  WifiMacHeader hdr;
360 
361  //If we are not a QoS AP then we definitely want to use AC_BE to
362  //transmit the packet. A TID of zero will map to AC_BE (through \c
363  //QosUtilsMapTidToAc()), so we use that as our default here.
364  uint8_t tid = 0;
365 
366  //For now, an AP that supports QoS does not support non-QoS
367  //associations, and vice versa. In future the AP model should
368  //support simultaneously associated QoS and non-QoS STAs, at which
369  //point there will need to be per-association QoS state maintained
370  //by the association state machine, and consulted here.
371  if (m_qosSupported)
372  {
375  hdr.SetQosNoEosp ();
376  hdr.SetQosNoAmsdu ();
377  //Transmission of multiple frames in the same TXOP is not
378  //supported for now
379  hdr.SetQosTxopLimit (0);
380 
381  //Fill in the QoS control field in the MAC header
382  tid = QosUtilsGetTidForPacket (packet);
383  //Any value greater than 7 is invalid and likely indicates that
384  //the packet had no QoS tag, so we revert to zero, which'll
385  //mean that AC_BE is used.
386  if (tid > 7)
387  {
388  tid = 0;
389  }
390  hdr.SetQosTid (tid);
391  }
392  else
393  {
394  hdr.SetTypeData ();
395  }
397  {
398  hdr.SetNoOrder ();
399  }
400 
401  hdr.SetAddr1 (GetBssid ());
402  hdr.SetAddr2 (m_low->GetAddress ());
403  hdr.SetAddr3 (to);
404  hdr.SetDsNotFrom ();
405  hdr.SetDsTo ();
406 
407  if (m_qosSupported)
408  {
409  //Sanity check that the TID is valid
410  NS_ASSERT (tid < 8);
411  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
412  }
413  else
414  {
415  m_dca->Queue (packet, hdr);
416  }
417 }
418 
419 void
421 {
422  NS_LOG_FUNCTION (this << packet << hdr);
423  NS_ASSERT (!hdr->IsCtl ());
424  if (hdr->GetAddr3 () == GetAddress ())
425  {
426  NS_LOG_LOGIC ("packet sent by us.");
427  return;
428  }
429  else if (hdr->GetAddr1 () != GetAddress ()
430  && !hdr->GetAddr1 ().IsGroup ())
431  {
432  NS_LOG_LOGIC ("packet is not for us");
433  NotifyRxDrop (packet);
434  return;
435  }
436  else if (hdr->IsData ())
437  {
438  if (!IsAssociated ())
439  {
440  NS_LOG_LOGIC ("Received data frame while not associated: ignore");
441  NotifyRxDrop (packet);
442  return;
443  }
444  if (!(hdr->IsFromDs () && !hdr->IsToDs ()))
445  {
446  NS_LOG_LOGIC ("Received data frame not from the DS: ignore");
447  NotifyRxDrop (packet);
448  return;
449  }
450  if (hdr->GetAddr2 () != GetBssid ())
451  {
452  NS_LOG_LOGIC ("Received data frame not from the BSS we are associated with: ignore");
453  NotifyRxDrop (packet);
454  return;
455  }
456  if (hdr->IsQosData ())
457  {
458  if (hdr->IsQosAmsdu ())
459  {
460  NS_ASSERT (hdr->GetAddr3 () == GetBssid ());
461  DeaggregateAmsduAndForward (packet, hdr);
462  packet = 0;
463  }
464  else
465  {
466  ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ());
467  }
468  }
469  else
470  {
471  ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ());
472  }
473  return;
474  }
475  else if (hdr->IsProbeReq ()
476  || hdr->IsAssocReq ())
477  {
478  //This is a frame aimed at an AP, so we can safely ignore it.
479  NotifyRxDrop (packet);
480  return;
481  }
482  else if (hdr->IsBeacon ())
483  {
484  MgtBeaconHeader beacon;
485  packet->RemoveHeader (beacon);
486  CapabilityInformation capabilities = beacon.GetCapabilities ();
487  bool goodBeacon = false;
488  if (GetSsid ().IsBroadcast ()
489  || beacon.GetSsid ().IsEqual (GetSsid ()))
490  {
491  NS_LOG_LOGIC ("Beacon is for our SSID");
492  goodBeacon = true;
493  }
494  SupportedRates rates = beacon.GetSupportedRates ();
495  bool bssMembershipSelectorMatch = false;
496  for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
497  {
498  uint32_t selector = m_phy->GetBssMembershipSelector (i);
499  if (rates.IsBssMembershipSelectorRate (selector))
500  {
501  NS_LOG_LOGIC ("Beacon is matched to our BSS membership selector");
502  bssMembershipSelectorMatch = true;
503  }
504  }
505  if (m_phy->GetNBssMembershipSelectors () > 0 && bssMembershipSelectorMatch == false)
506  {
507  NS_LOG_LOGIC ("No match for BSS membership selector");
508  goodBeacon = false;
509  }
510  if ((IsWaitAssocResp () || IsAssociated ()) && hdr->GetAddr3 () != GetBssid ())
511  {
512  NS_LOG_LOGIC ("Beacon is not for us");
513  goodBeacon = false;
514  }
515  if (goodBeacon)
516  {
518  RestartBeaconWatchdog (delay);
519  SetBssid (hdr->GetAddr3 ());
520  SupportedRates rates = beacon.GetSupportedRates ();
521  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
522  {
523  WifiMode mode = m_phy->GetMode (i);
524  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
525  {
526  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
527  }
528  }
529  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
530  if (m_erpSupported)
531  {
532  ErpInformation erpInformation = beacon.GetErpInformation ();
533  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
534  if (erpInformation.GetUseProtection () == true)
535  {
537  }
538  else
539  {
541  }
542  if (capabilities.IsShortSlotTime () == true)
543  {
544  //enable short slot time
545  SetSlot (MicroSeconds (9));
546  }
547  else
548  {
549  //disable short slot time
550  SetSlot (MicroSeconds (20));
551  }
552  }
553  if (m_qosSupported)
554  {
555  bool qosSupported = false;
556  EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
557  if (edcaParameters.IsQosSupported ())
558  {
559  qosSupported = true;
560  //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.
561  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit ()));
562  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit ()));
563  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit ()));
564  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit ()));
565  }
566  m_stationManager->SetQosSupport (hdr->GetAddr2 (), qosSupported);
567  }
568  if (m_htSupported)
569  {
570  HtCapabilities htCapabilities = beacon.GetHtCapabilities ();
571  if (!htCapabilities.IsSupportedMcs (0))
572  {
574  }
575  else
576  {
577  m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htCapabilities);
578  HtOperation htOperation = beacon.GetHtOperation ();
579  if (htOperation.GetNonGfHtStasPresent ())
580  {
582  }
583  else
584  {
586  }
587  if (!m_vhtSupported && GetRifsSupported () && htOperation.GetRifsMode ())
588  {
590  }
591  else
592  {
594  }
595  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
596  {
597  WifiMode mcs = m_phy->GetMcs (i);
598  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
599  {
600  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
601  }
602  }
603  }
604  }
605  if (m_vhtSupported)
606  {
607  VhtCapabilities vhtCapabilities = beacon.GetVhtCapabilities ();
608  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
609  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
610  {
611  m_stationManager->AddStationVhtCapabilities (hdr->GetAddr2 (), vhtCapabilities);
612  VhtOperation vhtOperation = beacon.GetVhtOperation ();
613  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
614  {
615  WifiMode mcs = m_phy->GetMcs (i);
616  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
617  {
618  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
619  }
620  }
621  }
622  }
623  if (m_heSupported)
624  {
625  HeCapabilities heCapabilities = beacon.GetHeCapabilities ();
626  //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
627  m_stationManager->AddStationHeCapabilities (hdr->GetAddr2 (), heCapabilities);
628  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
629  {
630  WifiMode mcs = m_phy->GetMcs (i);
631  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
632  {
633  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
634  }
635  }
636  }
637  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
639  }
640  if (goodBeacon && m_state == BEACON_MISSED)
641  {
644  }
645  return;
646  }
647  else if (hdr->IsProbeResp ())
648  {
649  if (m_state == WAIT_PROBE_RESP)
650  {
651  MgtProbeResponseHeader probeResp;
652  packet->RemoveHeader (probeResp);
653  CapabilityInformation capabilities = probeResp.GetCapabilities ();
654  if (!probeResp.GetSsid ().IsEqual (GetSsid ()))
655  {
656  //not a probe resp for our ssid.
657  return;
658  }
659  SupportedRates rates = probeResp.GetSupportedRates ();
660  for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
661  {
662  uint32_t selector = m_phy->GetBssMembershipSelector (i);
663  if (!rates.IsSupportedRate (selector))
664  {
665  return;
666  }
667  }
668  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
669  {
670  WifiMode mode = m_phy->GetMode (i);
671  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
672  {
673  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
674  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
675  {
677  }
678  }
679  }
680 
681  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
682  if (m_erpSupported)
683  {
684  bool isErpAllowed = false;
685  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
686  {
687  WifiMode mode = m_phy->GetMode (i);
689  {
690  isErpAllowed = true;
691  break;
692  }
693  }
694  if (!isErpAllowed)
695  {
696  //disable short slot time and set cwMin to 31
697  SetSlot (MicroSeconds (20));
698  ConfigureContentionWindow (31, 1023);
699  }
700  else
701  {
702  ErpInformation erpInformation = probeResp.GetErpInformation ();
703  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
705  {
706  //enable short slot time
707  SetSlot (MicroSeconds (9));
708  }
709  else
710  {
711  //disable short slot time
712  SetSlot (MicroSeconds (20));
713  }
714  ConfigureContentionWindow (15, 1023);
715  }
716  }
717  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
719  SetBssid (hdr->GetAddr3 ());
720  Time delay = MicroSeconds (probeResp.GetBeaconIntervalUs () * m_maxMissedBeacons);
721  RestartBeaconWatchdog (delay);
723  {
725  }
728  }
729  return;
730  }
731  else if (hdr->IsAssocResp ())
732  {
733  if (m_state == WAIT_ASSOC_RESP)
734  {
735  MgtAssocResponseHeader assocResp;
736  packet->RemoveHeader (assocResp);
738  {
740  }
741  if (assocResp.GetStatusCode ().IsSuccess ())
742  {
744  NS_LOG_DEBUG ("assoc completed");
745  CapabilityInformation capabilities = assocResp.GetCapabilities ();
746  SupportedRates rates = assocResp.GetSupportedRates ();
747  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
748  if (m_erpSupported)
749  {
750  bool isErpAllowed = false;
751  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
752  {
753  WifiMode mode = m_phy->GetMode (i);
755  {
756  isErpAllowed = true;
757  break;
758  }
759  }
760  if (!isErpAllowed)
761  {
762  //disable short slot time and set cwMin to 31
763  SetSlot (MicroSeconds (20));
764  ConfigureContentionWindow (31, 1023);
765  }
766  else
767  {
768  ErpInformation erpInformation = assocResp.GetErpInformation ();
769  isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
771  {
772  //enable short slot time
773  SetSlot (MicroSeconds (9));
774  }
775  else
776  {
777  //disable short slot time
778  SetSlot (MicroSeconds (20));
779  }
780  ConfigureContentionWindow (15, 1023);
781  }
782  }
783  m_stationManager->SetShortPreambleEnabled (isShortPreambleEnabled);
785  if (m_qosSupported)
786  {
787  bool qosSupported = false;
788  EdcaParameterSet edcaParameters = assocResp.GetEdcaParameterSet ();
789  if (edcaParameters.IsQosSupported ())
790  {
791  qosSupported = true;
792  //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.
793  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit ()));
794  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit ()));
795  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit ()));
796  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit ()));
797  }
798  m_stationManager->SetQosSupport (hdr->GetAddr2 (), qosSupported);
799  }
800  if (m_htSupported)
801  {
802  HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
803  if (!htCapabilities.IsSupportedMcs (0))
804  {
806  }
807  else
808  {
809  m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htCapabilities);
810  HtOperation htOperation = assocResp.GetHtOperation ();
811  if (htOperation.GetNonGfHtStasPresent ())
812  {
814  }
815  else
816  {
818  }
819  if (!m_vhtSupported && GetRifsSupported () && htOperation.GetRifsMode ())
820  {
822  }
823  else
824  {
826  }
827  }
828  }
829  if (m_vhtSupported)
830  {
831  VhtCapabilities vhtCapabilities = assocResp.GetVhtCapabilities ();
832  //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
833  if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
834  {
835  m_stationManager->AddStationVhtCapabilities (hdr->GetAddr2 (), vhtCapabilities);
836  VhtOperation vhtOperation = assocResp.GetVhtOperation ();
837  }
838  }
839  if (m_heSupported)
840  {
841  HeCapabilities hecapabilities = assocResp.GetHeCapabilities ();
842  //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
843  m_stationManager->AddStationHeCapabilities (hdr->GetAddr2 (), hecapabilities);
844  }
845  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
846  {
847  WifiMode mode = m_phy->GetMode (i);
848  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
849  {
850  m_stationManager->AddSupportedMode (hdr->GetAddr2 (), mode);
851  if (rates.IsBasicRate (mode.GetDataRate (m_phy->GetChannelWidth ())))
852  {
854  }
855  }
856  }
857  if (m_htSupported)
858  {
859  HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
860  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
861  {
862  WifiMode mcs = m_phy->GetMcs (i);
863  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
864  {
865  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
866  //here should add a control to add basic MCS when it is implemented
867  }
868  }
869  }
870  if (m_vhtSupported)
871  {
872  VhtCapabilities vhtcapabilities = assocResp.GetVhtCapabilities ();
873  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
874  {
875  WifiMode mcs = m_phy->GetMcs (i);
876  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
877  {
878  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
879  //here should add a control to add basic MCS when it is implemented
880  }
881  }
882  }
883  if (m_heSupported)
884  {
885  HeCapabilities heCapabilities = assocResp.GetHeCapabilities ();
886  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
887  {
888  WifiMode mcs = m_phy->GetMcs (i);
889  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
890  {
891  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
892  //here should add a control to add basic MCS when it is implemented
893  }
894  }
895  }
896  if (!m_linkUp.IsNull ())
897  {
898  m_linkUp ();
899  }
900  }
901  else
902  {
903  NS_LOG_DEBUG ("assoc refused");
904  SetState (REFUSED);
905  }
906  }
907  return;
908  }
909 
910  //Invoke the receive handler of our parent class to deal with any
911  //other frames. Specifically, this will handle Block Ack-related
912  //Management Action frames.
913  RegularWifiMac::Receive (packet, hdr);
914 }
915 
918 {
919  SupportedRates rates;
921  {
922  for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
923  {
925  }
926  }
927  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
928  {
929  WifiMode mode = m_phy->GetMode (i);
930  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth ());
931  NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
932  rates.AddSupportedRate (modeDataRate);
933  }
934  return rates;
935 }
936 
939 {
940  CapabilityInformation capabilities;
943  return capabilities;
944 }
945 
946 void
948 {
949  if (value == ASSOCIATED
950  && m_state != ASSOCIATED)
951  {
952  m_assocLogger (GetBssid ());
953  }
954  else if (value != ASSOCIATED
955  && m_state == ASSOCIATED)
956  {
958  }
959  m_state = value;
960 }
961 
962 void
963 StaWifiMac::SetEdcaParameters (AcIndex ac, uint8_t cwMin, uint8_t cwMax, uint8_t aifsn, Time txopLimit)
964 {
965  Ptr<EdcaTxopN> edca = m_edca.find (ac)->second;
966  edca->SetMinCw (cwMin);
967  edca->SetMaxCw (cwMax);
968  edca->SetAifsn (aifsn);
969  edca->SetTxopLimit (txopLimit);
970 }
971 
972 } //namespace ns3
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Definition: simulator.cc:258
bool IsWaitAssocResp(void) const
Return whether we are waiting for an association response from an AP.
bool IsBeacon(void) const
Return true if the header is a Beacon header.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:267
TracedCallback< Mac48Address > m_deAssocLogger
deassoc logger
Definition: sta-wifi-mac.h:203
void AddSupportedRate(uint32_t bs)
Add the given rate to the supported rates.
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates...
uint32_t GetNBssMembershipSelectors(void) const
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
Definition: wifi-phy.cc:1351
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Time m_assocRequestTimeout
assoc request timeout
Definition: sta-wifi-mac.h:194
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:197
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Implement the header for management frames of type association request.
Definition: mgt-headers.h:45
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:54
AttributeValue implementation for Boolean.
Definition: boolean.h:36
void SendAssociationRequest(void)
Forward an association request packet to the DCF.
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:667
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:185
void SetType(WifiMacType type)
Set Type/Subtype values with the correct values depending on the given type.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void SetProbeReq(void)
Set Type/Subtype values for a probe request header.
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: dca-txop.cc:174
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities.
Definition: mgt-headers.cc:727
uint64_t GetBeaconIntervalUs(void) const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:191
void SetState(MacState value)
Set the current MAC state.
void AssocRequestTimeout(void)
This method is called after the association timeout occurred.
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:84
Time m_probeRequestTimeout
probe request timeout
Definition: sta-wifi-mac.h:193
void SetProbeRequestTimeout(Time timeout)
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
uint8_t GetViCWmax(void) const
Return the AC_VI CWmax field in the EdcaParameterSet information element.
uint8_t GetVoAifsn(void) const
Return the AC_VO AIFSN field in the EdcaParameterSet information element.
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1270
The VHT Operation Information ElementThis class knows how to serialise and deserialise the VHT Operat...
Definition: vht-operation.h:37
#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
Callback< void > m_linkUp
Callback when a link is up.
void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
bool IsAssocReq(void) const
Return true if the header is an Association Request header.
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:466
void SetSlot(Time slotTime)
void NotifyRxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:283
The HT Operation Information ElementThis class knows how to serialise and deserialise the HT Operatio...
Definition: ht-operation.h:52
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:65
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:703
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack...
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
Definition: wifi-phy.cc:3553
TracedCallback< Mac48Address > m_assocLogger
assoc logger
Definition: sta-wifi-mac.h:202
EventId m_assocRequestEvent
assoc request event
Definition: sta-wifi-mac.h:196
bool IsAssocResp(void) const
Return true if the header is an Association Response header.
VHT PHY (Clause 22)
Definition: wifi-mode.h:60
Ptr< WifiPhy > m_phy
Wifi PHY.
bool IsCtl(void) const
Return true if the Type is Control.
ns3::Time timeout
bool IsEqual(const Ssid &o) const
Check if the two SSIDs are equal.
Definition: ssid.cc:72
uint8_t GetVoCWmin(void) const
Return the AC_VO CWmin field in the EdcaParameterSet information element.
Ssid GetSsid(void) const
Video.
Definition: qos-utils.h:45
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Voice.
Definition: qos-utils.h:47
Best Effort.
Definition: qos-utils.h:41
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
bool IsQosAmsdu(void) const
Check if the A-MSDU present bit is set in the QoS control field.
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capability of the device.
bool IsProbeResp(void) const
Return true if the header is a Probe Response header.
Capability information.
uint32_t GetBssMembershipSelector(uint32_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1357
void SetAssocRequestTimeout(Time timeout)
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
HeCapabilities GetHeCapabilities(void) const
Return the HE capability of the device.
ErpInformation GetErpInformation(void) const
Return the ERP information.
Definition: mgt-headers.cc:739
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
If a qos tag is attached to the packet, returns a value < 8.
Definition: qos-utils.cc:62
uint8_t GetNonGfHtStasPresent(void) const
Return the non GF HT STAs present.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
uint16_t GetBeTXOPLimit(void) const
Return the AC_BE TXOP Limit field in the EdcaParameterSet information element.
uint8_t GetViCWmin(void) const
Return the AC_VI CWmin field in the EdcaParameterSet information element.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:245
void SetBssid(Mac48Address bssid)
void SendProbeRequest(void)
Forward a probe request packet to the DCF.
Background.
Definition: qos-utils.h:43
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
base class for all MAC-level wifi objects.
void ProbeRequestTimeout(void)
This method is called after the probe request timeout occurred.
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service...
uint8_t IsQosSupported(void) const
Is QOS supported function.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1375
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
#define max(a, b)
Definition: 80211b.c:45
uint16_t GetBkTXOPLimit(void) const
Return the AC_BK TXOP Limit field in the EdcaParameterSet information element.
AttributeValue implementation for Time.
Definition: nstime.h:1055
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
uint8_t GetBeCWmin(void) const
Return the AC_BE CWmin field in the EdcaParameterSet information element.
MacState
The current MAC state of the STA.
Definition: sta-wifi-mac.h:91
Ptr< DcaTxop > m_dca
This holds a pointer to the DCF instance for this WifiMac - used for transmission of frames to non-Qo...
ErpInformation GetErpInformation(void) const
Return the ERP information.
Definition: mgt-headers.cc:311
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
The IEEE 802.11ac VHT Capabilities.
MacState m_state
MAC state.
Definition: sta-wifi-mac.h:192
void NotifyTxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:265
bool IsProbeReq(void) const
Return true if the header is a Probe Request header.
Hold an unsigned integer type.
Definition: uinteger.h:44
void MissedBeacons(void)
This method is called after we have not received a beacon from the AP.
uint8_t GetBarkerPreambleMode(void) const
Return the Barker_Preamble_Mode field in the ErpInformation information element.
uint64_t GetDataRate(uint8_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:143
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htcapabilities)
Records HT capabilities of the remote station.
bool m_vhtSupported
This Boolean is set true iff this WifiMac is to model 802.11ac.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:28
uint16_t GetVoTXOPLimit(void) const
Return the AC_VO TXOP Limit field in the EdcaParameterSet information element.
HT PHY (Clause 20)
Definition: wifi-mode.h:58
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:465
static Mac48Address GetBroadcast(void)
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:529
uint8_t GetVoCWmax(void) const
Return the AC_VO CWmax field in the EdcaParameterSet information element.
bool GetActiveProbing(void) const
Return whether active probing is enabled.
void AddStationHeCapabilities(Mac48Address from, HeCapabilities hecapabilities)
Records HE capabilities of the remote station.
uint32_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3541
bool m_heSupported
This Boolean is set true iff this WifiMac is to model 802.11ax.
void SetAssocReq(void)
Set Type/Subtype values for an association request header.
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set.
Definition: mgt-headers.cc:751
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
VhtOperation GetVhtOperation(void) const
Return the VHT operation.
Definition: mgt-headers.cc:715
SupportedRates GetSupportedRates(void)
Return the supported rates.
Definition: mgt-headers.cc:643
HtCapabilities GetHtCapabilities(void) const
Return the HT capability of the device.
void SetQosSupport(Mac48Address from, bool qosSupported)
Records QoS support of the remote station.
Callback< void > m_linkDown
Callback when a link is down.
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
bool IsBasicRate(uint32_t bs) const
Check if the given rate is a basic rate.
uint32_t m_maxMissedBeacons
maximum missed beacons
Definition: sta-wifi-mac.h:199
void SetAifsn(uint32_t aifsn)
Set the number of slots that make up an AIFS.
Definition: dca-txop.cc:181
void StartActiveAssociation(void)
Start an active association sequence immediately.
uint8_t GetRifsMode(void) const
Return the RIFS mode.
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
Definition: wifi-phy.cc:3559
void SetMaxMissedBeacons(uint32_t missed)
EventId m_beaconWatchdog
beacon watchdog
Definition: sta-wifi-mac.h:197
void AddBssMembershipSelectorRate(uint32_t bs)
Add a special value to the supported rate set, corresponding to a BSS membership selector.
virtual ~StaWifiMac()
bool IsToDs(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t GetBeCWmax(void) const
Return the AC_BE CWmax field in the EdcaParameterSet information element.
The EDCA Parameter SetThis class knows how to serialise and deserialise the EDCA Parameter Set...
uint8_t GetBkCWmax(void) const
Return the AC_BK CWmax field in the EdcaParameterSet information element.
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...
bool IsGroup(void) const
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
static TypeId GetTypeId(void)
Get the type ID.
Definition: sta-wifi-mac.cc:51
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:221
an EUI-48 address
Definition: mac48-address.h:43
uint8_t GetBkCWmin(void) const
Return the AC_BK CWmin field in the EdcaParameterSet information element.
uint16_t GetViTXOPLimit(void) const
Return the AC_VI TXOP Limit field in the EdcaParameterSet information element.
HtOperation GetHtOperation(void) const
Return the HT operation.
Definition: mgt-headers.cc:691
uint8_t GetViAifsn(void) const
Return the AC_VI AIFSN field in the EdcaParameterSet information element.
void RestartBeaconWatchdog(Time delay)
Restarts the beacon timer.
CapabilityInformation GetCapabilities(void) const
Return the Capability information of the current STA.
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
Definition: simulator.h:1564
void TryToEnsureAssociated(void)
Try to ensure that we are associated with an AP by taking an appropriate action depending on the curr...
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:1056
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:249
void SetShortPreamble(bool shortPreamble)
Set the short preamble bit in the capability information field.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
Implement the header for management frames of type probe request.
Definition: mgt-headers.h:321
bool m_htSupported
This Boolean is set true iff this WifiMac is to model 802.11n.
void SetActiveProbing(bool enable)
Enable or disable active probing.
Implement the header for management frames of type association response.
Definition: mgt-headers.h:163
Mac48Address GetBssid(void) const
uint8_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1304
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: dca-txop.cc:167
bool IsShortSlotTime(void) const
Check if the short slot time in the capability information field is set to 1.
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: dca-txop.cc:188
bool IsData(void) const
Return true if the Type is DATA.
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS DATA...
EdcaParameterSet GetEdcaParameterSet(void) const
Return the EDCA Parameter Set.
Definition: mgt-headers.cc:323
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:269
Mac48Address GetAddress(void) const
void SetTypeData(void)
Set Type/Subtype values for a data packet with no subtype equal to 0.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:993
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
bool IsSuccess(void) const
Return whether the status code is success.
Definition: status-code.cc:42
VhtOperation GetVhtOperation(void) const
Return the VHT operation.
Definition: mgt-headers.cc:257
bool IsSupportedRxMcs(uint8_t mcs) const
Is reeive MCS supported.
HtOperation GetHtOperation(void) const
Return the HT operation.
Definition: mgt-headers.cc:233
void Enqueue(Ptr< const Packet > packet, Mac48Address to)
void SetUseGreenfieldProtection(bool enable)
Enable or disable protection for stations that do not support HT greenfield format.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
void SetDsTo(void)
Set the To DS bit in the Frame Control field.
bool IsFromDs(void) const
uint8_t GetBeAifsn(void) const
Return the AC_BE AIFSN field in the EdcaParameterSet information element.
bool IsSupportedRate(uint32_t bs) const
Check if the given rate is supported.
uint8_t GetBkAifsn(void) const
Return the AC_BK AIFSN field in the EdcaParameterSet information element.
bool IsSupportedRxMcs(uint8_t mcs) const
Get the is receive MCS supported.
void SetNoOrder(void)
Unset order bit in the frame control field.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1009
The ErpInformation Information ElementThis class knows how to serialise and deserialise the ErpInform...
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:209
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:39
bool GetShortSlotTimeSupported(void) const
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Time m_beaconWatchdogEnd
beacon watchdog end
Definition: sta-wifi-mac.h:198
bool m_erpSupported
This Boolean is set true iff this WifiMac is to model 802.11g.
bool GetRifsSupported(void) const
bool m_activeProbing
active probing
Definition: sta-wifi-mac.h:200
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:487
void SetShortSlotTime(bool shortSlotTime)
Set the short slot time bit in the capability information field.
EventId m_probeRequestEvent
probe request event
Definition: sta-wifi-mac.h:195
void SetShortPreambleEnabled(bool enable)
Enable or disable short PLCP preambles.
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:412
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
uint16_t GetRxHighestSupportedLgiDataRate() const
Get the receive highest supported LGI data rate.
bool GetShortPlcpPreambleSupported(void) const
Return whether short PLCP preamble is supported.
Definition: wifi-phy.cc:664
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
uint8_t GetUseProtection(void) const
Return the Use_Protection field in the ErpInformation information element.
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities.
Definition: mgt-headers.cc:269
bool IsAssociated(void) const
Return whether we are associated with an AP.
The IEEE 802.11ax HE Capabilities.
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition: event-id.cc:59
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
a unique identifier for an interface.
Definition: type-id.h:58
void SetEdcaParameters(AcIndex ac, uint8_t cwMin, uint8_t cwMax, uint8_t aifsn, Time txopLimit)
Set the EDCA parameters.
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the suppported MCS by a destination.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:914
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:38
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:602
HE PHY (Clause 26)
Definition: wifi-mode.h:62
void SetRifsPermitted(bool allow)
Permit or prohibit RIFS.
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:256
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtcapabilities)
Records VHT capabilities of the remote station.
Implements the IEEE 802.11 MAC header.
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
StatusCode GetStatusCode(void)
Return the status code.
Definition: mgt-headers.cc:637
WifiMode GetMode(uint32_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3547
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
bool IsBssMembershipSelectorRate(uint32_t bs) const
Check if the given rate is a BSS membership selector value.
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:679
The Wifi MAC high model for a non-AP STA in a BSS.
Definition: sta-wifi-mac.h:39
bool IsShortPreamble(void) const
Check if the short preamble bit in the capability information field is set to 1.
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS ACK policy in the QoS control field.