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 #include "regular-wifi-mac.h"
21 
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 
28 #include "mac-rx-middle.h"
29 #include "mac-tx-middle.h"
30 #include "mac-low.h"
31 #include "dcf.h"
32 #include "dcf-manager.h"
33 #include "wifi-phy.h"
34 
35 #include "msdu-aggregator.h"
36 
37 namespace ns3 {
38 
39 NS_LOG_COMPONENT_DEFINE ("RegularWifiMac");
40 
41 NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac);
42 
44 {
45  NS_LOG_FUNCTION (this);
46  m_rxMiddle = new MacRxMiddle ();
48 
49  m_txMiddle = new MacTxMiddle ();
50 
51  m_low = CreateObject<MacLow> ();
53 
54  m_dcfManager = new DcfManager ();
56 
57  m_dca = CreateObject<DcaTxop> ();
58  m_dca->SetLow (m_low);
59  m_dca->SetManager (m_dcfManager);
60  m_dca->SetTxMiddle(m_txMiddle);
61  m_dca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
62  m_dca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
63 
64  // Construct the EDCAFs. The ordering is important - highest
65  // priority (Table 9-1 UP-to-AC mapping; IEEE 802.11-2012) must be created
66  // first.
71 }
72 
74 {
75  NS_LOG_FUNCTION (this);
76 }
77 
78 void
80 {
81  NS_LOG_FUNCTION (this);
82 
83  m_dca->Initialize ();
84 
85  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
86  {
87  i->second->Initialize ();
88  }
89 }
90 
91 void
93 {
94  NS_LOG_FUNCTION (this);
95  delete m_rxMiddle;
96  m_rxMiddle = 0;
97 
98  delete m_txMiddle;
99  m_txMiddle = 0;
100 
101  delete m_dcfManager;
102  m_dcfManager = 0;
103 
104  m_low->Dispose ();
105  m_low = 0;
106 
107  m_phy = 0;
108  m_stationManager = 0;
109 
110  m_dca->Dispose ();
111  m_dca = 0;
112 
113  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
114  {
115  i->second = 0;
116  }
117 }
118 
119 void
121 {
122  NS_LOG_FUNCTION (this << stationManager);
123  m_stationManager = stationManager;
125  m_low->SetWifiRemoteStationManager (stationManager);
126 
127  m_dca->SetWifiRemoteStationManager (stationManager);
128 
129  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
130  {
131  i->second->SetWifiRemoteStationManager (stationManager);
132  }
133 }
134 
137 {
138  return m_stationManager;
139 }
140 
141 void
143 {
144  NS_LOG_FUNCTION (this << ac);
145 
146  // Our caller shouldn't be attempting to setup a queue that is
147  // already configured.
148  NS_ASSERT (m_edca.find (ac) == m_edca.end ());
149 
150  Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> ();
151  edca->SetLow (m_low);
152  edca->SetManager (m_dcfManager);
153  edca->SetTxMiddle (m_txMiddle);
154  edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this));
155  edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this));
156  edca->SetAccessCategory (ac);
157  edca->CompleteConfig ();
158  m_edca.insert (std::make_pair (ac, edca));
159 }
160 
161 void
163 {
164  NS_LOG_FUNCTION (this << type);
165  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
166  {
167  i->second->SetTypeOfStation (type);
168  }
169 }
170 
173 {
174  return m_dca;
175 }
176 
179 {
180  return m_edca.find (AC_VO)->second;
181 }
182 
185 {
186  return m_edca.find (AC_VI)->second;
187 }
188 
191 {
192  return m_edca.find (AC_BE)->second;
193 }
194 
197 {
198  return m_edca.find (AC_BK)->second;
199 }
200 
201 void
203 {
204  NS_LOG_FUNCTION (this << phy);
205  m_phy = phy;
207  m_low->SetPhy (phy);
208 }
209 
212 {
213  NS_LOG_FUNCTION (this);
214  return m_phy;
215 }
216 
217 void
219 {
220  NS_LOG_FUNCTION (this);
221  m_low->ResetPhy ();
223  m_phy = 0;
224 }
225 
226 void
228 {
229  NS_LOG_FUNCTION (this);
230  m_forwardUp = upCallback;
231 }
232 
233 void
235 {
236  NS_LOG_FUNCTION (this);
237  m_linkUp = linkUp;
238 }
239 
240 void
242 {
243  NS_LOG_FUNCTION (this);
244  m_linkDown = linkDown;
245 }
246 
247 void
249 {
250  NS_LOG_FUNCTION (this);
251  m_qosSupported = enable;
252 }
253 
254 bool
256 {
257  return m_qosSupported;
258 }
259 void
261 {
262  NS_LOG_FUNCTION (this);
263  m_htSupported = enable;
264 }
265 
266 bool
268 {
269  return m_htSupported;
270 }
271 void
273 {
274  NS_LOG_FUNCTION (this);
275  m_low->SetCtsToSelfSupported (enable);
276 }
277 
278 bool
280 {
281  return m_low->GetCtsToSelfSupported ();
282 }
283 
284 void
286 {
287  NS_LOG_FUNCTION (this << slotTime);
288  m_dcfManager->SetSlot (slotTime);
289  m_low->SetSlotTime (slotTime);
290 }
291 
292 Time
294 {
295  return m_low->GetSlotTime ();
296 }
297 
298 void
300 {
301  NS_LOG_FUNCTION (this << sifs);
302  m_dcfManager->SetSifs (sifs);
303  m_low->SetSifs (sifs);
304 }
305 
306 Time
308 {
309  return m_low->GetSifs ();
310 }
311 
312 void
314 {
315  NS_LOG_FUNCTION (this << eifsNoDifs);
316  m_dcfManager->SetEifsNoDifs (eifsNoDifs);
317 }
318 
319 Time
321 {
322  return m_dcfManager->GetEifsNoDifs ();
323 }
324 void
326 {
327  NS_LOG_FUNCTION (this << rifs);
328  m_low->SetRifs (rifs);
329 }
330 
331 Time
333 {
334  return m_low->GetRifs();
335 }
336 
337 void
339 {
340  NS_LOG_FUNCTION (this << pifs);
341  m_low->SetPifs (pifs);
342 }
343 
344 Time
346 {
347  return m_low->GetPifs ();
348 }
349 
350 void
352 {
353  NS_LOG_FUNCTION (this << ackTimeout);
354  m_low->SetAckTimeout (ackTimeout);
355 }
356 
357 Time
359 {
360  return m_low->GetAckTimeout ();
361 }
362 
363 void
365 {
366  NS_LOG_FUNCTION (this << ctsTimeout);
367  m_low->SetCtsTimeout (ctsTimeout);
368 }
369 
370 Time
372 {
373  return m_low->GetCtsTimeout ();
374 }
375 
376 void
378 {
379  NS_LOG_FUNCTION (this << blockAckTimeout);
380  m_low->SetBasicBlockAckTimeout (blockAckTimeout);
381 }
382 
383 Time
385 {
386  return m_low->GetBasicBlockAckTimeout ();
387 }
388 
389 void
391 {
392  NS_LOG_FUNCTION (this << blockAckTimeout);
393  m_low->SetCompressedBlockAckTimeout (blockAckTimeout);
394 }
395 
396 Time
398 {
400 }
401 
402 void
404 {
405  NS_LOG_FUNCTION (this << address);
406  m_low->SetAddress (address);
407 }
408 
411 {
412  return m_low->GetAddress ();
413 }
414 
415 void
417 {
418  NS_LOG_FUNCTION (this << ssid);
419  m_ssid = ssid;
420 }
421 
422 Ssid
424 {
425  return m_ssid;
426 }
427 
428 void
430 {
431  NS_LOG_FUNCTION (this << bssid);
432  m_low->SetBssid (bssid);
433 }
434 
437 {
438  return m_low->GetBssid ();
439 }
440 
441 void
443 {
444  m_low->SetPromisc ();
445 }
446 
447 void
449  Mac48Address to, Mac48Address from)
450 {
451  // We expect RegularWifiMac subclasses which do support forwarding (e.g.,
452  // AP) to override this method. Therefore, we throw a fatal error if
453  // someone tries to invoke this method on a class which has not done
454  // this.
455  NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
456  << ") does not support Enqueue() with from address");
457 }
458 
459 bool
461 {
462  return false;
463 }
464 
465 void
467 {
468  NS_LOG_FUNCTION (this << packet << from);
469  m_forwardUp (packet, from, to);
470 }
471 
472 void
474 {
475  NS_LOG_FUNCTION (this << packet << hdr);
476 
477  Mac48Address to = hdr->GetAddr1 ();
478  Mac48Address from = hdr->GetAddr2 ();
479 
480  // We don't know how to deal with any frame that is not addressed to
481  // us (and odds are there is nothing sensible we could do anyway),
482  // so we ignore such frames.
483  //
484  // The derived class may also do some such filtering, but it doesn't
485  // hurt to have it here too as a backstop.
486  if (to != GetAddress ())
487  {
488  return;
489  }
490 
491  if (hdr->IsMgt () && hdr->IsAction ())
492  {
493  // There is currently only any reason for Management Action
494  // frames to be flying about if we are a QoS STA.
496 
497  WifiActionHeader actionHdr;
498  packet->RemoveHeader (actionHdr);
499 
500  switch (actionHdr.GetCategory ())
501  {
503 
504  switch (actionHdr.GetAction ().blockAck)
505  {
507  {
508  MgtAddBaRequestHeader reqHdr;
509  packet->RemoveHeader (reqHdr);
510 
511  // We've received an ADDBA Request. Our policy here is
512  // to automatically accept it, so we get the ADDBA
513  // Response on it's way immediately.
514  SendAddBaResponse (&reqHdr, from);
515  // This frame is now completely dealt with, so we're done.
516  return;
517  }
518 
520  {
521  MgtAddBaResponseHeader respHdr;
522  packet->RemoveHeader (respHdr);
523 
524  // We've received an ADDBA Response. We assume that it
525  // indicates success after an ADDBA Request we have
526  // sent (we could, in principle, check this, but it
527  // seems a waste given the level of the current model)
528  // and act by locally establishing the agreement on
529  // the appropriate queue.
530  AcIndex ac = QosUtilsMapTidToAc (respHdr.GetTid ());
531  m_edca[ac]->GotAddBaResponse (&respHdr, from);
532  // This frame is now completely dealt with, so we're done.
533  return;
534  }
535 
537  {
538  MgtDelBaHeader delBaHdr;
539  packet->RemoveHeader (delBaHdr);
540 
541  if (delBaHdr.IsByOriginator ())
542  {
543  // This DELBA frame was sent by the originator, so
544  // this means that an ingoing established
545  // agreement exists in MacLow and we need to
546  // destroy it.
547  m_low->DestroyBlockAckAgreement (from, delBaHdr.GetTid ());
548  }
549  else
550  {
551  // We must have been the originator. We need to
552  // tell the correct queue that the agreement has
553  // been torn down
554  AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
555  m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
556  }
557  // This frame is now completely dealt with, so we're done.
558  return;
559  }
560 
561  default:
562  NS_FATAL_ERROR ("Unsupported Action field in Block Ack Action frame");
563  return;
564  }
565 
566 
567  default:
568  NS_FATAL_ERROR ("Unsupported Action frame received");
569  return;
570  }
571  }
572  NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
573 }
574 
575 void
577  const WifiMacHeader *hdr)
578 {
580  MsduAggregator::Deaggregate (aggregatedPacket);
581 
582  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
583  i != packets.end (); ++i)
584  {
585  ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
586  (*i).second.GetDestinationAddr ());
587  }
588 }
589 
590 void
592  Mac48Address originator)
593 {
594  NS_LOG_FUNCTION (this);
595  WifiMacHeader hdr;
596  hdr.SetAction ();
597  hdr.SetAddr1 (originator);
598  hdr.SetAddr2 (GetAddress ());
599  hdr.SetAddr3 (GetAddress ());
600  hdr.SetDsNotFrom ();
601  hdr.SetDsNotTo ();
602 
603  MgtAddBaResponseHeader respHdr;
604  StatusCode code;
605  code.SetSuccess ();
606  respHdr.SetStatusCode (code);
607  //Here a control about queues type?
608  respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ());
609 
610  if (reqHdr->IsImmediateBlockAck ())
611  {
612  respHdr.SetImmediateBlockAck ();
613  }
614  else
615  {
616  respHdr.SetDelayedBlockAck ();
617  }
618  respHdr.SetTid (reqHdr->GetTid ());
619  // For now there's not no control about limit of reception. We
620  // assume that receiver has no limit on reception. However we assume
621  // that a receiver sets a bufferSize in order to satisfy next
622  // equation: (bufferSize + 1) % 16 = 0 So if a recipient is able to
623  // buffer a packet, it should be also able to buffer all possible
624  // packet's fragments. See section 7.3.1.14 in IEEE802.11e for more
625  // details.
626  respHdr.SetBufferSize (1023);
627  respHdr.SetTimeout (reqHdr->GetTimeout ());
628 
629  WifiActionHeader actionHdr;
632  actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action);
633 
634  Ptr<Packet> packet = Create<Packet> ();
635  packet->AddHeader (respHdr);
636  packet->AddHeader (actionHdr);
637 
638  // We need to notify our MacLow object as it will have to buffer all
639  // correctly received packets for this Block Ack session
640  m_low->CreateBlockAckAgreement (&respHdr, originator,
641  reqHdr->GetStartingSequence ());
642 
643  // It is unclear which queue this frame should go into. For now we
644  // bung it into the queue corresponding to the TID for which we are
645  // establishing an agreement, and push it to the head.
646  m_edca[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr);
647 }
648 
649 TypeId
651 {
652  static TypeId tid = TypeId ("ns3::RegularWifiMac")
653  .SetParent<WifiMac> ()
654  .SetGroupName ("Wifi")
655  .AddAttribute ("QosSupported",
656  "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
657  BooleanValue (false),
661  .AddAttribute ("HtSupported",
662  "This Boolean attribute is set to enable 802.11n support at this STA",
663  BooleanValue (false),
667  .AddAttribute ("CtsToSelfSupported",
668  "Use CTS to Self when using a rate that is not in the basic set rate",
669  BooleanValue (false),
673  .AddAttribute ("DcaTxop", "The DcaTxop object",
674  PointerValue (),
676  MakePointerChecker<DcaTxop> ())
677  .AddAttribute ("VO_EdcaTxopN",
678  "Queue that manages packets belonging to AC_VO access class",
679  PointerValue (),
681  MakePointerChecker<EdcaTxopN> ())
682  .AddAttribute ("VI_EdcaTxopN",
683  "Queue that manages packets belonging to AC_VI access class",
684  PointerValue (),
686  MakePointerChecker<EdcaTxopN> ())
687  .AddAttribute ("BE_EdcaTxopN",
688  "Queue that manages packets belonging to AC_BE access class",
689  PointerValue (),
691  MakePointerChecker<EdcaTxopN> ())
692  .AddAttribute ("BK_EdcaTxopN",
693  "Queue that manages packets belonging to AC_BK access class",
694  PointerValue (),
696  MakePointerChecker<EdcaTxopN> ())
697  .AddTraceSource ( "TxOkHeader",
698  "The header of successfully transmitted packet",
700  "ns3::WifiMacHeader::TracedCallback")
701  .AddTraceSource ("TxErrHeader",
702  "The header of unsuccessfully transmitted packet",
704  "ns3::WifiMacHeader::TracedCallback")
705  ;
706 
707  return tid;
708 }
709 
710 void
712 {
713  uint32_t cwmin;
714  uint32_t cwmax;
715 
716  switch (standard)
717  {
725  cwmin = 15;
726  cwmax = 1023;
727  break;
728 
730  cwmin = 31;
731  cwmax = 1023;
732  break;
733 
734  default:
735  NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
736  }
737 
738  // The special value of AC_BE_NQOS which exists in the Access
739  // Category enumeration allows us to configure plain old DCF.
740  ConfigureDcf (m_dca, cwmin, cwmax, AC_BE_NQOS);
741 
742  // Now we configure the EDCA functions
743  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
744  {
745  ConfigureDcf (i->second, cwmin, cwmax, i->first);
746  }
747 }
748 
749 void
751 {
752  NS_LOG_FUNCTION (this << hdr);
753  m_txOkCallback (hdr);
754 }
755 
756 void
758 {
759  NS_LOG_FUNCTION (this << hdr);
760  m_txErrCallback (hdr);
761 }
762 
763 } // 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 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:639
void SetPifs(Time pifs)
Set PCF Interframe Space (PIFS) of this MacLow.
Definition: mac-low.cc:579
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
#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:594
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
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:336
static TypeId GetTypeId(void)
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
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.
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:644
void SetSifs(Time sifs)
Set Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:569
Implement the header for management frames of type add block ack request.
Definition: mgt-headers.h:444
void SetPifs(Time pifs)
virtual void SetCompressedBlockAckTimeout(Time blockAckTimeout)
void SetupLowListener(Ptr< MacLow > low)
Set up listener for MacLow events.
Definition: dcf-manager.cc:338
#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.
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)
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:482
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
bool GetQosSupported() const
Return whether the device supports QoS.
void SetRxCallback(Callback< void, Ptr< Packet >, const WifiMacHeader * > callback)
Definition: mac-low.cc:655
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:614
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:515
Ptr< WifiPhy > m_phy
Wifi PHY.
void SetDelayedBlockAck()
Enable delayed Block ACK.
Definition: mgt-headers.cc:926
void SetRifs(Time rifs)
Time GetCtsTimeout(void) const
Return CTS timeout of this MacLow.
Definition: mac-low.cc:619
void SetStatusCode(StatusCode code)
Set the status code.
Definition: mgt-headers.cc:957
virtual Ssid GetSsid(void) const
Video.
Definition: qos-utils.h:42
Voice.
Definition: qos-utils.h:44
Best Effort.
Definition: qos-utils.h:38
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to, Mac48Address from)
void SetTimeout(uint16_t timeout)
Set timeout.
Definition: mgt-headers.cc:945
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...
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:554
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:544
void SetTid(uint8_t tid)
Set Traffic ID (TID).
Definition: mgt-headers.cc:938
virtual void SetBssid(Mac48Address bssid)
Ptr< EdcaTxopN > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
Time GetSifs(void) const
void SetLow(Ptr< MacLow > low)
Set MacLow associated with this EdcaTxopN.
Definition: edca-txop-n.cc:423
Background.
Definition: qos-utils.h:40
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.
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2227
Time GetCtsTimeout(void) const
virtual void SetForwardUpCallback(ForwardUpCallback upCallback)
void SetSuccess(void)
Set success bit to 0 (success).
Definition: status-code.cc:31
void SetEifsNoDifs(Time eifsNoDifs)
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:210
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:2185
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.
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:390
void SetImmediateBlockAck()
Enable immediate Block ACK.
Definition: mgt-headers.cc:932
void RemovePhyListener(Ptr< WifiPhy > phy)
Remove current registered listener for Phy events.
Definition: dcf-manager.cc:326
Time GetAckTimeout(void) const
void SetupPhyListener(Ptr< WifiPhy > phy)
Set up listener for Phy events.
Definition: dcf-manager.cc:314
Time GetSlot(void) const
void SetAckTimeout(Time ackTimeout)
Set ACK timeout of this MacLow.
Definition: mac-low.cc:539
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
Definition: dcf-manager.h:252
enum BlockAckActionValue blockAck
Definition: mgt-headers.h:407
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:27
virtual void SetAddress(Mac48Address address)
Time GetRifs(void) const
Return Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:629
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1296
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:599
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).
Definition: mgt-headers.cc:790
Time GetPifs(void) const
Ptr< MacLow > m_low
MacLow (RTS, CTS, DATA, ACK etc.)
virtual void SendAddBaResponse(const MgtAddBaRequestHeader *reqHdr, Mac48Address originator)
This method can be called to accept a received ADDBA Request.
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.
Status code for association response.
Definition: status-code.h:32
bool IsAmsduSupported(void) const
Return whether A-MSDU capability is supported.
Definition: mgt-headers.cc:814
Ptr< EdcaTxopN > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void DoDispose()
Destructor implementation.
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.
Hold objects of type Ptr.
Definition: pointer.h:36
void SetBssid(Mac48Address ad)
Set the Basic Service Set Identification.
Definition: mac-low.cc:589
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
void SetBufferSize(uint16_t size)
Set buffer size.
Definition: mgt-headers.cc:951
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.
void SetEifsNoDifs(Time eifsNoDifs)
Definition: dcf-manager.cc:362
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:507
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Definition: mgt-headers.cc:975
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:37
Time GetRifs(void) const
Time GetSlotTime(void) const
Return slot duration of this MacLow.
Definition: mac-low.cc:634
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.
Definition: mgt-headers.cc:796
virtual Mac48Address GetBssid(void) const
void SetSlot(Time slotTime)
Definition: dcf-manager.cc:350
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Definition: mgt-headers.cc:820
void SetRifs(Time rifs)
Set Reduced Interframe Space (RIFS) of this MacLow.
Definition: mac-low.cc:584
Ptr< EdcaTxopN > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
virtual Time GetBasicBlockAckTimeout(void) const
void SetSlotTime(Time slotTime)
Set slot duration of this MacLow.
Definition: mac-low.cc:574
Time GetSifs(void) const
Return Short Interframe Space (SIFS) of this MacLow.
Definition: mac-low.cc:624
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:572
Implement the header for management frames of type del block ack.
Definition: mgt-headers.h:688
virtual Mac48Address GetAddress(void) const
typedef for union of different ActionValues
Definition: mgt-headers.h:402
Total number of ACs.
Definition: qos-utils.h:47
bool GetCtsToSelfSupported() const
Return whether CTS-to-self capability is supported.
Definition: mac-low.cc:559
Time GetEifsNoDifs() const
Definition: dcf-manager.cc:368
virtual void DoInitialize()
Initialize() implementation.
void SetCtsTimeout(Time ctsTimeout)
Set CTS timeout of this MacLow.
Definition: mac-low.cc:564
Time GetAckTimeout(void) const
Return ACK timeout of this MacLow.
Definition: mac-low.cc:604
bool GetHtSupported() const
Return whether the device supports QoS.
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
void SetAddress(Mac48Address ad)
Set MAC address of this MacLow.
Definition: mac-low.cc:534
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
Definition: mgt-headers.cc:963
virtual void TxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver (i.e.
tuple address
Definition: first.py:37
TypeOfStation
Enumeration for type of station.
Definition: edca-txop-n.h:59
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self 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:535
virtual void SetPromisc(void)
Sets the interface in promiscuous mode.
void ResetPhy(void)
Remove WifiPhy associated with this MacLow.
Definition: mac-low.cc:520
Time GetBasicBlockAckTimeout() const
Return Basic Block ACK timeout of this MacLow.
Definition: mac-low.cc:609
a unique identifier for an interface.
Definition: type-id.h:57
TypeId SetParent(TypeId tid)
Definition: type-id.cc:638
void Dispose(void)
Dispose of this Object.
Definition: object.cc:208
void SetAckTimeout(Time ackTimeout)
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:35
void SetSifs(Time sifs)
Definition: dcf-manager.cc:356
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:253
Implements the IEEE 802.11 MAC header.
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:549
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this MacLow.
Definition: mac-low.cc:528
uint16_t GetTimeout(void) const
Return the timeout.
Definition: mgt-headers.cc:802
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 SetupEdcaQueue(enum AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...