A Discrete-Event Network Simulator
API
ap-wifi-mac.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
23 #include "ap-wifi-mac.h"
24 #include "ns3/assert.h"
25 #include "ns3/log.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
28 #include "ns3/pointer.h"
29 #include "ns3/boolean.h"
30 #include "qos-tag.h"
31 #include "wifi-phy.h"
32 #include "dcf-manager.h"
33 #include "mac-rx-middle.h"
34 #include "mac-tx-middle.h"
35 #include "mgt-headers.h"
36 #include "mac-low.h"
37 #include "amsdu-subframe-header.h"
38 #include "msdu-aggregator.h"
39 
40 namespace ns3 {
41 
42 NS_LOG_COMPONENT_DEFINE ("ApWifiMac");
43 
44 NS_OBJECT_ENSURE_REGISTERED (ApWifiMac);
45 
46 TypeId
48 {
49  static TypeId tid = TypeId ("ns3::ApWifiMac")
51  .SetGroupName ("Wifi")
52  .AddConstructor<ApWifiMac> ()
53  .AddAttribute ("BeaconInterval",
54  "Delay between two beacons",
55  TimeValue (MicroSeconds (102400)),
58  MakeTimeChecker ())
59  .AddAttribute ("BeaconJitter",
60  "A uniform random variable to cause the initial beacon starting time (after simulation time 0) "
61  "to be distributed between 0 and the BeaconInterval.",
62  StringValue ("ns3::UniformRandomVariable"),
64  MakePointerChecker<UniformRandomVariable> ())
65  .AddAttribute ("EnableBeaconJitter",
66  "If beacons are enabled, whether to jitter the initial send event.",
67  BooleanValue (false),
70  .AddAttribute ("BeaconGeneration",
71  "Whether or not beacons are generated.",
72  BooleanValue (true),
76  .AddAttribute ("EnableNonErpProtection", "Whether or not protection mechanism should be used when non-ERP STAs are present within the BSS."
77  "This parameter is only used when ERP is supported by the AP.",
78  BooleanValue (true),
81  ;
82  return tid;
83 }
84 
86 {
87  NS_LOG_FUNCTION (this);
88  m_beaconDca = CreateObject<DcaTxop> ();
89  m_beaconDca->SetAifsn (1);
90  m_beaconDca->SetMinCw (0);
91  m_beaconDca->SetMaxCw (0);
92  m_beaconDca->SetLow (m_low);
93  m_beaconDca->SetManager (m_dcfManager);
94  m_beaconDca->SetTxMiddle (m_txMiddle);
95 
96  //Let the lower layers know that we are acting as an AP.
98 
100 }
101 
103 {
104  NS_LOG_FUNCTION (this);
105  m_staList.clear();
106  m_nonErpStations.clear ();
107  m_nonHtStations.clear ();
108 }
109 
110 void
112 {
113  NS_LOG_FUNCTION (this);
114  m_beaconDca = 0;
115  m_enableBeaconGeneration = false;
118 }
119 
120 void
122 {
123  NS_LOG_FUNCTION (this << address);
124  //As an AP, our MAC address is also the BSSID. Hence we are
125  //overriding this function and setting both in our parent class.
126  RegularWifiMac::SetAddress (address);
127  RegularWifiMac::SetBssid (address);
128 }
129 
130 void
132 {
133  NS_LOG_FUNCTION (this << enable);
134  if (!enable)
135  {
137  }
138  else if (enable && !m_enableBeaconGeneration)
139  {
141  }
142  m_enableBeaconGeneration = enable;
143 }
144 
145 bool
147 {
148  NS_LOG_FUNCTION (this);
150 }
151 
152 Time
154 {
155  NS_LOG_FUNCTION (this);
156  return m_beaconInterval;
157 }
158 
159 void
161 {
162  NS_LOG_FUNCTION (this << stationManager);
163  m_beaconDca->SetWifiRemoteStationManager (stationManager);
165 }
166 
167 void
169 {
170  NS_LOG_FUNCTION (this << &linkUp);
172 
173  //The approach taken here is that, from the point of view of an AP,
174  //the link is always up, so we immediately invoke the callback if
175  //one is set
176  linkUp ();
177 }
178 
179 void
181 {
182  NS_LOG_FUNCTION (this << interval);
183  if ((interval.GetMicroSeconds () % 1024) != 0)
184  {
185  NS_LOG_WARN ("beacon interval should be multiple of 1024us (802.11 time unit), see IEEE Std. 802.11-2012");
186  }
187  m_beaconInterval = interval;
188 }
189 
190 void
192 {
193  NS_LOG_FUNCTION (this);
194  SendOneBeacon ();
195 }
196 
197 int64_t
198 ApWifiMac::AssignStreams (int64_t stream)
199 {
200  NS_LOG_FUNCTION (this << stream);
201  m_beaconJitter->SetStream (stream);
202  return 1;
203 }
204 
205 bool
207 {
208  if (m_nonErpStations.size () != 0)
209  {
210  return false;
211  }
212  if (m_erpSupported == true && GetShortSlotTimeSupported () == true)
213  {
214  for (std::list<Mac48Address>::const_iterator i = m_staList.begin (); i != m_staList.end (); i++)
215  {
216  if (m_stationManager->GetShortSlotTimeSupported (*i) == false)
217  {
218  return false;
219  }
220  }
221  return true;
222  }
223  return false;
224 }
225 
226 bool
228 {
230  {
231  for (std::list<Mac48Address>::const_iterator i = m_nonErpStations.begin (); i != m_nonErpStations.end (); i++)
232  {
233  if (m_stationManager->GetShortPreambleSupported (*i) == false)
234  {
235  return false;
236  }
237  }
238  return true;
239  }
240  return false;
241 }
242 
243 void
245  Mac48Address to)
246 {
247  NS_LOG_FUNCTION (this << packet << from << to);
248  //If we are not a QoS AP then we definitely want to use AC_BE to
249  //transmit the packet. A TID of zero will map to AC_BE (through \c
250  //QosUtilsMapTidToAc()), so we use that as our default here.
251  uint8_t tid = 0;
252 
253  //If we are a QoS AP then we attempt to get a TID for this packet
254  if (m_qosSupported)
255  {
256  tid = QosUtilsGetTidForPacket (packet);
257  //Any value greater than 7 is invalid and likely indicates that
258  //the packet had no QoS tag, so we revert to zero, which'll
259  //mean that AC_BE is used.
260  if (tid > 7)
261  {
262  tid = 0;
263  }
264  }
265 
266  ForwardDown (packet, from, to, tid);
267 }
268 
269 void
271  Mac48Address to, uint8_t tid)
272 {
273  NS_LOG_FUNCTION (this << packet << from << to << static_cast<uint32_t> (tid));
274  WifiMacHeader hdr;
275 
276  //For now, an AP that supports QoS does not support non-QoS
277  //associations, and vice versa. In future the AP model should
278  //support simultaneously associated QoS and non-QoS STAs, at which
279  //point there will need to be per-association QoS state maintained
280  //by the association state machine, and consulted here.
281  if (m_qosSupported)
282  {
285  hdr.SetQosNoEosp ();
286  hdr.SetQosNoAmsdu ();
287  //Transmission of multiple frames in the same TXOP is not
288  //supported for now
289  hdr.SetQosTxopLimit (0);
290  //Fill in the QoS control field in the MAC header
291  hdr.SetQosTid (tid);
292  }
293  else
294  {
295  hdr.SetTypeData ();
296  }
297 
299  {
300  hdr.SetNoOrder ();
301  }
302  hdr.SetAddr1 (to);
303  hdr.SetAddr2 (GetAddress ());
304  hdr.SetAddr3 (from);
305  hdr.SetDsFrom ();
306  hdr.SetDsNotTo ();
307 
308  if (m_qosSupported)
309  {
310  //Sanity check that the TID is valid
311  NS_ASSERT (tid < 8);
312  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
313  }
314  else
315  {
316  m_dca->Queue (packet, hdr);
317  }
318 }
319 
320 void
322 {
323  NS_LOG_FUNCTION (this << packet << to << from);
324  if (to.IsBroadcast () || m_stationManager->IsAssociated (to))
325  {
326  ForwardDown (packet, from, to);
327  }
328 }
329 
330 void
332 {
333  NS_LOG_FUNCTION (this << packet << to);
334  //We're sending this packet with a from address that is our own. We
335  //get that address from the lower MAC and make use of the
336  //from-spoofing Enqueue() method to avoid duplicated code.
337  Enqueue (packet, to, m_low->GetAddress ());
338 }
339 
340 bool
342 {
343  NS_LOG_FUNCTION (this);
344  return true;
345 }
346 
349 {
350  NS_LOG_FUNCTION (this);
351  SupportedRates rates;
352  //If it is an HT-AP or VHT-AP, then add the BSSMembershipSelectorSet
353  //The standard says that the BSSMembershipSelectorSet
354  //must have its MSB set to 1 (must be treated as a Basic Rate)
355  //Also the standard mentioned that at least 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
357  {
358  for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors (); i++)
359  {
361  }
362  }
363  //
364  uint8_t nss = 1; // Number of spatial streams is 1 for non-MIMO modes
365  //Send the set of supported rates and make sure that we indicate
366  //the Basic Rate set in this set of supported rates.
367  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
368  {
369  WifiMode mode = m_phy->GetMode (i);
370  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
371  NS_LOG_DEBUG ("Adding supported rate of " << modeDataRate);
372  rates.AddSupportedRate (modeDataRate);
373  //Add rates that are part of the BSSBasicRateSet (manufacturer dependent!)
374  //here we choose to add the mandatory rates to the BSSBasicRateSet,
375  //except for 802.11b where we assume that only the non HR-DSSS rates are part of the BSSBasicRateSet
376  if (mode.IsMandatory () && (mode.GetModulationClass () != WIFI_MOD_CLASS_HR_DSSS))
377  {
378  NS_LOG_DEBUG ("Adding basic mode " << mode.GetUniqueName ());
380  }
381  }
382  //set the basic rates
383  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
384  {
386  uint64_t modeDataRate = mode.GetDataRate (m_phy->GetChannelWidth (), false, nss);
387  NS_LOG_DEBUG ("Setting basic rate " << mode.GetUniqueName ());
388  rates.SetBasicRate (modeDataRate);
389  }
390 
391  return rates;
392 }
393 
396 {
397  CapabilityInformation capabilities;
398  capabilities.SetShortPreamble (GetShortPreambleEnabled ());
399  capabilities.SetShortSlotTime (GetShortSlotTimeEnabled ());
400  return capabilities;
401 }
402 
405 {
406  ErpInformation information;
407  information.SetErpSupported (1);
408  if (m_erpSupported)
409  {
410  information.SetNonErpPresent (!m_nonErpStations.empty ());
411  information.SetUseProtection (GetUseNonErpProtection ());
413  {
414  information.SetBarkerPreambleMode (0);
415  }
416  else
417  {
418  information.SetBarkerPreambleMode (1);
419  }
420  }
421  return information;
422 }
423 
426 {
427  HtOperations operations;
428  operations.SetHtSupported (1);
429  if (m_htSupported)
430  {
431  if (!m_nonHtStations.empty ())
432  {
434  }
435  else
436  {
437  operations.SetHtProtection (NO_PROTECTION);
438  }
439  }
440  return operations;
441 }
442 
443 void
445 {
446  NS_LOG_FUNCTION (this << to);
447  WifiMacHeader hdr;
448  hdr.SetProbeResp ();
449  hdr.SetAddr1 (to);
450  hdr.SetAddr2 (GetAddress ());
451  hdr.SetAddr3 (GetAddress ());
452  hdr.SetDsNotFrom ();
453  hdr.SetDsNotTo ();
454  Ptr<Packet> packet = Create<Packet> ();
456  probe.SetSsid (GetSsid ());
457  probe.SetSupportedRates (GetSupportedRates ());
458  probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
459  probe.SetCapabilities (GetCapabilities ());
462  if (m_erpSupported)
463  {
464  probe.SetErpInformation (GetErpInformation ());
465  }
467  {
468  probe.SetHtCapabilities (GetHtCapabilities ());
469  probe.SetHtOperations (GetHtOperations ());
470  hdr.SetNoOrder ();
471  }
472  if (m_vhtSupported)
473  {
474  probe.SetVhtCapabilities (GetVhtCapabilities ());
475  }
476  packet->AddHeader (probe);
477 
478  //The standard is not clear on the correct queue for management
479  //frames if we are a QoS AP. The approach taken here is to always
480  //use the DCF for these regardless of whether we have a QoS
481  //association or not.
482  m_dca->Queue (packet, hdr);
483 }
484 
485 void
487 {
488  NS_LOG_FUNCTION (this << to << success);
489  WifiMacHeader hdr;
490  hdr.SetAssocResp ();
491  hdr.SetAddr1 (to);
492  hdr.SetAddr2 (GetAddress ());
493  hdr.SetAddr3 (GetAddress ());
494  hdr.SetDsNotFrom ();
495  hdr.SetDsNotTo ();
496  Ptr<Packet> packet = Create<Packet> ();
498  StatusCode code;
499  if (success)
500  {
501  code.SetSuccess ();
502  m_staList.push_back (to);
503  }
504  else
505  {
506  code.SetFailure ();
507  }
508  assoc.SetSupportedRates (GetSupportedRates ());
509  assoc.SetStatusCode (code);
510  assoc.SetCapabilities (GetCapabilities ());
511  if (m_erpSupported)
512  {
513  assoc.SetErpInformation (GetErpInformation ());
514  }
516  {
517  assoc.SetHtCapabilities (GetHtCapabilities ());
518  assoc.SetHtOperations (GetHtOperations ());
519  hdr.SetNoOrder ();
520  }
521  if (m_vhtSupported)
522  {
523  assoc.SetVhtCapabilities (GetVhtCapabilities ());
524  }
525  packet->AddHeader (assoc);
526 
527  //The standard is not clear on the correct queue for management
528  //frames if we are a QoS AP. The approach taken here is to always
529  //use the DCF for these regardless of whether we have a QoS
530  //association or not.
531  m_dca->Queue (packet, hdr);
532 }
533 
534 void
536 {
537  NS_LOG_FUNCTION (this);
538  WifiMacHeader hdr;
539  hdr.SetBeacon ();
541  hdr.SetAddr2 (GetAddress ());
542  hdr.SetAddr3 (GetAddress ());
543  hdr.SetDsNotFrom ();
544  hdr.SetDsNotTo ();
545  Ptr<Packet> packet = Create<Packet> ();
546  MgtBeaconHeader beacon;
547  beacon.SetSsid (GetSsid ());
548  beacon.SetSupportedRates (GetSupportedRates ());
549  beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
550  beacon.SetCapabilities (GetCapabilities ());
553  if (m_erpSupported)
554  {
555  beacon.SetErpInformation (GetErpInformation ());
556  }
558  {
559  beacon.SetHtCapabilities (GetHtCapabilities ());
560  beacon.SetHtOperations (GetHtOperations ());
561  hdr.SetNoOrder ();
562  }
563  if (m_vhtSupported)
564  {
565  beacon.SetVhtCapabilities (GetVhtCapabilities ());
566  }
567  packet->AddHeader (beacon);
568 
569  //The beacon has it's own special queue, so we load it in there
570  m_beaconDca->Queue (packet, hdr);
572 
573  //If a STA that does not support Short Slot Time associates,
574  //the AP shall use long slot time beginning at the first Beacon
575  //subsequent to the association of the long slot time STA.
576  if (m_erpSupported)
577  {
578  if (GetShortSlotTimeEnabled () == true)
579  {
580  //Enable short slot time
581  SetSlot (MicroSeconds (9));
582  }
583  else
584  {
585  //Disable short slot time
586  SetSlot (MicroSeconds (20));
587  }
588  }
589 }
590 
591 void
593 {
594  NS_LOG_FUNCTION (this);
595  RegularWifiMac::TxOk (hdr);
596 
597  if (hdr.IsAssocResp ()
599  {
600  NS_LOG_DEBUG ("associated with sta=" << hdr.GetAddr1 ());
602  }
603 }
604 
605 void
607 {
608  NS_LOG_FUNCTION (this);
610 
611  if (hdr.IsAssocResp ()
613  {
614  NS_LOG_DEBUG ("assoc failed with sta=" << hdr.GetAddr1 ());
616  }
617 }
618 
619 void
621 {
622  NS_LOG_FUNCTION (this << packet << hdr);
623 
624  Mac48Address from = hdr->GetAddr2 ();
625 
626  if (hdr->IsData ())
627  {
628  Mac48Address bssid = hdr->GetAddr1 ();
629  if (!hdr->IsFromDs ()
630  && hdr->IsToDs ()
631  && bssid == GetAddress ()
632  && m_stationManager->IsAssociated (from))
633  {
634  Mac48Address to = hdr->GetAddr3 ();
635  if (to == GetAddress ())
636  {
637  NS_LOG_DEBUG ("frame for me from=" << from);
638  if (hdr->IsQosData ())
639  {
640  if (hdr->IsQosAmsdu ())
641  {
642  NS_LOG_DEBUG ("Received A-MSDU from=" << from << ", size=" << packet->GetSize ());
643  DeaggregateAmsduAndForward (packet, hdr);
644  packet = 0;
645  }
646  else
647  {
648  ForwardUp (packet, from, bssid);
649  }
650  }
651  else
652  {
653  ForwardUp (packet, from, bssid);
654  }
655  }
656  else if (to.IsGroup ()
658  {
659  NS_LOG_DEBUG ("forwarding frame from=" << from << ", to=" << to);
660  Ptr<Packet> copy = packet->Copy ();
661 
662  //If the frame we are forwarding is of type QoS Data,
663  //then we need to preserve the UP in the QoS control
664  //header...
665  if (hdr->IsQosData ())
666  {
667  ForwardDown (packet, from, to, hdr->GetQosTid ());
668  }
669  else
670  {
671  ForwardDown (packet, from, to);
672  }
673  ForwardUp (copy, from, to);
674  }
675  else
676  {
677  ForwardUp (packet, from, to);
678  }
679  }
680  else if (hdr->IsFromDs ()
681  && hdr->IsToDs ())
682  {
683  //this is an AP-to-AP frame
684  //we ignore for now.
685  NotifyRxDrop (packet);
686  }
687  else
688  {
689  //we can ignore these frames since
690  //they are not targeted at the AP
691  NotifyRxDrop (packet);
692  }
693  return;
694  }
695  else if (hdr->IsMgt ())
696  {
697  if (hdr->IsProbeReq ())
698  {
699  NS_ASSERT (hdr->GetAddr1 ().IsBroadcast ());
700  SendProbeResp (from);
701  return;
702  }
703  else if (hdr->GetAddr1 () == GetAddress ())
704  {
705  if (hdr->IsAssocReq ())
706  {
707  //first, verify that the the station's supported
708  //rate set is compatible with our Basic Rate set
709  MgtAssocRequestHeader assocReq;
710  packet->RemoveHeader (assocReq);
711  CapabilityInformation capabilities = assocReq.GetCapabilities ();
713  SupportedRates rates = assocReq.GetSupportedRates ();
714  bool problem = false;
715  bool isHtStation = false;
716  bool isOfdmStation = false;
717  bool isErpStation = false;
718  bool isDsssStation = false;
719  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
720  {
722  uint8_t nss = 1; // Assume 1 spatial stream in basic mode
723  if (!rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
724  {
726  {
727  isDsssStation = false;
728  }
729  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
730  {
731  isErpStation = false;
732  }
733  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM)
734  {
735  isOfdmStation = false;
736  }
737  if (isDsssStation == false && isErpStation == false && isOfdmStation == false)
738  {
739  problem = true;
740  break;
741  }
742  }
743  else
744  {
746  {
747  isDsssStation = true;
748  }
749  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
750  {
751  isErpStation = true;
752  }
753  else if (mode.GetModulationClass () == WIFI_MOD_CLASS_OFDM)
754  {
755  isOfdmStation = true;
756  }
757  }
758  }
759  m_stationManager->AddSupportedErpSlotTime (from, capabilities.IsShortSlotTime () && isErpStation);
760  if (m_htSupported)
761  {
762  //check whether the HT STA supports all MCSs in Basic MCS Set
763  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
764  if (htcapabilities.GetHtCapabilitiesInfo () != 0)
765  {
766  isHtStation = true;
767  for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
768  {
770  if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
771  {
772  problem = true;
773  break;
774  }
775  }
776  }
777  }
778  if (m_vhtSupported)
779  {
780  //check whether the VHT STA supports all MCSs in Basic MCS Set
781  VhtCapabilities vhtcapabilities = assocReq.GetVhtCapabilities ();
782  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
783  {
784  for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
785  {
787  if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
788  {
789  problem = true;
790  break;
791  }
792  }
793  }
794  }
795  if (problem)
796  {
797  //One of the Basic Rate set mode is not
798  //supported by the station. So, we return an assoc
799  //response with an error status.
800  SendAssocResp (hdr->GetAddr2 (), false);
801  }
802  else
803  {
804  //station supports all rates in Basic Rate Set.
805  //record all its supported modes in its associated WifiRemoteStation
806  for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
807  {
808  WifiMode mode = m_phy->GetMode (j);
809  uint8_t nss = 1; // Assume 1 spatial stream in basic mode
810  if (rates.IsSupportedRate (mode.GetDataRate (m_phy->GetChannelWidth (), false, nss)))
811  {
812  m_stationManager->AddSupportedMode (from, mode);
813  }
814  }
815  if (m_htSupported)
816  {
817  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
818  m_stationManager->AddStationHtCapabilities (from, htcapabilities);
819  for (uint32_t j = 0; j < m_phy->GetNMcs (); j++)
820  {
821  WifiMode mcs = m_phy->GetMcs (j);
822  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
823  {
824  m_stationManager->AddSupportedMcs (from, mcs);
825  }
826  }
827  }
828  if (m_vhtSupported)
829  {
830  VhtCapabilities vhtCapabilities = assocReq.GetVhtCapabilities ();
831  m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
832  for (uint32_t i = 0; i < m_phy->GetNMcs (); i++)
833  {
834  WifiMode mcs = m_phy->GetMcs (i);
835  if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
836  {
837  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
838  //here should add a control to add basic MCS when it is implemented
839  }
840  }
841  }
843  if (!isHtStation)
844  {
845  m_nonHtStations.push_back (hdr->GetAddr2 ());
846  }
847  if (!isErpStation && isDsssStation)
848  {
849  m_nonErpStations.push_back (hdr->GetAddr2 ());
850  }
851  // send assoc response with success status.
852  SendAssocResp (hdr->GetAddr2 (), true);
853  }
854  return;
855  }
856  else if (hdr->IsDisassociation ())
857  {
859  for (std::list<Mac48Address>::iterator i = m_staList.begin (); i != m_staList.end (); i++)
860  {
861  if ((*i) == from)
862  {
863  m_staList.erase (i);
864  break;
865  }
866  }
867  for (std::list<Mac48Address>::iterator j = m_nonErpStations.begin (); j != m_nonErpStations.end (); j++)
868  {
869  if ((*j) == from)
870  {
871  m_nonErpStations.erase (j);
872  break;
873  }
874  }
875  for (std::list<Mac48Address>::iterator j = m_nonHtStations.begin (); j != m_nonHtStations.end (); j++)
876  {
877  if ((*j) == from)
878  {
879  m_nonHtStations.erase (j);
880  break;
881  }
882  }
883  return;
884  }
885  }
886  }
887 
888  //Invoke the receive handler of our parent class to deal with any
889  //other frames. Specifically, this will handle Block Ack-related
890  //Management Action frames.
891  RegularWifiMac::Receive (packet, hdr);
892 }
893 
894 void
896  const WifiMacHeader *hdr)
897 {
898  NS_LOG_FUNCTION (this << aggregatedPacket << hdr);
900  MsduAggregator::Deaggregate (aggregatedPacket);
901 
902  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
903  i != packets.end (); ++i)
904  {
905  if ((*i).second.GetDestinationAddr () == GetAddress ())
906  {
907  ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
908  (*i).second.GetDestinationAddr ());
909  }
910  else
911  {
912  Mac48Address from = (*i).second.GetSourceAddr ();
913  Mac48Address to = (*i).second.GetDestinationAddr ();
914  NS_LOG_DEBUG ("forwarding QoS frame from=" << from << ", to=" << to);
915  ForwardDown ((*i).first, from, to, hdr->GetQosTid ());
916  }
917  }
918 }
919 
920 void
922 {
923  NS_LOG_FUNCTION (this);
924  m_beaconDca->Initialize ();
927  {
929  {
930  int64_t jitter = m_beaconJitter->GetValue (0, m_beaconInterval.GetMicroSeconds ());
931  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time " << jitter << " microseconds");
933  }
934  else
935  {
936  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress () << " at time 0");
938  }
939  }
941 }
942 
943 bool
945 {
946  bool useProtection = !m_nonErpStations.empty () && m_enableNonErpProtection;
947  m_stationManager->SetUseNonErpProtection (useProtection);
948  return useProtection;
949 }
950 
951 } //namespace ns3
HtOperations GetHtOperations(void) const
Return the HT operations of the current AP.
Definition: ap-wifi-mac.cc:425
virtual void DoInitialize(void)
Initialize() implementation.
Definition: ap-wifi-mac.cc:921
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:268
The HT Operations Information ElementThis class knows how to serialise and deserialise the HT Operati...
Definition: ht-operations.h:54
uint32_t GetVhtCapabilitiesInfo() const
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:180
void AddSupportedRate(uint32_t bs)
Add the given rate to the supported rates.
void SetErpSupported(uint8_t erpSupported)
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
bool IsSupportedTxMcs(uint8_t mcs) const
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Implement the header for management frames of type association request.
Definition: mgt-headers.h:44
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
void SetQosAckPolicy(enum QosAckPolicy policy)
Set the QoS ACK policy in the QoS control field.
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:58
AttributeValue implementation for Boolean.
Definition: boolean.h:34
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Hold variables of type string.
Definition: string.h:41
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: ap-wifi-mac.cc:198
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
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:81
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.
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:386
virtual uint8_t GetNMcs(void) const =0
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
#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
MacTxMiddle * m_txMiddle
TX middle (aggregation etc.)
#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.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:786
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
bool IsBroadcast(void) const
void SetSlot(Time slotTime)
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
void NotifyRxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:284
virtual bool GetShortPlcpPreambleSupported(void) const =0
void SendAssocResp(Mac48Address to, bool success)
Forward an association response packet to the DCF.
Definition: ap-wifi-mac.cc:486
virtual bool SupportsSendFrom(void) const
Definition: ap-wifi-mac.cc:341
bool IsAssocResp(void) const
Return true if the header is an Association Response header.
VHT PHY (Clause 22)
Definition: wifi-mode.h:64
Ptr< WifiPhy > m_phy
Wifi PHY.
Ptr< DcaTxop > m_beaconDca
Dedicated DcaTxop for beacons.
Definition: ap-wifi-mac.h:247
HR/DSSS PHY (Clause 18)
Definition: wifi-mode.h:52
void SetProbeResp(void)
Set Type/Subtype values for a probe response header.
virtual Ssid GetSsid(void) const
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
void SetBarkerPreambleMode(uint8_t barkerPreambleMode)
Set the Barker_Preamble_Mode field in the ErpInformation information element.
void SetHtProtection(uint8_t htprotection)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
bool IsMandatory(void) const
Definition: wifi-mode.cc:357
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.
Capability information.
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...
virtual WifiMode GetMcs(uint8_t mcs) const =0
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
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
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
bool GetUseNonErpProtection(void) const
Return whether protection for non-ERP stations is used in the BSS.
Definition: ap-wifi-mac.cc:944
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
bool m_enableBeaconGeneration
Flag whether beacons are being generated.
Definition: ap-wifi-mac.h:249
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:331
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:453
virtual void SetBssid(Mac48Address bssid)
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
virtual uint32_t GetChannelWidth(void) const =0
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:160
base class for all MAC-level wifi objects.
void SetSuccess(void)
Set success bit to 0 (success).
Definition: status-code.cc:32
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:220
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1216
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.
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:349
void SetBeacon(void)
Set Type/Subtype values for a beacon header.
AttributeValue implementation for Time.
Definition: nstime.h:957
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Ptr< DcaTxop > m_dca
This holds a pointer to the DCF instance for this WifiMac - used for transmission of frames to non-Qo...
CapabilityInformation GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:417
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
The IEEE 802.11ac VHT Capabilities.
static TypeId GetTypeId(void)
Definition: ap-wifi-mac.cc:47
bool IsProbeReq(void) const
Return true if the header is a Probe Request header.
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet down to DCF/EDCAF (enqueue the packet).
Definition: ap-wifi-mac.cc:244
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
bool GetShortPreambleEnabled(void) const
Determine whether short preamble should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:227
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.
bool m_enableNonErpProtection
Flag whether protection mechanism is used or not when non-ERP STAs are present within the BSS...
Definition: ap-wifi-mac.h:256
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:28
virtual void SetAddress(Mac48Address address)
HT PHY (Clause 20)
Definition: wifi-mode.h:62
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:364
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:349
static Mac48Address GetBroadcast(void)
EventId m_beaconEvent
Event to generate one beacon.
Definition: ap-wifi-mac.h:250
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:627
bool IsMgt(void) const
Return true if the Type is Management.
virtual uint32_t GetNBssMembershipSelectors(void) const =0
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
uint32_t GetNBasicMcs(void) const
Return the number of basic MCS index.
HtCapabilities GetHtCapabilities(void) const
Return the HT capability of the device.
void SetBasicRate(uint32_t bs)
Set the given rate to basic rates.
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...
Definition: ap-wifi-mac.cc:620
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
This method is called to de-aggregate an A-MSDU and forward the constituent packets up the stack...
Definition: ap-wifi-mac.cc:895
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
std::list< Mac48Address > m_staList
List of all stations currently associated to the AP.
Definition: ap-wifi-mac.h:253
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:122
Status code for association response.
Definition: status-code.h:33
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:237
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:168
virtual void DoDispose()
Destructor implementation.
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities.
Definition: mgt-headers.cc:441
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
bool IsToDs(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsDisassociation(void) const
Return true if the header is a Disassociation header.
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
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const =0
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
bool IsSupportedMcs(uint8_t mcs) const
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
DcfManager * m_dcfManager
DCF manager (access to channel)
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.
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
void SetUseProtection(uint8_t useProtection)
Set the Use_Protection field in the ErpInformation information element.
void SetHtSupported(uint8_t htsupported)
an EUI-48 address
Definition: mac48-address.h:43
WifiMode GetBasicMcs(uint32_t i) const
Return the MCS at the given list index.
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
Definition: wifi-mode.cc:109
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
Definition: simulator.h:1379
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:958
bool GetBeaconGeneration(void) const
Return whether the AP is generating beacons.
Definition: ap-wifi-mac.cc:146
void SetShortPreamble(bool shortPreamble)
Set the short preamble bit in the capability information field.
Wi-Fi AP state machineHandle association, dis-association and authentication, of STAs within an infra...
Definition: ap-wifi-mac.h:45
void AddSupportedPlcpPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PLCP preamble is supported by the station.
bool m_htSupported
This Boolean is set true iff this WifiMac is to model 802.11n.
Implement the header for management frames of type association response.
Definition: mgt-headers.h:149
void SendProbeResp(Mac48Address to)
Forward a probe response packet to the DCF.
Definition: ap-wifi-mac.cc:444
void SetAssocResp(void)
Set Type/Subtype values for an association response header.
SupportedRates GetSupportedRates(void) const
Return an instance of SupportedRates that contains all rates that we support including HT rates...
Definition: ap-wifi-mac.cc:348
uint16_t GetHtCapabilitiesInfo(void) const
bool IsShortSlotTime(void) const
Check if the short slot time in the capability information field is set to 1.
uint32_t GetNBasicModes(void) const
Return the number of basic modes we support.
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:606
bool IsData(void) const
Return true if the Type is DATA.
void SendOneBeacon(void)
Forward a beacon packet to the beacon special DCF.
Definition: ap-wifi-mac.cc:535
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS DATA...
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:228
virtual void DoDispose(void)
Destructor implementation.
Definition: ap-wifi-mac.cc:111
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:121
ErpInformation GetErpInformation(void) const
Return the ERP information of the current AP.
Definition: ap-wifi-mac.cc:404
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
virtual Mac48Address GetAddress(void) const
void SetTypeData(void)
Set Type/Subtype values for a data packet with no subtype equal to 0.
OFDM PHY (Clause 17)
Definition: wifi-mode.h:60
Ptr< UniformRandomVariable > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
Definition: ap-wifi-mac.h:251
CapabilityInformation GetCapabilities(void) const
Return the Capability information of the current AP.
Definition: ap-wifi-mac.cc:395
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
Time m_beaconInterval
Interval between beacons.
Definition: ap-wifi-mac.h:248
std::list< Mac48Address > m_nonErpStations
List of all non-ERP stations currently associated to the AP.
Definition: ap-wifi-mac.h:254
virtual void DoInitialize()
Initialize() implementation.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:102
bool IsFromDs(void) const
bool IsSupportedRate(uint32_t bs) const
Check if the given rate is supported.
void SetDsFrom(void)
Set the From DS bit in the Frame Control field.
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:911
The ErpInformation Information ElementThis class knows how to serialise and deserialise the ErpInform...
void SetType(enum WifiMacType type)
Set Type/Subtype values with the correct values depending on the given type.
bool m_enableBeaconJitter
Flag whether the first beacon should be generated at random time.
Definition: ap-wifi-mac.h:252
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:153
virtual bool GetShortSlotTimeSupported(void) const
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
virtual void TxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
tuple address
Definition: first.py:37
bool m_erpSupported
This Boolean is set true iff this WifiMac is to model 802.11g.
virtual void TxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Definition: ap-wifi-mac.cc:592
void SetShortSlotTime(bool shortSlotTime)
Set the short slot time bit in the capability information field.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PLCP preambles.
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:346
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
void SetFailure(void)
Set success bit to 1 (failure).
Definition: status-code.cc:38
std::list< Mac48Address > m_nonHtStations
List of all non-HT stations currently associated to the AP.
Definition: ap-wifi-mac.h:255
bool GetShortSlotTimeEnabled(void) const
Determine whether short slot time should be enabled or not in the BSS.
Definition: ap-wifi-mac.cc:206
void SetNonErpPresent(uint8_t nonErpPresent)
Set the Non_Erp_Present field in the ErpInformation information element.
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:429
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:826
void StartBeaconing(void)
Start beacon transmission immediately.
Definition: ap-wifi-mac.cc:191
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:484
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:257
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtcapabilities)
Records VHT capabilities of the remote station.
Implements the IEEE 802.11 MAC header.
DSSS PHY (Clause 15)
Definition: wifi-mode.h:50
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
Definition: ap-wifi-mac.cc:131
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PLCP preamble or not.
bool IsShortPreamble(void) const
Check if the short preamble bit in the capability information field is set to 1.