A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 NS_LOG_COMPONENT_DEFINE ("RegularWifiMac");
38 
39 namespace ns3 {
40 
41 NS_OBJECT_ENSURE_REGISTERED (RegularWifiMac)
42  ;
43 
45 {
46  NS_LOG_FUNCTION (this);
47  m_rxMiddle = new MacRxMiddle ();
49 
50  m_txMiddle = new MacTxMiddle ();
51 
52  m_low = CreateObject<MacLow> ();
54 
55  m_dcfManager = new DcfManager ();
57 
58  m_dca = CreateObject<DcaTxop> ();
59  m_dca->SetLow (m_low);
60  m_dca->SetManager (m_dcfManager);
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 (see Table 9-1 in IEEE 802.11-2007) 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;
124  m_stationManager->SetHtSupported (GetHtSupported());
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  return m_phy;
214 }
215 
216 void
218 {
219  NS_LOG_FUNCTION (this);
220  m_forwardUp = upCallback;
221 }
222 
223 void
225 {
226  NS_LOG_FUNCTION (this);
227  m_linkUp = linkUp;
228 }
229 
230 void
232 {
233  NS_LOG_FUNCTION (this);
234  m_linkDown = linkDown;
235 }
236 
237 void
239 {
240  NS_LOG_FUNCTION (this);
241  m_qosSupported = enable;
242 }
243 
244 bool
246 {
247  return m_qosSupported;
248 }
249 void
251 {
252  NS_LOG_FUNCTION (this);
253  m_htSupported = enable;
254 }
255 
256 bool
258 {
259  return m_htSupported;
260 }
261 void
263 {
264  NS_LOG_FUNCTION (this);
265  m_low->SetCtsToSelfSupported (enable);
266 }
267 
268 bool
270 {
271  return m_low->GetCtsToSelfSupported ();
272 }
273 
274 void
276 {
277  NS_LOG_FUNCTION (this << slotTime);
278  m_dcfManager->SetSlot (slotTime);
279  m_low->SetSlotTime (slotTime);
280 }
281 
282 Time
284 {
285  return m_low->GetSlotTime ();
286 }
287 
288 void
290 {
291  NS_LOG_FUNCTION (this << sifs);
292  m_dcfManager->SetSifs (sifs);
293  m_low->SetSifs (sifs);
294 }
295 
296 Time
298 {
299  return m_low->GetSifs ();
300 }
301 
302 void
304 {
305  NS_LOG_FUNCTION (this << eifsNoDifs);
306  m_dcfManager->SetEifsNoDifs (eifsNoDifs);
307 }
308 
309 Time
311 {
312  return m_dcfManager->GetEifsNoDifs ();
313 }
314 void
316 {
317  NS_LOG_FUNCTION (this << rifs);
318  m_low->SetRifs (rifs);
319 }
320 
321 Time
323 {
324  return m_low->GetRifs();
325 }
326 
327 void
329 {
330  NS_LOG_FUNCTION (this << pifs);
331  m_low->SetPifs (pifs);
332 }
333 
334 Time
336 {
337  return m_low->GetPifs ();
338 }
339 
340 void
342 {
343  NS_LOG_FUNCTION (this << ackTimeout);
344  m_low->SetAckTimeout (ackTimeout);
345 }
346 
347 Time
349 {
350  return m_low->GetAckTimeout ();
351 }
352 
353 void
355 {
356  NS_LOG_FUNCTION (this << ctsTimeout);
357  m_low->SetCtsTimeout (ctsTimeout);
358 }
359 
360 Time
362 {
363  return m_low->GetCtsTimeout ();
364 }
365 
366 void
368 {
369  NS_LOG_FUNCTION (this << blockAckTimeout);
370  m_low->SetBasicBlockAckTimeout (blockAckTimeout);
371 }
372 
373 Time
375 {
376  return m_low->GetBasicBlockAckTimeout ();
377 }
378 
379 void
381 {
382  NS_LOG_FUNCTION (this << blockAckTimeout);
383  m_low->SetCompressedBlockAckTimeout (blockAckTimeout);
384 }
385 
386 Time
388 {
389  return m_low->GetCompressedBlockAckTimeout ();
390 }
391 
392 void
394 {
395  NS_LOG_FUNCTION (this << address);
396  m_low->SetAddress (address);
397 }
398 
401 {
402  return m_low->GetAddress ();
403 }
404 
405 void
407 {
408  NS_LOG_FUNCTION (this << ssid);
409  m_ssid = ssid;
410 }
411 
412 Ssid
414 {
415  return m_ssid;
416 }
417 
418 void
420 {
421  NS_LOG_FUNCTION (this << bssid);
422  m_low->SetBssid (bssid);
423 }
424 
427 {
428  return m_low->GetBssid ();
429 }
430 
431 void
433 {
434  m_low->SetPromisc ();
435 }
436 
437 void
439  Mac48Address to, Mac48Address from)
440 {
441  // We expect RegularWifiMac subclasses which do support forwarding (e.g.,
442  // AP) to override this method. Therefore, we throw a fatal error if
443  // someone tries to invoke this method on a class which has not done
444  // this.
445  NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress ()
446  << ") does not support Enqueue() with from address");
447 }
448 
449 bool
451 {
452  return false;
453 }
454 
455 void
457 {
458  NS_LOG_FUNCTION (this << packet << from);
459  m_forwardUp (packet, from, to);
460 }
461 
462 void
464 {
465  NS_LOG_FUNCTION (this << packet << hdr);
466 
467  Mac48Address to = hdr->GetAddr1 ();
468  Mac48Address from = hdr->GetAddr2 ();
469 
470  // We don't know how to deal with any frame that is not addressed to
471  // us (and odds are there is nothing sensible we could do anyway),
472  // so we ignore such frames.
473  //
474  // The derived class may also do some such filtering, but it doesn't
475  // hurt to have it here too as a backstop.
476  if (to != GetAddress ())
477  {
478  return;
479  }
480 
481  if (hdr->IsMgt () && hdr->IsAction ())
482  {
483  // There is currently only any reason for Management Action
484  // frames to be flying about if we are a QoS STA.
486 
487  WifiActionHeader actionHdr;
488  packet->RemoveHeader (actionHdr);
489 
490  switch (actionHdr.GetCategory ())
491  {
493 
494  switch (actionHdr.GetAction ().blockAck)
495  {
497  {
498  MgtAddBaRequestHeader reqHdr;
499  packet->RemoveHeader (reqHdr);
500 
501  // We've received an ADDBA Request. Our policy here is
502  // to automatically accept it, so we get the ADDBA
503  // Response on it's way immediately.
504  SendAddBaResponse (&reqHdr, from);
505  // This frame is now completely dealt with, so we're done.
506  return;
507  }
508 
510  {
511  MgtAddBaResponseHeader respHdr;
512  packet->RemoveHeader (respHdr);
513 
514  // We've received an ADDBA Response. We assume that it
515  // indicates success after an ADDBA Request we have
516  // sent (we could, in principle, check this, but it
517  // seems a waste given the level of the current model)
518  // and act by locally establishing the agreement on
519  // the appropriate queue.
520  AcIndex ac = QosUtilsMapTidToAc (respHdr.GetTid ());
521  m_edca[ac]->GotAddBaResponse (&respHdr, from);
522  // This frame is now completely dealt with, so we're done.
523  return;
524  }
525 
527  {
528  MgtDelBaHeader delBaHdr;
529  packet->RemoveHeader (delBaHdr);
530 
531  if (delBaHdr.IsByOriginator ())
532  {
533  // This DELBA frame was sent by the originator, so
534  // this means that an ingoing established
535  // agreement exists in MacLow and we need to
536  // destroy it.
537  m_low->DestroyBlockAckAgreement (from, delBaHdr.GetTid ());
538  }
539  else
540  {
541  // We must have been the originator. We need to
542  // tell the correct queue that the agreement has
543  // been torn down
544  AcIndex ac = QosUtilsMapTidToAc (delBaHdr.GetTid ());
545  m_edca[ac]->GotDelBaFrame (&delBaHdr, from);
546  }
547  // This frame is now completely dealt with, so we're done.
548  return;
549  }
550 
551  default:
552  NS_FATAL_ERROR ("Unsupported Action field in Block Ack Action frame");
553  return;
554  }
555 
556 
557  default:
558  NS_FATAL_ERROR ("Unsupported Action frame received");
559  return;
560  }
561  }
562  NS_FATAL_ERROR ("Don't know how to handle frame (type=" << hdr->GetType ());
563 }
564 
565 void
567  const WifiMacHeader *hdr)
568 {
570  MsduAggregator::Deaggregate (aggregatedPacket);
571 
572  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
573  i != packets.end (); ++i)
574  {
575  ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
576  (*i).second.GetDestinationAddr ());
577  }
578 }
579 
580 void
582  Mac48Address originator)
583 {
584  NS_LOG_FUNCTION (this);
585  WifiMacHeader hdr;
586  hdr.SetAction ();
587  hdr.SetAddr1 (originator);
588  hdr.SetAddr2 (GetAddress ());
589  hdr.SetAddr3 (GetAddress ());
590  hdr.SetDsNotFrom ();
591  hdr.SetDsNotTo ();
592 
593  MgtAddBaResponseHeader respHdr;
594  StatusCode code;
595  code.SetSuccess ();
596  respHdr.SetStatusCode (code);
597  //Here a control about queues type?
598  respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ());
599 
600  if (reqHdr->IsImmediateBlockAck ())
601  {
602  respHdr.SetImmediateBlockAck ();
603  }
604  else
605  {
606  respHdr.SetDelayedBlockAck ();
607  }
608  respHdr.SetTid (reqHdr->GetTid ());
609  // For now there's not no control about limit of reception. We
610  // assume that receiver has no limit on reception. However we assume
611  // that a receiver sets a bufferSize in order to satisfy next
612  // equation: (bufferSize + 1) % 16 = 0 So if a recipient is able to
613  // buffer a packet, it should be also able to buffer all possible
614  // packet's fragments. See section 7.3.1.14 in IEEE802.11e for more
615  // details.
616  respHdr.SetBufferSize (1023);
617  respHdr.SetTimeout (reqHdr->GetTimeout ());
618 
619  WifiActionHeader actionHdr;
622  actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action);
623 
624  Ptr<Packet> packet = Create<Packet> ();
625  packet->AddHeader (respHdr);
626  packet->AddHeader (actionHdr);
627 
628  // We need to notify our MacLow object as it will have to buffer all
629  // correctly received packets for this Block Ack session
630  m_low->CreateBlockAckAgreement (&respHdr, originator,
631  reqHdr->GetStartingSequence ());
632 
633  // It is unclear which queue this frame should go into. For now we
634  // bung it into the queue corresponding to the TID for which we are
635  // establishing an agreement, and push it to the head.
636  m_edca[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr);
637 }
638 
639 TypeId
641 {
642  static TypeId tid = TypeId ("ns3::RegularWifiMac")
643  .SetParent<WifiMac> ()
644  .AddAttribute ("QosSupported",
645  "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA",
646  BooleanValue (false),
647  MakeBooleanAccessor (&RegularWifiMac::SetQosSupported,
649  MakeBooleanChecker ())
650  .AddAttribute ("HtSupported",
651  "This Boolean attribute is set to enable 802.11n support at this STA",
652  BooleanValue (false),
653  MakeBooleanAccessor (&RegularWifiMac::SetHtSupported,
655  MakeBooleanChecker ())
656  .AddAttribute ("CtsToSelfSupported",
657  "Use CTS to Self when using a rate that is not in the basic set rate",
658  BooleanValue (false),
659  MakeBooleanAccessor (&RegularWifiMac::SetCtsToSelfSupported,
661  MakeBooleanChecker ())
662  .AddAttribute ("DcaTxop", "The DcaTxop object",
663  PointerValue (),
664  MakePointerAccessor (&RegularWifiMac::GetDcaTxop),
665  MakePointerChecker<DcaTxop> ())
666  .AddAttribute ("VO_EdcaTxopN",
667  "Queue that manages packets belonging to AC_VO access class",
668  PointerValue (),
669  MakePointerAccessor (&RegularWifiMac::GetVOQueue),
670  MakePointerChecker<EdcaTxopN> ())
671  .AddAttribute ("VI_EdcaTxopN",
672  "Queue that manages packets belonging to AC_VI access class",
673  PointerValue (),
674  MakePointerAccessor (&RegularWifiMac::GetVIQueue),
675  MakePointerChecker<EdcaTxopN> ())
676  .AddAttribute ("BE_EdcaTxopN",
677  "Queue that manages packets belonging to AC_BE access class",
678  PointerValue (),
679  MakePointerAccessor (&RegularWifiMac::GetBEQueue),
680  MakePointerChecker<EdcaTxopN> ())
681  .AddAttribute ("BK_EdcaTxopN",
682  "Queue that manages packets belonging to AC_BK access class",
683  PointerValue (),
684  MakePointerAccessor (&RegularWifiMac::GetBKQueue),
685  MakePointerChecker<EdcaTxopN> ())
686  .AddTraceSource ( "TxOkHeader",
687  "The header of successfully transmitted packet",
689  .AddTraceSource ("TxErrHeader",
690  "The header of unsuccessfully transmitted packet",
692  ;
693 
694  return tid;
695 }
696 
697 void
699 {
700  uint32_t cwmin;
701  uint32_t cwmax;
702 
703  switch (standard)
704  {
712  cwmin = 15;
713  cwmax = 1023;
714  break;
715 
717  cwmin = 31;
718  cwmax = 1023;
719  break;
720 
721  default:
722  NS_FATAL_ERROR ("Unsupported WifiPhyStandard in RegularWifiMac::FinishConfigureStandard ()");
723  }
724 
725  // The special value of AC_BE_NQOS which exists in the Access
726  // Category enumeration allows us to configure plain old DCF.
727  ConfigureDcf (m_dca, cwmin, cwmax, AC_BE_NQOS);
728 
729  // Now we configure the EDCA functions
730  for (EdcaQueues::iterator i = m_edca.begin (); i != m_edca.end (); ++i)
731  {
732  ConfigureDcf (i->second, cwmin, cwmax, i->first);
733  }
734 }
735 
736 void
738 {
739  NS_LOG_FUNCTION (this << hdr);
740  m_txOkCallback (hdr);
741 }
742 
743 void
745 {
746  NS_LOG_FUNCTION (this << hdr);
747  m_txErrCallback (hdr);
748 }
749 
750 } // 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.
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
void SetSifs(Time sifs)
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:345
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
Hold a bool native type.
Definition: boolean.h:38
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
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)
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.
Implement the header for management frames of type add block ack request.
Definition: mgt-headers.h:454
void SetPifs(Time pifs)
virtual void SetCompressedBlockAckTimeout(Time blockAckTimeout)
void SetupLowListener(Ptr< MacLow > low)
Set up listener for MacLow events.
Definition: dcf-manager.cc:306
#define NS_ASSERT(condition)
Definition: assert.h:64
Callback< void > m_linkUp
Callback when a link is up.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
MacTxMiddle * m_txMiddle
TX middle (aggregation etc.)
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
bool GetQosSupported() const
Return whether the device supports QoS.
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...
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:513
Ptr< WifiPhy > m_phy
Wifi PHY.
void SetDelayedBlockAck()
Enable delayed Block ACK.
Definition: mgt-headers.cc:886
void SetRifs(Time rifs)
void SetStatusCode(StatusCode code)
Set the status code.
Definition: mgt-headers.cc:917
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:905
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...
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition: fatal-error.h:72
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
Handles sequence numbering of IEEE 802.11 data frames.
Definition: mac-tx-middle.h:39
virtual Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
void SetTid(uint8_t tid)
Set Traffic ID (TID).
Definition: mgt-headers.cc:898
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:326
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.
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...
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 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:385
void SetImmediateBlockAck()
Enable immediate Block ACK.
Definition: mgt-headers.cc:892
Time GetAckTimeout(void) const
void SetupPhyListener(Ptr< WifiPhy > phy)
Set up listener for Phy events.
Definition: dcf-manager.cc:295
Time GetSlot(void) const
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
Definition: dcf-manager.h:229
enum BlockAckActionValue blockAck
Definition: mgt-headers.h:417
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
Definition: qos-utils.cc:27
virtual void SetAddress(Mac48Address address)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1238
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:750
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
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:774
Ptr< EdcaTxopN > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
OFDM PHY for the 5 GHz band (Clause 17)
hold objects of type Ptr
Definition: pointer.h:33
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
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:911
DcfManager * m_dcfManager
DCF manager (access to channel)
uint8_t GetTid(void) const
Return the Traffic ID (TID).
an EUI-48 address
Definition: mac48-address.h:41
bool IsByOriginator(void) const
Check if the initiator bit in the DELBA is setted.
void SetEifsNoDifs(Time eifsNoDifs)
Definition: dcf-manager.cc:330
void SetCtsTimeout(Time ctsTimeout)
virtual bool SupportsSendFrom(void) const
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Definition: mgt-headers.cc:935
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:35
virtual Ptr< WifiPhy > GetWifiPhy() const
Time GetRifs(void) const
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:756
virtual Mac48Address GetBssid(void) const
void SetSlot(Time slotTime)
Definition: dcf-manager.cc:318
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Definition: mgt-headers.cc:780
Ptr< EdcaTxopN > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
virtual Time GetBasicBlockAckTimeout(void) const
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:582
Implement the header for management frames of type del block ack.
Definition: mgt-headers.h:698
virtual Mac48Address GetAddress(void) const
typedef for union of different ActionValues
Definition: mgt-headers.h:410
Total number of ACs.
Definition: qos-utils.h:47
Time GetEifsNoDifs() const
Definition: dcf-manager.cc:336
virtual void DoInitialize()
This method is called only once by Object::Initialize.
bool GetHtSupported() const
Return whether the device supports QoS.
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:923
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:539
virtual void SetPromisc(void)
Sets the interface in promiscuous mode.
a unique identifier for an interface.
Definition: type-id.h:49
TypeId SetParent(TypeId tid)
Definition: type-id.cc:611
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
NS_LOG_COMPONENT_DEFINE("RegularWifiMac")
void SetSifs(Time sifs)
Definition: dcf-manager.cc:324
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.
uint16_t GetTimeout(void) const
Return the timeout.
Definition: mgt-headers.cc:762
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...