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 
280  Ptr<WifiMacQueueItem> item = edca->GetNextMpdu (mpdu, txParams, availableTime, initialFrame);
281 
282  if (item == nullptr)
283  {
284  NS_LOG_DEBUG ("Not enough time to transmit a frame");
285  return false;
286  }
287 
288  NS_ASSERT_MSG (!item->GetHeader ().IsQosData () || !item->GetHeader ().IsQosAmsdu (),
289  "We should not get an A-MSDU here");
290 
291  // check if the MSDU needs to be fragmented
292  item = GetFirstFragmentIfNeeded (item);
293 
294  // update the protection method if the frame was fragmented
295  if (item->IsFragment () && item->GetSize () != mpdu->GetSize ())
296  {
297  WifiTxParameters fragmentTxParams;
298  fragmentTxParams.m_txVector = txParams.m_txVector;
299  txParams.m_protection = GetProtectionManager ()->TryAddMpdu (item, fragmentTxParams);
300  NS_ASSERT (txParams.m_protection != nullptr);
301  }
302 
303  SendMpduWithProtection (item, txParams);
304 
305  return true;
306 }
307 
308 bool
310  Time availableTime) const
311 {
312  NS_ASSERT (mpdu != 0);
313  NS_LOG_FUNCTION (this << *mpdu << &txParams << availableTime);
314 
315  // check if adding the given MPDU requires a different protection method
316  Time protectionTime = Time::Min (); // uninitialized
317  if (txParams.m_protection)
318  {
319  protectionTime = txParams.m_protection->protectionTime;
320  }
321 
322  std::unique_ptr<WifiProtection> protection;
323  protection = GetProtectionManager ()->TryAddMpdu (mpdu, txParams);
324  bool protectionSwapped = false;
325 
326  if (protection)
327  {
328  // the protection method has changed, calculate the new protection time
329  CalculateProtectionTime (protection.get ());
330  protectionTime = protection->protectionTime;
331  // swap unique pointers, so that the txParams that is passed to the next
332  // call to IsWithinLimitsIfAddMpdu is the most updated one
333  txParams.m_protection.swap (protection);
334  protectionSwapped = true;
335  }
336  NS_ASSERT (protectionTime != Time::Min ());
337  NS_LOG_DEBUG ("protection time=" << protectionTime);
338 
339  // check if adding the given MPDU requires a different acknowledgment method
340  Time acknowledgmentTime = Time::Min (); // uninitialized
341  if (txParams.m_acknowledgment)
342  {
343  acknowledgmentTime = txParams.m_acknowledgment->acknowledgmentTime;
344  }
345 
346  std::unique_ptr<WifiAcknowledgment> acknowledgment;
347  acknowledgment = GetAckManager ()->TryAddMpdu (mpdu, txParams);
348  bool acknowledgmentSwapped = false;
349 
350  if (acknowledgment)
351  {
352  // the acknowledgment method has changed, calculate the new acknowledgment time
353  CalculateAcknowledgmentTime (acknowledgment.get ());
354  acknowledgmentTime = acknowledgment->acknowledgmentTime;
355  // swap unique pointers, so that the txParams that is passed to the next
356  // call to IsWithinLimitsIfAddMpdu is the most updated one
357  txParams.m_acknowledgment.swap (acknowledgment);
358  acknowledgmentSwapped = true;
359  }
360  NS_ASSERT (acknowledgmentTime != Time::Min ());
361  NS_LOG_DEBUG ("acknowledgment time=" << acknowledgmentTime);
362 
363  Time ppduDurationLimit = Time::Min ();
364  if (availableTime != Time::Min ())
365  {
366  ppduDurationLimit = availableTime - protectionTime - acknowledgmentTime;
367  }
368 
369  if (!IsWithinLimitsIfAddMpdu (mpdu, txParams, ppduDurationLimit))
370  {
371  // adding MPDU failed, restore protection and acknowledgment methods
372  // if they were swapped
373  if (protectionSwapped)
374  {
375  txParams.m_protection.swap (protection);
376  }
377  if (acknowledgmentSwapped)
378  {
379  txParams.m_acknowledgment.swap (acknowledgment);
380  }
381  return false;
382  }
383 
384  // the given MPDU can be added, hence update the txParams
385  txParams.AddMpdu (mpdu);
386  UpdateTxDuration (mpdu->GetHeader ().GetAddr1 (), txParams);
387 
388  return true;
389 }
390 
391 bool
393  const WifiTxParameters& txParams,
394  Time ppduDurationLimit) const
395 {
396  NS_ASSERT (mpdu != 0);
397  NS_LOG_FUNCTION (this << *mpdu << &txParams << ppduDurationLimit);
398 
399  // A QoS station only has to check that the MPDU transmission time does not
400  // exceed the given limit
401  return IsWithinSizeAndTimeLimits (mpdu->GetSize (), mpdu->GetHeader ().GetAddr1 (),
402  txParams, ppduDurationLimit);
403 }
404 
405 bool
407  const WifiTxParameters& txParams,
408  Time ppduDurationLimit) const
409 {
410  NS_LOG_FUNCTION (this << ppduPayloadSize << receiver << &txParams << ppduDurationLimit);
411 
412  if (ppduDurationLimit != Time::Min () && ppduDurationLimit.IsNegative ())
413  {
414  NS_LOG_DEBUG ("ppduDurationLimit is null or negative, time limit is trivially exceeded");
415  return false;
416  }
417 
418  if (ppduPayloadSize > WifiPhy::GetMaxPsduSize (txParams.m_txVector.GetModulationClass ()))
419  {
420  NS_LOG_DEBUG ("the frame exceeds the max PSDU size");
421  return false;
422  }
423 
424  // Get the maximum PPDU Duration based on the preamble type
425  Time maxPpduDuration = GetPpduMaxTime (txParams.m_txVector.GetPreambleType ());
426 
427  Time txTime = GetTxDuration (ppduPayloadSize, receiver, txParams);
428  NS_LOG_DEBUG ("PPDU duration: " << txTime.As (Time::MS));
429 
430  if ((ppduDurationLimit.IsStrictlyPositive () && txTime > ppduDurationLimit)
431  || (maxPpduDuration.IsStrictlyPositive () && txTime > maxPpduDuration))
432  {
433  NS_LOG_DEBUG ("the frame does not meet the constraint on max PPDU duration or PPDU duration limit");
434  return false;
435  }
436 
437  return true;
438 }
439 
440 Time
442  const WifiTxParameters& txParams,
443  Ptr<Packet> fragmentedPacket) const
444 {
445  NS_LOG_FUNCTION (this << header << size << &txParams << fragmentedPacket);
446 
447  // TODO This will be removed once no Txop is installed on a QoS station
448  if (m_edca == 0)
449  {
450  return FrameExchangeManager::GetFrameDurationId (header, size, txParams, fragmentedPacket);
451  }
452 
453  if (m_edca->GetTxopLimit ().IsZero ())
454  {
455  return FrameExchangeManager::GetFrameDurationId (header, size, txParams, fragmentedPacket);
456  }
457 
458  // under multiple protection settings, if the TXOP limit is not null, Duration/ID
459  // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016).
460  // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8
461  // of 802.11-2016)
462  return std::max (m_edca->GetRemainingTxop ()
463  - m_phy->CalculateTxDuration (size, txParams.m_txVector, m_phy->GetPhyBand ()),
464  Seconds (0));
465 }
466 
467 Time
468 QosFrameExchangeManager::GetRtsDurationId (const WifiTxVector& rtsTxVector, Time txDuration, Time response) const
469 {
470  NS_LOG_FUNCTION (this << rtsTxVector << txDuration << response);
471 
472  // TODO This will be removed once no Txop is installed on a QoS station
473  if (m_edca == 0)
474  {
475  return FrameExchangeManager::GetRtsDurationId (rtsTxVector, txDuration, response);
476  }
477 
478  if (m_edca->GetTxopLimit ().IsZero ())
479  {
480  return FrameExchangeManager::GetRtsDurationId (rtsTxVector, txDuration, response);
481  }
482 
483  // under multiple protection settings, if the TXOP limit is not null, Duration/ID
484  // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016).
485  // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8
486  // of 802.11-2016)
487  return std::max (m_edca->GetRemainingTxop ()
488  - m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, m_phy->GetPhyBand ()),
489  Seconds (0));
490 }
491 
492 Time
494  Time txDuration, Time response) const
495 {
496  NS_LOG_FUNCTION (this << ctsTxVector << txDuration << response);
497 
498  // TODO This will be removed once no Txop is installed on a QoS station
499  if (m_edca == 0)
500  {
501  return FrameExchangeManager::GetCtsToSelfDurationId (ctsTxVector, txDuration, response);
502  }
503 
504  if (m_edca->GetTxopLimit ().IsZero ())
505  {
506  return FrameExchangeManager::GetCtsToSelfDurationId (ctsTxVector, txDuration, response);
507  }
508 
509  // under multiple protection settings, if the TXOP limit is not null, Duration/ID
510  // is set to cover the remaining TXOP time (Sec. 9.2.5.2 of 802.11-2016).
511  // The TXOP holder may exceed the TXOP limit in some situations (Sec. 10.22.2.8
512  // of 802.11-2016)
513  return std::max (m_edca->GetRemainingTxop ()
514  - m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, m_phy->GetPhyBand ()),
515  Seconds (0));
516 }
517 
518 void
520 {
521  NS_LOG_FUNCTION (this << *mpdu << txVector);
522 
523  WifiMacHeader& hdr = mpdu->GetHeader ();
524 
525  if (hdr.IsQosData () && m_mac->GetTypeOfStation () == STA
526  && (m_setQosQueueSize || hdr.IsQosEosp ()))
527  {
528  uint8_t tid = hdr.GetQosTid ();
529  hdr.SetQosEosp ();
530  hdr.SetQosQueueSize (m_mac->GetQosTxop (tid)->GetQosQueueSize (tid, hdr.GetAddr1 ()));
531  }
532  FrameExchangeManager::ForwardMpduDown (mpdu, txVector);
533 }
534 
535 void
537 {
538  NS_LOG_DEBUG (this);
539 
540  // TODO This will be removed once no Txop is installed on a QoS station
541  if (m_edca == 0)
542  {
544  return;
545  }
546 
548  && m_edca->GetRemainingTxop () > m_phy->GetSifs ())
549  {
550  NS_LOG_DEBUG ("Schedule another transmission in a SIFS");
552 
553  // we are continuing a TXOP, hence the txopDuration parameter is unused
554  Simulator::Schedule (m_phy->GetSifs (), fp, this, m_edca, Seconds (0));
555  }
556  else
557  {
559  m_edca = 0;
560  }
561  m_initialFrame = false;
562 }
563 
564 void
566 {
567  NS_LOG_FUNCTION (this);
568 
569  // TODO This will be removed once no Txop is installed on a QoS station
570  if (m_edca == 0)
571  {
573  return;
574  }
575 
576  if (m_initialFrame)
577  {
578  // The backoff procedure shall be invoked by an EDCAF when the transmission
579  // of an MPDU in the initial PPDU of a TXOP fails (Sec. 10.22.2.2 of 802.11-2016)
580  NS_LOG_DEBUG ("TX of the initial frame of a TXOP failed: terminate TXOP");
582  m_edca = 0;
583  }
584  else
585  {
587  "Cannot transmit more than one frame if TXOP Limit is zero");
588 
589  // A STA can perform a PIFS recovery or perform a backoff as a response to
590  // transmission failure within a TXOP. How it chooses between these two is
591  // implementation dependent. (Sec. 10.22.2.2 of 802.11-2016)
592  if (m_pifsRecovery)
593  {
594  // we can continue the TXOP if the carrier sense mechanism indicates that
595  // the medium is idle in a PIFS
596  NS_LOG_DEBUG ("TX of a non-initial frame of a TXOP failed: perform PIFS recovery");
599  }
600  else
601  {
602  // In order not to terminate (yet) the TXOP, we call the NotifyChannelReleased
603  // method of the Txop class, which only generates a new backoff value and
604  // requests channel access if needed,
605  NS_LOG_DEBUG ("TX of a non-initial frame of a TXOP failed: invoke backoff");
606  m_edca->Txop::NotifyChannelReleased ();
608  m_edca = 0;
609  }
610  }
611  m_initialFrame = false;
612 }
613 
614 void
616 {
617  NS_LOG_FUNCTION (this << psdu << txVector);
618 
619  SetTxopHolder (psdu, txVector);
620 
621  // APs store buffer size report of associated stations
622  if (m_mac->GetTypeOfStation () == AP && psdu->GetAddr1 () == m_self)
623  {
624  for (const auto& mpdu : *PeekPointer (psdu))
625  {
626  const WifiMacHeader& hdr = mpdu->GetHeader ();
627 
628  if (hdr.IsQosData () && hdr.IsQosEosp ())
629  {
630  NS_LOG_DEBUG ("Station " << hdr.GetAddr2 () << " reported a buffer status of "
631  << +hdr.GetQosQueueSize () << " for tid=" << +hdr.GetQosTid ());
632  StaticCast<ApWifiMac> (m_mac)->SetBufferStatus (hdr.GetQosTid (), hdr.GetAddr2 (), hdr.GetQosQueueSize ());
633  }
634  }
635  }
636 
637  FrameExchangeManager::PreProcessFrame (psdu, txVector);
638 }
639 
640 void
642 {
643  NS_LOG_FUNCTION (this << psdu << txVector);
644 
645  const WifiMacHeader& hdr = psdu->GetHeader (0);
646 
647  if (hdr.IsQosData () || hdr.IsMgt () || hdr.IsRts ())
648  {
649  m_txopHolder = psdu->GetAddr2 ();
650  }
651  else if (hdr.IsCts () || hdr.IsAck ())
652  {
653  m_txopHolder = psdu->GetAddr1 ();
654  }
655 }
656 
657 void
659  const WifiTxVector& txVector, bool inAmpdu)
660 {
661  // The received MPDU is either broadcast or addressed to this station
662  NS_ASSERT (mpdu->GetHeader ().GetAddr1 ().IsGroup ()
663  || mpdu->GetHeader ().GetAddr1 () == m_self);
664 
665  double rxSnr = rxSignalInfo.snr;
666  const WifiMacHeader& hdr = mpdu->GetHeader ();
667 
668  if (hdr.IsCfEnd ())
669  {
670  // reset NAV
671  NavResetTimeout ();
672  return;
673  }
674 
675  if (hdr.IsRts ())
676  {
677  NS_ABORT_MSG_IF (inAmpdu, "Received RTS as part of an A-MPDU");
678 
679  // If a non-VHT STA receives an RTS frame with the RA address matching the
680  // MAC address of the STA and the MAC address in the TA field in the RTS
681  // frame matches the saved TXOP holder address, then the STA shall send the
682  // CTS frame after SIFS, without regard for, and without resetting, its NAV.
683  // (sec. 10.22.2.4 of 802.11-2016)
684  if (hdr.GetAddr2 () == m_txopHolder || m_navEnd <= Simulator::Now ())
685  {
686  NS_LOG_DEBUG ("Received RTS from=" << hdr.GetAddr2 () << ", schedule CTS");
688  this, hdr, txVector.GetMode (), rxSnr);
689  }
690  else
691  {
692  NS_LOG_DEBUG ("Received RTS from=" << hdr.GetAddr2 () << ", cannot schedule CTS");
693  }
694  return;
695  }
696 
697  if (hdr.IsQosData ())
698  {
699  if (hdr.GetAddr1 () == m_self && hdr.GetQosAckPolicy () == WifiMacHeader::NORMAL_ACK)
700  {
701  NS_LOG_DEBUG ("Received " << hdr.GetTypeString () << " from=" << hdr.GetAddr2 () << ", schedule ACK");
703  this, hdr, txVector, rxSnr);
704  }
705 
706  // Forward up the frame if it is not a QoS Null frame
707  if (hdr.HasData ())
708  {
709  m_rxMiddle->Receive (mpdu);
710  }
711 
712  // the received data frame has been processed
713  return;
714  }
715 
716  return FrameExchangeManager::ReceiveMpdu (mpdu, rxSignalInfo, txVector, inAmpdu);
717 }
718 
719 } //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:487
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:1632
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:1024
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:519
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:548
ns3::FrameExchangeManager::SendNormalAck
void SendNormalAck(const WifiMacHeader &hdr, const WifiTxVector &dataTxVector, double dataSnr)
Send Normal Ack.
Definition: frame-exchange-manager.cc:678
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:1611
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:565
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:406
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:458
ns3::QosFrameExchangeManager::TransmissionSucceeded
void TransmissionSucceeded(void) override
Take necessary actions upon a transmission success.
Definition: qos-frame-exchange-manager.cc:536
ns3::WifiPhy::GetPifs
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:935
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:1016
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:658
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::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:642
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:556
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:72
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:527
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:738
ns3::Mac48Address::GetBroadcast
static Mac48Address GetBroadcast(void)
Definition: mac48-address.cc:170
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:615
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:468
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:507
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:1125
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:441
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:520
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:641
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:392
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:514
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::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:545
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:342
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:758
ns3::QosTxop::GetNextMpdu
Ptr< WifiMacQueueItem > GetNextMpdu(Ptr< const WifiMacQueueItem > peekedItem, WifiTxParameters &txParams, Time availableTime, bool initialFrame)
Prepare the frame to transmit starting from the MPDU that has been previously peeked by calling PeekN...
Definition: qos-txop.cc:437
ns3::FrameExchangeManager::ForwardMpduDown
virtual void ForwardMpduDown(Ptr< WifiMacQueueItem > mpdu, WifiTxVector &txVector)
Forward an MPDU down to the PHY layer.
Definition: frame-exchange-manager.cc:439
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:309
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:633
ns3::QosTxop::PeekNextMpdu
Ptr< const WifiMacQueueItem > PeekNextMpdu(uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast(), Ptr< const WifiMacQueueItem > item=nullptr)
Peek the next frame to transmit to the given receiver and of the given TID from the EDCA queue.
Definition: qos-txop.cc:357
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:108
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:102
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:493
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:911
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:951
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:1790
ns3::QosTxop::IsTxopStarted
virtual bool IsTxopStarted(void) const
Return true if a TXOP has started.
Definition: qos-txop.cc:538
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:559