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 {
47  NS_LOG_FUNCTION (this);
48  m_rxMiddle = new MacRxMiddle ();
50 
51  m_txMiddle = new MacTxMiddle ();
52 
53  m_low = CreateObject<MacLow> ();
55 
56  m_dcfManager = new DcfManager ();
58 
59  m_dca = CreateObject<DcaTxop> ();
60  m_dca->SetLow (m_low);
61  m_dca->SetManager (m_dcfManager);
62  m_dca->SetTxMiddle (m_txMiddle);
63  m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
64  m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
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_dca->Initialize ();
85 
86  for (EdcaQueues::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  delete m_rxMiddle;
97  m_rxMiddle = 0;
98 
99  delete m_txMiddle;
100  m_txMiddle = 0;
101 
102  delete m_dcfManager;
103  m_dcfManager = 0;
104 
105  m_low->Dispose ();
106  m_low = 0;
107 
108  m_phy = 0;
109  m_stationManager = 0;
110 
111  m_dca->Dispose ();
112  m_dca = 0;
113 
114  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
115  {
116  i->second = 0;
117  }
118 }
119 
120 void
122 {
123  NS_LOG_FUNCTION (this << stationManager);
124  m_stationManager = stationManager;
127  m_low->SetWifiRemoteStationManager (stationManager);
128 
129  m_dca->SetWifiRemoteStationManager (stationManager);
130 
131  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
132  {
133  i->second->SetWifiRemoteStationManager (stationManager);
134  }
135 }
136 
139 {
140  return m_stationManager;
141 }
142 
145 {
146  HtCapabilities capabilities;
147  capabilities.SetHtSupported (1);
148  if (m_htSupported)
149  {
150  capabilities.SetLdpc (m_phy->GetLdpc ());
151  capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40);
153  capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () == 40 && m_phy->GetGuardInterval ());
154  capabilities.SetGreenfield (m_phy->GetGreenfield ());
155  capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD)
156  capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
157  capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD)
158  uint64_t maxSupportedRate = 0; //in bit/s
159  for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
160  {
161  WifiMode mcs = m_phy->GetMcs (i);
163  {
164  continue;
165  }
166  capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
167  uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
168  NS_ASSERT (nss > 0 && nss < 5);
169  if (mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss) > maxSupportedRate)
170  {
171  maxSupportedRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetGuardInterval (), nss);
172  NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
173  }
174  }
175  capabilities.SetRxHighestSupportedDataRate (maxSupportedRate / 1e6); //in Mbit/s
176  capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
178  }
179  return capabilities;
180 }
181 
184 {
185  VhtCapabilities capabilities;
186  capabilities.SetVhtSupported (1);
187  if (m_vhtSupported)
188  {
189  if (m_phy->GetChannelWidth () == 160)
190  {
191  capabilities.SetSupportedChannelWidthSet (1);
192  }
193  else
194  {
195  capabilities.SetSupportedChannelWidthSet (0);
196  }
197  capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD)
198  capabilities.SetRxLdpc (m_phy->GetLdpc ());
201  capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
202  uint8_t maxMcs = 0;
203  for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
204  {
205  WifiMode mcs = m_phy->GetMcs (i);
206  if ((mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT)
207  && (mcs.GetMcsValue () > maxMcs))
208  {
209  maxMcs = mcs.GetMcsValue ();
210  }
211  }
212  // Support same MaxMCS for each spatial stream
213  for (uint8_t nss = 1; nss <= m_phy->GetSupportedRxSpatialStreams (); nss++)
214  {
215  capabilities.SetRxMcsMap (maxMcs, nss);
216  }
217  for (uint8_t nss = 1; nss <= m_phy->GetSupportedTxSpatialStreams (); nss++)
218  {
219  capabilities.SetTxMcsMap (maxMcs, nss);
220  }
221  }
222  return capabilities;
223 }
224 
225 void
227 {
228  NS_LOG_FUNCTION (this << size);
229  m_voMaxAmsduSize = size;
231 }
232 
233 void
235 {
236  NS_LOG_FUNCTION (this << size);
237  m_viMaxAmsduSize = size;
239 }
240 
241 void
243 {
244  NS_LOG_FUNCTION (this << size);
245  m_beMaxAmsduSize = size;
247 }
248 
249 void
251 {
252  NS_LOG_FUNCTION (this << size);
253  m_bkMaxAmsduSize = size;
255 }
256 
257 void
259 {
260  NS_LOG_FUNCTION (this << size);
261  m_voMaxAmpduSize = size;
263 }
264 
265 void
267 {
268  NS_LOG_FUNCTION (this << size);
269  m_viMaxAmpduSize = size;
271 }
272 
273 void
275 {
276  NS_LOG_FUNCTION (this << size);
277  m_beMaxAmpduSize = size;
279 }
280 
281 void
283 {
284  NS_LOG_FUNCTION (this << size);
285  m_bkMaxAmpduSize = size;
287 }
288 
289 void
291 {
292  NS_LOG_FUNCTION (this << threshold);
293  GetVOQueue ()->SetBlockAckThreshold (threshold);
294 }
295 
296 void
298 {
299  NS_LOG_FUNCTION (this << threshold);
300  GetVIQueue ()->SetBlockAckThreshold (threshold);
301 }
302 
303 void
305 {
306  NS_LOG_FUNCTION (this << threshold);
307  GetBEQueue ()->SetBlockAckThreshold (threshold);
308 }
309 
310 void
312 {
313  NS_LOG_FUNCTION (this << threshold);
314  GetBKQueue ()->SetBlockAckThreshold (threshold);
315 }
316 
317 void
319 {
320  NS_LOG_FUNCTION (this << timeout);
322 }
323 
324 void
326 {
327  NS_LOG_FUNCTION (this << timeout);
329 }
330 
331 void
333 {
334  NS_LOG_FUNCTION (this << timeout);
336 }
337 
338 void
340 {
341  NS_LOG_FUNCTION (this << timeout);
343 }
344 
345 void
347 {
348  NS_LOG_FUNCTION (this << ac);
349 
350  //Our caller shouldn't be attempting to setup a queue that is
351  //already configured.
352  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
353 
354  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
355  edca->SetLow (m_low);
356  edca->SetManager (m_dcfManager);
357  edca->SetTxMiddle (m_txMiddle);
358  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
359  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
360  edca->SetAccessCategory (ac);
361  edca->CompleteConfig ();
362 
363  m_edca.insert (std::make_pair (ac, edca));
364 }
365 
366 void
368 {
369  NS_LOG_FUNCTION (this << type);
370  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
371  {
372  i->second->SetTypeOfStation (type);
373  }
374 }
375 
378 {
379  return m_dca;
380 }
381 
384 {
385  return m_edca.find (AC_VO)->second;
386 }
387 
390 {
391  return m_edca.find (AC_VI)->second;
392 }
393 
396 {
397  return m_edca.find (AC_BE)->second;
398 }
399 
402 {
403  return m_edca.find (AC_BK)->second;
404 }
405 
406 void
408 {
409  NS_LOG_FUNCTION (this << phy);
410  m_phy = phy;
412  m_low->SetPhy (phy);
413 }
414 
417 {
418  NS_LOG_FUNCTION (this);
419  return m_phy;
420 }
421 
422 void
424 {
425  NS_LOG_FUNCTION (this);
426  m_low->ResetPhy ();
428  m_phy = 0;
429 }
430 
431 void
433 {
434  NS_LOG_FUNCTION (this);
435  m_forwardUp = upCallback;
436 }
437 
438 void
440 {
441  NS_LOG_FUNCTION (this);
442  m_linkUp = linkUp;
443 }
444 
445 void
447 {
448  NS_LOG_FUNCTION (this);
449  m_linkDown = linkDown;
450 }
451 
452 void
454 {
455  NS_LOG_FUNCTION (this << enable);
456  m_qosSupported = enable;
457 }
458 
459 bool
461 {
462  return m_qosSupported;
463 }
464 
465 void
467 {
468  NS_LOG_FUNCTION (this << enable);
469  m_htSupported = enable;
470  if (enable)
471  {
472  SetQosSupported (true);
473  }
474  if (!enable && !m_vhtSupported)
475  {
477  }
478  else
479  {
481  }
482 }
483 
484 bool
486 {
487  return m_vhtSupported;
488 }
489 
490 void
492 {
493  NS_LOG_FUNCTION (this << enable);
494  m_vhtSupported = enable;
495  if (enable)
496  {
497  SetQosSupported (true);
498  }
499  if (!enable && !m_htSupported)
500  {
502  }
503  else
504  {
506  }
507 }
508 
509 bool
511 {
512  return m_htSupported;
513 }
514 
515 bool
517 {
518  return m_erpSupported;
519 }
520 
521 void
523 {
524  NS_LOG_FUNCTION (this);
525  m_erpSupported = enable;
526 }
527 
528 void
530 {
531  NS_LOG_FUNCTION (this);
532  m_low->SetCtsToSelfSupported (enable);
533 }
534 
535 bool
537 {
538  return m_low->GetCtsToSelfSupported ();
539 }
540 
541 void
543 {
544  NS_LOG_FUNCTION (this << slotTime);
545  m_dcfManager->SetSlot (slotTime);
546  m_low->SetSlotTime (slotTime);
547 }
548 
549 Time
551 {
552  return m_low->GetSlotTime ();
553 }
554 
555 void
557 {
558  NS_LOG_FUNCTION (this << sifs);
559  m_dcfManager->SetSifs (sifs);
560  m_low->SetSifs (sifs);
561 }
562 
563 Time
565 {
566  return m_low->GetSifs ();
567 }
568 
569 void
571 {
572  NS_LOG_FUNCTION (this << eifsNoDifs);
573  m_dcfManager->SetEifsNoDifs (eifsNoDifs);
574 }
575 
576 Time
578 {
579  return m_dcfManager->GetEifsNoDifs ();
580 }
581 
582 void
584 {
585  NS_LOG_FUNCTION (this << rifs);
586  m_low->SetRifs (rifs);
587 }
588 
589 Time
591 {
592  return m_low->GetRifs ();
593 }
594 
595 void
597 {
598  NS_LOG_FUNCTION (this << pifs);
599  m_low->SetPifs (pifs);
600 }
601 
602 Time
604 {
605  return m_low->GetPifs ();
606 }
607 
608 void
610 {
611  NS_LOG_FUNCTION (this << ackTimeout);
612  m_low->SetAckTimeout (ackTimeout);
613 }
614 
615 Time
617 {
618  return m_low->GetAckTimeout ();
619 }
620 
621 void
623 {
624  NS_LOG_FUNCTION (this << ctsTimeout);
625  m_low->SetCtsTimeout (ctsTimeout);
626 }
627 
628 Time
630 {
631  return m_low->GetCtsTimeout ();
632 }
633 
634 void
636 {
637  NS_LOG_FUNCTION (this << blockAckTimeout);
638  m_low->SetBasicBlockAckTimeout (blockAckTimeout);
639 }
640 
641 Time
643 {
644  return m_low->GetBasicBlockAckTimeout ();
645 }
646 
647 void
649 {
650  NS_LOG_FUNCTION (this << blockAckTimeout);
651  m_low->SetCompressedBlockAckTimeout (blockAckTimeout);
652 }
653 
654 Time
656 {
658 }
659 
660 void
662 {
663  NS_LOG_FUNCTION (this << address);
664  m_low->SetAddress (address);
665 }
666 
669 {
670  return m_low->GetAddress ();
671 }
672 
673 void
675 {
676  NS_LOG_FUNCTION (this << ssid);
677  m_ssid = ssid;
678 }
679 
680 Ssid
682 {
683  return m_ssid;
684 }
685 
686 void
688 {
689  NS_LOG_FUNCTION (this << bssid);
690  m_low->SetBssid (bssid);
691 }
692 
695 {
696  return m_low->GetBssid ();
697 }
698 
699 void
701 {
702  m_low->SetPromisc ();
703 }
704 
705 void
707 {
708  NS_LOG_FUNCTION (this << enable);
709  m_shortSlotTimeSupported = enable;
710 }
711 
712 bool
714 {
716 }
717 
718 void
720  Mac48Address to, Mac48Address from)
721 {
722  //We expect RegularWifiMac subclasses which do support forwarding (e.g.,
723  //AP) to override this method. Therefore, we throw a fatal error if
724  //someone tries to invoke this method on a class which has not done
725  //this.
726  NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
727  << ") does not support Enqueue() with from address");
728 }
729 
730 bool
732 {
733  return false;
734 }
735 
736 void
738 {
739  NS_LOG_FUNCTION (this << packet << from);
740  m_forwardUp (packet, from, to);
741 }
742 
743 void
745 {
746  NS_LOG_FUNCTION (this << packet << hdr);
747 
748  Mac48Address to = hdr->GetAddr1 ();
749  Mac48Address from = hdr->GetAddr2 ();
750 
751  //We don't know how to deal with any frame that is not addressed to
752  //us (and odds are there is nothing sensible we could do anyway),
753  //so we ignore such frames.
754  //
755  //The derived class may also do some such filtering, but it doesn't
756  //hurt to have it here too as a backstop.
757  if (to != GetAddress ())
758  {
759  return;
760  }
761 
762  if (hdr->IsMgt () && hdr->IsAction ())
763  {
764  //There is currently only any reason for Management Action
765  //frames to be flying about if we are a QoS STA.
767 
768  WifiActionHeader actionHdr;
769  packet->RemoveHeader (actionHdr);
770 
771  switch (actionHdr.GetCategory ())
772  {
774 
775  switch (actionHdr.GetAction ().blockAck)
776  {
778  {
779  MgtAddBaRequestHeader reqHdr;
780  packet->RemoveHeader (reqHdr);
781 
782  //We've received an ADDBA Request. Our policy here is
783  //to automatically accept it, so we get the ADDBA
784  //Response on it's way immediately.
785  SendAddBaResponse (&reqHdr, from);
786  //This frame is now completely dealt with, so we're done.
787  return;
788  }
790  {
791  MgtAddBaResponseHeader respHdr;
792  packet->RemoveHeader (respHdr);
793 
794  //We've received an ADDBA Response. We assume that it
795  //indicates success after an ADDBA Request we have
796  //sent (we could, in principle, check this, but it
797  //seems a waste given the level of the current model)
798  //and act by locally establishing the agreement on
799  //the appropriate queue.
800  AcIndex ac = QosUtilsMapTidToAc (respHdr.GetTid ());
801  m_edca[ac]->GotAddBaResponse (&respHdr, from);
802  //This frame is now completely dealt with, so we're done.
803  return;
804  }
806  {
807  MgtDelBaHeader delBaHdr;
808  packet->RemoveHeader (delBaHdr);
809 
810  if (delBaHdr.IsByOriginator ())
811  {
812  //This DELBA frame was sent by the originator, so
813  //this means that an ingoing established
814  //agreement exists in MacLow and we need to
815  //destroy it.
816  m_low->DestroyBlockAckAgreement (from, delBaHdr.GetTid ());
817  }
818  else
819  {
820  //We must have been the originator. We need to
821  //tell the correct queue that the agreement has
822  //been torn down
823  AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
824  m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
825  }
826  //This frame is now completely dealt with, so we're done.
827  return;
828  }
829  default:
830  NS_FATAL_ERROR ("Unsupported Action field in Block Ack Action frame");
831  return;
832  }
833  default:
834  NS_FATAL_ERROR ("Unsupported Action frame received");
835  return;
836  }
837  }
838  NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
839 }
840 
841 void
843  const WifiMacHeader *hdr)
844 {
846  MsduAggregator::Deaggregate (aggregatedPacket);
847 
848  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
849  i != packets.end (); ++i)
850  {
851  ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
852  (*i).second.GetDestinationAddr ());
853  }
854 }
855 
856 void
858  Mac48Address originator)
859 {
860  NS_LOG_FUNCTION (this);
861  WifiMacHeader hdr;
862  hdr.SetAction ();
863  hdr.SetAddr1 (originator);
864  hdr.SetAddr2 (GetAddress ());
865  hdr.SetAddr3 (GetAddress ());
866  hdr.SetDsNotFrom ();
867  hdr.SetDsNotTo ();
868 
869  MgtAddBaResponseHeader respHdr;
870  StatusCode code;
871  code.SetSuccess ();
872  respHdr.SetStatusCode (code);
873  //Here a control about queues type?
874  respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ());
875 
876  if (reqHdr->IsImmediateBlockAck ())
877  {
878  respHdr.SetImmediateBlockAck ();
879  }
880  else
881  {
882  respHdr.SetDelayedBlockAck ();
883  }
884  respHdr.SetTid (reqHdr->GetTid ());
885  //For now there's not no control about limit of reception. We
886  //assume that receiver has no limit on reception. However we assume
887  //that a receiver sets a bufferSize in order to satisfy next
888  //equation: (bufferSize + 1) % 16 = 0 So if a recipient is able to
889  //buffer a packet, it should be also able to buffer all possible
890  //packet's fragments. See section 7.3.1.14 in IEEE802.11e for more details.
891  respHdr.SetBufferSize (1023);
892  respHdr.SetTimeout (reqHdr->GetTimeout ());
893 
894  WifiActionHeader actionHdr;
897  actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action);
898 
899  Ptr<Packet> packet = Create<Packet> ();
900  packet->AddHeader (respHdr);
901  packet->AddHeader (actionHdr);
902 
903  //We need to notify our MacLow object as it will have to buffer all
904  //correctly received packets for this Block Ack session
905  m_low->CreateBlockAckAgreement (&respHdr, originator,
906  reqHdr->GetStartingSequence ());
907 
908  //It is unclear which queue this frame should go into. For now we
909  //bung it into the queue corresponding to the TID for which we are
910  //establishing an agreement, and push it to the head.
911  m_edca[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr);
912 }
913 
914 TypeId
916 {
917  static TypeId tid = TypeId ("ns3::RegularWifiMac")
918  .SetParent<WifiMac> ()
919  .SetGroupName ("Wifi")
920  .AddAttribute ("QosSupported",
921  "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA.",
922  BooleanValue (false),
926  .AddAttribute ("HtSupported",
927  "This Boolean attribute is set to enable 802.11n support at this STA.",
928  BooleanValue (false),
932  .AddAttribute ("VhtSupported",
933  "This Boolean attribute is set to enable 802.11ac support at this STA.",
934  BooleanValue (false),
938  .AddAttribute ("CtsToSelfSupported",
939  "Use CTS to Self when using a rate that is not in the basic rate set.",
940  BooleanValue (false),
944  .AddAttribute ("VO_MaxAmsduSize",
945  "Maximum length in bytes of an A-MSDU for AC_VO access class.",
946  UintegerValue (0),
948  MakeUintegerChecker<uint32_t> ())
949  .AddAttribute ("VI_MaxAmsduSize",
950  "Maximum length in bytes of an A-MSDU for AC_VI access class.",
951  UintegerValue (0),
953  MakeUintegerChecker<uint32_t> ())
954  .AddAttribute ("BE_MaxAmsduSize",
955  "Maximum length in bytes of an A-MSDU for AC_BE access class.",
956  UintegerValue (0),
958  MakeUintegerChecker<uint32_t> ())
959  .AddAttribute ("BK_MaxAmsduSize",
960  "Maximum length in bytes of an A-MSDU for AC_BK access class.",
961  UintegerValue (0),
963  MakeUintegerChecker<uint32_t> ())
964  .AddAttribute ("VO_MaxAmpduSize",
965  "Maximum length in bytes of an A-MPDU for AC_VO access class.",
966  UintegerValue (0),
968  MakeUintegerChecker<uint32_t> ())
969  .AddAttribute ("VI_MaxAmpduSize",
970  "Maximum length in bytes of an A-MPDU for AC_VI access class.",
971  UintegerValue (65535),
973  MakeUintegerChecker<uint32_t> ())
974  .AddAttribute ("BE_MaxAmpduSize",
975  "Maximum length in bytes of an A-MPDU for AC_BE access class.",
976  UintegerValue (65535),
978  MakeUintegerChecker<uint32_t> ())
979  .AddAttribute ("BK_MaxAmpduSize",
980  "Maximum length in bytes of an A-MPDU for AC_BK access class.",
981  UintegerValue (0),
983  MakeUintegerChecker<uint32_t> ())
984  .AddAttribute ("VO_BlockAckThreshold",
985  "If number of packets in VO queue reaches this value, "
986  "block ack mechanism is used. If this value is 0, block ack is never used.",
987  UintegerValue (0),
989  MakeUintegerChecker<uint8_t> (0, 64))
990  .AddAttribute ("VI_BlockAckThreshold",
991  "If number of packets in VI queue reaches this value, "
992  "block ack mechanism is used. If this value is 0, block ack is never used.",
993  UintegerValue (0),
995  MakeUintegerChecker<uint8_t> (0, 64))
996  .AddAttribute ("BE_BlockAckThreshold",
997  "If number of packets in BE queue reaches this value, "
998  "block ack mechanism is used. If this value is 0, block ack is never used.",
999  UintegerValue (0),
1001  MakeUintegerChecker<uint8_t> (0, 64))
1002  .AddAttribute ("BK_BlockAckThreshold",
1003  "If number of packets in BK 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 ("VO_BlockAckInactivityTimeout",
1009  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1010  "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
1011  "block ack setup is completed and will be reset every time that a block ack"
1012  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1013  UintegerValue (0),
1015  MakeUintegerChecker<uint16_t> ())
1016  .AddAttribute ("VI_BlockAckInactivityTimeout",
1017  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1018  "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
1019  "block ack setup is completed and will be reset every time that a block ack"
1020  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1021  UintegerValue (0),
1023  MakeUintegerChecker<uint16_t> ())
1024  .AddAttribute ("BE_BlockAckInactivityTimeout",
1025  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1026  "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
1027  "block ack setup is completed and will be reset every time that a block ack"
1028  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1029  UintegerValue (0),
1031  MakeUintegerChecker<uint16_t> ())
1032  .AddAttribute ("BK_BlockAckInactivityTimeout",
1033  "Represents max time (blocks of 1024 micro seconds) allowed for block ack"
1034  "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
1035  "block ack setup is completed and will be reset every time that a block ack"
1036  "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
1037  UintegerValue (0),
1039  MakeUintegerChecker<uint16_t> ())
1040  .AddAttribute ("ShortSlotTimeSupported",
1041  "Whether or not short slot time is supported (only used by ERP APs or STAs).",
1042  BooleanValue (true),
1045  MakeBooleanChecker ())
1046  .AddAttribute ("DcaTxop",
1047  "The DcaTxop object.",
1048  PointerValue (),
1050  MakePointerChecker<DcaTxop> ())
1051  .AddAttribute ("VO_EdcaTxopN",
1052  "Queue that manages packets belonging to AC_VO access class.",
1053  PointerValue (),
1055  MakePointerChecker<EdcaTxopN> ())
1056  .AddAttribute ("VI_EdcaTxopN",
1057  "Queue that manages packets belonging to AC_VI access class.",
1058  PointerValue (),
1060  MakePointerChecker<EdcaTxopN> ())
1061  .AddAttribute ("BE_EdcaTxopN",
1062  "Queue that manages packets belonging to AC_BE access class.",
1063  PointerValue (),
1065  MakePointerChecker<EdcaTxopN> ())
1066  .AddAttribute ("BK_EdcaTxopN",
1067  "Queue that manages packets belonging to AC_BK access class.",
1068  PointerValue (),
1070  MakePointerChecker<EdcaTxopN> ())
1071  .AddTraceSource ("TxOkHeader",
1072  "The header of successfully transmitted packet.",
1074  "ns3::WifiMacHeader::TracedCallback")
1075  .AddTraceSource ("TxErrHeader",
1076  "The header of unsuccessfully transmitted packet.",
1078  "ns3::WifiMacHeader::TracedCallback")
1079  ;
1080  return tid;
1081 }
1082 
1083 void
1085 {
1086  NS_LOG_FUNCTION (this << standard);
1087  uint32_t cwmin = 0;
1088  uint32_t cwmax = 0;
1089  switch (standard)
1090  {
1092  SetVhtSupported (true);
1095  SetHtSupported (true);
1097  m_erpSupported = true;
1102  cwmin = 15;
1103  cwmax = 1023;
1104  break;
1106  cwmin = 31;
1107  cwmax = 1023;
1108  break;
1109  default:
1110  NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
1111  }
1112 
1113  ConfigureContentionWindow (cwmin, cwmax);
1114 }
1115 
1116 void
1117 RegularWifiMac::ConfigureContentionWindow (uint32_t cwMin, uint32_t cwMax)
1118 {
1119  //The special value of AC_BE_NQOS which exists in the Access
1120  //Category enumeration allows us to configure plain old DCF.
1121  ConfigureDcf (m_dca, cwMin, cwMax, AC_BE_NQOS);
1122 
1123  //Now we configure the EDCA functions
1124  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1125  {
1126  ConfigureDcf (i->second, cwMin, cwMax, i->first);
1127  }
1128 }
1129 
1130 void
1132 {
1133  NS_LOG_FUNCTION (this << hdr);
1134  m_txOkCallback (hdr);
1135 }
1136 
1137 void
1139 {
1140  NS_LOG_FUNCTION (this << hdr);
1141  m_txErrCallback (hdr);
1142 }
1143 
1144 void
1146 {
1147  NS_LOG_FUNCTION (this);
1148  if (GetVOQueue ()->GetMsduAggregator () != 0)
1149  {
1151  }
1152  if (GetVIQueue ()->GetMsduAggregator () != 0)
1153  {
1155  }
1156  if (GetBEQueue ()->GetMsduAggregator () != 0)
1157  {
1159  }
1160  if (GetBKQueue ()->GetMsduAggregator () != 0)
1161  {
1163  }
1164  if (GetVOQueue ()->GetMpduAggregator () != 0)
1165  {
1167  }
1168  if (GetVIQueue ()->GetMpduAggregator () != 0)
1169  {
1171  }
1172  if (GetBEQueue ()->GetMpduAggregator () != 0)
1173  {
1175  }
1176  if (GetBKQueue ()->GetMpduAggregator () != 0)
1177  {
1179  }
1180 }
1181 
1182 void
1184 {
1185  NS_LOG_FUNCTION (this);
1186  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1187  {
1188  if (i->second->GetMsduAggregator () == 0)
1189  {
1190  Ptr<MsduStandardAggregator> msduAggregator = CreateObject<MsduStandardAggregator> ();
1191  i->second->SetMsduAggregator (msduAggregator);
1192  }
1193  if (i->second->GetMpduAggregator () == 0)
1194  {
1195  Ptr<MpduStandardAggregator> mpduAggregator = CreateObject<MpduStandardAggregator> ();
1196  i->second->SetMpduAggregator (mpduAggregator);
1197  }
1198  }
1200 }
1201 
1202 void
1204 {
1205  NS_LOG_FUNCTION (this);
1206  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
1207  {
1208  i->second->SetMsduAggregator (0);
1209  i->second->SetMpduAggregator (0);
1210  }
1211 }
1212 
1213 } //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:208
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)
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)
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:507
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:626
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:386
virtual uint8_t GetNMcs(void) const =0
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
void SetPifs(Time pifs)
virtual void SetCompressedBlockAckTimeout(Time blockAckTimeout)
void SetupLowListener(Ptr< MacLow > low)
Set up listener for MacLow events.
Definition: dcf-manager.cc:365
#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:720
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:145
virtual bool GetLdpc(void) const =0
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 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:754
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)
virtual WifiMode GetMcs(uint8_t mcs) const =0
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
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)
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:433
Background.
Definition: qos-utils.h:41
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
virtual uint32_t GetChannelWidth(void) const =0
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2514
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:2472
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 ConfigureDcf(Ptr< Dcf > dcf, uint32_t cwmin, uint32_t cwmax, enum AcIndex ac)
Definition: wifi-mac.cc:411
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:353
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:341
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:262
enum BlockAckActionValue blockAck
Definition: mgt-headers.h:579
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:364
void SetMaxAmpduLength(uint8_t maxampdulength)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1480
virtual bool GetGuardInterval(void) const =0
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
void SetHtSupported(bool enable)
Enable or disable HT capability support.
void SetRxHighestSupportedDataRate(uint16_t maxsupportedrate)
virtual uint8_t GetSupportedRxSpatialStreams(void) const =0
Status code for association response.
Definition: status-code.h:33
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
Definition: edca-txop-n.cc:967
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
Definition: edca-txop-n.cc:961
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:391
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:377
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
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:758
Implement the header for management frames of type del block ack.
Definition: mgt-headers.h:879
#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:574
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:398
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
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:60
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.
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
ActionValue GetAction()
Return the action value.
Definition: mgt-headers.cc:775
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
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:826
void SetAckTimeout(Time ackTimeout)
virtual uint8_t GetSupportedTxSpatialStreams(void) const =0
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:36
virtual bool GetGreenfield(void) const =0
void SetSifs(Time sifs)
Definition: dcf-manager.cc:384
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...