A Discrete-Event Network Simulator
API
regular-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) 2008 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/pointer.h"
23 #include "ns3/packet.h"
24 #include "regular-wifi-mac.h"
25 #include "wifi-phy.h"
26 #include "mac-rx-middle.h"
27 #include "mac-tx-middle.h"
28 #include "msdu-aggregator.h"
29 #include "mpdu-aggregator.h"
30 #include "mgt-headers.h"
31 #include "amsdu-subframe-header.h"
32 #include "wifi-net-device.h"
33 #include "ns3/ht-configuration.h"
34 #include "ns3/vht-configuration.h"
35 #include "ns3/he-configuration.h"
36 #include <algorithm>
37 #include <cmath>
38 #include "ns3/he-frame-exchange-manager.h"
39 #include "channel-access-manager.h"
40 
41 namespace ns3 {
42 
43 NS_LOG_COMPONENT_DEFINE ("RegularWifiMac");
44 
45 NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac);
46 
48  : m_qosSupported (0),
49  m_erpSupported (0),
50  m_dsssSupported (0)
51 {
52  NS_LOG_FUNCTION (this);
53  m_rxMiddle = Create<MacRxMiddle> ();
54  m_rxMiddle->SetForwardCallback (MakeCallback (&RegularWifiMac::Receive, this));
55 
56  m_txMiddle = Create<MacTxMiddle> ();
57 
58  m_channelAccessManager = CreateObject<ChannelAccessManager> ();
59 
60  m_txop = CreateObject<Txop> ();
63  m_txop->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(),
65 
66  //Construct the EDCAFs. The ordering is important - highest
67  //priority (Table 9-1 UP-to-AC mapping; IEEE 802.11-2012) must be created
68  //first.
73 }
74 
76 {
77  NS_LOG_FUNCTION (this);
78 }
79 
80 void
82 {
83  NS_LOG_FUNCTION (this);
84  m_txop->Initialize ();
85 
86  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
87  {
88  i->second->Initialize ();
89  }
90 }
91 
92 void
94 {
95  NS_LOG_FUNCTION (this);
96 
97  m_rxMiddle = 0;
98  m_txMiddle = 0;
99 
100  m_phy = 0;
101  m_stationManager = 0;
102  if (m_feManager != 0)
103  {
104  m_feManager->Dispose ();
105  }
106  m_feManager = 0;
107 
108  m_txop->Dispose ();
109  m_txop = 0;
110 
111  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
112  {
113  i->second->Dispose ();
114  i->second = 0;
115  }
116 
117  m_channelAccessManager->Dispose ();
119 
121 }
122 
123 void
125 {
126  NS_LOG_FUNCTION (this);
127 
128  if (GetHeSupported ())
129  {
130  m_feManager = CreateObject<HeFrameExchangeManager> ();
131  }
132  else if (GetVhtSupported ())
133  {
134  m_feManager = CreateObject<VhtFrameExchangeManager> ();
135  }
136  else if (GetHtSupported ())
137  {
138  m_feManager = CreateObject<HtFrameExchangeManager> ();
139  }
140  else if (GetQosSupported ())
141  {
142  m_feManager = CreateObject<QosFrameExchangeManager> ();
143  }
144  else
145  {
146  m_feManager = CreateObject<FrameExchangeManager> ();
147  }
148 
149  m_feManager->SetWifiMac (this);
150  m_feManager->SetMacTxMiddle (m_txMiddle);
151  m_feManager->SetMacRxMiddle (m_rxMiddle);
152  m_feManager->SetAddress (GetAddress ());
153  m_feManager->SetBssid (GetBssid ());
154  m_feManager->GetWifiTxTimer ().SetMpduResponseTimeoutCallback (MakeCallback (&MpduResponseTimeoutTracedCallback::operator(),
156  m_feManager->GetWifiTxTimer ().SetPsduResponseTimeoutCallback (MakeCallback (&PsduResponseTimeoutTracedCallback::operator(),
158  m_feManager->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(),
160  m_feManager->SetAckedMpduCallback (MakeCallback (&MpduTracedCallback::operator(),
162  m_channelAccessManager->SetupFrameExchangeManager (m_feManager);
163  if (GetQosSupported ())
164  {
165  for (const auto& pair : m_edca)
166  {
167  pair.second->SetQosFrameExchangeManager (DynamicCast<QosFrameExchangeManager> (m_feManager));
168  }
169  }
170 }
171 
174 {
175  return m_feManager;
176 }
177 
178 void
180 {
181  NS_LOG_FUNCTION (this << stationManager);
182  m_stationManager = stationManager;
183  m_txop->SetWifiRemoteStationManager (stationManager);
184  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
185  {
186  i->second->SetWifiRemoteStationManager (stationManager);
187  }
188 }
189 
192 {
193  return m_stationManager;
194 }
195 
198 {
199  NS_LOG_FUNCTION (this);
200  ExtendedCapabilities capabilities;
201  capabilities.SetHtSupported (GetHtSupported ());
202  capabilities.SetVhtSupported (GetVhtSupported ());
203  //TODO: to be completed
204  return capabilities;
205 }
206 
209 {
210  NS_LOG_FUNCTION (this);
211  HtCapabilities capabilities;
212  if (GetHtSupported ())
213  {
214  Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
215  bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
216  capabilities.SetHtSupported (1);
217  capabilities.SetLdpc (htConfiguration->GetLdpcSupported ());
218  capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40);
219  capabilities.SetShortGuardInterval20 (sgiSupported);
220  capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && sgiSupported);
221  // Set Maximum A-MSDU Length subfield
222  uint16_t maxAmsduSize = std::max ({m_voMaxAmsduSize, m_viMaxAmsduSize,
224  if (maxAmsduSize <= 3839)
225  {
226  capabilities.SetMaxAmsduLength (3839);
227  }
228  else
229  {
230  capabilities.SetMaxAmsduLength (7935);
231  }
232  uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
234  // round to the next power of two minus one
235  maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
236  // The maximum A-MPDU length in HT capabilities elements ranges from 2^13-1 to 2^16-1
237  capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 8191u), 65535u));
238 
239  capabilities.SetLSigProtectionSupport (true);
240  uint64_t maxSupportedRate = 0; //in bit/s
241  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HT))
242  {
243  capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
244  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
245  NS_ASSERT (nss > 0 && nss < 5);
246  uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), sgiSupported ? 400 : 800, nss);
247  if (dataRate > maxSupportedRate)
248  {
249  maxSupportedRate = dataRate;
250  NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
251  }
252  }
253  capabilities.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
254  capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
256  //we do not support unequal modulations
257  capabilities.SetTxRxMcsSetUnequal (0);
258  capabilities.SetTxUnequalModulation (0);
259  }
260  return capabilities;
261 }
262 
265 {
266  NS_LOG_FUNCTION (this);
267  VhtCapabilities capabilities;
268  if (GetVhtSupported ())
269  {
270  Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
271  Ptr<VhtConfiguration> vhtConfiguration = GetVhtConfiguration ();
272  bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
273  capabilities.SetVhtSupported (1);
274  if (m_phy->GetChannelWidth () == 160)
275  {
276  capabilities.SetSupportedChannelWidthSet (1);
277  }
278  else
279  {
280  capabilities.SetSupportedChannelWidthSet (0);
281  }
282  // Set Maximum MPDU Length subfield
283  uint16_t maxAmsduSize = std::max ({m_voMaxAmsduSize, m_viMaxAmsduSize,
285  if (maxAmsduSize <= 3839)
286  {
287  capabilities.SetMaxMpduLength (3895);
288  }
289  else if (maxAmsduSize <= 7935)
290  {
291  capabilities.SetMaxMpduLength (7991);
292  }
293  else
294  {
295  capabilities.SetMaxMpduLength (11454);
296  }
297  uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
299  // round to the next power of two minus one
300  maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
301  // The maximum A-MPDU length in VHT capabilities elements ranges from 2^13-1 to 2^20-1
302  capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 8191u), 1048575u));
303 
304  capabilities.SetRxLdpc (htConfiguration->GetLdpcSupported ());
305  capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && sgiSupported);
306  capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && sgiSupported);
307  uint8_t maxMcs = 0;
308  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
309  {
310  if (mcs.GetMcsValue () > maxMcs)
311  {
312  maxMcs = mcs.GetMcsValue ();
313  }
314  }
315  // Support same MaxMCS for each spatial stream
316  for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
317  {
318  capabilities.SetRxMcsMap (maxMcs, nss);
319  }
320  for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedTxSpatialStreams (); nss++)
321  {
322  capabilities.SetTxMcsMap (maxMcs, nss);
323  }
324  uint64_t maxSupportedRateLGI = 0; //in bit/s
325  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
326  {
327  if (!mcs.IsAllowed (m_phy->GetChannelWidth (), 1))
328  {
329  continue;
330  }
331  if (mcs.GetDataRate (m_phy->GetChannelWidth ()) > maxSupportedRateLGI)
332  {
333  maxSupportedRateLGI = mcs.GetDataRate (m_phy->GetChannelWidth ());
334  NS_LOG_DEBUG ("Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
335  }
336  }
337  capabilities.SetRxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
338  capabilities.SetTxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
339  //To be filled in once supported
340  capabilities.SetRxStbc (0);
341  capabilities.SetTxStbc (0);
342  }
343  return capabilities;
344 }
345 
348 {
349  NS_LOG_FUNCTION (this);
350  HeCapabilities capabilities;
351  if (GetHeSupported ())
352  {
353  Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
354  Ptr<HeConfiguration> heConfiguration = GetHeConfiguration ();
355  capabilities.SetHeSupported (1);
356  uint8_t channelWidthSet = 0;
357  if ((m_phy->GetChannelWidth () >= 40) && (m_phy->GetPhyBand () == WIFI_PHY_BAND_2_4GHZ))
358  {
359  channelWidthSet |= 0x01;
360  }
362  {
363  channelWidthSet |= 0x02;
364  }
365  if ((m_phy->GetChannelWidth () >= 160) && ((m_phy->GetPhyBand () == WIFI_PHY_BAND_5GHZ) || (m_phy->GetPhyBand () == WIFI_PHY_BAND_6GHZ)))
366  {
367  channelWidthSet |= 0x04;
368  }
369  capabilities.SetChannelWidthSet (channelWidthSet);
370  capabilities.SetLdpcCodingInPayload (htConfiguration->GetLdpcSupported ());
371  uint8_t gi = 0;
372  if (heConfiguration->GetGuardInterval () <= NanoSeconds (1600))
373  {
374  //todo: We assume for now that if we support 800ns GI then 1600ns GI is supported as well
375  gi |= 0x01;
376  }
377  if (heConfiguration->GetGuardInterval () == NanoSeconds (800))
378  {
379  gi |= 0x02;
380  }
381  capabilities.SetHeLtfAndGiForHePpdus (gi);
382  uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
384  // round to the next power of two minus one
385  maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
386  // The maximum A-MPDU length in HE capabilities elements ranges from 2^20-1 to 2^23-1
387  capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 1048575u), 8388607u));
388 
389  uint8_t maxMcs = 0;
390  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
391  {
392  if (mcs.GetMcsValue () > maxMcs)
393  {
394  maxMcs = mcs.GetMcsValue ();
395  }
396  }
397  capabilities.SetHighestMcsSupported (maxMcs);
399  }
400  return capabilities;
401 }
402 
403 void
405 {
406  NS_LOG_FUNCTION (this << +threshold);
407  GetVOQueue ()->SetBlockAckThreshold (threshold);
408 }
409 
410 void
412 {
413  NS_LOG_FUNCTION (this << +threshold);
414  GetVIQueue ()->SetBlockAckThreshold (threshold);
415 }
416 
417 void
419 {
420  NS_LOG_FUNCTION (this << +threshold);
421  GetBEQueue ()->SetBlockAckThreshold (threshold);
422 }
423 
424 void
426 {
427  NS_LOG_FUNCTION (this << +threshold);
428  GetBKQueue ()->SetBlockAckThreshold (threshold);
429 }
430 
431 void
433 {
434  NS_LOG_FUNCTION (this << timeout);
436 }
437 
438 void
440 {
441  NS_LOG_FUNCTION (this << timeout);
443 }
444 
445 void
447 {
448  NS_LOG_FUNCTION (this << timeout);
450 }
451 
452 void
454 {
455  NS_LOG_FUNCTION (this << timeout);
457 }
458 
459 void
461 {
462  NS_LOG_FUNCTION (this << ac);
463 
464  //Our caller shouldn't be attempting to setup a queue that is
465  //already configured.
466  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
467 
468  Ptr<QosTxop> edca = CreateObject<QosTxop> ();
470  edca->SetTxMiddle (m_txMiddle);
471  edca->GetBaManager ()->SetTxOkCallback (MakeCallback (&MpduTracedCallback::operator(),
473  edca->GetBaManager ()->SetTxFailedCallback (MakeCallback (&MpduTracedCallback::operator(),
475  edca->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(),
477  edca->SetAccessCategory (ac);
478  edca->CompleteConfig ();
479 
480  m_edca.insert (std::make_pair (ac, edca));
481 }
482 
483 void
485 {
486  NS_LOG_FUNCTION (this << type);
487  m_typeOfStation = type;
488 }
489 
492 {
493  return m_typeOfStation;
494 }
495 
496 Ptr<Txop>
498 {
499  return m_txop;
500 }
501 
504 {
505  return m_edca.find (ac)->second;
506 }
507 
509 RegularWifiMac::GetQosTxop (uint8_t tid) const
510 {
511  return GetQosTxop (QosUtilsMapTidToAc (tid));
512 }
513 
516 {
517  return m_edca.find (AC_VO)->second;
518 }
519 
522 {
523  return m_edca.find (AC_VI)->second;
524 }
525 
528 {
529  return m_edca.find (AC_BE)->second;
530 }
531 
534 {
535  return m_edca.find (AC_BK)->second;
536 }
537 
538 void
540 {
541  NS_LOG_FUNCTION (this << phy);
542  m_phy = phy;
543  m_channelAccessManager->SetupPhyListener (phy);
544  NS_ASSERT (m_feManager != 0);
545  m_feManager->SetWifiPhy (phy);
546 }
547 
550 {
551  NS_LOG_FUNCTION (this);
552  return m_phy;
553 }
554 
555 void
557 {
558  NS_LOG_FUNCTION (this);
559  NS_ASSERT (m_feManager != 0);
560  m_feManager->ResetPhy ();
561  m_channelAccessManager->RemovePhyListener (m_phy);
562  m_phy = 0;
563 }
564 
565 void
567 {
568  NS_LOG_FUNCTION (this);
569  m_forwardUp = upCallback;
570 }
571 
572 void
574 {
575  NS_LOG_FUNCTION (this);
576  m_linkUp = linkUp;
577 }
578 
579 void
581 {
582  NS_LOG_FUNCTION (this);
583  m_linkDown = linkDown;
584 }
585 
586 void
588 {
589  NS_LOG_FUNCTION (this << enable);
590  m_qosSupported = enable;
591 }
592 
593 bool
595 {
596  return m_qosSupported;
597 }
598 
599 bool
601 {
602  if (GetHtConfiguration ())
603  {
604  return true;
605  }
606  return false;
607 }
608 
609 bool
611 {
612  if (GetVhtConfiguration ())
613  {
614  return true;
615  }
616  return false;
617 }
618 
619 bool
621 {
622  if (GetHeConfiguration ())
623  {
624  return true;
625  }
626  return false;
627 }
628 
629 bool
631 {
632  return m_erpSupported;
633 }
634 
635 void
637 {
638  NS_LOG_FUNCTION (this);
639  if (enable)
640  {
641  SetDsssSupported (true);
642  }
643  m_erpSupported = enable;
644 }
645 
646 void
648 {
649  NS_LOG_FUNCTION (this);
650  m_dsssSupported = enable;
651 }
652 
653 bool
655 {
656  return m_dsssSupported;
657 }
658 
659 void
661 {
662  NS_LOG_FUNCTION (this);
663  m_ctsToSelfSupported = enable;
664 }
665 
666 void
668 {
669  NS_LOG_FUNCTION (this << address);
670  m_address = address;
671 }
672 
675 {
676  return m_address;
677 }
678 
679 void
681 {
682  NS_LOG_FUNCTION (this << ssid);
683  m_ssid = ssid;
684 }
685 
686 Ssid
688 {
689  return m_ssid;
690 }
691 
692 void
694 {
695  NS_LOG_FUNCTION (this << bssid);
696  m_bssid = bssid;
697  if (m_feManager)
698  {
699  m_feManager->SetBssid (bssid);
700  }
701 }
702 
705 {
706  return m_bssid;
707 }
708 
709 void
711 {
712  NS_ASSERT (m_feManager != 0);
713  m_feManager->SetPromisc ();
714 }
715 
716 void
718 {
719  NS_LOG_FUNCTION (this << enable);
720  m_shortSlotTimeSupported = enable;
721 }
722 
723 bool
725 {
727 }
728 
729 void
731  Mac48Address to, Mac48Address from)
732 {
733  //We expect RegularWifiMac subclasses which do support forwarding (e.g.,
734  //AP) to override this method. Therefore, we throw a fatal error if
735  //someone tries to invoke this method on a class which has not done
736  //this.
737  NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
738  << ") does not support Enqueue() with from address");
739 }
740 
741 bool
743 {
744  return false;
745 }
746 
747 void
749 {
750  NS_LOG_FUNCTION (this << packet << from << to);
751  m_forwardUp (packet, from, to);
752 }
753 
754 void
756 {
757  NS_LOG_FUNCTION (this << *mpdu);
758 
759  const WifiMacHeader* hdr = &mpdu->GetHeader ();
760  Ptr<Packet> packet = mpdu->GetPacket ()->Copy ();
761  Mac48Address to = hdr->GetAddr1 ();
762  Mac48Address from = hdr->GetAddr2 ();
763 
764  //We don't know how to deal with any frame that is not addressed to
765  //us (and odds are there is nothing sensible we could do anyway),
766  //so we ignore such frames.
767  //
768  //The derived class may also do some such filtering, but it doesn't
769  //hurt to have it here too as a backstop.
770  if (to != GetAddress ())
771  {
772  return;
773  }
774 
775  if (hdr->IsMgt () && hdr->IsAction ())
776  {
777  //There is currently only any reason for Management Action
778  //frames to be flying about if we are a QoS STA.
780 
781  WifiActionHeader actionHdr;
782  packet->RemoveHeader (actionHdr);
783 
784  switch (actionHdr.GetCategory ())
785  {
787 
788  switch (actionHdr.GetAction ().blockAck)
789  {
791  {
792  MgtAddBaRequestHeader reqHdr;
793  packet->RemoveHeader (reqHdr);
794 
795  //We've received an ADDBA Request. Our policy here is
796  //to automatically accept it, so we get the ADDBA
797  //Response on it's way immediately.
798  NS_ASSERT (m_feManager != 0);
799  Ptr<HtFrameExchangeManager> htFem = DynamicCast<HtFrameExchangeManager> (m_feManager);
800  if (htFem != 0)
801  {
802  htFem->SendAddBaResponse (&reqHdr, from);
803  }
804  //This frame is now completely dealt with, so we're done.
805  return;
806  }
808  {
809  MgtAddBaResponseHeader respHdr;
810  packet->RemoveHeader (respHdr);
811 
812  //We've received an ADDBA Response. We assume that it
813  //indicates success after an ADDBA Request we have
814  //sent (we could, in principle, check this, but it
815  //seems a waste given the level of the current model)
816  //and act by locally establishing the agreement on
817  //the appropriate queue.
818  AcIndex ac = QosUtilsMapTidToAc (respHdr.GetTid ());
819  m_edca[ac]->GotAddBaResponse (&respHdr, from);
820  //This frame is now completely dealt with, so we're done.
821  return;
822  }
824  {
825  MgtDelBaHeader delBaHdr;
826  packet->RemoveHeader (delBaHdr);
827 
828  if (delBaHdr.IsByOriginator ())
829  {
830  //This DELBA frame was sent by the originator, so
831  //this means that an ingoing established
832  //agreement exists in HtFrameExchangeManager and we need to
833  //destroy it.
834  NS_ASSERT (m_feManager != 0);
835  Ptr<HtFrameExchangeManager> htFem = DynamicCast<HtFrameExchangeManager> (m_feManager);
836  if (htFem != 0)
837  {
838  htFem->DestroyBlockAckAgreement (from, delBaHdr.GetTid ());
839  }
840  }
841  else
842  {
843  //We must have been the originator. We need to
844  //tell the correct queue that the agreement has
845  //been torn down
846  AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
847  m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
848  }
849  //This frame is now completely dealt with, so we're done.
850  return;
851  }
852  default:
853  NS_FATAL_ERROR ("Unsupported Action field in Block Ack Action frame");
854  return;
855  }
856  default:
857  NS_FATAL_ERROR ("Unsupported Action frame received");
858  return;
859  }
860  }
861  NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
862 }
863 
864 void
866 {
867  NS_LOG_FUNCTION (this << *mpdu);
868  for (auto& msduPair : *PeekPointer (mpdu))
869  {
870  ForwardUp (msduPair.first, msduPair.second.GetSourceAddr (),
871  msduPair.second.GetDestinationAddr ());
872  }
873 }
874 
875 TypeId
877 {
878  static TypeId tid = TypeId ("ns3::RegularWifiMac")
879  .SetParent<WifiMac> ()
880  .SetGroupName ("Wifi")
881  .AddAttribute ("QosSupported",
882  "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA.",
883  BooleanValue (false),
887  .AddAttribute ("CtsToSelfSupported",
888  "Use CTS to Self when using a rate that is not in the basic rate set.",
889  BooleanValue (false),
892  .AddAttribute ("VO_MaxAmsduSize",
893  "Maximum length in bytes of an A-MSDU for AC_VO access class "
894  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
895  "Value 0 means A-MSDU aggregation is disabled for that AC.",
896  UintegerValue (0),
898  MakeUintegerChecker<uint16_t> (0, 11398))
899  .AddAttribute ("VI_MaxAmsduSize",
900  "Maximum length in bytes of an A-MSDU for AC_VI access class "
901  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
902  "Value 0 means A-MSDU aggregation is disabled for that AC.",
903  UintegerValue (0),
905  MakeUintegerChecker<uint16_t> (0, 11398))
906  .AddAttribute ("BE_MaxAmsduSize",
907  "Maximum length in bytes of an A-MSDU for AC_BE access class "
908  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
909  "Value 0 means A-MSDU aggregation is disabled for that AC.",
910  UintegerValue (0),
912  MakeUintegerChecker<uint16_t> (0, 11398))
913  .AddAttribute ("BK_MaxAmsduSize",
914  "Maximum length in bytes of an A-MSDU for AC_BK access class "
915  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
916  "Value 0 means A-MSDU aggregation is disabled for that AC.",
917  UintegerValue (0),
919  MakeUintegerChecker<uint16_t> (0, 11398))
920  .AddAttribute ("VO_MaxAmpduSize",
921  "Maximum length in bytes of an A-MPDU for AC_VO access class "
922  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
923  "Value 0 means A-MPDU aggregation is disabled for that AC.",
924  UintegerValue (0),
926  MakeUintegerChecker<uint32_t> ())
927  .AddAttribute ("VI_MaxAmpduSize",
928  "Maximum length in bytes of an A-MPDU for AC_VI access class "
929  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
930  "Value 0 means A-MPDU aggregation is disabled for that AC.",
931  UintegerValue (65535),
933  MakeUintegerChecker<uint32_t> ())
934  .AddAttribute ("BE_MaxAmpduSize",
935  "Maximum length in bytes of an A-MPDU for AC_BE access class "
936  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
937  "Value 0 means A-MPDU aggregation is disabled for that AC.",
938  UintegerValue (65535),
940  MakeUintegerChecker<uint32_t> ())
941  .AddAttribute ("BK_MaxAmpduSize",
942  "Maximum length in bytes of an A-MPDU for AC_BK access class "
943  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 8388607 for HE PPDUs). "
944  "Value 0 means A-MPDU aggregation is disabled for that AC.",
945  UintegerValue (0),
947  MakeUintegerChecker<uint32_t> ())
948  .AddAttribute ("VO_BlockAckThreshold",
949  "If number of packets in VO queue reaches this value, "
950  "block ack mechanism is used. If this value is 0, block ack is never used."
951  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
952  UintegerValue (0),
954  MakeUintegerChecker<uint8_t> (0, 64))
955  .AddAttribute ("VI_BlockAckThreshold",
956  "If number of packets in VI queue reaches this value, "
957  "block ack mechanism is used. If this value is 0, block ack is never used."
958  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
959  UintegerValue (0),
961  MakeUintegerChecker<uint8_t> (0, 64))
962  .AddAttribute ("BE_BlockAckThreshold",
963  "If number of packets in BE queue reaches this value, "
964  "block ack mechanism is used. If this value is 0, block ack is never used."
965  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
966  UintegerValue (0),
968  MakeUintegerChecker<uint8_t> (0, 64))
969  .AddAttribute ("BK_BlockAckThreshold",
970  "If number of packets in BK queue reaches this value, "
971  "block ack mechanism is used. If this value is 0, block ack is never used."
972  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
973  UintegerValue (0),
975  MakeUintegerChecker<uint8_t> (0, 64))
976  .AddAttribute ("VO_BlockAckInactivityTimeout",
977  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
978  "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
979  "block ack setup is completed and will be reset every time that a block ack"
980  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
981  UintegerValue (0),
983  MakeUintegerChecker<uint16_t> ())
984  .AddAttribute ("VI_BlockAckInactivityTimeout",
985  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
986  "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
987  "block ack setup is completed and will be reset every time that a block ack"
988  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
989  UintegerValue (0),
991  MakeUintegerChecker<uint16_t> ())
992  .AddAttribute ("BE_BlockAckInactivityTimeout",
993  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
994  "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
995  "block ack setup is completed and will be reset every time that a block ack"
996  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
997  UintegerValue (0),
999  MakeUintegerChecker<uint16_t> ())
1000  .AddAttribute ("BK_BlockAckInactivityTimeout",
1001  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
1002  "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
1003  "block ack setup is completed and will be reset every time that a block ack"
1004  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1005  UintegerValue (0),
1007  MakeUintegerChecker<uint16_t> ())
1008  .AddAttribute ("ShortSlotTimeSupported",
1009  "Whether or not short slot time is supported (only used by ERP APs or STAs).",
1010  BooleanValue (true),
1013  MakeBooleanChecker ())
1014  .AddAttribute ("Txop",
1015  "The Txop object.",
1016  PointerValue (),
1018  MakePointerChecker<Txop> ())
1019  .AddAttribute ("VO_Txop",
1020  "Queue that manages packets belonging to AC_VO access class.",
1021  PointerValue (),
1023  MakePointerChecker<QosTxop> ())
1024  .AddAttribute ("VI_Txop",
1025  "Queue that manages packets belonging to AC_VI access class.",
1026  PointerValue (),
1028  MakePointerChecker<QosTxop> ())
1029  .AddAttribute ("BE_Txop",
1030  "Queue that manages packets belonging to AC_BE access class.",
1031  PointerValue (),
1033  MakePointerChecker<QosTxop> ())
1034  .AddAttribute ("BK_Txop",
1035  "Queue that manages packets belonging to AC_BK access class.",
1036  PointerValue (),
1038  MakePointerChecker<QosTxop> ())
1039  .AddTraceSource ("TxOkHeader",
1040  "The header of successfully transmitted packet.",
1042  "ns3::WifiMacHeader::TracedCallback",
1044  "Use the AckedMpdu trace instead.")
1045  .AddTraceSource ("TxErrHeader",
1046  "The header of unsuccessfully transmitted packet.",
1048  "ns3::WifiMacHeader::TracedCallback",
1050  "Depending on the failure type, use the NAckedMpdu trace, the "
1051  "DroppedMpdu trace or one of the traces associated with TX timeouts.")
1052  .AddTraceSource ("AckedMpdu",
1053  "An MPDU that was successfully acknowledged, via either a "
1054  "Normal Ack or a Block Ack.",
1056  "ns3::WifiMacQueueItem::TracedCallback")
1057  .AddTraceSource ("NAckedMpdu",
1058  "An MPDU that was negatively acknowledged via a Block Ack.",
1060  "ns3::WifiMacQueueItem::TracedCallback")
1061  .AddTraceSource ("DroppedMpdu",
1062  "An MPDU that was dropped for the given reason (see WifiMacDropReason).",
1064  "ns3::RegularWifiMac::DroppedMpduCallback")
1065  .AddTraceSource ("MpduResponseTimeout",
1066  "An MPDU whose response was not received before the timeout, along with "
1067  "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
1068  "TXVECTOR used to transmit the MPDU. This trace source is fired when a "
1069  "CTS is missing after an RTS or a Normal Ack is missing after an MPDU.",
1071  "ns3::RegularWifiMac::MpduResponseTimeoutCallback")
1072  .AddTraceSource ("PsduResponseTimeout",
1073  "A PSDU whose response was not received before the timeout, along with "
1074  "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
1075  "TXVECTOR used to transmit the PSDU. This trace source is fired when a "
1076  "BlockAck is missing after an A-MPDU or a BlockAckReq.",
1078  "ns3::RegularWifiMac::PsduResponseTimeoutCallback")
1079  ;
1080  return tid;
1081 }
1082 
1083 void
1085 {
1086  NS_LOG_FUNCTION (this << standard);
1087  uint32_t cwmin = 0;
1088  uint32_t cwmax = 0;
1089  switch (standard)
1090  {
1092  case WIFI_STANDARD_80211ac:
1095  {
1096  SetQosSupported (true);
1097  cwmin = 15;
1098  cwmax = 1023;
1099  break;
1100  }
1103  {
1104  SetQosSupported (true);
1105  }
1106  case WIFI_STANDARD_80211g:
1107  SetErpSupported (true);
1108  case WIFI_STANDARD_80211a:
1109  case WIFI_STANDARD_80211p:
1110  cwmin = 15;
1111  cwmax = 1023;
1112  break;
1113  case WIFI_STANDARD_80211b:
1114  SetDsssSupported (true);
1115  cwmin = 31;
1116  cwmax = 1023;
1117  break;
1118  default:
1119  NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
1120  }
1121 
1123  ConfigureContentionWindow (cwmin, cwmax);
1124 }
1125 
1126 void
1127 RegularWifiMac::ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax)
1128 {
1129  bool isDsssOnly = m_dsssSupported && !m_erpSupported;
1130  //The special value of AC_BE_NQOS which exists in the Access
1131  //Category enumeration allows us to configure plain old DCF.
1132  ConfigureDcf (m_txop, cwMin, cwMax, isDsssOnly, AC_BE_NQOS);
1133 
1134  //Now we configure the EDCA functions
1135  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1136  {
1137  ConfigureDcf (i->second, cwMin, cwMax, isDsssOnly, i->first);
1138  }
1139 }
1140 
1141 } //namespace ns3
virtual void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:280
Mac48Address m_bssid
the BSSID
uint16_t m_voMaxAmsduSize
maximum A-MSDU size for AC_VO (in bytes)
void Dispose(void)
Dispose of this Object.
Definition: object.cc:214
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
Set VO block ack inactivity timeout.
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
void SetupEdcaQueue(AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...
void SetTxStbc(uint8_t txStbc)
Set the transmit STBC.
Ptr< HeConfiguration > GetHeConfiguration(void) const
Definition: wifi-mac.cc:198
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetHtSupported(uint8_t htSupported)
Set the HT Supported flag.
MpduResponseTimeoutTracedCallback m_mpduResponseTimeoutCallback
MPDU response timeout traced callback.
AttributeValue implementation for Boolean.
Definition: boolean.h:36
bool GetHeSupported() const
Return whether the device supports HE.
Ptr< Txop > m_txop
This holds a pointer to the TXOP instance for this WifiMac - used for transmission of frames to non-Q...
void SetSupportedChannelWidthSet(uint8_t channelWidthSet)
Set the supported channel width set.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
uint32_t m_bkMaxAmpduSize
maximum A-MPDU size for AC_BK (in bytes)
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:57
#define min(a, b)
Definition: 80211b.c:42
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:856
virtual void DeaggregateAmsduAndForward(Ptr< WifiMacQueueItem > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack...
bool GetQosSupported() const
Return whether the device supports QoS.
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:1124
static TypeId GetTypeId(void)
Get the type ID.
void SetShortGuardInterval40(uint8_t shortGuardInterval)
Set the short guard interval 40 field.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:85
void SetHeSupported(uint8_t heSupported)
Set HE supported.
uint16_t m_bkMaxAmsduSize
maximum A-MSDU size for AC_BK (in bytes)
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
uint32_t m_beMaxAmpduSize
maximum A-MPDU size for AC_BE (in bytes)
void SetErpSupported(bool enable)
Enable or disable ERP support for the device.
void SetLSigProtectionSupport(uint8_t lSigProtection)
Set the LSIG protection support.
void SetChannelAccessManager(const Ptr< ChannelAccessManager > manager)
Set ChannelAccessManager this Txop is associated to.
Definition: txop.cc:118
Implement the header for management frames of type Add Block Ack request.
Definition: mgt-headers.h:989
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities of the device.
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
The Extended Capabilities Information ElementThis class knows how to serialise and deserialise the Ex...
#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
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:411
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:205
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
void SetHighestNssSupported(uint8_t nss)
Set highest NSS supported.
void SetSsid(Ssid ssid)
void SetBlockAckInactivityTimeout(uint16_t timeout)
Set the BlockAck inactivity timeout.
Definition: qos-txop.cc:700
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
WifiMacType GetType(void) const
Return the type (enum WifiMacType)
void SetLinkDownCallback(Callback< void > linkDown)
CategoryValue GetCategory()
Return the category value.
The 5 GHz band.
Definition: wifi-phy-band.h:37
Ptr< WifiPhy > m_phy
Wifi PHY.
uint32_t m_voMaxAmpduSize
maximum A-MPDU size for AC_VO (in bytes)
Ptr< ChannelAccessManager > m_channelAccessManager
channel access manager
ns3::Time timeout
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Definition: wifi-phy.cc:2049
virtual void Receive(Ptr< WifiMacQueueItem > mpdu)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac)
Definition: wifi-mac.cc:127
bool GetShortSlotTimeSupported(void) const
bool GetDsssSupported() const
Return whether the device supports DSSS.
TracedCallback< const WifiMacHeader & > m_txErrCallback
transmit error callback
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
phy
Definition: third.py:93
void SetVoBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VO.
void SetVhtSupported(uint8_t vhtSupported)
Set the VHT supported field.
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1233
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
void SetHeLtfAndGiForHePpdus(uint8_t heLtfAndGiForHePpdus)
Set HE LTF and GI for HE PDPUs.
uint8_t GetTid(void) const
Return the Traffic ID (TID).
void SetBssid(Mac48Address bssid)
void SetVhtSupported(uint8_t vhtSupported)
Set the VHT Supported flag.
bool IsByOriginator(void) const
Check if the initiator bit in the DELBA is set.
virtual bool SupportsSendFrom(void) const
bool IsAction(void) const
Return true if the header is an Action header.
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to, Mac48Address from)
void SetForwardUpCallback(ForwardUpCallback upCallback)
Ptr< HtConfiguration > GetHtConfiguration(void) const
Definition: wifi-mac.cc:184
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
void SetBkBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BK.
bool GetErpSupported() const
Return whether the device supports ERP.
Video.
Definition: qos-utils.h:64
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:227
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:43
void SetHighestMcsSupported(uint8_t mcs)
Set highest MCS supported.
bool GetVhtSupported() const
Return whether the device supports VHT.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1313
The IEEE 802.11ac VHT Capabilities.
Ssid m_ssid
Service Set ID (SSID)
base class for all MAC-level wifi objects.
Definition: wifi-mac.h:70
Hold an unsigned integer type.
Definition: uinteger.h:44
ssid
Definition: third.py:100
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:53
void SetAddress(Mac48Address address)
Best Effort.
Definition: qos-utils.h:60
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
virtual void DoDispose()
Destructor implementation.
Definition: wifi-mac.cc:79
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
Ptr< QosTxop > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
TypeOfStation GetTypeOfStation(void) const
Return the type of station.
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
Mac48Address GetBssid(void) const
uint16_t m_beMaxAmsduSize
maximum A-MSDU size for AC_BE (in bytes)
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities of the device.
void ResetWifiPhy(void)
Remove currently attached WifiPhy device from this MAC.
void SetupFrameExchangeManager(void)
Create a Frame Exchange Manager depending on the supported version of the standard.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
PsduResponseTimeoutTracedCallback m_psduResponseTimeoutCallback
PSDU response timeout traced callback.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
TypeOfStation m_typeOfStation
the type of station
void SetBeBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BE.
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
Callback< void > m_linkDown
Callback when a link is down.
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
TracedCallback< const WifiMacHeader & > m_txOkCallback
transmit OK callback
Ptr< FrameExchangeManager > GetFrameExchangeManager(void) const
Get the Frame Exchange Manager.
void SetRxStbc(uint8_t rxStbc)
Set the receive STBC.
Ptr< FrameExchangeManager > m_feManager
Frame Exchange Manager.
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
virtual void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > stationManager)
void SetLinkUpCallback(Callback< void > linkUp)
Total number of ACs.
Definition: qos-utils.h:68
virtual void DoDispose()
Destructor implementation.
DroppedMpduTracedCallback m_droppedMpduCallback
This trace indicates that an MPDU was dropped for the given reason.
void SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
Set indication whether the transmission and reception of LDPC encoded packets is supported.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
address
Definition: first.py:44
Background.
Definition: qos-utils.h:62
void SetShortGuardIntervalFor80Mhz(uint8_t shortGuardInterval)
Set the short guard interval 80 MHz.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:121
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
an EUI-48 address
Definition: mac48-address.h:43
void SetRxLdpc(uint8_t rxLdpc)
Set the receive LDPC.
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
Ssid GetSsid(void) const
Ptr< QosTxop > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
void SetMaxAmsduLength(uint16_t maxAmsduLength)
Set the maximum AMSDU length.
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ack mechanism.
Definition: qos-txop.cc:692
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:35
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Set VI block ack inactivity timeout.
MpduTracedCallback m_nackedMpduCallback
nack&#39;ed MPDU callback
Mac48Address GetAddress(void) const
void SetRxMcsMap(uint8_t mcs, uint8_t nss)
Voice.
Definition: qos-utils.h:66
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
Definition: txop.cc:139
Attribute or trace source is not used anymore; simulation fails.
Definition: type-id.h:74
Ptr< QosTxop > GetBEQueue(void) const
Accessor for the AC_BE channel access function.
Ptr< Txop > GetTxop(void) const
Accessor for the DCF object.
bool IsMgt(void) const
Return true if the Type is Management.
void SetViBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VI.
void SetShortGuardIntervalFor160Mhz(uint8_t shortGuardInterval)
Set the short guard interval 160 MHz.
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
Definition: wifi-mac.cc:191
BlockAckActionValue blockAck
block ack
Definition: mgt-headers.h:932
bool GetHtSupported() const
Return whether the device supports HT.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
Implement the header for management frames of type Add Block Ack response.
Definition: mgt-headers.h:1121
Implement the header for management frames of type Delete Block Ack.
Definition: mgt-headers.h:1242
MpduTracedCallback m_ackedMpduCallback
ack&#39;ed MPDU callback
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
Definition: txop.cc:125
void SetSupportedChannelWidth(uint8_t supportedChannelWidth)
Set the supported channel width field.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
virtual void DoInitialize()
Initialize() implementation.
void SetLdpc(uint8_t ldpc)
Set the LDPC field.
void SetShortGuardInterval20(uint8_t shortGuardInterval)
Set the short guard interval 20 field.
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Set BK block ack inactivity timeout.
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
virtual void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > remoteManager)
Set WifiRemoteStationsManager this Txop is associated to.
Definition: txop.cc:132
The 6 GHz band.
Definition: wifi-phy-band.h:39
bool m_shortSlotTimeSupported
flag whether short slot time is supported
uint32_t m_viMaxAmpduSize
maximum A-MPDU size for AC_VI (in bytes)
uint8_t GetTid(void) const
Return the Traffic ID (TID).
bool m_erpSupported
This Boolean is set true iff this WifiMac is to model 802.11g.
TypeOfStation
Enumeration for type of station.
Definition: wifi-mac.h:40
Ptr< QosTxop > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum N spatial streams.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time feature.
void SetDsssSupported(bool enable)
Enable or disable DSSS support for the device.
void ConfigureStandard(WifiStandard standard)
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
Mac48Address m_address
MAC address of this station.
ActionValue GetAction()
Return the action value.
void SetRxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the receive highest supported LGI data rate.
void SetPromisc(void)
Sets the interface in promiscuous mode.
Ptr< WifiPhy > GetWifiPhy(void) const
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities of the device.
The IEEE 802.11ax HE Capabilities.
void SetTxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the transmit highest supported LGI data rate.
void SetTxMcsMap(uint8_t mcs, uint8_t nss)
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
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
Set BE block ack inactivity timeout.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1403
a unique identifier for an interface.
Definition: type-id.h:58
bool m_dsssSupported
This Boolean is set true iff this WifiMac is to model 802.11b.
virtual void SetWifiPhy(const Ptr< WifiPhy > phy)
uint16_t GetNMcs(void) const
Definition: wifi-phy.cc:2035
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
Definition: object.cc:183
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
Implements the IEEE 802.11 MAC header.
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1421
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities of the device.
void SetHtSupported(uint8_t htSupported)
Set the HT supported field.