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 "regular-wifi-mac.h"
22 #include "ns3/log.h"
23 #include "ns3/boolean.h"
24 #include "ns3/pointer.h"
25 #include "ns3/uinteger.h"
26 #include "ns3/trace-source-accessor.h"
27 #include "mac-rx-middle.h"
28 #include "mac-tx-middle.h"
29 #include "mac-low.h"
30 #include "dcf.h"
31 #include "dcf-manager.h"
32 #include "wifi-phy.h"
35 
36 namespace ns3 {
37 
38 NS_LOG_COMPONENT_DEFINE ("RegularWifiMac");
39 
40 NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac);
41 
43  m_htSupported (0),
44  m_vhtSupported (0),
45  m_erpSupported (0),
46  m_dsssSupported (0)
47 {
48  NS_LOG_FUNCTION (this);
49  m_rxMiddle = new MacRxMiddle ();
51 
52  m_txMiddle = new MacTxMiddle ();
53 
54  m_low = CreateObject<MacLow> ();
56 
57  m_dcfManager = new DcfManager ();
59 
60  m_dca = CreateObject<DcaTxop> ();
61  m_dca->SetLow (m_low);
62  m_dca->SetManager (m_dcfManager);
63  m_dca->SetTxMiddle (m_txMiddle);
64  m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
65  m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
66 
67  //Construct the EDCAFs. The ordering is important - highest
68  //priority (Table 9-1 UP-to-AC mapping; IEEE 802.11-2012) must be created
69  //first.
74 }
75 
77 {
78  NS_LOG_FUNCTION (this);
79 }
80 
81 void
83 {
84  NS_LOG_FUNCTION (this);
85  m_dca->Initialize ();
86 
87  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
88  {
89  i->second->Initialize ();
90  }
91 }
92 
93 void
95 {
96  NS_LOG_FUNCTION (this);
97  delete m_rxMiddle;
98  m_rxMiddle = 0;
99 
100  delete m_txMiddle;
101  m_txMiddle = 0;
102 
103  delete m_dcfManager;
104  m_dcfManager = 0;
105 
106  m_low->Dispose ();
107  m_low = 0;
108 
109  m_phy = 0;
110  m_stationManager = 0;
111 
112  m_dca->Dispose ();
113  m_dca = 0;
114 
115  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
116  {
117  i->second = 0;
118  }
119 }
120 
121 void
123 {
124  NS_LOG_FUNCTION (this << stationManager);
125  m_stationManager = stationManager;
128  m_low->SetWifiRemoteStationManager (stationManager);
129 
130  m_dca->SetWifiRemoteStationManager (stationManager);
131 
132  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
133  {
134  i->second->SetWifiRemoteStationManager (stationManager);
135  }
136 }
137 
140 {
141  return m_stationManager;
142 }
143 
146 {
147  HtCapabilities capabilities;
148  capabilities.SetHtSupported (1);
149  if (m_htSupported)
150  {
151  capabilities.SetLdpc (m_phy->GetLdpc ());
152  capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40);
154  capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () == 40 && m_phy->GetGuardInterval ());
155  capabilities.SetGreenfield (m_phy->GetGreenfield ());
156  capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD)
157  capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
158  capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD)
159  uint64_t maxSupportedRate = 0; //in bit/s
160  for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
161  {
162  WifiMode mcs = m_phy->GetMcs (i);
164  {
165  continue;
166  }
167  capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
168  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
169  NS_ASSERT (nss > 0 && nss < 5);
170  if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss) > maxSupportedRate)
171  {
172  maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss);
173  NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
174  }
175  }
176  capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
177  capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
179  }
180  return capabilities;
181 }
182 
185 {
186  VhtCapabilities capabilities;
187  capabilities.SetVhtSupported (1);
188  if (m_vhtSupported)
189  {
190  if (m_phy->GetChannelWidth () == 160)
191  {
192  capabilities.SetSupportedChannelWidthSet (1);
193  }
194  else
195  {
196  capabilities.SetSupportedChannelWidthSet (0);
197  }
198  capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD)
199  capabilities.SetRxLdpc (m_phy->GetLdpc ());
202  capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
203  uint8_t maxMcs = 0;
204  for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
205  {
206  WifiMode mcs = m_phy->GetMcs (i);
207  if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT)
208  && (mcs.GetMcsValue () > maxMcs))
209  {
210  maxMcs = mcs.GetMcsValue ();
211  }
212  }
213  // Support same MaxMCS for each spatial stream
214  for (uint8_t nss = 1; nss <= m_phy->GetSupportedRxSpatialStreams (); nss++)
215  {
216  capabilities.SetRxMcsMap (maxMcs, nss);
217  }
218  for (uint8_t nss = 1; nss <= m_phy->GetSupportedTxSpatialStreams (); nss++)
219  {
220  capabilities.SetTxMcsMap (maxMcs, nss);
221  }
222  }
223  return capabilities;
224 }
225 
226 void
228 {
229  NS_LOG_FUNCTION (this << size);
230  m_voMaxAmsduSize = size;
232 }
233 
234 void
236 {
237  NS_LOG_FUNCTION (this << size);
238  m_viMaxAmsduSize = size;
240 }
241 
242 void
244 {
245  NS_LOG_FUNCTION (this << size);
246  m_beMaxAmsduSize = size;
248 }
249 
250 void
252 {
253  NS_LOG_FUNCTION (this << size);
254  m_bkMaxAmsduSize = size;
256 }
257 
258 void
260 {
261  NS_LOG_FUNCTION (this << size);
262  m_voMaxAmpduSize = size;
264 }
265 
266 void
268 {
269  NS_LOG_FUNCTION (this << size);
270  m_viMaxAmpduSize = size;
272 }
273 
274 void
276 {
277  NS_LOG_FUNCTION (this << size);
278  m_beMaxAmpduSize = size;
280 }
281 
282 void
284 {
285  NS_LOG_FUNCTION (this << size);
286  m_bkMaxAmpduSize = size;
288 }
289 
290 void
292 {
293  NS_LOG_FUNCTION (this << (uint16_t) threshold);
294  GetVOQueue ()->SetBlockAckThreshold (threshold);
295 }
296 
297 void
299 {
300  NS_LOG_FUNCTION (this << (uint16_t) threshold);
301  GetVIQueue ()->SetBlockAckThreshold (threshold);
302 }
303 
304 void
306 {
307  NS_LOG_FUNCTION (this << (uint16_t) threshold);
308  GetBEQueue ()->SetBlockAckThreshold (threshold);
309 }
310 
311 void
313 {
314  NS_LOG_FUNCTION (this << (uint16_t) threshold);
315  GetBKQueue ()->SetBlockAckThreshold (threshold);
316 }
317 
318 void
320 {
321  NS_LOG_FUNCTION (this << timeout);
323 }
324 
325 void
327 {
328  NS_LOG_FUNCTION (this << timeout);
330 }
331 
332 void
334 {
335  NS_LOG_FUNCTION (this << timeout);
337 }
338 
339 void
341 {
342  NS_LOG_FUNCTION (this << timeout);
344 }
345 
346 void
348 {
349  NS_LOG_FUNCTION (this << ac);
350 
351  //Our caller shouldn't be attempting to setup a queue that is
352  //already configured.
353  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
354 
355  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
356  edca->SetLow (m_low);
357  edca->SetManager (m_dcfManager);
358  edca->SetTxMiddle (m_txMiddle);
359  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
360  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
361  edca->SetAccessCategory (ac);
362  edca->CompleteConfig ();
363 
364  m_edca.insert (std::make_pair (ac, edca));
365 }
366 
367 void
369 {
370  NS_LOG_FUNCTION (this << type);
371  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
372  {
373  i->second->SetTypeOfStation (type);
374  }
375 }
376 
379 {
380  return m_dca;
381 }
382 
385 {
386  return m_edca.find (AC_VO)->second;
387 }
388 
391 {
392  return m_edca.find (AC_VI)->second;
393 }
394 
397 {
398  return m_edca.find (AC_BE)->second;
399 }
400 
403 {
404  return m_edca.find (AC_BK)->second;
405 }
406 
407 void
409 {
410  NS_LOG_FUNCTION (this << phy);
411  m_phy = phy;
413  m_low->SetPhy (phy);
414 }
415 
418 {
419  NS_LOG_FUNCTION (this);
420  return m_phy;
421 }
422 
423 void
425 {
426  NS_LOG_FUNCTION (this);
427  m_low->ResetPhy ();
429  m_phy = 0;
430 }
431 
432 void
434 {
435  NS_LOG_FUNCTION (this);
436  m_forwardUp = upCallback;
437 }
438 
439 void
441 {
442  NS_LOG_FUNCTION (this);
443  m_linkUp = linkUp;
444 }
445 
446 void
448 {
449  NS_LOG_FUNCTION (this);
450  m_linkDown = linkDown;
451 }
452 
453 void
455 {
456  NS_LOG_FUNCTION (this << enable);
457  m_qosSupported = enable;
458 }
459 
460 bool
462 {
463  return m_qosSupported;
464 }
465 
466 void
468 {
469  NS_LOG_FUNCTION (this << enable);
470  m_htSupported = enable;
471  if (enable)
472  {
473  SetQosSupported (true);
474  }
475  if (!enable && !m_vhtSupported)
476  {
478  }
479  else
480  {
482  }
483 }
484 
485 bool
487 {
488  return m_vhtSupported;
489 }
490 
491 void
493 {
494  NS_LOG_FUNCTION (this << enable);
495  m_vhtSupported = enable;
496  if (enable)
497  {
498  SetQosSupported (true);
499  }
500  if (!enable && !m_htSupported)
501  {
503  }
504  else
505  {
507  }
508 }
509 
510 bool
512 {
513  return m_htSupported;
514 }
515 
516 bool
518 {
519  return m_erpSupported;
520 }
521 
522 void
524 {
525  NS_LOG_FUNCTION (this);
526  if (enable)
527  {
528  SetDsssSupported (true);
529  }
530  m_erpSupported = enable;
531 }
532 
533 void
535 {
536  NS_LOG_FUNCTION (this);
537  m_dsssSupported = enable;
538 }
539 
540 bool
542 {
543  return m_dsssSupported;
544 }
545 
546 void
548 {
549  NS_LOG_FUNCTION (this);
550  m_low->SetCtsToSelfSupported (enable);
551 }
552 
553 bool
555 {
556  return m_low->GetCtsToSelfSupported ();
557 }
558 
559 void
561 {
562  NS_LOG_FUNCTION (this << slotTime);
563  m_dcfManager->SetSlot (slotTime);
564  m_low->SetSlotTime (slotTime);
565 }
566 
567 Time
569 {
570  return m_low->GetSlotTime ();
571 }
572 
573 void
575 {
576  NS_LOG_FUNCTION (this << sifs);
577  m_dcfManager->SetSifs (sifs);
578  m_low->SetSifs (sifs);
579 }
580 
581 Time
583 {
584  return m_low->GetSifs ();
585 }
586 
587 void
589 {
590  NS_LOG_FUNCTION (this << eifsNoDifs);
591  m_dcfManager->SetEifsNoDifs (eifsNoDifs);
592 }
593 
594 Time
596 {
597  return m_dcfManager->GetEifsNoDifs ();
598 }
599 
600 void
602 {
603  NS_LOG_FUNCTION (this << rifs);
604  m_low->SetRifs (rifs);
605 }
606 
607 Time
609 {
610  return m_low->GetRifs ();
611 }
612 
613 void
615 {
616  NS_LOG_FUNCTION (this << pifs);
617  m_low->SetPifs (pifs);
618 }
619 
620 Time
622 {
623  return m_low->GetPifs ();
624 }
625 
626 void
628 {
629  NS_LOG_FUNCTION (this << ackTimeout);
630  m_low->SetAckTimeout (ackTimeout);
631 }
632 
633 Time
635 {
636  return m_low->GetAckTimeout ();
637 }
638 
639 void
641 {
642  NS_LOG_FUNCTION (this << ctsTimeout);
643  m_low->SetCtsTimeout (ctsTimeout);
644 }
645 
646 Time
648 {
649  return m_low->GetCtsTimeout ();
650 }
651 
652 void
654 {
655  NS_LOG_FUNCTION (this << blockAckTimeout);
656  m_low->SetBasicBlockAckTimeout (blockAckTimeout);
657 }
658 
659 Time
661 {
662  return m_low->GetBasicBlockAckTimeout ();
663 }
664 
665 void
667 {
668  NS_LOG_FUNCTION (this << blockAckTimeout);
669  m_low->SetCompressedBlockAckTimeout (blockAckTimeout);
670 }
671 
672 Time
674 {
676 }
677 
678 void
680 {
681  NS_LOG_FUNCTION (this << address);
682  m_low->SetAddress (address);
683 }
684 
687 {
688  return m_low->GetAddress ();
689 }
690 
691 void
693 {
694  NS_LOG_FUNCTION (this << ssid);
695  m_ssid = ssid;
696 }
697 
698 Ssid
700 {
701  return m_ssid;
702 }
703 
704 void
706 {
707  NS_LOG_FUNCTION (this << bssid);
708  m_low->SetBssid (bssid);
709 }
710 
713 {
714  return m_low->GetBssid ();
715 }
716 
717 void
719 {
720  m_low->SetPromisc ();
721 }
722 
723 void
725 {
726  NS_LOG_FUNCTION (this << enable);
727  m_shortSlotTimeSupported = enable;
728 }
729 
730 bool
732 {
734 }
735 
736 void
738  Mac48Address to, Mac48Address from)
739 {
740  //We expect RegularWifiMac subclasses which do support forwarding (e.g.,
741  //AP) to override this method. Therefore, we throw a fatal error if
742  //someone tries to invoke this method on a class which has not done
743  //this.
744  NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
745  << ") does not support Enqueue() with from address");
746 }
747 
748 bool
750 {
751  return false;
752 }
753 
754 void
756 {
757  NS_LOG_FUNCTION (this << packet << from);
758  m_forwardUp (packet, from, to);
759 }
760 
761 void
763 {
764  NS_LOG_FUNCTION (this << packet << hdr);
765 
766  Mac48Address to = hdr->GetAddr1 ();
767  Mac48Address from = hdr->GetAddr2 ();
768 
769  //We don't know how to deal with any frame that is not addressed to
770  //us (and odds are there is nothing sensible we could do anyway),
771  //so we ignore such frames.
772  //
773  //The derived class may also do some such filtering, but it doesn't
774  //hurt to have it here too as a backstop.
775  if (to != GetAddress ())
776  {
777  return;
778  }
779 
780  if (hdr->IsMgt () && hdr->IsAction ())
781  {
782  //There is currently only any reason for Management Action
783  //frames to be flying about if we are a QoS STA.
785 
786  WifiActionHeader actionHdr;
787  packet->RemoveHeader (actionHdr);
788 
789  switch (actionHdr.GetCategory ())
790  {
792 
793  switch (actionHdr.GetAction ().blockAck)
794  {
796  {
797  MgtAddBaRequestHeader reqHdr;
798  packet->RemoveHeader (reqHdr);
799 
800  //We've received an ADDBA Request. Our policy here is
801  //to automatically accept it, so we get the ADDBA
802  //Response on it's way immediately.
803  SendAddBaResponse (&reqHdr, from);
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 MacLow and we need to
833  //destroy it.
834  m_low->DestroyBlockAckAgreement (from, delBaHdr.GetTid ());
835  }
836  else
837  {
838  //We must have been the originator. We need to
839  //tell the correct queue that the agreement has
840  //been torn down
841  AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
842  m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
843  }
844  //This frame is now completely dealt with, so we're done.
845  return;
846  }
847  default:
848  NS_FATAL_ERROR ("Unsupported Action field in Block Ack Action frame");
849  return;
850  }
851  default:
852  NS_FATAL_ERROR ("Unsupported Action frame received");
853  return;
854  }
855  }
856  NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
857 }
858 
859 void
861  const WifiMacHeader *hdr)
862 {
864  MsduAggregator::Deaggregate (aggregatedPacket);
865 
866  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
867  i != packets.end (); ++i)
868  {
869  ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
870  (*i).second.GetDestinationAddr ());
871  }
872 }
873 
874 void
876  Mac48Address originator)
877 {
878  NS_LOG_FUNCTION (this);
879  WifiMacHeader hdr;
880  hdr.SetAction ();
881  hdr.SetAddr1 (originator);
882  hdr.SetAddr2 (GetAddress ());
883  hdr.SetAddr3 (GetAddress ());
884  hdr.SetDsNotFrom ();
885  hdr.SetDsNotTo ();
886 
887  MgtAddBaResponseHeader respHdr;
888  StatusCode code;
889  code.SetSuccess ();
890  respHdr.SetStatusCode (code);
891  //Here a control about queues type?
892  respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ());
893 
894  if (reqHdr->IsImmediateBlockAck ())
895  {
896  respHdr.SetImmediateBlockAck ();
897  }
898  else
899  {
900  respHdr.SetDelayedBlockAck ();
901  }
902  respHdr.SetTid (reqHdr->GetTid ());
903  //For now there's not no control about limit of reception. We
904  //assume that receiver has no limit on reception. However we assume
905  //that a receiver sets a bufferSize in order to satisfy next
906  //equation: (bufferSize + 1) % 16 = 0 So if a recipient is able to
907  //buffer a packet, it should be also able to buffer all possible
908  //packet's fragments. See section 7.3.1.14 in IEEE802.11e for more details.
909  respHdr.SetBufferSize (1023);
910  respHdr.SetTimeout (reqHdr->GetTimeout ());
911 
912  WifiActionHeader actionHdr;
915  actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action);
916 
917  Ptr<Packet> packet = Create<Packet> ();
918  packet->AddHeader (respHdr);
919  packet->AddHeader (actionHdr);
920 
921  //We need to notify our MacLow object as it will have to buffer all
922  //correctly received packets for this Block Ack session
923  m_low->CreateBlockAckAgreement (&respHdr, originator,
924  reqHdr->GetStartingSequence ());
925 
926  //It is unclear which queue this frame should go into. For now we
927  //bung it into the queue corresponding to the TID for which we are
928  //establishing an agreement, and push it to the head.
929  m_edca[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr);
930 }
931 
932 TypeId
934 {
935  static TypeId tid = TypeId ("ns3::RegularWifiMac")
936  .SetParent<WifiMac> ()
937  .SetGroupName ("Wifi")
938  .AddAttribute ("QosSupported",
939  "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA.",
940  BooleanValue (false),
944  .AddAttribute ("HtSupported",
945  "This Boolean attribute is set to enable 802.11n support at this STA.",
946  BooleanValue (false),
950  .AddAttribute ("VhtSupported",
951  "This Boolean attribute is set to enable 802.11ac support at this STA.",
952  BooleanValue (false),
956  .AddAttribute ("CtsToSelfSupported",
957  "Use CTS to Self when using a rate that is not in the basic rate set.",
958  BooleanValue (false),
962  .AddAttribute ("VO_MaxAmsduSize",
963  "Maximum length in bytes of an A-MSDU for AC_VO access class.",
964  UintegerValue (0),
966  MakeUintegerChecker<uint32_t> ())
967  .AddAttribute ("VI_MaxAmsduSize",
968  "Maximum length in bytes of an A-MSDU for AC_VI access class.",
969  UintegerValue (0),
971  MakeUintegerChecker<uint32_t> ())
972  .AddAttribute ("BE_MaxAmsduSize",
973  "Maximum length in bytes of an A-MSDU for AC_BE access class.",
974  UintegerValue (0),
976  MakeUintegerChecker<uint32_t> ())
977  .AddAttribute ("BK_MaxAmsduSize",
978  "Maximum length in bytes of an A-MSDU for AC_BK access class.",
979  UintegerValue (0),
981  MakeUintegerChecker<uint32_t> ())
982  .AddAttribute ("VO_MaxAmpduSize",
983  "Maximum length in bytes of an A-MPDU for AC_VO access class.",
984  UintegerValue (0),
986  MakeUintegerChecker<uint32_t> ())
987  .AddAttribute ("VI_MaxAmpduSize",
988  "Maximum length in bytes of an A-MPDU for AC_VI access class.",
989  UintegerValue (65535),
991  MakeUintegerChecker<uint32_t> ())
992  .AddAttribute ("BE_MaxAmpduSize",
993  "Maximum length in bytes of an A-MPDU for AC_BE access class.",
994  UintegerValue (65535),
996  MakeUintegerChecker<uint32_t> ())
997  .AddAttribute ("BK_MaxAmpduSize",
998  "Maximum length in bytes of an A-MPDU for AC_BK access class.",
999  UintegerValue (0),
1001  MakeUintegerChecker<uint32_t> ())
1002  .AddAttribute ("VO_BlockAckThreshold",
1003  "If number of packets in VO queue reaches this value, "
1004  "block ack mechanism is used. If this value is 0, block ack is never used.",
1005  UintegerValue (0),
1007  MakeUintegerChecker<uint8_t> (0, 64))
1008  .AddAttribute ("VI_BlockAckThreshold",
1009  "If number of packets in VI queue reaches this value, "
1010  "block ack mechanism is used. If this value is 0, block ack is never used.",
1011  UintegerValue (0),
1013  MakeUintegerChecker<uint8_t> (0, 64))
1014  .AddAttribute ("BE_BlockAckThreshold",
1015  "If number of packets in BE queue reaches this value, "
1016  "block ack mechanism is used. If this value is 0, block ack is never used.",
1017  UintegerValue (0),
1019  MakeUintegerChecker<uint8_t> (0, 64))
1020  .AddAttribute ("BK_BlockAckThreshold",
1021  "If number of packets in BK queue reaches this value, "
1022  "block ack mechanism is used. If this value is 0, block ack is never used.",
1023  UintegerValue (0),
1025  MakeUintegerChecker<uint8_t> (0, 64))
1026  .AddAttribute ("VO_BlockAckInactivityTimeout",
1027  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1028  "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
1029  "block ack setup is completed and will be reset every time that a block ack"
1030  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1031  UintegerValue (0),
1033  MakeUintegerChecker<uint16_t> ())
1034  .AddAttribute ("VI_BlockAckInactivityTimeout",
1035  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1036  "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
1037  "block ack setup is completed and will be reset every time that a block ack"
1038  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1039  UintegerValue (0),
1041  MakeUintegerChecker<uint16_t> ())
1042  .AddAttribute ("BE_BlockAckInactivityTimeout",
1043  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1044  "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
1045  "block ack setup is completed and will be reset every time that a block ack"
1046  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1047  UintegerValue (0),
1049  MakeUintegerChecker<uint16_t> ())
1050  .AddAttribute ("BK_BlockAckInactivityTimeout",
1051  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1052  "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
1053  "block ack setup is completed and will be reset every time that a block ack"
1054  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1055  UintegerValue (0),
1057  MakeUintegerChecker<uint16_t> ())
1058  .AddAttribute ("ShortSlotTimeSupported",
1059  "Whether or not short slot time is supported (only used by ERP APs or STAs).",
1060  BooleanValue (true),
1063  MakeBooleanChecker ())
1064  .AddAttribute ("DcaTxop",
1065  "The DcaTxop object.",
1066  PointerValue (),
1068  MakePointerChecker<DcaTxop> ())
1069  .AddAttribute ("VO_EdcaTxopN",
1070  "Queue that manages packets belonging to AC_VO access class.",
1071  PointerValue (),
1073  MakePointerChecker<EdcaTxopN> ())
1074  .AddAttribute ("VI_EdcaTxopN",
1075  "Queue that manages packets belonging to AC_VI access class.",
1076  PointerValue (),
1078  MakePointerChecker<EdcaTxopN> ())
1079  .AddAttribute ("BE_EdcaTxopN",
1080  "Queue that manages packets belonging to AC_BE access class.",
1081  PointerValue (),
1083  MakePointerChecker<EdcaTxopN> ())
1084  .AddAttribute ("BK_EdcaTxopN",
1085  "Queue that manages packets belonging to AC_BK access class.",
1086  PointerValue (),
1088  MakePointerChecker<EdcaTxopN> ())
1089  .AddTraceSource ("TxOkHeader",
1090  "The header of successfully transmitted packet.",
1092  "ns3::WifiMacHeader::TracedCallback")
1093  .AddTraceSource ("TxErrHeader",
1094  "The header of unsuccessfully transmitted packet.",
1096  "ns3::WifiMacHeader::TracedCallback")
1097  ;
1098  return tid;
1099 }
1100 
1101 void
1103 {
1104  NS_LOG_FUNCTION (this << standard);
1105  uint32_t cwmin = 0;
1106  uint32_t cwmax = 0;
1107  switch (standard)
1108  {
1110  SetVhtSupported (true);
1112  SetHtSupported (true);
1113  cwmin = 15;
1114  cwmax = 1023;
1115  break;
1117  SetHtSupported (true);
1119  SetErpSupported (true);
1124  cwmin = 15;
1125  cwmax = 1023;
1126  break;
1128  SetDsssSupported (true);
1129  cwmin = 31;
1130  cwmax = 1023;
1131  break;
1132  default:
1133  NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
1134  }
1135 
1136  ConfigureContentionWindow (cwmin, cwmax);
1137 }
1138 
1139 void
1140 RegularWifiMac::ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax)
1141 {
1142  bool isDsssOnly = m_dsssSupported && !m_erpSupported;
1143  //The special value of AC_BE_NQOS which exists in the Access
1144  //Category enumeration allows us to configure plain old DCF.
1145  ConfigureDcf (m_dca, cwMin, cwMax, isDsssOnly, AC_BE_NQOS);
1146 
1147  //Now we configure the EDCA functions
1148  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1149  {
1150  ConfigureDcf (i->second, cwMin, cwMax, isDsssOnly, i->first);
1151  }
1152 }
1153 
1154 void
1156 {
1157  NS_LOG_FUNCTION (this << hdr);
1158  m_txOkCallback (hdr);
1159 }
1160 
1161 void
1163 {
1164  NS_LOG_FUNCTION (this << hdr);
1165  m_txErrCallback (hdr);
1166 }
1167 
1168 void
1170 {
1171  NS_LOG_FUNCTION (this);
1172  if (GetVOQueue ()->GetMsduAggregator () != 0)
1173  {
1175  }
1176  if (GetVIQueue ()->GetMsduAggregator () != 0)
1177  {
1179  }
1180  if (GetBEQueue ()->GetMsduAggregator () != 0)
1181  {
1183  }
1184  if (GetBKQueue ()->GetMsduAggregator () != 0)
1185  {
1187  }
1188  if (GetVOQueue ()->GetMpduAggregator () != 0)
1189  {
1191  }
1192  if (GetVIQueue ()->GetMpduAggregator () != 0)
1193  {
1195  }
1196  if (GetBEQueue ()->GetMpduAggregator () != 0)
1197  {
1199  }
1200  if (GetBKQueue ()->GetMpduAggregator () != 0)
1201  {
1203  }
1204 }
1205 
1206 void
1208 {
1209  NS_LOG_FUNCTION (this);
1210  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1211  {
1212  if (i->second->GetMsduAggregator () == 0)
1213  {
1214  Ptr<MsduStandardAggregator> msduAggregator = CreateObject<MsduStandardAggregator> ();
1215  i->second->SetMsduAggregator (msduAggregator);
1216  }
1217  if (i->second->GetMpduAggregator () == 0)
1218  {
1219  Ptr<MpduStandardAggregator> mpduAggregator = CreateObject<MpduStandardAggregator> ();
1220  i->second->SetMpduAggregator (mpduAggregator);
1221  }
1222  }
1224 }
1225 
1226 void
1228 {
1229  NS_LOG_FUNCTION (this);
1230  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1231  {
1232  i->second->SetMsduAggregator (0);
1233  i->second->SetMpduAggregator (0);
1234  }
1235 }
1236 
1237 } //namespace ns3
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
ERP-OFDM PHY (Clause 19, Section 19.5)
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:268
void Dispose(void)
Dispose of this Object.
Definition: object.cc:214
void SetAction()
Set Type/Subtype values for an action header.
Time GetPifs(void) const
Return PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:675
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:603
void SetTxMcsSetDefined(uint8_t txmcssetdefined)
void SetShortGuardIntervalFor80Mhz(uint8_t shortguardinterval)
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
void SetSifs(Time sifs)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
AttributeValue implementation for Boolean.
Definition: boolean.h:34
void SetGreenfield(uint8_t greenfield)
HT OFDM PHY for the 5 GHz band (clause 20)
virtual bool GetGuardInterval(void) const
Return whether guard interval is being used.
Definition: wifi-phy.cc:579
bool GetDsssSupported() const
Return whether the device supports DSSS.
bool GetVhtSupported() const
Return whether the device supports VHT.
void SetBlockAckInactivityTimeout(uint16_t timeout)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
void SetPromisc(void)
Enable promiscuous mode.
Definition: mac-low.cc:621
void SetTxMcsMap(uint16_t map)
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
void SetHtSupported(uint8_t htsupported)
virtual bool GetGreenfield(void) const
Return whether Greenfield is supported.
Definition: wifi-phy.cc:566
void SetForwardCallback(ForwardUpCallback callback)
Set a callback to forward the packet up.
bool GetCtsToSelfSupported() const
Return whether the device supports CTS-to-self capability.
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:548
static TypeId GetTypeId(void)
void SetRxMcsBitmask(uint8_t index)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:81
void SetMaxMpduLength(uint8_t length)
bool IsAction() const
Return true if the header is an Action header.
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
void SetErpSupported(bool enable)
Enable or disable ERP support for the device.
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:681
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:591
Implement the header for management frames of type add block ack request.
Definition: mgt-headers.h:667
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:379
void SetPifs(Time pifs)
virtual void SetCompressedBlockAckTimeout(Time blockAckTimeout)
void SetupLowListener(Ptr< MacLow > low)
Set up listener for MacLow events.
Definition: dcf-manager.cc:384
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
Callback< void > m_linkUp
Callback when a link is up.
void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
MacTxMiddle * m_txMiddle
TX middle (aggregation etc.)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
enum WifiMacType GetType(void) const
Return the type (enum WifiMacType)
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
virtual void SetSsid(Ssid ssid)
void SetSlot(Time slotTime)
virtual Time GetCompressedBlockAckTimeout(void) const
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
void SetAction(enum CategoryValue type, ActionValue action)
Set action for this Action header.
Definition: mgt-headers.cc:762
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
bool GetQosSupported() const
Return whether the device supports QoS.
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader * > callback)
Definition: mac-low.cc:693
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack...
Time GetCompressedBlockAckTimeout() const
Return Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:645
virtual uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
Definition: wifi-phy.cc:2862
virtual void SetLinkDownCallback(Callback< void > linkDown)
void SetHtSupported(bool enable)
Enable or disable HT support for the device.
CategoryValue GetCategory()
Return the category value.
Definition: mgt-headers.cc:796
HT OFDM PHY for the 2.4 GHz band (clause 20)
VHT PHY (Clause 22)
Definition: wifi-mode.h:64
void SetVhtSupported(uint8_t vhtsupported)
Ptr< WifiPhy > m_phy
Wifi PHY.
void SetRxLdpc(uint8_t rxldpc)
void SetDelayedBlockAck()
Enable delayed Block ACK.
ns3::Time timeout
void SetRifs(Time rifs)
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
Definition: mac-low.cc:651
void SetStatusCode(StatusCode code)
Set the status code.
virtual Ssid GetSsid(void) const
Video.
Definition: qos-utils.h:43
Voice.
Definition: qos-utils.h:45
Best Effort.
Definition: qos-utils.h:39
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capability of the device.
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to, Mac48Address from)
void SetTimeout(uint16_t timeout)
Set timeout.
MacRxMiddle * m_rxMiddle
RX middle (de-fragmentation etc.)
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
void SetShortGuardIntervalFor160Mhz(uint8_t shortguardinterval)
void SetViMaxAmpduSize(uint32_t size)
This class handles duplicate detection and recomposition of fragments.
Definition: mac-rx-middle.h:40
void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
TracedCallback< const WifiMacHeader & > m_txErrCallback
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self capability.
Definition: mac-low.cc:573
Handles sequence numbering of IEEE 802.11 data frames.
Definition: mac-tx-middle.h:39
void SetBasicBlockAckTimeout(Time blockAckTimeout)
Set Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:561
void SetBkMaxAmsduSize(uint32_t size)
void SetVoMaxAmpduSize(uint32_t size)
void SetVoBlockAckThreshold(uint8_t threshold)
virtual bool GetLdpc(void) const
Return if LDPC is supported.
Definition: wifi-phy.cc:540
void SetTid(uint8_t tid)
Set Traffic ID (TID).
void SetBeMaxAmpduSize(uint32_t size)
virtual void SetBssid(Mac48Address bssid)
Ptr< EdcaTxopN > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
void SetLSigProtectionSupport(uint8_t lsigprotection)
Time GetSifs(void) const
void SetLow(Ptr< MacLow > low)
Set MacLow associated with this EdcaTxopN.
Definition: edca-txop-n.cc:461
Background.
Definition: qos-utils.h:41
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
virtual void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2526
Time GetCtsTimeout(void) const
virtual void SetForwardUpCallback(ForwardUpCallback upCallback)
void SetBeMaxAmsduSize(uint32_t size)
void SetSuccess(void)
Set success bit to 0 (success).
Definition: status-code.cc:32
void SetEifsNoDifs(Time eifsNoDifs)
void SetBkBlockAckThreshold(uint8_t threshold)
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service...
tuple phy
Definition: third.py:86
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:220
virtual void SetBasicBlockAckTimeout(Time blockAckTimeout)
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
virtual void SetWifiPhy(Ptr< WifiPhy > phy)
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
void CreateBlockAckAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address originator, uint16_t startingSeq)
Definition: mac-low.cc:2484
void SetShortGuardInterval20(uint8_t shortguardinterval)
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Ptr< DcaTxop > m_dca
This holds a pointer to the DCF instance for this WifiMac - used for transmission of frames to non-Qo...
Ptr< EdcaTxopN > GetBEQueue(void) const
Accessor for the AC_BE channel access function.
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
void SetVoMaxAmsduSize(uint32_t size)
The IEEE 802.11ac VHT Capabilities.
Ssid m_ssid
Service Set ID (SSID)
Ptr< DcaTxop > GetDcaTxop(void) const
Accessor for the DCF object.
base class for all MAC-level wifi objects.
Definition: wifi-mac.h:44
void SetImmediateBlockAck()
Enable immediate Block ACK.
Hold an unsigned integer type.
Definition: uinteger.h:44
void RemovePhyListener(Ptr< WifiPhy > phy)
Remove current registered listener for Phy events.
Definition: dcf-manager.cc:372
virtual void SetMaxAmpduSize(uint32_t maxSize)=0
Time GetAckTimeout(void) const
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ACK mechanism.
void SetupPhyListener(Ptr< WifiPhy > phy)
Set up listener for Phy events.
Definition: dcf-manager.cc:360
void ConfigureDcf(Ptr< Dcf > dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, enum AcIndex ac)
Definition: wifi-mac.cc:411
void SetViMaxAmsduSize(uint32_t size)
void SetMaxAmsduLength(uint8_t maxamsdulength)
Time GetSlot(void) const
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
Definition: mac-low.cc:555
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
Definition: dcf-manager.h:279
enum BlockAckActionValue blockAck
Definition: mgt-headers.h:620
bool m_vhtSupported
This Boolean is set true iff this WifiMac is to model 802.11ac.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:28
virtual void SetAddress(Mac48Address address)
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:663
HT PHY (Clause 20)
Definition: wifi-mode.h:62
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:357
void SetMaxAmpduLength(uint8_t maxampdulength)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:627
virtual void ResetWifiPhy(void)
removes attached WifiPhy device from this MAC.
bool IsMgt(void) const
Return true if the Type is Management.
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Time GetPifs(void) const
bool GetErpSupported() const
Return whether the device supports ERP.
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
void SetBeBlockAckThreshold(uint8_t threshold)
HtCapabilities GetHtCapabilities(void) const
Return the HT capability of the device.
virtual void SendAddBaResponse(const MgtAddBaRequestHeader *reqHdr, Mac48Address originator)
This method can be called to accept a received ADDBA Request.
void SetSupportedChannelWidthSet(uint8_t channelwidthset)
Callback< void > m_linkDown
Callback when a link is down.
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
TracedCallback< const WifiMacHeader & > m_txOkCallback
virtual void SetHtSupported(bool enable)
Enable or disable HT capability support.
void SetRxHighestSupportedDataRate(uint16_t maxsupportedrate)
Status code for association response.
Definition: status-code.h:33
virtual WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
Definition: wifi-phy.cc:2868
virtual uint32_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1157
bool IsAmsduSupported(void) const
Return whether A-MSDU capability is supported.
Ptr< EdcaTxopN > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void DoDispose()
Destructor implementation.
Ptr< MpduAggregator > GetMpduAggregator(void) const
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< MsduAggregator > GetMsduAggregator(void) const
Hold objects of type Ptr.
Definition: pointer.h:36
VHT OFDM PHY (clause 22)
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:615
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
void SetVhtSupported(bool enable)
Enable or disable VHT support for the device.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
void SetBufferSize(uint16_t size)
Set buffer size.
DcfManager * m_dcfManager
DCF manager (access to channel)
uint8_t GetTid(void) const
Return the Traffic ID (TID).
virtual Ptr< WifiPhy > GetWifiPhy(void) const
an EUI-48 address
Definition: mac48-address.h:43
bool IsByOriginator(void) const
Check if the initiator bit in the DELBA is setted.
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
Definition: wifi-mode.cc:109
tuple ssid
Definition: third.py:93
void SetEifsNoDifs(Time eifsNoDifs)
Definition: dcf-manager.cc:410
virtual void SetMaxAmsduSize(uint32_t maxSize)=0
void SetCtsTimeout(Time ctsTimeout)
virtual bool SupportsSendFrom(void) const
void SetPhy(Ptr< WifiPhy > phy)
Set up WifiPhy associated with this MacLow.
Definition: mac-low.cc:519
uint8_t GetTid(void) const
Return the Traffic ID (TID).
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:38
Time GetRifs(void) const
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:669
bool m_htSupported
This Boolean is set true iff this WifiMac is to model 802.11n.
bool IsImmediateBlockAck(void) const
Return whether the Block ACK policy is immediate Block ACK.
virtual Mac48Address GetBssid(void) const
void SetSlot(Time slotTime)
Definition: dcf-manager.cc:396
void SetRxMcsMap(uint16_t map)
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:609
Ptr< EdcaTxopN > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
void SetViBlockAckThreshold(uint8_t threshold)
virtual Time GetBasicBlockAckTimeout(void) const
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:597
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:657
virtual uint8_t GetSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1194
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:799
Implement the header for management frames of type del block ack.
Definition: mgt-headers.h:920
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
virtual Mac48Address GetAddress(void) const
virtual bool GetShortSlotTimeSupported(void) const =0
typedef for union of different ActionValues
Definition: mgt-headers.h:615
Total number of ACs.
Definition: qos-utils.h:47
bool GetCtsToSelfSupported() const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:579
Time GetEifsNoDifs() const
Definition: dcf-manager.cc:417
virtual void DoInitialize()
Initialize() implementation.
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Definition: mac-low.cc:585
void SetLdpc(uint8_t ldpc)
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
Definition: mac-low.cc:633
bool GetHtSupported() const
Return whether the device supports HT.
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
virtual uint8_t GetSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1188
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:549
virtual bool GetShortSlotTimeSupported(void) const
void SetTxMaxNSpatialStreams(uint8_t maxtxspatialstreams)
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
virtual void TxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
tuple address
Definition: first.py:37
bool m_erpSupported
This Boolean is set true iff this WifiMac is to model 802.11g.
TypeOfStation
Enumeration for type of station.
Definition: edca-txop-n.h:61
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
virtual void SetShortSlotTimeSupported(bool enable)=0
virtual void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time 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.)
ActionValue GetAction()
Return the action value.
Definition: mgt-headers.cc:817
virtual void SetPromisc(void)
Sets the interface in promiscuous mode.
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:534
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 SetShortGuardInterval40(uint8_t shortguardinterval)
Time GetBasicBlockAckTimeout() const
Return Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:639
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
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.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
void SetAckTimeout(Time ackTimeout)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:36
void SetSifs(Time sifs)
Definition: dcf-manager.cc:403
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:257
Implements the IEEE 802.11 MAC header.
void SetSupportedChannelWidth(uint8_t supportedchannelwidth)
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
void SetCompressedBlockAckTimeout(Time blockAckTimeout)
Set Compressed Block ACK timeout of this MacLow.
Definition: mac-low.cc:567
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:543
void SetBkMaxAmpduSize(uint32_t size)
uint16_t GetTimeout(void) const
Return the timeout.
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
virtual void FinishConfigureStandard(enum WifiPhyStandard standard)
virtual void TxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
Time GetEifsNoDifs(void) const
void SetMaxAmpduLengthExponent(uint8_t exponent)
void SetupEdcaQueue(enum AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...