A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ap-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) 2006, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Author: Mirko Banchi <mk.banchi@gmail.com>
21  */
22 #include "ap-wifi-mac.h"
23 
24 #include "ns3/assert.h"
25 #include "ns3/log.h"
26 #include "ns3/simulator.h"
27 #include "ns3/string.h"
28 #include "ns3/pointer.h"
29 #include "ns3/boolean.h"
30 
31 #include "qos-tag.h"
32 #include "wifi-phy.h"
33 #include "dcf-manager.h"
34 #include "mac-rx-middle.h"
35 #include "mac-tx-middle.h"
36 #include "mgt-headers.h"
37 #include "mac-low.h"
38 #include "amsdu-subframe-header.h"
39 #include "msdu-aggregator.h"
40 
41 NS_LOG_COMPONENT_DEFINE ("ApWifiMac");
42 
43 namespace ns3 {
44 
45 NS_OBJECT_ENSURE_REGISTERED (ApWifiMac);
46 
47 TypeId
49 {
50  static TypeId tid = TypeId ("ns3::ApWifiMac")
52  .AddConstructor<ApWifiMac> ()
53  .AddAttribute ("BeaconInterval", "Delay between two beacons",
54  TimeValue (MicroSeconds (102400)),
55  MakeTimeAccessor (&ApWifiMac::GetBeaconInterval,
57  MakeTimeChecker ())
58  .AddAttribute ("BeaconJitter", "A uniform random variable to cause the initial beacon starting time (after simulation time 0) to be distributed between 0 and the BeaconInterval.",
59  StringValue ("ns3::UniformRandomVariable"),
60  MakePointerAccessor (&ApWifiMac::m_beaconJitter),
61  MakePointerChecker<UniformRandomVariable> ())
62  .AddAttribute ("EnableBeaconJitter", "If beacons are enabled, whether to jitter the initial send event.",
63  BooleanValue (false),
64  MakeBooleanAccessor (&ApWifiMac::m_enableBeaconJitter),
65  MakeBooleanChecker ())
66  .AddAttribute ("BeaconGeneration", "Whether or not beacons are generated.",
67  BooleanValue (true),
68  MakeBooleanAccessor (&ApWifiMac::SetBeaconGeneration,
70  MakeBooleanChecker ())
71  ;
72  return tid;
73 }
74 
76 {
77  NS_LOG_FUNCTION (this);
78  m_beaconDca = CreateObject<DcaTxop> ();
79  m_beaconDca->SetAifsn (1);
80  m_beaconDca->SetMinCw (0);
81  m_beaconDca->SetMaxCw (0);
82  m_beaconDca->SetLow (m_low);
83  m_beaconDca->SetManager (m_dcfManager);
84 
85  // Let the lower layers know that we are acting as an AP.
87 
89 }
90 
92 {
93  NS_LOG_FUNCTION (this);
94 }
95 
96 void
98 {
99  NS_LOG_FUNCTION (this);
100  m_beaconDca = 0;
101  m_enableBeaconGeneration = false;
104 }
105 
106 void
108 {
109  NS_LOG_FUNCTION (this << address);
110  // As an AP, our MAC address is also the BSSID. Hence we are
111  // overriding this function and setting both in our parent class.
112  RegularWifiMac::SetAddress (address);
113  RegularWifiMac::SetBssid (address);
114 }
115 
116 void
118 {
119  NS_LOG_FUNCTION (this << enable);
120  if (!enable)
121  {
123  }
124  else if (enable && !m_enableBeaconGeneration)
125  {
127  }
128  m_enableBeaconGeneration = enable;
129 }
130 
131 bool
133 {
134  NS_LOG_FUNCTION (this);
136 }
137 
138 Time
140 {
141  NS_LOG_FUNCTION (this);
142  return m_beaconInterval;
143 }
144 
145 void
147 {
148  NS_LOG_FUNCTION (this << stationManager);
149  m_beaconDca->SetWifiRemoteStationManager (stationManager);
151 }
152 
153 void
155 {
156  NS_LOG_FUNCTION (this << &linkUp);
158 
159  // The approach taken here is that, from the point of view of an AP,
160  // the link is always up, so we immediately invoke the callback if
161  // one is set
162  linkUp ();
163 }
164 
165 void
167 {
168  NS_LOG_FUNCTION (this << interval);
169  if ((interval.GetMicroSeconds () % 1024) != 0)
170  {
171  NS_LOG_WARN ("beacon interval should be multiple of 1024us, see IEEE Std. 802.11-2007, section 11.1.1.1");
172  }
173  m_beaconInterval = interval;
174 }
175 
176 void
178 {
179  NS_LOG_FUNCTION (this);
180  SendOneBeacon ();
181 }
182 
183 int64_t
184 ApWifiMac::AssignStreams (int64_t stream)
185 {
186  NS_LOG_FUNCTION (this << stream);
187  m_beaconJitter->SetStream (stream);
188  return 1;
189 }
190 
191 void
193  Mac48Address to)
194 {
195  NS_LOG_FUNCTION (this << packet << from << to);
196  // If we are not a QoS AP then we definitely want to use AC_BE to
197  // transmit the packet. A TID of zero will map to AC_BE (through \c
198  // QosUtilsMapTidToAc()), so we use that as our default here.
199  uint8_t tid = 0;
200 
201  // If we are a QoS AP then we attempt to get a TID for this packet
202  if (m_qosSupported)
203  {
204  tid = QosUtilsGetTidForPacket (packet);
205  // Any value greater than 7 is invalid and likely indicates that
206  // the packet had no QoS tag, so we revert to zero, which'll
207  // mean that AC_BE is used.
208  if (tid >= 7)
209  {
210  tid = 0;
211  }
212  }
213 
214  ForwardDown (packet, from, to, tid);
215 }
216 
217 void
219  Mac48Address to, uint8_t tid)
220 {
221  NS_LOG_FUNCTION (this << packet << from << to << static_cast<uint32_t> (tid));
222  WifiMacHeader hdr;
223 
224  // For now, an AP that supports QoS does not support non-QoS
225  // associations, and vice versa. In future the AP model should
226  // support simultaneously associated QoS and non-QoS STAs, at which
227  // point there will need to be per-association QoS state maintained
228  // by the association state machine, and consulted here.
229  if (m_qosSupported)
230  {
233  hdr.SetQosNoEosp ();
234  hdr.SetQosNoAmsdu ();
235  // Transmission of multiple frames in the same TXOP is not
236  // supported for now
237  hdr.SetQosTxopLimit (0);
238  // Fill in the QoS control field in the MAC header
239  hdr.SetQosTid (tid);
240  }
241  else
242  {
243  hdr.SetTypeData ();
244  }
245 
246  if (m_htSupported)
247  hdr.SetNoOrder();
248  hdr.SetAddr1 (to);
249  hdr.SetAddr2 (GetAddress ());
250  hdr.SetAddr3 (from);
251  hdr.SetDsFrom ();
252  hdr.SetDsNotTo ();
253 
254  if (m_qosSupported)
255  {
256  // Sanity check that the TID is valid
257  NS_ASSERT (tid < 8);
258  m_edca[QosUtilsMapTidToAc (tid)]->Queue (packet, hdr);
259  }
260  else
261  {
262  m_dca->Queue (packet, hdr);
263  }
264 }
265 
266 void
268 {
269  NS_LOG_FUNCTION (this << packet << to << from);
270  if (to.IsBroadcast () || m_stationManager->IsAssociated (to))
271  {
272  ForwardDown (packet, from, to);
273  }
274 }
275 
276 void
278 {
279  NS_LOG_FUNCTION (this << packet << to);
280  // We're sending this packet with a from address that is our own. We
281  // get that address from the lower MAC and make use of the
282  // from-spoofing Enqueue() method to avoid duplicated code.
283  Enqueue (packet, to, m_low->GetAddress ());
284 }
285 
286 bool
288 {
289  NS_LOG_FUNCTION (this);
290  return true;
291 }
292 
295 {
296  NS_LOG_FUNCTION (this);
297  SupportedRates rates;
298  // If it is an HT-AP then add the BSSMembershipSelectorSet
299  // which only includes 127 for HT now. The standard says that the BSSMembershipSelectorSet
300  // must have its MSB set to 1 (must be treated as a Basic Rate)
301  // Also the standard mentioned that at leat 1 element should be included in the SupportedRates the rest can be in the ExtendedSupportedRates
302  if (m_htSupported)
303  {
304  for (uint32_t i = 0; i < m_phy->GetNBssMembershipSelectors(); i++)
305  {
307  }
308  }
309  // send the set of supported rates and make sure that we indicate
310  // the Basic Rate set in this set of supported rates.
311  for (uint32_t i = 0; i < m_phy->GetNModes (); i++)
312  {
313  WifiMode mode = m_phy->GetMode (i);
314  rates.AddSupportedRate (mode.GetDataRate ());
315  }
316  // set the basic rates
317  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
318  {
319  WifiMode mode = m_stationManager->GetBasicMode (j);
320  rates.SetBasicRate (mode.GetDataRate ());
321  }
322 
323  return rates;
324 }
327 {
328  HtCapabilities capabilities;
329  capabilities.SetHtSupported(1);
330  capabilities.SetLdpc (m_phy->GetLdpc());
332  capabilities.SetGreenfield (m_phy->GetGreenfield());
333  for (uint8_t i =0 ; i < m_phy->GetNMcs();i++)
334  {
335  capabilities.SetRxMcsBitmask(m_phy->GetMcs(i));
336  }
337  return capabilities;
338 }
339 void
341 {
342  NS_LOG_FUNCTION (this << to);
343  WifiMacHeader hdr;
344  hdr.SetProbeResp ();
345  hdr.SetAddr1 (to);
346  hdr.SetAddr2 (GetAddress ());
347  hdr.SetAddr3 (GetAddress ());
348  hdr.SetDsNotFrom ();
349  hdr.SetDsNotTo ();
350  Ptr<Packet> packet = Create<Packet> ();
352  probe.SetSsid (GetSsid ());
353  probe.SetSupportedRates (GetSupportedRates ());
354  probe.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
355 if (m_htSupported)
356  {
357  probe.SetHtCapabilities (GetHtCapabilities());
358  hdr.SetNoOrder();
359  }
360  packet->AddHeader (probe);
361 
362  // The standard is not clear on the correct queue for management
363  // frames if we are a QoS AP. The approach taken here is to always
364  // use the DCF for these regardless of whether we have a QoS
365  // association or not.
366  m_dca->Queue (packet, hdr);
367 }
368 
369 void
371 {
372  NS_LOG_FUNCTION (this << to << success);
373  WifiMacHeader hdr;
374  hdr.SetAssocResp ();
375  hdr.SetAddr1 (to);
376  hdr.SetAddr2 (GetAddress ());
377  hdr.SetAddr3 (GetAddress ());
378  hdr.SetDsNotFrom ();
379  hdr.SetDsNotTo ();
380  Ptr<Packet> packet = Create<Packet> ();
382  StatusCode code;
383  if (success)
384  {
385  code.SetSuccess ();
386  }
387  else
388  {
389  code.SetFailure ();
390  }
391  assoc.SetSupportedRates (GetSupportedRates ());
392  assoc.SetStatusCode (code);
393 
394  if (m_htSupported)
395  {
396  assoc.SetHtCapabilities (GetHtCapabilities());
397  hdr.SetNoOrder();
398  }
399  packet->AddHeader (assoc);
400 
401  // The standard is not clear on the correct queue for management
402  // frames if we are a QoS AP. The approach taken here is to always
403  // use the DCF for these regardless of whether we have a QoS
404  // association or not.
405  m_dca->Queue (packet, hdr);
406 }
407 
408 void
410 {
411  NS_LOG_FUNCTION (this);
412  WifiMacHeader hdr;
413  hdr.SetBeacon ();
415  hdr.SetAddr2 (GetAddress ());
416  hdr.SetAddr3 (GetAddress ());
417  hdr.SetDsNotFrom ();
418  hdr.SetDsNotTo ();
419  Ptr<Packet> packet = Create<Packet> ();
420  MgtBeaconHeader beacon;
421  beacon.SetSsid (GetSsid ());
422  beacon.SetSupportedRates (GetSupportedRates ());
423  beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
424  if (m_htSupported)
425  {
426  beacon.SetHtCapabilities (GetHtCapabilities());
427  hdr.SetNoOrder();
428  }
429  packet->AddHeader (beacon);
430 
431  // The beacon has it's own special queue, so we load it in there
432  m_beaconDca->Queue (packet, hdr);
434 }
435 
436 void
438 {
439  NS_LOG_FUNCTION (this);
440  RegularWifiMac::TxOk (hdr);
441 
442  if (hdr.IsAssocResp ()
443  && m_stationManager->IsWaitAssocTxOk (hdr.GetAddr1 ()))
444  {
445  NS_LOG_DEBUG ("associated with sta=" << hdr.GetAddr1 ());
446  m_stationManager->RecordGotAssocTxOk (hdr.GetAddr1 ());
447  }
448 }
449 
450 void
452 {
453  NS_LOG_FUNCTION (this);
455 
456  if (hdr.IsAssocResp ()
457  && m_stationManager->IsWaitAssocTxOk (hdr.GetAddr1 ()))
458  {
459  NS_LOG_DEBUG ("assoc failed with sta=" << hdr.GetAddr1 ());
460  m_stationManager->RecordGotAssocTxFailed (hdr.GetAddr1 ());
461  }
462 }
463 
464 void
466 {
467  NS_LOG_FUNCTION (this << packet << hdr);
468 
469  Mac48Address from = hdr->GetAddr2 ();
470 
471  if (hdr->IsData ())
472  {
473  Mac48Address bssid = hdr->GetAddr1 ();
474  if (!hdr->IsFromDs ()
475  && hdr->IsToDs ()
476  && bssid == GetAddress ()
477  && m_stationManager->IsAssociated (from))
478  {
479  Mac48Address to = hdr->GetAddr3 ();
480  if (to == GetAddress ())
481  {
482  NS_LOG_DEBUG ("frame for me from=" << from);
483  if (hdr->IsQosData ())
484  {
485  if (hdr->IsQosAmsdu ())
486  {
487  NS_LOG_DEBUG ("Received A-MSDU from=" << from << ", size=" << packet->GetSize ());
488  DeaggregateAmsduAndForward (packet, hdr);
489  packet = 0;
490  }
491  else
492  {
493  ForwardUp (packet, from, bssid);
494  }
495  }
496  else
497  {
498  ForwardUp (packet, from, bssid);
499  }
500  }
501  else if (to.IsGroup ()
502  || m_stationManager->IsAssociated (to))
503  {
504  NS_LOG_DEBUG ("forwarding frame from=" << from << ", to=" << to);
505  Ptr<Packet> copy = packet->Copy ();
506 
507  // If the frame we are forwarding is of type QoS Data,
508  // then we need to preserve the UP in the QoS control
509  // header...
510  if (hdr->IsQosData ())
511  {
512  ForwardDown (packet, from, to, hdr->GetQosTid ());
513  }
514  else
515  {
516  ForwardDown (packet, from, to);
517  }
518  ForwardUp (copy, from, to);
519  }
520  else
521  {
522  ForwardUp (packet, from, to);
523  }
524  }
525  else if (hdr->IsFromDs ()
526  && hdr->IsToDs ())
527  {
528  // this is an AP-to-AP frame
529  // we ignore for now.
530  NotifyRxDrop (packet);
531  }
532  else
533  {
534  // we can ignore these frames since
535  // they are not targeted at the AP
536  NotifyRxDrop (packet);
537  }
538  return;
539  }
540  else if (hdr->IsMgt ())
541  {
542  if (hdr->IsProbeReq ())
543  {
544  NS_ASSERT (hdr->GetAddr1 ().IsBroadcast ());
545  SendProbeResp (from);
546  return;
547  }
548  else if (hdr->GetAddr1 () == GetAddress ())
549  {
550  if (hdr->IsAssocReq ())
551  {
552  // first, verify that the the station's supported
553  // rate set is compatible with our Basic Rate set
554  MgtAssocRequestHeader assocReq;
555  packet->RemoveHeader (assocReq);
556  SupportedRates rates = assocReq.GetSupportedRates ();
557  bool problem = false;
558  for (uint32_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
559  {
560  WifiMode mode = m_stationManager->GetBasicMode (i);
561  if (!rates.IsSupportedRate (mode.GetDataRate ()))
562  {
563  problem = true;
564  break;
565  }
566  }
567  if (m_htSupported)
568  {//check that the STA supports all MCSs in Basic MCS Set
569  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
570  for (uint32_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
571  {
572  uint8_t mcs = m_stationManager->GetBasicMcs (i);
573  if (!htcapabilities.IsSupportedMcs (mcs))
574  {
575  problem = true;
576  break;
577  }
578  }
579 
580  }
581  if (problem)
582  {
583  // one of the Basic Rate set mode is not
584  // supported by the station. So, we return an assoc
585  // response with an error status.
586  SendAssocResp (hdr->GetAddr2 (), false);
587  }
588  else
589  {
590  // station supports all rates in Basic Rate Set.
591  // record all its supported modes in its associated WifiRemoteStation
592  for (uint32_t j = 0; j < m_phy->GetNModes (); j++)
593  {
594  WifiMode mode = m_phy->GetMode (j);
595  if (rates.IsSupportedRate (mode.GetDataRate ()))
596  {
597  m_stationManager->AddSupportedMode (from, mode);
598  }
599  }
600  if (m_htSupported)
601  {
602  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
603  m_stationManager->AddStationHtCapabilities (from,htcapabilities);
604  for (uint32_t j = 0; j < m_phy->GetNMcs (); j++)
605  {
606  uint8_t mcs = m_phy->GetMcs (j);
607  if (htcapabilities.IsSupportedMcs (mcs))
608  {
609  m_stationManager->AddSupportedMcs (from, mcs);
610  }
611  }
612  }
613  m_stationManager->RecordWaitAssocTxOk (from);
614  // send assoc response with success status.
615  SendAssocResp (hdr->GetAddr2 (), true);
616  }
617  return;
618  }
619  else if (hdr->IsDisassociation ())
620  {
621  m_stationManager->RecordDisassociated (from);
622  return;
623  }
624  }
625  }
626 
627  // Invoke the receive handler of our parent class to deal with any
628  // other frames. Specifically, this will handle Block Ack-related
629  // Management Action frames.
630  RegularWifiMac::Receive (packet, hdr);
631 }
632 
633 void
635  const WifiMacHeader *hdr)
636 {
637  NS_LOG_FUNCTION (this << aggregatedPacket << hdr);
639  MsduAggregator::Deaggregate (aggregatedPacket);
640 
641  for (MsduAggregator::DeaggregatedMsdusCI i = packets.begin ();
642  i != packets.end (); ++i)
643  {
644  if ((*i).second.GetDestinationAddr () == GetAddress ())
645  {
646  ForwardUp ((*i).first, (*i).second.GetSourceAddr (),
647  (*i).second.GetDestinationAddr ());
648  }
649  else
650  {
651  Mac48Address from = (*i).second.GetSourceAddr ();
652  Mac48Address to = (*i).second.GetDestinationAddr ();
653  NS_LOG_DEBUG ("forwarding QoS frame from=" << from << ", to=" << to);
654  ForwardDown ((*i).first, from, to, hdr->GetQosTid ());
655  }
656  }
657 }
658 
659 void
661 {
662  NS_LOG_FUNCTION (this);
663  m_beaconDca->Initialize ();
666  {
668  {
669  int64_t jitter = m_beaconJitter->GetValue (0, m_beaconInterval.GetMicroSeconds ());
670  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress() << " at time " << jitter << " microseconds");
671  m_beaconEvent = Simulator::Schedule (MicroSeconds (jitter), &ApWifiMac::SendOneBeacon, this);
672  }
673  else
674  {
675  NS_LOG_DEBUG ("Scheduling initial beacon for access point " << GetAddress() << " at time 0");
677  }
678  }
680 }
681 
682 } // namespace ns3
virtual void DoInitialize(void)
Definition: ap-wifi-mac.cc:660
uint32_t RemoveHeader(Header &header)
Definition: packet.cc:268
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:166
void AddSupportedRate(uint32_t bs)
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:311
HtCapabilities GetHtCapabilities(void) const
Definition: ap-wifi-mac.cc:326
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
Hold a bool native type.
Definition: boolean.h:38
void SetGreenfield(uint8_t greenfield)
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
hold variables of type string
Definition: string.h:19
void SetHtSupported(uint8_t htsupported)
int64_t AssignStreams(int64_t stream)
Definition: ap-wifi-mac.cc:184
virtual uint32_t GetNModes(void) const =0
void SetRxMcsBitmask(uint8_t index)
Mac48Address GetAddr3(void) const
virtual uint8_t GetNMcs(void) const =0
#define NS_ASSERT(condition)
Definition: assert.h:64
The Ht Capabilities Information ElementThis class knows how to serialise and deserialise the Ht Capab...
bool IsAssocReq(void) const
uint32_t GetSize(void) const
Definition: packet.h:650
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
bool IsBroadcast(void) const
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
void NotifyRxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:268
virtual bool GetLdpc(void) const =0
virtual uint8_t GetMcs(uint8_t mcs) const =0
void SendAssocResp(Mac48Address to, bool success)
Definition: ap-wifi-mac.cc:370
virtual bool SupportsSendFrom(void) const
Definition: ap-wifi-mac.cc:287
bool IsAssocResp(void) const
Ptr< WifiPhy > m_phy
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Definition: simulator.h:824
Ptr< DcaTxop > m_beaconDca
Definition: ap-wifi-mac.h:138
virtual Ssid GetSsid(void) const
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:91
bool IsQosAmsdu(void) const
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
Definition: qos-utils.cc:60
void SetQosAckPolicy(enum QosAckPolicy)
bool m_enableBeaconGeneration
Definition: ap-wifi-mac.h:140
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition: ap-wifi-mac.cc:277
SupportedRates GetSupportedRates(void) const
Definition: mgt-headers.cc:299
virtual void SetBssid(Mac48Address bssid)
uint8_t GetQosTid(void) const
void ForwardUp(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
virtual void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: ap-wifi-mac.cc:146
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
void SetSuccess(void)
Definition: status-code.cc:31
void SetAddr1(Mac48Address address)
void SetTypeOfStation(TypeOfStation type)
int64_t GetMicroSeconds(void) const
Definition: nstime.h:283
void SetShortGuardInterval20(uint8_t shortguardinterval)
hold objects of type ns3::Time
Definition: nstime.h:828
Ptr< DcaTxop > m_dca
void SetAddr3(Mac48Address address)
static TypeId GetTypeId(void)
Definition: ap-wifi-mac.cc:48
bool IsProbeReq(void) const
void ForwardDown(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Definition: ap-wifi-mac.cc:192
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Definition: qos-utils.cc:27
virtual void SetAddress(Mac48Address address)
static Mac48Address GetBroadcast(void)
bool IsSupportedMcs(uint8_t mcs)
EventId m_beaconEvent
Definition: ap-wifi-mac.h:141
virtual bool GetGuardInterval(void) const =0
bool IsMgt(void) const
virtual uint32_t GetNBssMembershipSelectors(void) const =0
void SetBasicRate(uint32_t bs)
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
Definition: ap-wifi-mac.cc:465
virtual void DeaggregateAmsduAndForward(Ptr< Packet > aggregatedPacket, const WifiMacHeader *hdr)
Definition: ap-wifi-mac.cc:634
void SetQosTid(uint8_t tid)
Ptr< Packet > Copy(void) const
Definition: packet.cc:122
virtual void SetLinkUpCallback(Callback< void > linkUp)
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: ap-wifi-mac.cc:154
virtual void DoDispose()
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
bool IsToDs(void) const
bool IsDisassociation(void) const
bool IsGroup(void) const
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const =0
void SetAddr2(Mac48Address address)
DcfManager * m_dcfManager
double GetValue(double min, double max)
Returns a random double from the uniform distribution with the specified range.
an EUI-48 address
Definition: mac48-address.h:41
virtual WifiMode GetMode(uint32_t mode) const =0
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Definition: simulator.h:985
bool GetBeaconGeneration(void) const
Definition: ap-wifi-mac.cc:132
void SendProbeResp(Mac48Address to)
Definition: ap-wifi-mac.cc:340
SupportedRates GetSupportedRates(void) const
Definition: ap-wifi-mac.cc:294
void SetQosTxopLimit(uint8_t txop)
virtual void TxFailed(const WifiMacHeader &hdr)
Definition: ap-wifi-mac.cc:451
bool IsData(void) const
void SendOneBeacon(void)
Definition: ap-wifi-mac.cc:409
bool IsQosData(void) const
#define NS_LOG_WARN(msg)
Definition: log.h:246
virtual void DoDispose(void)
Definition: ap-wifi-mac.cc:97
virtual void SetAddress(Mac48Address address)
Definition: ap-wifi-mac.cc:107
#define NS_LOG_DEBUG(msg)
Definition: log.h:255
virtual Mac48Address GetAddress(void) const
Ptr< UniformRandomVariable > m_beaconJitter
Definition: ap-wifi-mac.h:142
Time m_beaconInterval
Definition: ap-wifi-mac.h:139
virtual void DoInitialize()
void Cancel(void)
Definition: event-id.cc:47
virtual ~ApWifiMac()
Definition: ap-wifi-mac.cc:91
void SetLdpc(uint8_t ldpc)
bool IsFromDs(void) const
bool IsSupportedRate(uint32_t bs) const
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range. Both limits are inclusive.
Definition: time.cc:404
void SetType(enum WifiMacType type)
bool m_enableBeaconJitter
Definition: ap-wifi-mac.h:143
Time GetBeaconInterval(void) const
Definition: ap-wifi-mac.cc:139
NS_LOG_COMPONENT_DEFINE("ApWifiMac")
Mac48Address GetAddr1(void) const
virtual void TxOk(const WifiMacHeader &hdr)
tuple address
Definition: first.py:37
virtual void TxOk(const WifiMacHeader &hdr)
Definition: ap-wifi-mac.cc:437
Ptr< WifiRemoteStationManager > m_stationManager
void SetFailure(void)
Definition: status-code.cc:36
HtCapabilities GetHtCapabilities(void) const
Definition: mgt-headers.cc:289
a unique identifier for an interface.
Definition: type-id.h:49
uint64_t GetDataRate(void) const
Definition: wifi-mode.cc:57
TypeId SetParent(TypeId tid)
Definition: type-id.cc:610
void StartBeaconing(void)
Definition: ap-wifi-mac.cc:177
virtual bool GetGreenfield(void) const =0
void AddHeader(const Header &header)
Definition: packet.cc:253
Mac48Address GetAddr2(void) const
void SetBeaconGeneration(bool enable)
Definition: ap-wifi-mac.cc:117
virtual void TxFailed(const WifiMacHeader &hdr)