A Discrete-Event Network Simulator
API
qos-frame-exchange-manager.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
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: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/abort.h"
24 #include "wifi-mac-queue.h"
25 #include "wifi-mac-trailer.h"
26 #include "ap-wifi-mac.h"
27 
28 #undef NS_LOG_APPEND_CONTEXT
29 #define NS_LOG_APPEND_CONTEXT std::clog << "[mac=" << m_self << "] "
30 
31 namespace ns3 {
32 
33 NS_LOG_COMPONENT_DEFINE ("QosFrameExchangeManager");
34 
35 NS_OBJECT_ENSURE_REGISTERED (QosFrameExchangeManager);
36 
37 TypeId
39 {
40  static TypeId tid = TypeId ("ns3::QosFrameExchangeManager")
42  .AddConstructor<QosFrameExchangeManager> ()
43  .SetGroupName ("Wifi")
44  .AddAttribute ("PifsRecovery",
45  "Perform a PIFS recovery as a response to transmission failure "
46  "within a TXOP",
47  BooleanValue (true),
50  .AddAttribute ("SetQueueSize",
51  "Whether to set the Queue Size subfield of the QoS Control field "
52  "of QoS data frames sent by non-AP stations",
53  BooleanValue (false),
56  ;
57  return tid;
58 }
59 
61  : m_initialFrame (false)
62 {
63  NS_LOG_FUNCTION (this);
64 }
65 
67 {
69 }
70 
71 void
73 {
74  NS_LOG_FUNCTION (this);
75  m_edca = 0;
76  m_edcaBackingOff = 0;
79 }
80 
81 bool
83 {
84  NS_LOG_FUNCTION (this);
85  NS_ASSERT (m_edca != 0);
87 
88  WifiMacHeader cfEnd;
89  cfEnd.SetType (WIFI_MAC_CTL_END);
90  cfEnd.SetDsNotFrom ();
91  cfEnd.SetDsNotTo ();
92  cfEnd.SetNoRetry ();
93  cfEnd.SetNoMoreFragments ();
94  cfEnd.SetDuration (Seconds (0));
96  cfEnd.SetAddr2 (m_self);
97 
98  WifiTxVector cfEndTxVector = m_mac->GetWifiRemoteStationManager ()->GetRtsTxVector (cfEnd.GetAddr1 ());
99 
100  Time txDuration = m_phy->CalculateTxDuration (cfEnd.GetSize () + WIFI_MAC_FCS_LENGTH,
101  cfEndTxVector, m_phy->GetPhyBand ());
102 
103  // Send the CF-End frame if the remaining duration is long enough to transmit this frame
104  if (m_edca->GetRemainingTxop () > txDuration)
105  {
106  NS_LOG_DEBUG ("Send CF-End frame");
107  m_phy->Send (Create<WifiPsdu> (Create<Packet> (), cfEnd), cfEndTxVector);
109  return true;
110  }
111 
113  m_edca = 0;
114  return false;
115 }
116 
117 void
119 {
120  NS_LOG_FUNCTION (this);
121  NS_ASSERT (m_edca != 0);
123 
124  // Release the channel if it has not been idle for the last PIFS interval
125  if (m_channelAccessManager->GetAccessGrantStart () - m_phy->GetSifs ()
126  > Simulator::Now () - m_phy->GetPifs ())
127  {
129  m_edca = 0;
130  }
131  else
132  {
133  // the txopDuration parameter is unused because we are not starting a new TXOP
135  }
136 }
137 
138 void
140 {
141  NS_LOG_FUNCTION (this);
143  NS_ASSERT (m_edca != 0);
144 
145  NS_LOG_DEBUG ("Cancel PIFS recovery being attempted by EDCAF " << m_edca);
148 }
149 
150 bool
152 {
153  NS_LOG_FUNCTION (this << edca);
154 
156  {
157  // Another AC (having AIFS=1 or lower, if the user changed the default settings)
158  // gained channel access while performing PIFS recovery. Abort PIFS recovery
160  }
161 
162  // TODO This will become an assert once no Txop is installed on a QoS station
163  if (!edca->IsQosTxop ())
164  {
165  m_edca = 0;
167  }
168 
169  Ptr<QosTxop> qosTxop = StaticCast<QosTxop> (edca);
170  return StartTransmission (qosTxop, qosTxop->GetTxopLimit ());
171 }
172 
173 bool
175 {
176  NS_LOG_FUNCTION (this << edca << txopDuration);
177 
179  {
180  // Another AC (having AIFS=1 or lower, if the user changed the default settings)
181  // gained channel access while performing PIFS recovery. Abort PIFS recovery
183  }
184 
185  if (m_txTimer.IsRunning ())
186  {
187  m_txTimer.Cancel ();
188  }
189  m_dcf = edca;
190  m_edca = edca;
191 
192  // We check if this EDCAF invoked the backoff procedure (without terminating
193  // the TXOP) because the transmission of a non-initial frame of a TXOP failed
194  bool backingOff = (m_edcaBackingOff == m_edca);
195 
196  if (backingOff)
197  {
202 
203  // clear the member variable
204  m_edcaBackingOff = 0;
205  }
206 
208  {
209  // TXOP limit is not null. We have to check if this EDCAF is starting a
210  // new TXOP. This includes the case when the transmission of a non-initial
211  // frame of a TXOP failed and backoff was invoked without terminating the
212  // TXOP. In such a case, we assume that a new TXOP is being started if it
213  // elapsed more than TXOPlimit since the start of the paused TXOP. Note
214  // that GetRemainingTxop returns 0 iff Now - TXOPstart >= TXOPlimit
215  if (!m_edca->IsTxopStarted ()
216  || (backingOff && m_edca->GetRemainingTxop ().IsZero ()))
217  {
218  // starting a new TXOP
219  m_edca->NotifyChannelAccessed (txopDuration);
220 
221  if (StartFrameExchange (m_edca, txopDuration, true))
222  {
223  m_initialFrame = true;
224  return true;
225  }
226 
227  // TXOP not even started, return false
228  NS_LOG_DEBUG ("No frame transmitted");
230  m_edca = 0;
231  return false;
232  }
233 
234  // We are continuing a TXOP, check if we can transmit another frame
236 
238  {
239  NS_LOG_DEBUG ("Not enough remaining TXOP time");
240  return SendCfEndIfNeeded ();
241  }
242 
243  return true;
244  }
245 
246  // we get here if TXOP limit is null
247  m_initialFrame = true;
248 
249  if (StartFrameExchange (m_edca, Time::Min (), true))
250  {
252  return true;
253  }
254 
255  NS_LOG_DEBUG ("No frame transmitted");
257  m_edca = 0;
258  return false;
259 }
260 
261 bool
262 QosFrameExchangeManager::StartFrameExchange (Ptr<QosTxop> edca, Time availableTime, bool initialFrame)
263 {
264  NS_LOG_FUNCTION (this << edca << availableTime << initialFrame);
265 
267 
268  // Even though channel access is requested when the queue is not empty, at
269  // the time channel access is granted the lifetime of the packet might be
270  // expired and the queue might be empty.
271  if (mpdu == 0)
272  {
273  NS_LOG_DEBUG ("Queue empty");
274  return false;
275  }
276 
277  WifiTxParameters txParams;
278  txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader ());
279 
281  Ptr<WifiMacQueueItem> item = edca->GetNextMpdu (mpdu, txParams, availableTime, initialFrame, queueIt);
282 
283  if (item == nullptr)
284  {
285  NS_LOG_DEBUG ("Not enough time to transmit a frame");
286  return false;
287  }
288 
289  NS_ASSERT_MSG (!item->GetHeader ().IsQosData () || !item->GetHeader ().IsQosAmsdu (),
290  "We should not get an A-MSDU here");
291 
292  // check if the MSDU needs to be fragmented
293  item = GetFirstFragmentIfNeeded (item);
294 
295  // update the protection method if the frame was fragmented
296  if (item->IsFragment () && item->GetSize () != mpdu->GetSize ())
297  {
298  WifiTxParameters fragmentTxParams;
299  fragmentTxParams.m_txVector = txParams.m_txVector;
300  txParams.m_protection = GetProtectionManager ()->TryAddMpdu (item, fragmentTxParams);
301  NS_ASSERT (txParams.m_protection != nullptr);
302  }
303 
304  SendMpduWithProtection (item, txParams);
305 
306  return true;
307 }
308 
309 bool
311  Time availableTime) const
312 {
313  NS_ASSERT (mpdu != 0);
314  NS_LOG_FUNCTION (this << *mpdu << &txParams << availableTime);
315 
316  // check if adding the given MPDU requires a different protection method
317  Time protectionTime = Time::Min (); // uninitialized
318  if (txParams.m_protection)
319  {
320  protectionTime = txParams.m_protection->protectionTime;
321  }
322 
323  std::unique_ptr<WifiProtection> protection;
324  protection = GetProtectionManager ()->TryAddMpdu (mpdu, txParams);
325  bool protectionSwapped = false;
326 
327  if (protection)
328  {
329  // the protection method has changed, calculate the new protection time
330  CalculateProtectionTime (protection.get ());
331  protectionTime = protection->protectionTime;
332  // swap unique pointers, so that the txParams that is passed to the next
333  // call to IsWithinLimitsIfAddMpdu is the most updated one
334  txParams.m_protection.swap (protection);
335  protectionSwapped = true;
336  }
337  NS_ASSERT (protectionTime != Time::Min ());
338  NS_LOG_DEBUG ("protection time=" << protectionTime);
339 
340  // check if adding the given MPDU requires a different acknowledgment method
341  Time acknowledgmentTime = Time::Min (); // uninitialized
342  if (txParams.m_acknowledgment)
343  {
344  acknowledgmentTime = txParams.m_acknowledgment->acknowledgmentTime;
345  }
346 
347  std::unique_ptr<WifiAcknowledgment> acknowledgment;
348  acknowledgment = GetAckManager ()->TryAddMpdu (mpdu, txParams);
349  bool acknowledgmentSwapped = false;
350 
351  if (acknowledgment)
352  {
353  // the acknowledgment method has changed, calculate the new acknowledgment time
354  CalculateAcknowledgmentTime (acknowledgment.get ());
355  acknowledgmentTime = acknowledgment->acknowledgmentTime;
356  // swap unique pointers, so that the txParams that is passed to the next
357  // call to IsWithinLimitsIfAddMpdu is the most updated one
358  txParams.m_acknowledgment.swap (acknowledgment);
359  acknowledgmentSwapped = true;
360  }
361  NS_ASSERT (acknowledgmentTime != Time::Min ());
362  NS_LOG_DEBUG ("acknowledgment time=" << acknowledgmentTime);
363 
364  Time ppduDurationLimit = Time::Min ();
365  if (availableTime != Time::Min ())
366  {
367  ppduDurationLimit = availableTime - protectionTime - acknowledgmentTime;
368  }
369 
370  if (!IsWithinLimitsIfAddMpdu (mpdu, txParams, ppduDurationLimit))
371  {
372  // adding MPDU failed, restore protection and acknowledgment methods
373  // if they were swapped
374  if (protectionSwapped)
375  {
376  txParams.m_protection.swap (protection);
377  }
378  if (acknowledgmentSwapped)
379  {
380  txParams.m_acknowledgment.swap (acknowledgment);
381  }
382  return false;
383  }
384 
385  // the given MPDU can be added, hence update the txParams
386  txParams.AddMpdu (mpdu);
387  UpdateTxDuration (mpdu->GetHeader ().GetAddr1 (), txParams);
388 
389  return true;
390 }
391 
392 bool
394  const WifiTxParameters& txParams,
395  Time ppduDurationLimit) const
396 {
397  NS_ASSERT (mpdu != 0);
398  NS_LOG_FUNCTION (this << *mpdu << &txParams << ppduDurationLimit);
399 
400  // A QoS station only has to check that the MPDU transmission time does not
401  // exceed the given limit
402  return IsWithinSizeAndTimeLimits (mpdu->GetSize (), mpdu->GetHeader ().GetAddr1 (),
403  txParams, ppduDurationLimit);
404 }
405 
406 bool
408  const WifiTxParameters& txParams,
409  Time ppduDurationLimit) const
410 {
411  NS_LOG_FUNCTION (this << ppduPayloadSize << receiver << &txParams << ppduDurationLimit);
412 
413  if (ppduDurationLimit != Time::Min () && ppduDurationLimit.IsNegative ())
414  {
415  NS_LOG_DEBUG ("ppduDurationLimit is null or negative, time limit is trivially exceeded");
416  return false;
417  }
418 
419  if (ppduPayloadSize > WifiPhy::GetMaxPsduSize (txParams.m_txVector.GetModulationClass ()))
420  {
421  NS_LOG_DEBUG ("the frame exceeds the max PSDU size");
422  return false;
423  }
424 
425  // Get the maximum PPDU Duration based on the preamble type
426  Time maxPpduDuration = GetPpduMaxTime (txParams.m_txVector.GetPreambleType ());
427 
428  Time txTime = GetTxDuration (ppduPayloadSize, receiver, txParams);
429  NS_LOG_DEBUG ("PPDU duration: " << txTime.As (Time::MS));
430 
431  if ((ppduDurationLimit.IsStrictlyPositive () && txTime > ppduDurationLimit)
432  || (maxPpduDuration.IsStrictlyPositive () && txTime > maxPpduDuration))
433  {
434  NS_LOG_DEBUG ("the frame does not meet the constraint on max PPDU duration or PPDU duration limit");
435  return false;
436  }
437 
438  return true;
439 }
440 
441 Time
443  const WifiTxParameters& txParams,
444  Ptr<Packet> fragmentedPacket) const
445 {
446  NS_LOG_FUNCTION (this << header << size << &txParams << fragmentedPacket);
447 
448  // TODO This will be removed once no Txop is installed on a QoS station
449  if (m_edca == 0)
450  {
451  return FrameExchangeManager::GetFrameDurationId (header, size, txParams, fragmentedPacket);
452  }
453 
454  if (m_edca->GetTxopLimit ().IsZero ())
455  {
456  return FrameExchangeManager::GetFrameDurationId (header, size, txParams, fragmentedPacket);
457  }
458 
459  // under multiple protection settings, if the TXOP limit is not null, Duration/ID
460  // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016).
461  // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8
462  // of 802.11-2016)
463  return std::max (m_edca->GetRemainingTxop ()
464  - m_phy->CalculateTxDuration (size, txParams.m_txVector, m_phy->GetPhyBand ()),
465  Seconds (0));
466 }
467 
468 Time
469 QosFrameExchangeManager::GetRtsDurationId (const WifiTxVector& rtsTxVector, Time txDuration, Time response) const
470 {
471  NS_LOG_FUNCTION (this << rtsTxVector << txDuration << response);
472 
473  // TODO This will be removed once no Txop is installed on a QoS station
474  if (m_edca == 0)
475  {
476  return FrameExchangeManager::GetRtsDurationId (rtsTxVector, txDuration, response);
477  }
478 
479  if (m_edca->GetTxopLimit ().IsZero ())
480  {
481  return FrameExchangeManager::GetRtsDurationId (rtsTxVector, txDuration, response);
482  }
483 
484  // under multiple protection settings, if the TXOP limit is not null, Duration/ID
485  // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016).
486  // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8
487  // of 802.11-2016)
488  return std::max (m_edca->GetRemainingTxop ()
489  - m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, m_phy->GetPhyBand ()),
490  Seconds (0));
491 }
492 
493 Time
495  Time txDuration, Time response) const
496 {
497  NS_LOG_FUNCTION (this << ctsTxVector << txDuration << response);
498 
499  // TODO This will be removed once no Txop is installed on a QoS station
500  if (m_edca == 0)
501  {
502  return FrameExchangeManager::GetCtsToSelfDurationId (ctsTxVector, txDuration, response);
503  }
504 
505  if (m_edca->GetTxopLimit ().IsZero ())
506  {
507  return FrameExchangeManager::GetCtsToSelfDurationId (ctsTxVector, txDuration, response);
508  }
509 
510  // under multiple protection settings, if the TXOP limit is not null, Duration/ID
511  // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016).
512  // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8
513  // of 802.11-2016)
514  return std::max (m_edca->GetRemainingTxop ()
515  - m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, m_phy->GetPhyBand ()),
516  Seconds (0));
517 }
518 
519 void
521 {
522  NS_LOG_FUNCTION (this << *mpdu << txVector);
523 
524  WifiMacHeader& hdr = mpdu->GetHeader ();
525 
526  if (hdr.IsQosData () && m_mac->GetTypeOfStation () == STA
527  && (m_setQosQueueSize || hdr.IsQosEosp ()))
528  {
529  uint8_t tid = hdr.GetQosTid ();
530  hdr.SetQosEosp ();
531  hdr.SetQosQueueSize (m_mac->GetQosTxop (tid)->GetQosQueueSize (tid, hdr.GetAddr1 ()));
532  }
533  FrameExchangeManager::ForwardMpduDown (mpdu, txVector);
534 }
535 
536 void
538 {
539  NS_LOG_DEBUG (this);
540 
541  // TODO This will be removed once no Txop is installed on a QoS station
542  if (m_edca == 0)
543  {
545  return;
546  }
547 
549  && m_edca->GetRemainingTxop () > m_phy->GetSifs ())
550  {
551  NS_LOG_DEBUG ("Schedule another transmission in a SIFS");
553 
554  // we are continuing a TXOP, hence the txopDuration parameter is unused
555  Simulator::Schedule (m_phy->GetSifs (), fp, this, m_edca, Seconds (0));
556  }
557  else
558  {
560  m_edca = 0;
561  }
562  m_initialFrame = false;
563 }
564 
565 void
567 {
568  NS_LOG_FUNCTION (this);
569 
570  // TODO This will be removed once no Txop is installed on a QoS station
571  if (m_edca == 0)
572  {
574  return;
575  }
576 
577  if (m_initialFrame)
578  {
579  // The backoff procedure shall be invoked by an EDCAF when the transmission
580  // of an MPDU in the initial PPDU of a TXOP fails (Sec. 10.22.2.2 of 802.11-2016)
581  NS_LOG_DEBUG ("TX of the initial frame of a TXOP failed: terminate TXOP");
583  m_edca = 0;
584  }
585  else
586  {
588  "Cannot transmit more than one frame if TXOP Limit is zero");
589 
590  // A STA can perform a PIFS recovery or perform a backoff as a response to
591  // transmission failure within a TXOP. How it chooses between these two is
592  // implementation dependent. (Sec. 10.22.2.2 of 802.11-2016)
593  if (m_pifsRecovery)
594  {
595  // we can continue the TXOP if the carrier sense mechanism indicates that
596  // the medium is idle in a PIFS
597  NS_LOG_DEBUG ("TX of a non-initial frame of a TXOP failed: perform PIFS recovery");
600  }
601  else
602  {
603  // In order not to terminate (yet) the TXOP, we call the NotifyChannelReleased
604  // method of the Txop class, which only generates a new backoff value and
605  // requests channel access if needed,
606  NS_LOG_DEBUG ("TX of a non-initial frame of a TXOP failed: invoke backoff");
607  m_edca->Txop::NotifyChannelReleased ();
609  m_edca = 0;
610  }
611  }
612  m_initialFrame = false;
613 }
614 
615 void
617 {
618  NS_LOG_FUNCTION (this << psdu << txVector);
619 
620  SetTxopHolder (psdu, txVector);
621 
622  // APs store buffer size report of associated stations
623  if (m_mac->GetTypeOfStation () == AP && psdu->GetAddr1 () == m_self)
624  {
625  for (const auto& mpdu : *PeekPointer (psdu))
626  {
627  const WifiMacHeader& hdr = mpdu->GetHeader ();
628 
629  if (hdr.IsQosData () && hdr.IsQosEosp ())
630  {
631  NS_LOG_DEBUG ("Station " << hdr.GetAddr2 () << " reported a buffer status of "
632  << +hdr.GetQosQueueSize () << " for tid=" << +hdr.GetQosTid ());
633  StaticCast<ApWifiMac> (m_mac)->SetBufferStatus (hdr.GetQosTid (), hdr.GetAddr2 (), hdr.GetQosQueueSize ());
634  }
635  }
636  }
637 
638  FrameExchangeManager::PreProcessFrame (psdu, txVector);
639 }
640 
641 void
643 {
644  NS_LOG_FUNCTION (this << psdu << txVector);
645 
646  const WifiMacHeader& hdr = psdu->GetHeader (0);
647 
648  if (hdr.IsQosData () || hdr.IsMgt () || hdr.IsRts ())
649  {
650  m_txopHolder = psdu->GetAddr2 ();
651  }
652  else if (hdr.IsCts () || hdr.IsAck ())
653  {
654  m_txopHolder = psdu->GetAddr1 ();
655  }
656 }
657 
658 void
660  const WifiTxVector& txVector, bool inAmpdu)
661 {
662  // The received MPDU is either broadcast or addressed to this station
663  NS_ASSERT (mpdu->GetHeader ().GetAddr1 ().IsGroup ()
664  || mpdu->GetHeader ().GetAddr1 () == m_self);
665 
666  double rxSnr = rxSignalInfo.snr;
667  const WifiMacHeader& hdr = mpdu->GetHeader ();
668 
669  if (hdr.IsCfEnd ())
670  {
671  // reset NAV
672  NavResetTimeout ();
673  return;
674  }
675 
676  if (hdr.IsRts ())
677  {
678  NS_ABORT_MSG_IF (inAmpdu, "Received RTS as part of an A-MPDU");
679 
680  // If a non-VHT STA receives an RTS frame with the RA address matching the
681  // MAC address of the STA and the MAC address in the TA field in the RTS
682  // frame matches the saved TXOP holder address, then the STA shall send the
683  // CTS frame after SIFS, without regard for, and without resetting, its NAV.
684  // (sec. 10.22.2.4 of 802.11-2016)
685  if (hdr.GetAddr2 () == m_txopHolder || m_navEnd <= Simulator::Now ())
686  {
687  NS_LOG_DEBUG ("Received RTS from=" << hdr.GetAddr2 () << ", schedule CTS");
689  this, hdr, txVector.GetMode (), rxSnr);
690  }
691  else
692  {
693  NS_LOG_DEBUG ("Received RTS from=" << hdr.GetAddr2 () << ", cannot schedule CTS");
694  }
695  return;
696  }
697 
698  if (hdr.IsQosData ())
699  {
700  if (hdr.GetAddr1 () == m_self && hdr.GetQosAckPolicy () == WifiMacHeader::NORMAL_ACK)
701  {
702  NS_LOG_DEBUG ("Received " << hdr.GetTypeString () << " from=" << hdr.GetAddr2 () << ", schedule ACK");
704  this, hdr, txVector, rxSnr);
705  }
706 
707  // Forward up the frame if it is not a QoS Null frame
708  if (hdr.HasData ())
709  {
710  m_rxMiddle->Receive (mpdu);
711  }
712 
713  // the received data frame has been processed
714  return;
715  }
716 
717  return FrameExchangeManager::ReceiveMpdu (mpdu, rxSignalInfo, txVector, inAmpdu);
718 }
719 
720 } //namespace ns3
ns3::FrameExchangeManager::CalculateAcknowledgmentTime
virtual void CalculateAcknowledgmentTime(WifiAcknowledgment *acknowledgment) const
Calculate the time required to acknowledge a frame according to the given acknowledgment method.
Definition: frame-exchange-manager.cc:490
ns3::WifiPhy::GetMaxPsduSize
static uint32_t GetMaxPsduSize(WifiModulationClass modulation)
Get the maximum PSDU size in bytes for the given modulation class.
Definition: wifi-phy.cc:1631
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::QosFrameExchangeManager::m_setQosQueueSize
bool m_setQosQueueSize
whether to set the Queue Size subfield of the QoS Control field of QoS data frames
Definition: qos-frame-exchange-manager.h:161
ns3::FrameExchangeManager::m_txTimer
WifiTxTimer m_txTimer
the timer set upon frame transmission
Definition: frame-exchange-manager.h:379
ns3::WifiMacHeader::IsRts
bool IsRts(void) const
Return true if the header is a RTS header.
Definition: wifi-mac-header.cc:651
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#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
ns3::WifiMacHeader::SetNoMoreFragments
void SetNoMoreFragments(void)
Un-set the More Fragment bit in the Frame Control Field.
Definition: wifi-mac-header.cc:322
ns3::FrameExchangeManager::ReceiveMpdu
virtual void ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, bool inAmpdu)
This method handles the reception of an MPDU (possibly included in an A-MPDU)
Definition: frame-exchange-manager.cc:1023
ns3::FrameExchangeManager::m_phy
Ptr< WifiPhy > m_phy
the PHY layer on this station
Definition: frame-exchange-manager.h:385
ns3::QosFrameExchangeManager::ForwardMpduDown
void ForwardMpduDown(Ptr< WifiMacQueueItem > mpdu, WifiTxVector &txVector) override
Forward an MPDU down to the PHY layer.
Definition: qos-frame-exchange-manager.cc:520
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition: boolean.h:37
ns3::WifiMacHeader::SetDuration
void SetDuration(Time duration)
Set the Duration/ID field with the given duration (Time object).
Definition: wifi-mac-header.cc:300
ns3::WifiMacHeader::IsAck
bool IsAck(void) const
Return true if the header is an Ack header.
Definition: wifi-mac-header.cc:663
ap-wifi-mac.h
ns3::GetRtsSize
uint32_t GetRtsSize(void)
Return the total RTS size (including FCS trailer).
Definition: wifi-utils.cc:100
ns3::WifiMacHeader::GetSize
uint32_t GetSize(void) const
Return the size of the WifiMacHeader in octets.
Definition: wifi-mac-header.cc:933
ns3::WifiPsdu::GetAddr1
Mac48Address GetAddr1(void) const
Get the Receiver Address (RA), which is common to all the MPDUs.
Definition: wifi-psdu.cc:111
ns3::FrameExchangeManager::GetRtsDurationId
virtual Time GetRtsDurationId(const WifiTxVector &rtsTxVector, Time txDuration, Time response) const
Compute how to set the Duration/ID field of an RTS frame to send to protect a frame transmitted with ...
Definition: frame-exchange-manager.cc:551
ns3::FrameExchangeManager::SendNormalAck
void SendNormalAck(const WifiMacHeader &hdr, const WifiTxVector &dataTxVector, double dataSnr)
Send Normal Ack.
Definition: frame-exchange-manager.cc:681
ns3::WifiMacHeader::IsQosEosp
bool IsQosEosp(void) const
Return if the end of service period (EOSP) is set.
Definition: wifi-mac-header.cc:822
ns3::WifiMacHeader::GetQosQueueSize
uint8_t GetQosQueueSize(void) const
Get the Queue Size subfield in the QoS control field.
Definition: wifi-mac-header.cc:869
ns3::Mac48Address::IsGroup
bool IsGroup(void) const
Definition: mac48-address.cc:164
ns3::Txop::NotifyChannelReleased
virtual void NotifyChannelReleased(void)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Definition: txop.cc:355
ns3::Time::IsNegative
bool IsNegative(void) const
Exactly equivalent to t <= 0.
Definition: nstime.h:309
ns3::Simulator::Now
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiPhy::CalculateTxDuration
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1610
ns3::WIFI_MAC_FCS_LENGTH
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
Definition: wifi-mac-trailer.h:31
ns3::QosFrameExchangeManager::m_initialFrame
bool m_initialFrame
true if transmitting the initial frame of a TXOP
Definition: qos-frame-exchange-manager.h:172
ns3::QosFrameExchangeManager::TransmissionFailed
void TransmissionFailed(void) override
Take necessary actions upon a transmission failure.
Definition: qos-frame-exchange-manager.cc:566
qos-frame-exchange-manager.h
ns3::WIFI_MAC_CTL_END
@ WIFI_MAC_CTL_END
Definition: wifi-mac-header.h:45
ns3::WifiTxTimer::IsRunning
bool IsRunning(void) const
Return true if the timer is running.
Definition: wifi-tx-timer.cc:94
ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits
virtual bool IsWithinSizeAndTimeLimits(uint32_t ppduPayloadSize, Mac48Address receiver, const WifiTxParameters &txParams, Time ppduDurationLimit) const
Check whether the transmission time of the frame being built (as described by the given TX parameters...
Definition: qos-frame-exchange-manager.cc:407
ns3::FrameExchangeManager::CalculateProtectionTime
virtual void CalculateProtectionTime(WifiProtection *protection) const
Calculate the time required to protect a frame according to the given protection method.
Definition: frame-exchange-manager.cc:461
ns3::QosFrameExchangeManager::TransmissionSucceeded
void TransmissionSucceeded(void) override
Take necessary actions upon a transmission success.
Definition: qos-frame-exchange-manager.cc:537
ns3::WifiPhy::GetPifs
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:934
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::FrameExchangeManager::NavResetTimeout
virtual void NavResetTimeout(void)
Reset the NAV upon expiration of the NAV reset timer.
Definition: frame-exchange-manager.cc:1015
ns3::QosFrameExchangeManager::ReceiveMpdu
void ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, bool inAmpdu) override
This method handles the reception of an MPDU (possibly included in an A-MPDU)
Definition: qos-frame-exchange-manager.cc:659
ns3::Time::IsStrictlyPositive
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
Definition: nstime.h:333
ns3::QosFrameExchangeManager::~QosFrameExchangeManager
virtual ~QosFrameExchangeManager()
Definition: qos-frame-exchange-manager.cc:66
ns3::FrameExchangeManager::m_channelAccessManager
Ptr< ChannelAccessManager > m_channelAccessManager
the channel access manager
Definition: frame-exchange-manager.h:384
ns3::QosFrameExchangeManager::StartFrameExchange
virtual bool StartFrameExchange(Ptr< QosTxop > edca, Time availableTime, bool initialFrame)
Start a frame exchange (including protection frames and acknowledgment frames as needed) that fits wi...
Definition: qos-frame-exchange-manager.cc:262
ns3::WifiMacHeader::IsCfEnd
bool IsCfEnd(void) const
Return true if the header is a CF-End header.
Definition: wifi-mac-header.cc:602
ns3::WifiMacHeader::IsCts
bool IsCts(void) const
Return true if the header is a CTS header.
Definition: wifi-mac-header.cc:657
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::QosFrameExchangeManager::StartTransmission
bool StartTransmission(Ptr< Txop > edca) override
Request the FrameExchangeManager to start a frame exchange sequence.
Definition: qos-frame-exchange-manager.cc:151
ns3::QosTxop::PeekNextMpdu
Ptr< const WifiMacQueueItem > PeekNextMpdu(uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast())
Peek the next frame to transmit to the given receiver and of the given TID from the block ack manager...
Definition: qos-txop.cc:357
ns3::WifiMacHeader::SetNoRetry
void SetNoRetry(void)
Un-set the Retry bit in the Frame Control field.
Definition: wifi-mac-header.cc:347
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
ns3::Time::As
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:429
ns3::WifiMacHeader::SetQosQueueSize
void SetQosQueueSize(uint8_t size)
Set the Queue Size subfield in the QoS control field.
Definition: wifi-mac-header.cc:402
ns3::FrameExchangeManager::m_self
Mac48Address m_self
the MAC address of this device
Definition: frame-exchange-manager.h:386
ns3::FrameExchangeManager::GetCtsToSelfDurationId
virtual Time GetCtsToSelfDurationId(const WifiTxVector &ctsTxVector, Time txDuration, Time response) const
Compute how to set the Duration/ID field of a CTS-to-self frame to send to protect a frame transmitte...
Definition: frame-exchange-manager.cc:645
ns3::WifiTxParameters
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Definition: wifi-tx-parameters.h:45
ns3::Simulator::Schedule
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:557
ns3::MakeBooleanAccessor
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:85
ns3::WifiMacQueueItem::GetHeader
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Definition: wifi-mac-queue-item.cc:65
ns3::Txop::GetTxopLimit
Time GetTxopLimit(void) const
Return the TXOP limit.
Definition: txop.cc:280
ns3::PeekPointer
U * PeekPointer(const Ptr< U > &p)
Definition: ptr.h:415
ns3::QosTxop::NotifyChannelAccessed
void NotifyChannelAccessed(Time txopDuration) override
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
Definition: qos-txop.cc:538
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::AP
@ AP
Definition: wifi-mac.h:43
ns3::WifiTxParameters::m_protection
std::unique_ptr< WifiProtection > m_protection
protection method
Definition: wifi-tx-parameters.h:63
ns3::GetPpduMaxTime
Time GetPpduMaxTime(WifiPreamble preamble)
Get the maximum PPDU duration (see Section 10.14 of 802.11-2016) for the PHY layers defining the aPPD...
Definition: wifi-phy-common.cc:135
wifi-mac-queue.h
ns3::QosFrameExchangeManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition: qos-frame-exchange-manager.cc:72
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::FrameExchangeManager::GetFirstFragmentIfNeeded
Ptr< WifiMacQueueItem > GetFirstFragmentIfNeeded(Ptr< WifiMacQueueItem > mpdu)
Fragment the given MPDU if needed.
Definition: frame-exchange-manager.cc:317
ns3::FrameExchangeManager::GetProtectionManager
Ptr< WifiProtectionManager > GetProtectionManager(void) const
Get the Protection Manager used by this node.
Definition: frame-exchange-manager.cc:111
ns3::WifiMacHeader::GetTypeString
const char * GetTypeString(void) const
Return a string corresponds to the header type.
Definition: wifi-mac-header.cc:977
ns3::QosFrameExchangeManager::CancelPifsRecovery
void CancelPifsRecovery(void)
Cancel the PIFS recovery event and have the EDCAF attempting PIFS recovery release the channel.
Definition: qos-frame-exchange-manager.cc:139
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::Ptr< Txop >
ns3::FrameExchangeManager::TransmissionSucceeded
virtual void TransmissionSucceeded(void)
Take necessary actions upon a transmission success.
Definition: frame-exchange-manager.cc:741
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition: mac48-address.cc:170
ns3::WifiMacQueueItem::ConstIterator
std::list< Ptr< WifiMacQueueItem > >::const_iterator ConstIterator
Const iterator typedef.
Definition: wifi-mac-queue-item.h:144
ns3::QosFrameExchangeManager
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
Definition: qos-frame-exchange-manager.h:37
ns3::EventId::IsRunning
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
Definition: event-id.cc:71
ns3::WifiTxVector::GetModulationClass
WifiModulationClass GetModulationClass(void) const
Get the modulation class specified by this TXVECTOR.
Definition: wifi-tx-vector.cc:128
ns3::QosFrameExchangeManager::m_txopHolder
Mac48Address m_txopHolder
MAC address of the TXOP holder.
Definition: qos-frame-exchange-manager.h:160
ns3::QosFrameExchangeManager::m_pifsRecovery
bool m_pifsRecovery
true if performing a PIFS recovery after failure
Definition: qos-frame-exchange-manager.h:173
ns3::QosFrameExchangeManager::m_edca
Ptr< QosTxop > m_edca
the EDCAF that gained channel access
Definition: qos-frame-exchange-manager.h:159
ns3::QosFrameExchangeManager::PreProcessFrame
void PreProcessFrame(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector) override
Perform actions that are possibly needed when receiving any frame, independently of whether the frame...
Definition: qos-frame-exchange-manager.cc:616
max
#define max(a, b)
Definition: 80211b.c:43
ns3::QosFrameExchangeManager::GetRtsDurationId
Time GetRtsDurationId(const WifiTxVector &rtsTxVector, Time txDuration, Time response) const override
Compute how to set the Duration/ID field of an RTS frame to send to protect a frame transmitted with ...
Definition: qos-frame-exchange-manager.cc:469
ns3::WifiMacHeader::IsQosAmsdu
bool IsQosAmsdu(void) const
Check if the A-MSDU present bit is set in the QoS control field.
Definition: wifi-mac-header.cc:855
ns3::Time::IsZero
bool IsZero(void) const
Exactly equivalent to t == 0.
Definition: nstime.h:301
ns3::FrameExchangeManager::GetTxDuration
virtual Time GetTxDuration(uint32_t ppduPayloadSize, Mac48Address receiver, const WifiTxParameters &txParams) const
Get the updated TX duration of the frame associated with the given TX parameters if the size of the P...
Definition: frame-exchange-manager.cc:510
ns3::FrameExchangeManager::m_rxMiddle
Ptr< MacRxMiddle > m_rxMiddle
the MAC RX Middle on this station
Definition: frame-exchange-manager.h:383
ns3::WifiPsdu::GetHeader
const WifiMacHeader & GetHeader(std::size_t i) const
Get the header of the i-th MPDU.
Definition: wifi-psdu.cc:266
ns3::EventId::Cancel
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
ns3::WifiMacHeader::HasData
bool HasData(void) const
Return true if the header type is DATA and is not DATA_NULL.
Definition: wifi-mac-header.cc:632
ns3::WifiMacHeader::NORMAL_ACK
@ NORMAL_ACK
Definition: wifi-mac-header.h:92
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
ns3::WifiMacHeader::IsQosData
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
Definition: wifi-mac-header.cc:565
ns3::WifiPhy::GetPhyBand
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:1124
ns3::WifiTxVector::GetPreambleType
WifiPreamble GetPreambleType(void) const
Definition: wifi-tx-vector.cc:148
ns3::QosFrameExchangeManager::GetFrameDurationId
Time GetFrameDurationId(const WifiMacHeader &header, uint32_t size, const WifiTxParameters &txParams, Ptr< Packet > fragmentedPacket) const override
Compute how to set the Duration/ID field of a frame being transmitted with the given TX parameters.
Definition: qos-frame-exchange-manager.cc:442
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
NS_ABORT_MSG_IF
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
ns3::Txop::IsQosTxop
virtual bool IsQosTxop() const
Check for QoS TXOP.
Definition: txop.cc:419
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::WifiMacHeader::GetQosAckPolicy
QosAckPolicy GetQosAckPolicy(void) const
Return the QoS Ack policy in the QoS control field.
Definition: wifi-mac-header.cc:829
ns3::FrameExchangeManager::GetFrameDurationId
virtual Time GetFrameDurationId(const WifiMacHeader &header, uint32_t size, const WifiTxParameters &txParams, Ptr< Packet > fragmentedPacket) const
Compute how to set the Duration/ID field of a frame being transmitted with the given TX parameters.
Definition: frame-exchange-manager.cc:523
ns3::FrameExchangeManager::m_navEnd
Time m_navEnd
NAV expiration time.
Definition: frame-exchange-manager.h:388
ns3::FrameExchangeManager::GetAckManager
Ptr< WifiAckManager > GetAckManager(void) const
Get the Acknowledgment Manager used by this node.
Definition: frame-exchange-manager.cc:124
ns3::QosFrameExchangeManager::PifsRecovery
void PifsRecovery(void)
Perform a PIFS recovery as a response to transmission failure within a TXOP.
Definition: qos-frame-exchange-manager.cc:118
ns3::WifiTxParameters::m_acknowledgment
std::unique_ptr< WifiAcknowledgment > m_acknowledgment
acknowledgment method
Definition: wifi-tx-parameters.h:64
ns3::QosFrameExchangeManager::SetTxopHolder
virtual void SetTxopHolder(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Set the TXOP holder, if needed, based on the received frame.
Definition: qos-frame-exchange-manager.cc:642
ns3::FrameExchangeManager::StartTransmission
virtual bool StartTransmission(Ptr< Txop > dcf)
Request the FrameExchangeManager to start a frame exchange sequence.
Definition: frame-exchange-manager.cc:259
ns3::WifiMacHeader::IsMgt
bool IsMgt(void) const
Return true if the Type is Management.
Definition: wifi-mac-header.cc:577
ns3::QosFrameExchangeManager::IsWithinLimitsIfAddMpdu
virtual bool IsWithinLimitsIfAddMpdu(Ptr< const WifiMacQueueItem > mpdu, const WifiTxParameters &txParams, Time ppduDurationLimit) const
Check whether the given MPDU can be added to the frame being built (as described by the given TX para...
Definition: qos-frame-exchange-manager.cc:393
ns3::WifiMacHeader::SetAddr2
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
Definition: wifi-mac-header.cc:114
ns3::WifiMacHeader::GetQosTid
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Definition: wifi-mac-header.cc:862
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition: log-macros-enabled.h:209
ns3::STA
@ STA
Definition: wifi-mac.h:42
ns3::QosFrameExchangeManager::m_pifsRecoveryEvent
EventId m_pifsRecoveryEvent
event associated with an attempt of PIFS recovery
Definition: qos-frame-exchange-manager.h:174
ns3::Time::Min
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
Definition: nstime.h:274
ns3::FrameExchangeManager::UpdateTxDuration
void UpdateTxDuration(Mac48Address receiver, WifiTxParameters &txParams) const
Update the TX duration field of the given TX parameters after that the PSDU addressed to the given re...
Definition: frame-exchange-manager.cc:517
ns3::WifiPsdu::GetAddr2
Mac48Address GetAddr2(void) const
Get the Transmitter Address (TA), which is common to all the MPDUs.
Definition: wifi-psdu.cc:126
ns3::RxSignalInfo::snr
double snr
SNR in linear scale.
Definition: phy-entity.h:68
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::WifiTxParameters::m_txVector
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
Definition: wifi-tx-parameters.h:62
ns3::QosTxop::GetNextMpdu
Ptr< WifiMacQueueItem > GetNextMpdu(Ptr< const WifiMacQueueItem > peekedItem, WifiTxParameters &txParams, Time availableTime, bool initialFrame, WifiMacQueueItem::ConstIterator &queueIt)
Prepare the frame to transmit starting from the MPDU that has been previously peeked by calling PeekN...
Definition: qos-txop.cc:443
ns3::RxSignalInfo
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:67
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::QosTxop::NotifyChannelReleased
void NotifyChannelReleased(void) override
Called by the FrameExchangeManager to notify the completion of the transmissions.
Definition: qos-txop.cc:556
ns3::QosFrameExchangeManager::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: qos-frame-exchange-manager.cc:38
ns3::FrameExchangeManager
FrameExchangeManager is a base class handling the basic frame exchange sequences for non-QoS stations...
Definition: frame-exchange-manager.h:52
ns3::FrameExchangeManager::SendMpduWithProtection
void SendMpduWithProtection(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams)
Send an MPDU with the given TX parameters (with the specified protection).
Definition: frame-exchange-manager.cc:345
ns3::FrameExchangeManager::m_mac
Ptr< RegularWifiMac > m_mac
the MAC layer on this station
Definition: frame-exchange-manager.h:381
ns3::QosFrameExchangeManager::QosFrameExchangeManager
QosFrameExchangeManager()
Definition: qos-frame-exchange-manager.cc:60
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::FrameExchangeManager::TransmissionFailed
virtual void TransmissionFailed(void)
Take necessary actions upon a transmission failure.
Definition: frame-exchange-manager.cc:761
ns3::FrameExchangeManager::ForwardMpduDown
virtual void ForwardMpduDown(Ptr< WifiMacQueueItem > mpdu, WifiTxVector &txVector)
Forward an MPDU down to the PHY layer.
Definition: frame-exchange-manager.cc:442
ns3::WifiMacHeader::SetQosEosp
void SetQosEosp()
Set the end of service period (EOSP) bit in the QoS control field.
Definition: wifi-mac-header.cc:357
ns3::QosFrameExchangeManager::m_edcaBackingOff
Ptr< Txop > m_edcaBackingOff
channel access function that invoked backoff during TXOP
Definition: qos-frame-exchange-manager.h:175
ns3::FrameExchangeManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition: frame-exchange-manager.cc:83
ns3::QosFrameExchangeManager::TryAddMpdu
bool TryAddMpdu(Ptr< const WifiMacQueueItem > mpdu, WifiTxParameters &txParams, Time availableTime) const
Recompute the protection and acknowledgment methods to use if the given MPDU is added to the frame be...
Definition: qos-frame-exchange-manager.cc:310
ns3::WifiMacHeader::SetType
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Definition: wifi-mac-header.cc:132
ns3::FrameExchangeManager::SendCtsAfterRts
void SendCtsAfterRts(const WifiMacHeader &rtsHdr, WifiMode rtsTxMode, double rtsSnr)
Send CTS after receiving RTS.
Definition: frame-exchange-manager.cc:636
ns3::TracedValueCallback::Time
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:813
ns3::QosFrameExchangeManager::SendCfEndIfNeeded
virtual bool SendCfEndIfNeeded(void)
Send a CF-End frame to indicate the completion of the TXOP, provided that the remaining duration is l...
Definition: qos-frame-exchange-manager.cc:82
ns3::WifiTxParameters::AddMpdu
void AddMpdu(Ptr< const WifiMacQueueItem > mpdu)
Record that an MPDU is being added to the current frame.
Definition: wifi-tx-parameters.cc:98
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::WifiMacQueueItem::IsFragment
bool IsFragment(void) const
Return true if this item contains an MSDU fragment, false otherwise.
Definition: wifi-mac-queue-item.cc:101
ns3::WifiMacQueueItem::GetSize
uint32_t GetSize(void) const
Return the size of the packet stored by this item, including header size and trailer size.
Definition: wifi-mac-queue-item.cc:95
ns3::QosFrameExchangeManager::GetCtsToSelfDurationId
Time GetCtsToSelfDurationId(const WifiTxVector &ctsTxVector, Time txDuration, Time response) const override
Compute how to set the Duration/ID field of a CTS-to-self frame to send to protect a frame transmitte...
Definition: qos-frame-exchange-manager.cc:494
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
ns3::GetCtsSize
uint32_t GetCtsSize(void)
Return the total CTS size (including FCS trailer).
Definition: wifi-utils.cc:108
ns3::WifiPhy::GetSifs
Time GetSifs(void) const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:910
ns3::FrameExchangeManager::PreProcessFrame
virtual void PreProcessFrame(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Perform actions that are possibly needed when receiving any frame, independently of whether the frame...
Definition: frame-exchange-manager.cc:950
wifi-mac-trailer.h
ns3::WifiTxTimer::Cancel
void Cancel(void)
Cancel the timer.
Definition: wifi-tx-timer.cc:100
ns3::Time::MS
@ MS
millisecond
Definition: nstime.h:116
ns3::WifiPhy::Send
void Send(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
This function is a wrapper for the Send variant that accepts a WifiConstPsduMap as first argument.
Definition: wifi-phy.cc:1789
ns3::QosTxop::IsTxopStarted
virtual bool IsTxopStarted(void) const
Return true if a TXOP has started.
Definition: qos-txop.cc:549
ns3::WifiTxVector::GetMode
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
Definition: wifi-tx-vector.cc:112
ns3::FrameExchangeManager::m_dcf
Ptr< Txop > m_dcf
the DCF/EDCAF that gained channel access
Definition: frame-exchange-manager.h:378
ns3::QosTxop::GetRemainingTxop
virtual Time GetRemainingTxop(void) const
Return the remaining duration in the current TXOP.
Definition: qos-txop.cc:570