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->GetWifiTxTimer ().SetPsduMapResponseTimeoutCallback (MakeCallback (&PsduMapResponseTimeoutTracedCallback::operator(),
160  m_feManager->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(),
162  m_feManager->SetAckedMpduCallback (MakeCallback (&MpduTracedCallback::operator(),
164  m_channelAccessManager->SetupFrameExchangeManager (m_feManager);
165  if (GetQosSupported ())
166  {
167  for (const auto& pair : m_edca)
168  {
169  pair.second->SetQosFrameExchangeManager (DynamicCast<QosFrameExchangeManager> (m_feManager));
170  }
171  }
172 }
173 
176 {
177  return m_feManager;
178 }
179 
180 void
182 {
183  NS_LOG_FUNCTION (this << stationManager);
184  m_stationManager = stationManager;
185  m_txop->SetWifiRemoteStationManager (stationManager);
186  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
187  {
188  i->second->SetWifiRemoteStationManager (stationManager);
189  }
190 }
191 
194 {
195  return m_stationManager;
196 }
197 
200 {
201  NS_LOG_FUNCTION (this);
202  ExtendedCapabilities capabilities;
203  capabilities.SetHtSupported (GetHtSupported ());
204  capabilities.SetVhtSupported (GetVhtSupported ());
205  //TODO: to be completed
206  return capabilities;
207 }
208 
211 {
212  NS_LOG_FUNCTION (this);
213  HtCapabilities capabilities;
214  if (GetHtSupported ())
215  {
216  Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
217  bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
218  capabilities.SetHtSupported (1);
219  capabilities.SetLdpc (htConfiguration->GetLdpcSupported ());
220  capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40);
221  capabilities.SetShortGuardInterval20 (sgiSupported);
222  capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && sgiSupported);
223  // Set Maximum A-MSDU Length subfield
224  uint16_t maxAmsduSize = std::max ({m_voMaxAmsduSize, m_viMaxAmsduSize,
226  if (maxAmsduSize <= 3839)
227  {
228  capabilities.SetMaxAmsduLength (3839);
229  }
230  else
231  {
232  capabilities.SetMaxAmsduLength (7935);
233  }
234  uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
236  // round to the next power of two minus one
237  maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
238  // The maximum A-MPDU length in HT capabilities elements ranges from 2^13-1 to 2^16-1
239  capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 8191u), 65535u));
240 
241  capabilities.SetLSigProtectionSupport (true);
242  uint64_t maxSupportedRate = 0; //in bit/s
243  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HT))
244  {
245  capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
246  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
247  NS_ASSERT (nss > 0 && nss < 5);
248  uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), sgiSupported ? 400 : 800, nss);
249  if (dataRate > maxSupportedRate)
250  {
251  maxSupportedRate = dataRate;
252  NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
253  }
254  }
255  capabilities.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
256  capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
258  //we do not support unequal modulations
259  capabilities.SetTxRxMcsSetUnequal (0);
260  capabilities.SetTxUnequalModulation (0);
261  }
262  return capabilities;
263 }
264 
267 {
268  NS_LOG_FUNCTION (this);
269  VhtCapabilities capabilities;
270  if (GetVhtSupported ())
271  {
272  Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
273  Ptr<VhtConfiguration> vhtConfiguration = GetVhtConfiguration ();
274  bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
275  capabilities.SetVhtSupported (1);
276  if (m_phy->GetChannelWidth () == 160)
277  {
278  capabilities.SetSupportedChannelWidthSet (1);
279  }
280  else
281  {
282  capabilities.SetSupportedChannelWidthSet (0);
283  }
284  // Set Maximum MPDU Length subfield
285  uint16_t maxAmsduSize = std::max ({m_voMaxAmsduSize, m_viMaxAmsduSize,
287  if (maxAmsduSize <= 3839)
288  {
289  capabilities.SetMaxMpduLength (3895);
290  }
291  else if (maxAmsduSize <= 7935)
292  {
293  capabilities.SetMaxMpduLength (7991);
294  }
295  else
296  {
297  capabilities.SetMaxMpduLength (11454);
298  }
299  uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
301  // round to the next power of two minus one
302  maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
303  // The maximum A-MPDU length in VHT capabilities elements ranges from 2^13-1 to 2^20-1
304  capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 8191u), 1048575u));
305 
306  capabilities.SetRxLdpc (htConfiguration->GetLdpcSupported ());
307  capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && sgiSupported);
308  capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && sgiSupported);
309  uint8_t maxMcs = 0;
310  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
311  {
312  if (mcs.GetMcsValue () > maxMcs)
313  {
314  maxMcs = mcs.GetMcsValue ();
315  }
316  }
317  // Support same MaxMCS for each spatial stream
318  for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
319  {
320  capabilities.SetRxMcsMap (maxMcs, nss);
321  }
322  for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedTxSpatialStreams (); nss++)
323  {
324  capabilities.SetTxMcsMap (maxMcs, nss);
325  }
326  uint64_t maxSupportedRateLGI = 0; //in bit/s
327  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_VHT))
328  {
329  if (!mcs.IsAllowed (m_phy->GetChannelWidth (), 1))
330  {
331  continue;
332  }
333  if (mcs.GetDataRate (m_phy->GetChannelWidth ()) > maxSupportedRateLGI)
334  {
335  maxSupportedRateLGI = mcs.GetDataRate (m_phy->GetChannelWidth ());
336  NS_LOG_DEBUG ("Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
337  }
338  }
339  capabilities.SetRxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
340  capabilities.SetTxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
341  //To be filled in once supported
342  capabilities.SetRxStbc (0);
343  capabilities.SetTxStbc (0);
344  }
345  return capabilities;
346 }
347 
350 {
351  NS_LOG_FUNCTION (this);
352  HeCapabilities capabilities;
353  if (GetHeSupported ())
354  {
355  Ptr<HtConfiguration> htConfiguration = GetHtConfiguration ();
356  Ptr<HeConfiguration> heConfiguration = GetHeConfiguration ();
357  capabilities.SetHeSupported (1);
358  uint8_t channelWidthSet = 0;
359  if ((m_phy->GetChannelWidth () >= 40) && (m_phy->GetPhyBand () == WIFI_PHY_BAND_2_4GHZ))
360  {
361  channelWidthSet |= 0x01;
362  }
364  {
365  channelWidthSet |= 0x02;
366  }
367  if ((m_phy->GetChannelWidth () >= 160) && ((m_phy->GetPhyBand () == WIFI_PHY_BAND_5GHZ) || (m_phy->GetPhyBand () == WIFI_PHY_BAND_6GHZ)))
368  {
369  channelWidthSet |= 0x04;
370  }
371  capabilities.SetChannelWidthSet (channelWidthSet);
372  capabilities.SetLdpcCodingInPayload (htConfiguration->GetLdpcSupported ());
373  uint8_t gi = 0;
374  if (heConfiguration->GetGuardInterval () <= NanoSeconds (1600))
375  {
376  //todo: We assume for now that if we support 800ns GI then 1600ns GI is supported as well
377  gi |= 0x01;
378  }
379  if (heConfiguration->GetGuardInterval () == NanoSeconds (800))
380  {
381  gi |= 0x02;
382  }
383  capabilities.SetHeLtfAndGiForHePpdus (gi);
384  uint32_t maxAmpduLength = std::max ({m_voMaxAmpduSize, m_viMaxAmpduSize,
386  // round to the next power of two minus one
387  maxAmpduLength = (1ul << static_cast<uint32_t> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
388  // The maximum A-MPDU length in HE capabilities elements ranges from 2^20-1 to 2^23-1
389  capabilities.SetMaxAmpduLength (std::min (std::max (maxAmpduLength, 1048575u), 8388607u));
390 
391  uint8_t maxMcs = 0;
392  for (const auto & mcs : m_phy->GetMcsList (WIFI_MOD_CLASS_HE))
393  {
394  if (mcs.GetMcsValue () > maxMcs)
395  {
396  maxMcs = mcs.GetMcsValue ();
397  }
398  }
399  capabilities.SetHighestMcsSupported (maxMcs);
401  }
402  return capabilities;
403 }
404 
405 void
407 {
408  NS_LOG_FUNCTION (this << +threshold);
409  GetVOQueue ()->SetBlockAckThreshold (threshold);
410 }
411 
412 void
414 {
415  NS_LOG_FUNCTION (this << +threshold);
416  GetVIQueue ()->SetBlockAckThreshold (threshold);
417 }
418 
419 void
421 {
422  NS_LOG_FUNCTION (this << +threshold);
423  GetBEQueue ()->SetBlockAckThreshold (threshold);
424 }
425 
426 void
428 {
429  NS_LOG_FUNCTION (this << +threshold);
430  GetBKQueue ()->SetBlockAckThreshold (threshold);
431 }
432 
433 void
435 {
436  NS_LOG_FUNCTION (this << timeout);
438 }
439 
440 void
442 {
443  NS_LOG_FUNCTION (this << timeout);
445 }
446 
447 void
449 {
450  NS_LOG_FUNCTION (this << timeout);
452 }
453 
454 void
456 {
457  NS_LOG_FUNCTION (this << timeout);
459 }
460 
461 void
463 {
464  NS_LOG_FUNCTION (this << ac);
465 
466  //Our caller shouldn't be attempting to setup a queue that is
467  //already configured.
468  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
469 
470  Ptr<QosTxop> edca = CreateObject<QosTxop> ();
472  edca->SetTxMiddle (m_txMiddle);
473  edca->GetBaManager ()->SetTxOkCallback (MakeCallback (&MpduTracedCallback::operator(),
475  edca->GetBaManager ()->SetTxFailedCallback (MakeCallback (&MpduTracedCallback::operator(),
477  edca->SetDroppedMpduCallback (MakeCallback (&DroppedMpduTracedCallback::operator(),
479  edca->SetAccessCategory (ac);
480 
481  m_edca.insert (std::make_pair (ac, edca));
482 }
483 
484 void
486 {
487  NS_LOG_FUNCTION (this << type);
488  m_typeOfStation = type;
489 }
490 
493 {
494  return m_typeOfStation;
495 }
496 
497 Ptr<Txop>
499 {
500  return m_txop;
501 }
502 
505 {
506  return m_edca.find (ac)->second;
507 }
508 
510 RegularWifiMac::GetQosTxop (uint8_t tid) const
511 {
512  return GetQosTxop (QosUtilsMapTidToAc (tid));
513 }
514 
517 {
518  return m_edca.find (AC_VO)->second;
519 }
520 
523 {
524  return m_edca.find (AC_VI)->second;
525 }
526 
529 {
530  return m_edca.find (AC_BE)->second;
531 }
532 
535 {
536  return m_edca.find (AC_BK)->second;
537 }
538 
539 void
541 {
542  NS_LOG_FUNCTION (this << phy);
543  m_phy = phy;
544  m_channelAccessManager->SetupPhyListener (phy);
545  NS_ASSERT (m_feManager != 0);
546  m_feManager->SetWifiPhy (phy);
547 }
548 
551 {
552  NS_LOG_FUNCTION (this);
553  return m_phy;
554 }
555 
556 void
558 {
559  NS_LOG_FUNCTION (this);
560  NS_ASSERT (m_feManager != 0);
561  m_feManager->ResetPhy ();
562  m_channelAccessManager->RemovePhyListener (m_phy);
563  m_phy = 0;
564 }
565 
566 void
568 {
569  NS_LOG_FUNCTION (this);
570  m_forwardUp = upCallback;
571 }
572 
573 void
575 {
576  NS_LOG_FUNCTION (this);
577  m_linkUp = linkUp;
578 }
579 
580 void
582 {
583  NS_LOG_FUNCTION (this);
584  m_linkDown = linkDown;
585 }
586 
587 void
589 {
590  NS_LOG_FUNCTION (this << enable);
591  m_qosSupported = enable;
592 }
593 
594 bool
596 {
597  return m_qosSupported;
598 }
599 
600 bool
602 {
603  if (GetHtConfiguration ())
604  {
605  return true;
606  }
607  return false;
608 }
609 
610 bool
612 {
613  if (GetVhtConfiguration ())
614  {
615  return true;
616  }
617  return false;
618 }
619 
620 bool
622 {
623  if (GetHeConfiguration ())
624  {
625  return true;
626  }
627  return false;
628 }
629 
630 bool
632 {
633  return m_erpSupported;
634 }
635 
636 void
638 {
639  NS_LOG_FUNCTION (this);
640  if (enable)
641  {
642  SetDsssSupported (true);
643  }
644  m_erpSupported = enable;
645 }
646 
647 void
649 {
650  NS_LOG_FUNCTION (this);
651  m_dsssSupported = enable;
652 }
653 
654 bool
656 {
657  return m_dsssSupported;
658 }
659 
660 void
662 {
663  NS_LOG_FUNCTION (this);
664  m_ctsToSelfSupported = enable;
665 }
666 
667 void
669 {
670  NS_LOG_FUNCTION (this << address);
671  m_address = address;
672 }
673 
676 {
677  return m_address;
678 }
679 
680 void
682 {
683  NS_LOG_FUNCTION (this << ssid);
684  m_ssid = ssid;
685 }
686 
687 Ssid
689 {
690  return m_ssid;
691 }
692 
693 void
695 {
696  NS_LOG_FUNCTION (this << bssid);
697  m_bssid = bssid;
698  if (m_feManager)
699  {
700  m_feManager->SetBssid (bssid);
701  }
702 }
703 
706 {
707  return m_bssid;
708 }
709 
710 void
712 {
713  NS_ASSERT (m_feManager != 0);
714  m_feManager->SetPromisc ();
715 }
716 
717 void
719 {
720  NS_LOG_FUNCTION (this << enable);
721  m_shortSlotTimeSupported = enable;
722 }
723 
724 bool
726 {
728 }
729 
730 void
732  Mac48Address to, Mac48Address from)
733 {
734  //We expect RegularWifiMac subclasses which do support forwarding (e.g.,
735  //AP) to override this method. Therefore, we throw a fatal error if
736  //someone tries to invoke this method on a class which has not done
737  //this.
738  NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
739  << ") does not support Enqueue() with from address");
740 }
741 
742 bool
744 {
745  return false;
746 }
747 
748 void
750 {
751  NS_LOG_FUNCTION (this << packet << from << to);
752  m_forwardUp (packet, from, to);
753 }
754 
755 void
757 {
758  NS_LOG_FUNCTION (this << *mpdu);
759 
760  const WifiMacHeader* hdr = &mpdu->GetHeader ();
761  Ptr<Packet> packet = mpdu->GetPacket ()->Copy ();
762  Mac48Address to = hdr->GetAddr1 ();
763  Mac48Address from = hdr->GetAddr2 ();
764 
765  //We don't know how to deal with any frame that is not addressed to
766  //us (and odds are there is nothing sensible we could do anyway),
767  //so we ignore such frames.
768  //
769  //The derived class may also do some such filtering, but it doesn't
770  //hurt to have it here too as a backstop.
771  if (to != GetAddress ())
772  {
773  return;
774  }
775 
776  if (hdr->IsMgt () && hdr->IsAction ())
777  {
778  //There is currently only any reason for Management Action
779  //frames to be flying about if we are a QoS STA.
781 
782  WifiActionHeader actionHdr;
783  packet->RemoveHeader (actionHdr);
784 
785  switch (actionHdr.GetCategory ())
786  {
788 
789  switch (actionHdr.GetAction ().blockAck)
790  {
792  {
793  MgtAddBaRequestHeader reqHdr;
794  packet->RemoveHeader (reqHdr);
795 
796  //We've received an ADDBA Request. Our policy here is
797  //to automatically accept it, so we get the ADDBA
798  //Response on it's way immediately.
799  NS_ASSERT (m_feManager != 0);
800  Ptr<HtFrameExchangeManager> htFem = DynamicCast<HtFrameExchangeManager> (m_feManager);
801  if (htFem != 0)
802  {
803  htFem->SendAddBaResponse (&reqHdr, from);
804  }
805  //This frame is now completely dealt with, so we're done.
806  return;
807  }
809  {
810  MgtAddBaResponseHeader respHdr;
811  packet->RemoveHeader (respHdr);
812 
813  //We've received an ADDBA Response. We assume that it
814  //indicates success after an ADDBA Request we have
815  //sent (we could, in principle, check this, but it
816  //seems a waste given the level of the current model)
817  //and act by locally establishing the agreement on
818  //the appropriate queue.
819  AcIndex ac = QosUtilsMapTidToAc (respHdr.GetTid ());
820  m_edca[ac]->GotAddBaResponse (&respHdr, from);
821  //This frame is now completely dealt with, so we're done.
822  return;
823  }
825  {
826  MgtDelBaHeader delBaHdr;
827  packet->RemoveHeader (delBaHdr);
828 
829  if (delBaHdr.IsByOriginator ())
830  {
831  //This DELBA frame was sent by the originator, so
832  //this means that an ingoing established
833  //agreement exists in HtFrameExchangeManager and we need to
834  //destroy it.
835  NS_ASSERT (m_feManager != 0);
836  Ptr<HtFrameExchangeManager> htFem = DynamicCast<HtFrameExchangeManager> (m_feManager);
837  if (htFem != 0)
838  {
839  htFem->DestroyBlockAckAgreement (from, delBaHdr.GetTid ());
840  }
841  }
842  else
843  {
844  //We must have been the originator. We need to
845  //tell the correct queue that the agreement has
846  //been torn down
847  AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
848  m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
849  }
850  //This frame is now completely dealt with, so we're done.
851  return;
852  }
853  default:
854  NS_FATAL_ERROR ("Unsupported Action field in Block Ack Action frame");
855  return;
856  }
857  default:
858  NS_FATAL_ERROR ("Unsupported Action frame received");
859  return;
860  }
861  }
862  NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
863 }
864 
865 void
867 {
868  NS_LOG_FUNCTION (this << *mpdu);
869  for (auto& msduPair : *PeekPointer (mpdu))
870  {
871  ForwardUp (msduPair.first, msduPair.second.GetSourceAddr (),
872  msduPair.second.GetDestinationAddr ());
873  }
874 }
875 
876 TypeId
878 {
879  static TypeId tid = TypeId ("ns3::RegularWifiMac")
880  .SetParent<WifiMac> ()
881  .SetGroupName ("Wifi")
882  .AddAttribute ("QosSupported",
883  "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA.",
884  BooleanValue (false),
888  .AddAttribute ("CtsToSelfSupported",
889  "Use CTS to Self when using a rate that is not in the basic rate set.",
890  BooleanValue (false),
893  .AddAttribute ("VO_MaxAmsduSize",
894  "Maximum length in bytes of an A-MSDU for AC_VO access class "
895  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
896  "Value 0 means A-MSDU aggregation is disabled for that AC.",
897  UintegerValue (0),
899  MakeUintegerChecker<uint16_t> (0, 11398))
900  .AddAttribute ("VI_MaxAmsduSize",
901  "Maximum length in bytes of an A-MSDU for AC_VI access class "
902  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
903  "Value 0 means A-MSDU aggregation is disabled for that AC.",
904  UintegerValue (0),
906  MakeUintegerChecker<uint16_t> (0, 11398))
907  .AddAttribute ("BE_MaxAmsduSize",
908  "Maximum length in bytes of an A-MSDU for AC_BE access class "
909  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
910  "Value 0 means A-MSDU aggregation is disabled for that AC.",
911  UintegerValue (0),
913  MakeUintegerChecker<uint16_t> (0, 11398))
914  .AddAttribute ("BK_MaxAmsduSize",
915  "Maximum length in bytes of an A-MSDU for AC_BK access class "
916  "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
917  "Value 0 means A-MSDU aggregation is disabled for that AC.",
918  UintegerValue (0),
920  MakeUintegerChecker<uint16_t> (0, 11398))
921  .AddAttribute ("VO_MaxAmpduSize",
922  "Maximum length in bytes of an A-MPDU for AC_VO access class "
923  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
924  "Value 0 means A-MPDU aggregation is disabled for that AC.",
925  UintegerValue (0),
927  MakeUintegerChecker<uint32_t> (0, 6500631))
928  .AddAttribute ("VI_MaxAmpduSize",
929  "Maximum length in bytes of an A-MPDU for AC_VI access class "
930  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
931  "Value 0 means A-MPDU aggregation is disabled for that AC.",
932  UintegerValue (65535),
934  MakeUintegerChecker<uint32_t> (0, 6500631))
935  .AddAttribute ("BE_MaxAmpduSize",
936  "Maximum length in bytes of an A-MPDU for AC_BE access class "
937  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
938  "Value 0 means A-MPDU aggregation is disabled for that AC.",
939  UintegerValue (65535),
941  MakeUintegerChecker<uint32_t> (0, 6500631))
942  .AddAttribute ("BK_MaxAmpduSize",
943  "Maximum length in bytes of an A-MPDU for AC_BK access class "
944  "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
945  "Value 0 means A-MPDU aggregation is disabled for that AC.",
946  UintegerValue (0),
948  MakeUintegerChecker<uint32_t> (0, 6500631))
949  .AddAttribute ("VO_BlockAckThreshold",
950  "If number of packets in VO queue reaches this value, "
951  "block ack mechanism is used. If this value is 0, block ack is never used."
952  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
953  UintegerValue (0),
955  MakeUintegerChecker<uint8_t> (0, 64))
956  .AddAttribute ("VI_BlockAckThreshold",
957  "If number of packets in VI queue reaches this value, "
958  "block ack mechanism is used. If this value is 0, block ack is never used."
959  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
960  UintegerValue (0),
962  MakeUintegerChecker<uint8_t> (0, 64))
963  .AddAttribute ("BE_BlockAckThreshold",
964  "If number of packets in BE queue reaches this value, "
965  "block ack mechanism is used. If this value is 0, block ack is never used."
966  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
967  UintegerValue (0),
969  MakeUintegerChecker<uint8_t> (0, 64))
970  .AddAttribute ("BK_BlockAckThreshold",
971  "If number of packets in BK queue reaches this value, "
972  "block ack mechanism is used. If this value is 0, block ack is never used."
973  "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
974  UintegerValue (0),
976  MakeUintegerChecker<uint8_t> (0, 64))
977  .AddAttribute ("VO_BlockAckInactivityTimeout",
978  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
979  "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
980  "block ack setup is completed and will be reset every time that a block ack"
981  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
982  UintegerValue (0),
984  MakeUintegerChecker<uint16_t> ())
985  .AddAttribute ("VI_BlockAckInactivityTimeout",
986  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
987  "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
988  "block ack setup is completed and will be reset every time that a block ack"
989  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
990  UintegerValue (0),
992  MakeUintegerChecker<uint16_t> ())
993  .AddAttribute ("BE_BlockAckInactivityTimeout",
994  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
995  "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
996  "block ack setup is completed and will be reset every time that a block ack"
997  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
998  UintegerValue (0),
1000  MakeUintegerChecker<uint16_t> ())
1001  .AddAttribute ("BK_BlockAckInactivityTimeout",
1002  "Represents max time (blocks of 1024 microseconds) allowed for block ack"
1003  "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
1004  "block ack setup is completed and will be reset every time that a block ack"
1005  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1006  UintegerValue (0),
1008  MakeUintegerChecker<uint16_t> ())
1009  .AddAttribute ("ShortSlotTimeSupported",
1010  "Whether or not short slot time is supported (only used by ERP APs or STAs).",
1011  BooleanValue (true),
1014  MakeBooleanChecker ())
1015  .AddAttribute ("Txop",
1016  "The Txop object.",
1017  PointerValue (),
1019  MakePointerChecker<Txop> ())
1020  .AddAttribute ("VO_Txop",
1021  "Queue that manages packets belonging to AC_VO access class.",
1022  PointerValue (),
1024  MakePointerChecker<QosTxop> ())
1025  .AddAttribute ("VI_Txop",
1026  "Queue that manages packets belonging to AC_VI access class.",
1027  PointerValue (),
1029  MakePointerChecker<QosTxop> ())
1030  .AddAttribute ("BE_Txop",
1031  "Queue that manages packets belonging to AC_BE access class.",
1032  PointerValue (),
1034  MakePointerChecker<QosTxop> ())
1035  .AddAttribute ("BK_Txop",
1036  "Queue that manages packets belonging to AC_BK access class.",
1037  PointerValue (),
1039  MakePointerChecker<QosTxop> ())
1040  .AddTraceSource ("TxOkHeader",
1041  "The header of successfully transmitted packet.",
1043  "ns3::WifiMacHeader::TracedCallback",
1045  "Use the AckedMpdu trace instead.")
1046  .AddTraceSource ("TxErrHeader",
1047  "The header of unsuccessfully transmitted packet.",
1049  "ns3::WifiMacHeader::TracedCallback",
1051  "Depending on the failure type, use the NAckedMpdu trace, the "
1052  "DroppedMpdu trace or one of the traces associated with TX timeouts.")
1053  .AddTraceSource ("AckedMpdu",
1054  "An MPDU that was successfully acknowledged, via either a "
1055  "Normal Ack or a Block Ack.",
1057  "ns3::WifiMacQueueItem::TracedCallback")
1058  .AddTraceSource ("NAckedMpdu",
1059  "An MPDU that was negatively acknowledged via a Block Ack.",
1061  "ns3::WifiMacQueueItem::TracedCallback")
1062  .AddTraceSource ("DroppedMpdu",
1063  "An MPDU that was dropped for the given reason (see WifiMacDropReason).",
1065  "ns3::RegularWifiMac::DroppedMpduCallback")
1066  .AddTraceSource ("MpduResponseTimeout",
1067  "An MPDU whose response was not received before the timeout, along with "
1068  "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
1069  "TXVECTOR used to transmit the MPDU. This trace source is fired when a "
1070  "CTS is missing after an RTS or a Normal Ack is missing after an MPDU "
1071  "or after a DL MU PPDU acknowledged in SU format.",
1073  "ns3::RegularWifiMac::MpduResponseTimeoutCallback")
1074  .AddTraceSource ("PsduResponseTimeout",
1075  "A PSDU whose response was not received before the timeout, along with "
1076  "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
1077  "TXVECTOR used to transmit the PSDU. This trace source is fired when a "
1078  "BlockAck is missing after an A-MPDU, a BlockAckReq (possibly in the "
1079  "context of the acknowledgment of a DL MU PPDU in SU format) or a TB PPDU "
1080  "(in the latter case the missing BlockAck is a Multi-STA BlockAck).",
1082  "ns3::RegularWifiMac::PsduResponseTimeoutCallback")
1083  .AddTraceSource ("PsduMapResponseTimeout",
1084  "A PSDU map for which not all the responses were received before the timeout, "
1085  "along with an identifier of the type of timeout (see WifiTxTimer::Reason), "
1086  "the set of MAC addresses of the stations that did not respond and the total "
1087  "number of stations that had to respond. This trace source is fired when not "
1088  "all the addressed stations responded to an MU-BAR Trigger frame (either sent as "
1089  "a SU frame or aggregated to PSDUs in the DL MU PPDU), a Basic Trigger Frame or "
1090  "a BSRP Trigger Frame.",
1092  "ns3::RegularWifiMac::PsduMapResponseTimeoutCallback")
1093  ;
1094  return tid;
1095 }
1096 
1097 void
1099 {
1100  NS_LOG_FUNCTION (this << standard);
1101  uint32_t cwmin = 0;
1102  uint32_t cwmax = 0;
1103  switch (standard)
1104  {
1106  case WIFI_STANDARD_80211ac:
1109  {
1110  SetQosSupported (true);
1111  cwmin = 15;
1112  cwmax = 1023;
1113  break;
1114  }
1117  {
1118  SetQosSupported (true);
1119  }
1120  case WIFI_STANDARD_80211g:
1121  SetErpSupported (true);
1122  case WIFI_STANDARD_80211a:
1123  case WIFI_STANDARD_80211p:
1124  cwmin = 15;
1125  cwmax = 1023;
1126  break;
1127  case WIFI_STANDARD_80211b:
1128  SetDsssSupported (true);
1129  cwmin = 31;
1130  cwmax = 1023;
1131  break;
1132  default:
1133  NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
1134  }
1135 
1137  ConfigureContentionWindow (cwmin, cwmax);
1138 }
1139 
1140 void
1141 RegularWifiMac::ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax)
1142 {
1143  bool isDsssOnly = m_dsssSupported && !m_erpSupported;
1144  //The special value of AC_BE_NQOS which exists in the Access
1145  //Category enumeration allows us to configure plain old DCF.
1146  ConfigureDcf (m_txop, cwMin, cwMax, isDsssOnly, AC_BE_NQOS);
1147 
1148  //Now we configure the EDCA functions
1149  for (EdcaQueues::const_iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1150  {
1151  ConfigureDcf (i->second, cwMin, cwMax, isDsssOnly, i->first);
1152  }
1153 }
1154 
1155 } //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 SetLinkUpCallback(Callback< void > linkUp) override
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.
Callback template class.
Definition: callback.h:1278
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:70
#define min(a, b)
Definition: 80211b.c:42
Ptr< WifiPhy > GetWifiPhy(void) const override
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:857
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:990
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities of the device.
void SetWifiRemoteStationManager(const Ptr< WifiRemoteStationManager > stationManager) override
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
bool SupportsSendFrom(void) const override
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 SetBlockAckInactivityTimeout(uint16_t timeout)
Set the BlockAck inactivity timeout.
Definition: qos-txop.cc:693
#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)
CategoryValue GetCategory()
Return the category value.
TypeOfStation GetTypeOfStation(void) const override
Return the type of station.
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:2053
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const override
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 SetForwardUpCallback(ForwardUpCallback upCallback) override
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac)
Definition: wifi-mac.cc:127
bool GetShortSlotTimeSupported(void) const override
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.
bool IsAction(void) const
Return true if the header is an Action header.
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:77
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
#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:126
void SetShortSlotTimeSupported(bool enable) override
Enable or disable short slot time feature.
void DoDispose() override
Destructor implementation.
Best Effort.
Definition: qos-utils.h:73
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.
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
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 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.
void SetAddress(Mac48Address address) override
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.
void SetSsid(Ssid ssid) override
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.
Total number of ACs.
Definition: qos-utils.h:81
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
void Enqueue(Ptr< Packet > packet, Mac48Address to, Mac48Address from) override
Background.
Definition: qos-utils.h:75
void ResetWifiPhy(void) override
Remove currently attached WifiPhy device from this MAC.
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
Mac48Address GetBssid(void) const override
void SetWifiPhy(const Ptr< WifiPhy > phy) override
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.
Ptr< QosTxop > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
void SetTypeOfStation(TypeOfStation type) override
This method is invoked by a subclass to specify what type of station it is implementing.
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:685
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
void SetRxMcsMap(uint8_t mcs, uint8_t nss)
Voice.
Definition: qos-utils.h:79
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.
void SetLinkDownCallback(Callback< void > linkDown) override
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.
void DoInitialize() override
Initialize() implementation.
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:933
bool GetHtSupported() const
Return whether the device supports HT.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetPromisc(void) override
Sets the interface in promiscuous mode.
Implement the header for management frames of type Add Block Ack response.
Definition: mgt-headers.h:1122
Implement the header for management frames of type Delete Block Ack.
Definition: mgt-headers.h:1243
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.
Ssid GetSsid(void) const override
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback
PSDU map response timeout traced callback.
void ConfigureStandard(WifiStandard standard) override
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
Mac48Address GetAddress(void) const override
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 SetDsssSupported(bool enable)
Enable or disable DSSS support for the device.
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.
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.
uint16_t GetNMcs(void) const
Definition: wifi-phy.cc:2039
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.