A Discrete-Event Network Simulator
API
edca-txop-n.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  */
22 
23 #include "ns3/log.h"
24 #include "ns3/assert.h"
25 #include "ns3/pointer.h"
26 #include "edca-txop-n.h"
27 #include "mac-low.h"
28 #include "dcf-manager.h"
29 #include "mac-tx-middle.h"
30 #include "wifi-mac-trailer.h"
31 #include "wifi-mac.h"
32 #include "random-stream.h"
33 #include "wifi-mac-queue.h"
34 #include "msdu-aggregator.h"
35 #include "mpdu-aggregator.h"
36 #include "mgt-headers.h"
38 
39 #undef NS_LOG_APPEND_CONTEXT
40 #define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] "; }
41 
42 namespace ns3 {
43 
44 NS_LOG_COMPONENT_DEFINE ("EdcaTxopN");
45 
46 class EdcaTxopN::Dcf : public DcfState
47 {
48 public:
49  Dcf (EdcaTxopN * txop)
50  : m_txop (txop)
51  {
52  }
53 
54  virtual bool IsEdca (void) const
55  {
56  return true;
57  }
58 
59 private:
60  virtual void DoNotifyAccessGranted (void)
61  {
63  }
64  virtual void DoNotifyInternalCollision (void)
65  {
67  }
68  virtual void DoNotifyCollision (void)
69  {
71  }
72  virtual void DoNotifyChannelSwitching (void)
73  {
75  }
76  virtual void DoNotifySleep (void)
77  {
78  m_txop->NotifySleep ();
79  }
80  virtual void DoNotifyWakeUp (void)
81  {
82  m_txop->NotifyWakeUp ();
83  }
84 
86 };
87 
88 
90 {
91 public:
94  m_txop (txop)
95  {
96  }
97 
99  {
100  }
101 
102  virtual void GotCts (double snr, WifiMode txMode)
103  {
104  m_txop->GotCts (snr, txMode);
105  }
106  virtual void MissedCts (void)
107  {
108  m_txop->MissedCts ();
109  }
110  virtual void GotAck (double snr, WifiMode txMode)
111  {
112  m_txop->GotAck (snr, txMode);
113  }
114  virtual void MissedAck (void)
115  {
116  m_txop->MissedAck ();
117  }
118  virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address source, double rxSnr, WifiMode txMode, double dataSnr)
119  {
120  m_txop->GotBlockAck (blockAck, source, rxSnr, txMode, dataSnr);
121  }
122  virtual void MissedBlockAck (uint32_t nMpdus)
123  {
124  m_txop->MissedBlockAck (nMpdus);
125  }
126  virtual void StartNext (void)
127  {
128  m_txop->StartNext ();
129  }
130  virtual void Cancel (void)
131  {
132  m_txop->Cancel ();
133  }
134  virtual void EndTxNoAck (void)
135  {
136  m_txop->EndTxNoAck ();
137  }
139  {
140  return m_txop->GetEdcaQueue ();
141  }
142 
143 private:
145 };
146 
147 
149 {
150 public:
153  m_txop (txop)
154  {
155  }
157  {
158  }
159 
160  virtual void BlockAckInactivityTimeout (Mac48Address address, uint8_t tid)
161  {
162  m_txop->SendDelbaFrame (address, tid, false);
163  }
165  {
166  return m_txop->GetEdcaQueue ();
167  }
168  virtual void CompleteTransfer (Mac48Address recipient, uint8_t tid)
169  {
170  m_txop->CompleteAmpduTransfer (recipient, tid);
171  }
172  virtual void SetAmpdu (Mac48Address dest, bool enableAmpdu)
173  {
174  return m_txop->SetAmpduExist (dest, enableAmpdu);
175  }
176  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp)
177  {
178  m_txop->CompleteMpduTx (packet, hdr, tstamp);
179  }
180  virtual uint16_t GetNextSequenceNumberfor (WifiMacHeader *hdr)
181  {
182  return m_txop->GetNextSequenceNumberfor (hdr);
183  }
184  virtual uint16_t PeekNextSequenceNumberfor (WifiMacHeader *hdr)
185  {
186  return m_txop->PeekNextSequenceNumberfor (hdr);
187  }
188  virtual Ptr<const Packet> PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp)
189  {
190  return m_txop->PeekNextRetransmitPacket (header, recipient, tid, timestamp);
191  }
192  virtual void RemoveFromBaQueue (uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
193  {
194  m_txop->RemoveRetransmitPacket (tid, recipient, seqnumber);
195  }
196  virtual bool GetBlockAckAgreementExists (Mac48Address address, uint8_t tid)
197  {
198  return m_txop->GetBaAgreementExists (address,tid);
199  }
200  virtual uint32_t GetNOutstandingPackets (Mac48Address address, uint8_t tid)
201  {
202  return m_txop->GetNOutstandingPacketsInBa (address, tid);
203  }
204  virtual uint32_t GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) const
205  {
206  return m_txop->GetNRetryNeededPackets (recipient, tid);
207  }
209  {
210  return m_txop->GetMsduAggregator ();
211  }
213  {
214  return m_txop->GetMpduAggregator ();
215  }
217  {
218  return m_txop->MapSrcAddressForAggregation (hdr);
219  }
221  {
222  return m_txop->MapDestAddressForAggregation (hdr);
223  }
224 
225 private:
227 };
228 
230 
231 TypeId
233 {
234  static TypeId tid = TypeId ("ns3::EdcaTxopN")
235  .SetParent<ns3::Dcf> ()
236  .SetGroupName ("Wifi")
237  .AddConstructor<EdcaTxopN> ()
238  .AddAttribute ("Queue",
239  "The WifiMacQueue object",
240  PointerValue (),
242  MakePointerChecker<WifiMacQueue> ())
243  ;
244  return tid;
245 }
246 
248  : m_manager (0),
249  m_currentPacket (0),
250  m_msduAggregator (0),
251  m_mpduAggregator (0),
252  m_typeOfStation (STA),
253  m_blockAckType (COMPRESSED_BLOCK_ACK)
254 {
255  NS_LOG_FUNCTION (this);
258  m_dcf = new EdcaTxopN::Dcf (this);
259  m_queue = CreateObject<WifiMacQueue> ();
260  m_rng = new RealRandomStream ();
262  m_baManager = new BlockAckManager ();
267  m_baManager->SetMaxPacketDelay (m_queue->GetMaxDelay ());
270 }
271 
273 {
274  NS_LOG_FUNCTION (this);
275 }
276 
277 void
279 {
280  NS_LOG_FUNCTION (this);
281  m_queue = 0;
282  m_low = 0;
283  m_stationManager = 0;
284  delete m_transmissionListener;
285  delete m_dcf;
286  delete m_rng;
288  delete m_baManager;
289  delete m_blockAckListener;
291  m_dcf = 0;
292  m_rng = 0;
294  m_baManager = 0;
295  m_blockAckListener = 0;
296  m_txMiddle = 0;
297  m_msduAggregator = 0;
298  m_mpduAggregator = 0;
299 }
300 
301 bool
303 {
304  return m_baManager->ExistsAgreement (address, tid);
305 }
306 
307 uint32_t
309 {
310  return m_baManager->GetNBufferedPackets (address, tid);
311 }
312 
313 uint32_t
314 EdcaTxopN::GetNRetryNeededPackets (Mac48Address recipient, uint8_t tid) const
315 {
316  return m_baManager->GetNRetryNeededPackets (recipient, tid);
317 }
318 
319 void
321 {
322  m_baManager->CompleteAmpduExchange (recipient, tid);
323 }
324 
325 void
327 {
328  NS_LOG_FUNCTION (this << manager);
329  m_manager = manager;
330  m_manager->Add (m_dcf);
331 }
332 
333 void
335 {
336  NS_LOG_FUNCTION (this << &callback);
337  m_txOkCallback = callback;
338 }
339 
340 void
342 {
343  NS_LOG_FUNCTION (this << &callback);
344  m_txFailedCallback = callback;
345 }
346 
347 void
349 {
350  NS_LOG_FUNCTION (this << remoteManager);
351  m_stationManager = remoteManager;
353 }
354 
355 void
357 {
358  NS_LOG_FUNCTION (this << static_cast<uint32_t> (type));
359  m_typeOfStation = type;
360 }
361 
362 enum TypeOfStation
364 {
365  NS_LOG_FUNCTION (this);
366  return m_typeOfStation;
367 }
368 
371 {
372  NS_LOG_FUNCTION (this);
373  return m_queue;
374 }
375 
376 void
377 EdcaTxopN::SetMinCw (uint32_t minCw)
378 {
379  NS_LOG_FUNCTION (this << minCw);
380  m_dcf->SetCwMin (minCw);
381 }
382 
383 void
384 EdcaTxopN::SetMaxCw (uint32_t maxCw)
385 {
386  NS_LOG_FUNCTION (this << maxCw);
387  m_dcf->SetCwMax (maxCw);
388 }
389 
390 void
391 EdcaTxopN::SetAifsn (uint32_t aifsn)
392 {
393  NS_LOG_FUNCTION (this << aifsn);
394  m_dcf->SetAifsn (aifsn);
395 }
396 
397 uint32_t
399 {
400  NS_LOG_FUNCTION (this);
401  return m_dcf->GetCwMin ();
402 }
403 
404 uint32_t
406 {
407  NS_LOG_FUNCTION (this);
408  return m_dcf->GetCwMax ();
409 }
410 
411 uint32_t
413 {
414  NS_LOG_FUNCTION (this);
415  return m_dcf->GetAifsn ();
416 }
417 
418 void
420 {
421  NS_LOG_FUNCTION (this << txMiddle);
422  m_txMiddle = txMiddle;
423 }
424 
427 {
428  NS_LOG_FUNCTION (this);
429  return m_low;
430 }
431 
432 void
434 {
435  NS_LOG_FUNCTION (this << low);
436  m_low = low;
437 }
438 
439 bool
441 {
442  NS_LOG_FUNCTION (this);
443  return !m_queue->IsEmpty () || m_currentPacket != 0 || m_baManager->HasPackets ();
444 }
445 
447 {
448  return m_txMiddle->GetNextSequenceNumberfor (hdr);
449 }
450 
452 {
454 }
455 
457 EdcaTxopN::PeekNextRetransmitPacket (WifiMacHeader &header,Mac48Address recipient, uint8_t tid, Time *timestamp)
458 {
459  return m_baManager->PeekNextPacket (header,recipient,tid, timestamp);
460 }
461 
462 void
463 EdcaTxopN::RemoveRetransmitPacket (uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
464 {
465  m_baManager->RemovePacket (tid, recipient, seqnumber);
466 }
467 
468 void
470 {
471  NS_LOG_FUNCTION (this);
472  if (m_currentPacket == 0)
473  {
474  if (m_queue->IsEmpty () && !m_baManager->HasPackets ())
475  {
476  NS_LOG_DEBUG ("queue is empty");
477  return;
478  }
480  {
482  return;
483  }
484  /* check if packets need retransmission are stored in BlockAckManager */
486  if (m_currentPacket == 0)
487  {
488  if (m_queue->PeekFirstAvailable (&m_currentHdr, m_currentPacketTimestamp, m_qosBlockedDestinations) == 0)
489  {
490  NS_LOG_DEBUG ("no available packets in the queue");
491  return;
492  }
495  && SetupBlockAckIfNeeded ())
496  {
497  return;
498  }
500  NS_ASSERT (m_currentPacket != 0);
501 
502  uint16_t sequence = m_txMiddle->GetNextSequenceNumberfor (&m_currentHdr);
503  m_currentHdr.SetSequenceNumber (sequence);
508  m_fragmentNumber = 0;
509  NS_LOG_DEBUG ("dequeued size=" << m_currentPacket->GetSize () <<
510  ", to=" << m_currentHdr.GetAddr1 () <<
511  ", seq=" << m_currentHdr.GetSequenceControl ());
513  {
514  VerifyBlockAck ();
515  }
516  }
517  }
519  params.DisableOverrideDurationId ();
520  if (m_currentHdr.GetAddr1 ().IsGroup ())
521  {
522  params.DisableRts ();
523  params.DisableAck ();
524  params.DisableNextData ();
526  &m_currentHdr,
527  params,
529 
530  NS_LOG_DEBUG ("tx broadcast");
531  }
533  {
535  }
536  else
537  {
539  {
540  params.DisableAck ();
541  }
542  else
543  {
544  params.EnableAck ();
545  }
549  && NeedFragmentation ())
550  {
551  //With COMPRESSED_BLOCK_ACK fragmentation must be avoided.
552  params.DisableRts ();
553  WifiMacHeader hdr;
554  Ptr<Packet> fragment = GetFragmentPacket (&hdr);
555  if (IsLastFragment ())
556  {
557  NS_LOG_DEBUG ("fragmenting last fragment size=" << fragment->GetSize ());
558  params.DisableNextData ();
559  }
560  else
561  {
562  NS_LOG_DEBUG ("fragmenting size=" << fragment->GetSize ());
564  }
565  m_low->StartTransmission (fragment, &hdr, params,
567  }
568  else
569  {
570  WifiMacHeader peekedHdr;
571  Time tstamp;
572  if (m_currentHdr.IsQosData ()
573  && m_queue->PeekByTidAndAddress (&peekedHdr, m_currentHdr.GetQosTid (),
576  && m_msduAggregator != 0 && !m_currentHdr.IsRetry ())
577  {
578  /* here is performed aggregation */
579  Ptr<Packet> currentAggregatedPacket = Create<Packet> ();
580  m_msduAggregator->Aggregate (m_currentPacket, currentAggregatedPacket,
581  MapSrcAddressForAggregation (peekedHdr),
582  MapDestAddressForAggregation (peekedHdr));
583  bool aggregated = false;
584  bool isAmsdu = false;
585  Ptr<const Packet> peekedPacket = m_queue->PeekByTidAndAddress (&peekedHdr, m_currentHdr.GetQosTid (),
587  m_currentHdr.GetAddr1 (), &tstamp);
588  while (peekedPacket != 0)
589  {
590  aggregated = m_msduAggregator->Aggregate (peekedPacket, currentAggregatedPacket,
591  MapSrcAddressForAggregation (peekedHdr),
592  MapDestAddressForAggregation (peekedHdr));
593  if (aggregated)
594  {
595  isAmsdu = true;
596  m_queue->Remove (peekedPacket);
597  }
598  else
599  {
600  break;
601  }
602  peekedPacket = m_queue->PeekByTidAndAddress (&peekedHdr, m_currentHdr.GetQosTid (),
604  }
605  if (isAmsdu)
606  {
609  m_currentPacket = currentAggregatedPacket;
610  currentAggregatedPacket = 0;
611  NS_LOG_DEBUG ("tx unicast A-MSDU");
612  }
613  }
614  params.DisableNextData ();
616  params, m_transmissionListener);
618  {
619  CompleteTx ();
620  }
621  }
622  }
623 }
624 
626 {
627  NS_LOG_FUNCTION (this);
628  NotifyCollision ();
629 }
630 
631 void
633 {
634  NS_LOG_FUNCTION (this);
637 }
638 
639 void
640 EdcaTxopN::GotCts (double snr, WifiMode txMode)
641 {
642  NS_LOG_FUNCTION (this << snr << txMode);
643  NS_LOG_DEBUG ("got cts");
644 }
645 
646 void
648 {
649  NS_LOG_FUNCTION (this);
650  NS_LOG_DEBUG ("missed cts");
651  if (!NeedRtsRetransmission ())
652  {
653  NS_LOG_DEBUG ("Cts Fail");
654  bool resetCurrentPacket = true;
656  if (!m_txFailedCallback.IsNull ())
657  {
659  }
661  {
663  uint8_t tid = 0;
664  if (m_currentHdr.IsQosData ())
665  {
666  tid = m_currentHdr.GetQosTid ();
667  }
668  else if (m_currentHdr.IsBlockAckReq ())
669  {
670  CtrlBAckRequestHeader baReqHdr;
671  m_currentPacket->PeekHeader (baReqHdr);
672  tid = baReqHdr.GetTidInfo ();
673  }
674  else
675  {
676  NS_FATAL_ERROR ("Current packet is not Qos Data nor BlockAckReq");
677  }
678 
680  {
681  NS_LOG_DEBUG ("Transmit Block Ack Request");
682  CtrlBAckRequestHeader reqHdr;
683  reqHdr.SetType (COMPRESSED_BLOCK_ACK);
685  reqHdr.SetTidInfo (tid);
686  reqHdr.SetHtImmediateAck (true);
687  Ptr<Packet> bar = Create<Packet> ();
688  bar->AddHeader (reqHdr);
689  Bar request (bar, m_currentHdr.GetAddr1 (), tid, reqHdr.MustSendHtImmediateAck ());
690  m_currentBar = request;
691  WifiMacHeader hdr;
693  hdr.SetAddr1 (request.recipient);
694  hdr.SetAddr2 (m_low->GetAddress ());
695  hdr.SetAddr3 (m_low->GetBssid ());
696  hdr.SetDsNotTo ();
697  hdr.SetDsNotFrom ();
698  hdr.SetNoRetry ();
699  hdr.SetNoMoreFragments ();
700  m_currentPacket = request.bar;
701  m_currentHdr = hdr;
702  resetCurrentPacket = false;
703  }
704  }
705  //to reset the dcf.
706  if (resetCurrentPacket == true)
707  {
708  m_currentPacket = 0;
709  }
710  m_dcf->ResetCw ();
711  }
712  else
713  {
714  m_dcf->UpdateFailedCw ();
715  }
718 }
719 
720 void
722 {
723  NS_LOG_FUNCTION (this);
724  m_queue->Flush ();
725  m_currentPacket = 0;
726 }
727 
728 void
730 {
731  NS_LOG_FUNCTION (this);
732  if (m_currentPacket != 0)
733  {
734  m_queue->PushFront (m_currentPacket, m_currentHdr);
735  m_currentPacket = 0;
736  }
737 }
738 
739 void
741 {
742  NS_LOG_FUNCTION (this);
744 }
745 
746 void
748 {
749  NS_LOG_FUNCTION (this << packet << &hdr);
750  WifiMacTrailer fcs;
751  m_stationManager->PrepareForQueue (hdr.GetAddr1 (), &hdr, packet);
752  m_queue->Enqueue (packet, hdr);
754 }
755 
756 void
757 EdcaTxopN::GotAck (double snr, WifiMode txMode)
758 {
759  NS_LOG_FUNCTION (this << snr << txMode);
760  if (!NeedFragmentation ()
761  || IsLastFragment ()
762  || m_currentHdr.IsQosAmsdu ())
763  {
764  NS_LOG_DEBUG ("got ack. tx done.");
765  if (!m_txOkCallback.IsNull ())
766  {
768  }
769 
770  if (m_currentHdr.IsAction ())
771  {
772  WifiActionHeader actionHdr;
774  p->RemoveHeader (actionHdr);
775  if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK
777  {
778  MgtDelBaHeader delBa;
779  p->PeekHeader (delBa);
780  if (delBa.IsByOriginator ())
781  {
783  }
784  else
785  {
787  }
788  }
789  }
790  m_currentPacket = 0;
791 
792  m_dcf->ResetCw ();
795  }
796  else
797  {
798  NS_LOG_DEBUG ("got ack. tx not done, size=" << m_currentPacket->GetSize ());
799  }
800 }
801 
802 void
804 {
805  NS_LOG_FUNCTION (this);
806  NS_LOG_DEBUG ("missed ack");
807  if (!NeedDataRetransmission ())
808  {
809  NS_LOG_DEBUG ("Ack Fail");
811  bool resetCurrentPacket = true;
812  if (!m_txFailedCallback.IsNull ())
813  {
815  }
817  {
818  uint8_t tid = 0;
819  if (m_currentHdr.IsQosData ())
820  {
821  tid = m_currentHdr.GetQosTid ();
822  }
823  else
824  {
825  NS_FATAL_ERROR ("Current packet is not Qos Data");
826  }
827 
829  {
830  //send Block ACK Request in order to shift WinStart at the receiver
831  NS_LOG_DEBUG ("Transmit Block Ack Request");
832  CtrlBAckRequestHeader reqHdr;
833  reqHdr.SetType (COMPRESSED_BLOCK_ACK);
835  reqHdr.SetTidInfo (tid);
836  reqHdr.SetHtImmediateAck (true);
837  Ptr<Packet> bar = Create<Packet> ();
838  bar->AddHeader (reqHdr);
839  Bar request (bar, m_currentHdr.GetAddr1 (), tid, reqHdr.MustSendHtImmediateAck ());
840  m_currentBar = request;
841  WifiMacHeader hdr;
843  hdr.SetAddr1 (request.recipient);
844  hdr.SetAddr2 (m_low->GetAddress ());
845  hdr.SetAddr3 (m_low->GetBssid ());
846  hdr.SetDsNotTo ();
847  hdr.SetDsNotFrom ();
848  hdr.SetNoRetry ();
849  hdr.SetNoMoreFragments ();
850  m_currentPacket = request.bar;
851  m_currentHdr = hdr;
852  resetCurrentPacket = false;
853  }
854  }
855  //to reset the dcf.
856  if (resetCurrentPacket == true)
857  {
858  m_currentPacket = 0;
859  }
860  m_dcf->ResetCw ();
861  }
862  else
863  {
864  NS_LOG_DEBUG ("Retransmit");
866  m_dcf->UpdateFailedCw ();
867  }
870 }
871 
872 void
873 EdcaTxopN::MissedBlockAck (uint32_t nMpdus)
874 {
875  NS_LOG_FUNCTION (this);
876  NS_LOG_DEBUG ("missed block ack");
877  uint8_t tid = 0;
878  if (m_currentHdr.IsQosData ())
879  {
880  tid = m_currentHdr.GetQosTid ();
881  }
882  else if (m_currentHdr.IsBlockAckReq ())
883  {
884  CtrlBAckRequestHeader baReqHdr;
885  m_currentPacket->PeekHeader (baReqHdr);
886  tid = baReqHdr.GetTidInfo ();
887  }
888  else if (m_currentHdr.IsBlockAck ())
889  {
890  CtrlBAckResponseHeader baRespHdr;
891  m_currentPacket->PeekHeader (baRespHdr);
892  tid = baRespHdr.GetTidInfo ();
893  }
895  {
896  m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), tid, 0, nMpdus, 0, 0);
897  }
898  if (NeedBarRetransmission ())
899  {
901  {
902  //should i report this to station addressed by ADDR1?
903  NS_LOG_DEBUG ("Retransmit block ack request");
905  }
906  else
907  {
908  //standard says when loosing a BlockAck originator may send a BAR page 139
909  NS_LOG_DEBUG ("Transmit Block Ack Request");
910  CtrlBAckRequestHeader reqHdr;
911  reqHdr.SetType (COMPRESSED_BLOCK_ACK);
912  if (m_currentHdr.IsQosData ())
913  {
915  }
916  else if (m_currentHdr.IsBlockAckReq ())
917  {
918  CtrlBAckRequestHeader baReqHdr;
919  m_currentPacket->PeekHeader (baReqHdr);
920  reqHdr.SetStartingSequence (baReqHdr.GetStartingSequence ());
921  }
922  else if (m_currentHdr.IsBlockAck ())
923  {
924  CtrlBAckResponseHeader baRespHdr;
925  m_currentPacket->PeekHeader (baRespHdr);
927  }
928  reqHdr.SetTidInfo (tid);
929  reqHdr.SetHtImmediateAck (true);
930  Ptr<Packet> bar = Create<Packet> ();
931  bar->AddHeader (reqHdr);
932  Bar request (bar, m_currentHdr.GetAddr1 (), tid, reqHdr.MustSendHtImmediateAck ());
933  m_currentBar = request;
934  WifiMacHeader hdr;
936  hdr.SetAddr1 (request.recipient);
937  hdr.SetAddr2 (m_low->GetAddress ());
938  hdr.SetAddr3 (m_low->GetBssid ());
939  hdr.SetDsNotTo ();
940  hdr.SetDsNotFrom ();
941  hdr.SetNoRetry ();
942  hdr.SetNoMoreFragments ();
943 
944  m_currentPacket = request.bar;
945  m_currentHdr = hdr;
946  }
947  m_dcf->UpdateFailedCw ();
948  }
949  else
950  {
951  NS_LOG_DEBUG ("Block Ack Request Fail");
952  //to reset the dcf.
953  m_currentPacket = 0;
954  m_dcf->ResetCw ();
955  }
958 }
959 
962 {
963  return m_msduAggregator;
964 }
965 
968 {
969  return m_mpduAggregator;
970 }
971 
972 void
974 {
975  NS_LOG_FUNCTION (this);
976  if ((m_currentPacket != 0
977  || !m_queue->IsEmpty () || m_baManager->HasPackets ())
978  && !m_dcf->IsAccessRequested ())
979  {
981  }
982 }
983 
984 void
986 {
987  NS_LOG_FUNCTION (this);
988  if (m_currentPacket == 0
989  && (!m_queue->IsEmpty () || m_baManager->HasPackets ())
990  && !m_dcf->IsAccessRequested ())
991  {
993  }
994 }
995 
996 bool
998 {
999  NS_LOG_FUNCTION (this);
1001  m_currentPacket);
1002 }
1003 
1004 bool
1006 {
1007  NS_LOG_FUNCTION (this);
1009  m_currentPacket);
1010 }
1011 
1012 bool
1014 {
1015  uint8_t tid = 0;
1016  uint16_t seqNumber = 0;
1017  if (m_currentHdr.IsQosData ())
1018  {
1019  tid = m_currentHdr.GetQosTid ();
1020  seqNumber = m_currentHdr.GetSequenceNumber ();
1021  }
1022  else if (m_currentHdr.IsBlockAckReq ())
1023  {
1024  CtrlBAckRequestHeader baReqHdr;
1025  m_currentPacket->PeekHeader (baReqHdr);
1026  tid = baReqHdr.GetTidInfo ();
1027  seqNumber = baReqHdr.GetStartingSequence ();
1028  }
1029  else if (m_currentHdr.IsBlockAck ())
1030  {
1031  CtrlBAckResponseHeader baRespHdr;
1032  m_currentPacket->PeekHeader (baRespHdr);
1033  tid = baRespHdr.GetTidInfo ();
1034  seqNumber = m_currentHdr.GetSequenceNumber ();
1035  }
1036  return m_baManager->NeedBarRetransmission (tid, seqNumber, m_currentHdr.GetAddr1 ());
1037 }
1038 
1039 void
1041 {
1042  NS_LOG_FUNCTION (this);
1043  m_fragmentNumber++;
1044 }
1045 
1046 void
1048 {
1049  NS_LOG_FUNCTION (this);
1050  NS_LOG_DEBUG ("start next packet fragment");
1051  /* this callback is used only for fragments. */
1052  NextFragment ();
1053  WifiMacHeader hdr;
1054  Ptr<Packet> fragment = GetFragmentPacket (&hdr);
1056  params.EnableAck ();
1057  params.DisableRts ();
1058  params.DisableOverrideDurationId ();
1059  if (IsLastFragment ())
1060  {
1061  params.DisableNextData ();
1062  }
1063  else
1064  {
1065  params.EnableNextData (GetNextFragmentSize ());
1066  }
1067  Low ()->StartTransmission (fragment, &hdr, params, m_transmissionListener);
1068 }
1069 
1070 void
1072 {
1073  NS_LOG_FUNCTION (this);
1074  NS_LOG_DEBUG ("transmission cancelled");
1075 }
1076 
1077 void
1079 {
1080  NS_LOG_FUNCTION (this);
1081  NS_LOG_DEBUG ("a transmission that did not require an ACK just finished");
1082  m_currentPacket = 0;
1083  m_dcf->ResetCw ();
1086 }
1087 
1088 bool
1090 {
1091  NS_LOG_FUNCTION (this);
1093  m_currentPacket);
1094 }
1095 
1096 uint32_t
1098 {
1099  NS_LOG_FUNCTION (this);
1102 }
1103 
1104 uint32_t
1106 {
1107  NS_LOG_FUNCTION (this);
1110 }
1111 
1112 uint32_t
1114 {
1115  NS_LOG_FUNCTION (this);
1118 }
1119 
1120 
1121 bool
1123 {
1124  NS_LOG_FUNCTION (this);
1127 }
1128 
1131 {
1132  NS_LOG_FUNCTION (this << hdr);
1133  *hdr = m_currentHdr;
1135  uint32_t startOffset = GetFragmentOffset ();
1136  Ptr<Packet> fragment;
1137  if (IsLastFragment ())
1138  {
1139  hdr->SetNoMoreFragments ();
1140  }
1141  else
1142  {
1143  hdr->SetMoreFragments ();
1144  }
1145  fragment = m_currentPacket->CreateFragment (startOffset,
1146  GetFragmentSize ());
1147  return fragment;
1148 }
1149 
1150 void
1152 {
1153  NS_LOG_FUNCTION (this << static_cast<uint32_t> (ac));
1154  m_ac = ac;
1155 }
1156 
1159 {
1160  NS_LOG_FUNCTION (this << &hdr);
1161  Mac48Address retval;
1163  {
1164  retval = hdr.GetAddr2 ();
1165  }
1166  else
1167  {
1168  retval = hdr.GetAddr3 ();
1169  }
1170  return retval;
1171 }
1172 
1175 {
1176  NS_LOG_FUNCTION (this << &hdr);
1177  Mac48Address retval;
1179  {
1180  retval = hdr.GetAddr1 ();
1181  }
1182  else
1183  {
1184  retval = hdr.GetAddr3 ();
1185  }
1186  return retval;
1187 }
1188 
1189 void
1191 {
1192  NS_LOG_FUNCTION (this << aggr);
1193  m_msduAggregator = aggr;
1194 }
1195 
1196 void
1198 {
1199  NS_LOG_FUNCTION (this << aggr);
1200  m_mpduAggregator = aggr;
1201 }
1202 
1203 void
1205 {
1206  NS_LOG_FUNCTION (this << packet << &hdr);
1207  WifiMacTrailer fcs;
1208  m_stationManager->PrepareForQueue (hdr.GetAddr1 (), &hdr, packet);
1209  m_queue->PushFront (packet, hdr);
1211 }
1212 
1213 void
1215 {
1216  NS_LOG_FUNCTION (this << respHdr << recipient);
1217  NS_LOG_DEBUG ("received ADDBA response from " << recipient);
1218  uint8_t tid = respHdr->GetTid ();
1220  {
1221  if (respHdr->GetStatusCode ().IsSuccess ())
1222  {
1223  NS_LOG_DEBUG ("block ack agreement established with " << recipient);
1224  m_baManager->UpdateAgreement (respHdr, recipient);
1225  }
1226  else
1227  {
1228  NS_LOG_DEBUG ("discard ADDBA response" << recipient);
1229  m_baManager->NotifyAgreementUnsuccessful (recipient, tid);
1230  }
1231  }
1233 }
1234 
1235 void
1237 {
1238  NS_LOG_FUNCTION (this << delBaHdr << recipient);
1239  NS_LOG_DEBUG ("received DELBA frame from=" << recipient);
1240  m_baManager->TearDownBlockAck (recipient, delBaHdr->GetTid ());
1241 }
1242 
1243 void
1244 EdcaTxopN::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr)
1245 {
1246  NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << txMode.GetUniqueName () << dataSnr);
1247  NS_LOG_DEBUG ("got block ack from=" << recipient);
1248  m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, txMode, dataSnr);
1249  if (!m_txOkCallback.IsNull ())
1250  {
1252  }
1253  m_currentPacket = 0;
1254  m_dcf->ResetCw ();
1257 }
1258 
1259 void
1261 {
1262  NS_LOG_FUNCTION (this);
1263  uint8_t tid = m_currentHdr.GetQosTid ();
1264  Mac48Address recipient = m_currentHdr.GetAddr1 ();
1265  uint16_t sequence = m_currentHdr.GetSequenceNumber ();
1267  {
1268  m_baManager->SwitchToBlockAckIfNeeded (recipient, tid, sequence);
1269  }
1271  {
1273  }
1274 }
1275 
1277 {
1278  NS_LOG_FUNCTION (this << dest);
1279  if (m_aMpduEnabled.find (dest) != m_aMpduEnabled.end ())
1280  {
1281  return m_aMpduEnabled.find (dest)->second;
1282  }
1283  return false;
1284 }
1285 
1286 void EdcaTxopN::SetAmpduExist (Mac48Address dest, bool enableAmpdu)
1287 {
1288  NS_LOG_FUNCTION (this << dest << enableAmpdu);
1289  if (m_aMpduEnabled.find (dest) != m_aMpduEnabled.end () && m_aMpduEnabled.find (dest)->second != enableAmpdu)
1290  {
1291  m_aMpduEnabled.erase (m_aMpduEnabled.find (dest));
1292  }
1293  if (m_aMpduEnabled.find (dest) == m_aMpduEnabled.end ())
1294  {
1295  m_aMpduEnabled.insert (std::make_pair (dest, enableAmpdu));
1296  }
1297 }
1298 
1299 void
1301 {
1302  NS_LOG_FUNCTION (this);
1304  {
1305  if (!m_currentHdr.IsRetry ())
1306  {
1308  }
1312  }
1313 }
1314 
1315 void
1317 {
1318  NS_ASSERT (hdr.IsQosData ());
1319  m_baManager->StorePacket (packet, hdr, tstamp);
1323 }
1324 
1325 bool
1327 {
1328  NS_LOG_FUNCTION (this);
1329  uint8_t tid = m_currentHdr.GetQosTid ();
1330  Mac48Address recipient = m_currentHdr.GetAddr1 ();
1331 
1332  uint32_t packets = m_queue->GetNPacketsByTidAndAddress (tid, WifiMacHeader::ADDR1, recipient);
1333 
1334  if ((m_blockAckThreshold > 0 && packets >= m_blockAckThreshold) || (packets > 1 && m_mpduAggregator != 0) || m_stationManager->HasVhtSupported ())
1335  {
1336  /* Block ack setup */
1337  uint16_t startingSequence = m_txMiddle->GetNextSeqNumberByTidAndAddress (tid, recipient);
1338  SendAddBaRequest (recipient, tid, startingSequence, m_blockAckInactivityTimeout, true);
1339  return true;
1340  }
1341  return false;
1342 }
1343 
1344 void
1346 {
1347  NS_LOG_FUNCTION (this << &bar);
1348  WifiMacHeader hdr;
1350  hdr.SetAddr1 (bar.recipient);
1351  hdr.SetAddr2 (m_low->GetAddress ());
1352  hdr.SetAddr3 (m_low->GetBssid ());
1353  hdr.SetDsNotTo ();
1354  hdr.SetDsNotFrom ();
1355  hdr.SetNoRetry ();
1356  hdr.SetNoMoreFragments ();
1357 
1358  m_currentPacket = bar.bar;
1359  m_currentHdr = hdr;
1360 
1362  params.DisableRts ();
1363  params.DisableNextData ();
1364  params.DisableOverrideDurationId ();
1365  if (bar.immediate)
1366  {
1368  {
1369  params.EnableBasicBlockAck ();
1370  }
1372  {
1373  params.EnableCompressedBlockAck ();
1374  }
1375  else if (m_blockAckType == MULTI_TID_BLOCK_ACK)
1376  {
1377  NS_FATAL_ERROR ("Multi-tid block ack is not supported");
1378  }
1379  }
1380  else
1381  {
1382  //Delayed block ack
1383  params.EnableAck ();
1384  }
1386 }
1387 
1388 void
1390 {
1391  NS_LOG_FUNCTION (this);
1395 }
1396 
1397 void
1399 {
1400  NS_LOG_FUNCTION (this << static_cast<uint32_t> (threshold));
1401  m_blockAckThreshold = threshold;
1402  m_baManager->SetBlockAckThreshold (threshold);
1403 }
1404 
1405 void
1407 {
1408  NS_LOG_FUNCTION (this << timeout);
1410 }
1411 
1412 uint8_t
1414 {
1415  NS_LOG_FUNCTION (this);
1416  return m_blockAckThreshold;
1417 }
1418 
1419 void
1420 EdcaTxopN::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16_t startSeq,
1421  uint16_t timeout, bool immediateBAck)
1422 {
1423  NS_LOG_FUNCTION (this << dest << static_cast<uint32_t> (tid) << startSeq << timeout << immediateBAck);
1424  NS_LOG_DEBUG ("sent ADDBA request to " << dest);
1425  WifiMacHeader hdr;
1426  hdr.SetAction ();
1427  hdr.SetAddr1 (dest);
1428  hdr.SetAddr2 (m_low->GetAddress ());
1429  hdr.SetAddr3 (m_low->GetAddress ());
1430  hdr.SetDsNotTo ();
1431  hdr.SetDsNotFrom ();
1432 
1433  WifiActionHeader actionHdr;
1436  actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action);
1437 
1438  Ptr<Packet> packet = Create<Packet> ();
1439  /*Setting ADDBARequest header*/
1440  MgtAddBaRequestHeader reqHdr;
1441  reqHdr.SetAmsduSupport (true);
1442  if (immediateBAck)
1443  {
1444  reqHdr.SetImmediateBlockAck ();
1445  }
1446  else
1447  {
1448  reqHdr.SetDelayedBlockAck ();
1449  }
1450  reqHdr.SetTid (tid);
1451  /* For now we don't use buffer size field in the ADDBA request frame. The recipient
1452  * will choose how many packets it can receive under block ack.
1453  */
1454  reqHdr.SetBufferSize (0);
1455  reqHdr.SetTimeout (timeout);
1456  reqHdr.SetStartingSequence (startSeq);
1457 
1458  m_baManager->CreateAgreement (&reqHdr, dest);
1459 
1460  packet->AddHeader (reqHdr);
1461  packet->AddHeader (actionHdr);
1462 
1463  m_currentPacket = packet;
1464  m_currentHdr = hdr;
1465 
1466  uint16_t sequence = m_txMiddle->GetNextSequenceNumberfor (&m_currentHdr);
1467  m_currentHdr.SetSequenceNumber (sequence);
1472 
1474  params.EnableAck ();
1475  params.DisableRts ();
1476  params.DisableNextData ();
1477  params.DisableOverrideDurationId ();
1478 
1481 }
1482 
1483 void
1484 EdcaTxopN::SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator)
1485 {
1486  NS_LOG_FUNCTION (this << addr << static_cast<uint32_t> (tid) << byOriginator);
1487  WifiMacHeader hdr;
1488  hdr.SetAction ();
1489  hdr.SetAddr1 (addr);
1490  hdr.SetAddr2 (m_low->GetAddress ());
1491  hdr.SetAddr3 (m_low->GetAddress ());
1492  hdr.SetDsNotTo ();
1493  hdr.SetDsNotFrom ();
1494 
1495  MgtDelBaHeader delbaHdr;
1496  delbaHdr.SetTid (tid);
1497  if (byOriginator)
1498  {
1499  delbaHdr.SetByOriginator ();
1500  }
1501  else
1502  {
1503  delbaHdr.SetByRecipient ();
1504  }
1505 
1506  WifiActionHeader actionHdr;
1509  actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action);
1510 
1511  Ptr<Packet> packet = Create<Packet> ();
1512  packet->AddHeader (delbaHdr);
1513  packet->AddHeader (actionHdr);
1514 
1515  PushFront (packet, hdr);
1516 }
1517 
1518 int64_t
1520 {
1521  NS_LOG_FUNCTION (this << stream);
1522  m_rng->AssignStreams (stream);
1523  return 1;
1524 }
1525 
1526 void
1528 {
1529  NS_LOG_FUNCTION (this);
1530  m_dcf->ResetCw ();
1533 }
1534 
1535 void
1537 {
1538  NS_LOG_FUNCTION (this << hdr);
1539  if (!m_txOkCallback.IsNull ())
1540  {
1542  }
1543 }
1544 
1545 void
1547 {
1548  NS_LOG_FUNCTION (this << hdr);
1549  if (!m_txFailedCallback.IsNull ())
1550  {
1552  }
1553 }
1554 
1555 } //namespace ns3
virtual uint16_t PeekNextSequenceNumberfor(WifiMacHeader *hdr)
Return the next sequence number for the Traffic ID and destination, but do not pick it (i...
Definition: edca-txop-n.cc:184
Keep track of destination address - TID pairs that are waiting for a block ACK response.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Definition: packet.cc:268
void SetAction()
Set Type/Subtype values for an action header.
void SetRetry(void)
Set the Retry bit in the Frame Control field.
void SetUnblockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
virtual void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: edca-txop-n.cc:384
void SetMoreFragments(void)
Set the More Fragment bit in the Frame Control field.
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:346
void SetType(enum BlockAckType type)
Set the block ACK type.
TransmissionListener * m_transmissionListener
Definition: edca-txop-n.h:540
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
void NotifyGotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr)
Ptr< const Packet > m_currentPacket
Definition: edca-txop-n.h:549
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void DoInitialize()
Initialize() implementation.
void SetQosAckPolicy(enum QosAckPolicy policy)
Set the QoS ACK policy in the QoS control field.
Introspection did not find any typical Config paths.
Definition: dcf.h:32
TxFailed m_txFailedCallback
Definition: edca-txop-n.h:537
virtual Mac48Address GetDestAddressForAggregation(const WifiMacHeader &hdr)
Definition: edca-txop-n.cc:220
void NotifyWakeUp(void)
When wake up operation occurs, restart channel access.
Definition: edca-txop-n.cc:740
void SetBlockAckInactivityTimeout(uint16_t timeout)
bool NeedDataRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint32_t GetCwMin(void) const
Return the minimum congestion window size.
Definition: dcf-manager.cc:90
uint32_t GetFragmentSize(void)
Calculate the size of the current fragment.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
uint16_t m_blockAckInactivityTimeout
Definition: edca-txop-n.h:563
void CreateAgreement(const MgtAddBaRequestHeader *reqHdr, Mac48Address recipient)
virtual uint32_t GetNOutstandingPackets(Mac48Address address, uint8_t tid)
Definition: edca-txop-n.cc:200
virtual bool Aggregate(Ptr< const Packet > packet, Ptr< Packet > aggregatedPacket, Mac48Address src, Mac48Address dest)=0
void VerifyBlockAck(void)
Verifies if dequeued packet has to be transmitted with ack policy Block Ack.
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:507
void NotifyCollision(void)
Notify the EDCAF that collision has occurred.
Definition: edca-txop-n.cc:632
void SetTypeOfStation(enum TypeOfStation type)
Set type of station with the given type.
Definition: edca-txop-n.cc:356
void EnableBasicBlockAck(void)
Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame.
Definition: mac-low.cc:168
void StorePacket(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tStamp)
bool NeedDataRetransmission(void)
Check if DATA should be re-transmitted if ACK was missed.
void RequestAccess(DcfState *state)
Definition: dcf-manager.cc:487
void CompleteMpduTx(Ptr< const Packet > packet, WifiMacHeader hdr, Time tstamp)
virtual void EndTxNoAck(void)
Invoked upon the end of the transmission of a frame that does not require an ACK (e.g., broadcast and multicast frames).
Definition: edca-txop-n.cc:134
bool IsAction() const
Return true if the header is an Action header.
Mac48Address GetBssid(void) const
Return the Basic Service Set Identification.
Definition: mac-low.cc:681
void SetTxFailedCallback(TxFailed callback)
Definition: edca-txop-n.cc:341
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
Implement the header for management frames of type add block ack request.
Definition: mgt-headers.h:626
void GotAck(double snr, WifiMode txMode)
Event handler when an ACK is received.
Definition: edca-txop-n.cc:757
void SetNoMoreFragments(void)
Un-set the More Fragment bit in the Frame Control Field.
void RegisterBlockAckListenerForAc(enum AcIndex ac, MacLowAggregationCapableTransmissionListener *listener)
Definition: mac-low.cc:2801
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1258
#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
bool NeedBarRetransmission(void)
Check if Block ACK Request should be re-transmitted.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
enum WifiMacType GetType(void) const
Return the type (enum WifiMacType)
uint8_t m_blockAckThreshold
Definition: edca-txop-n.h:560
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > remoteManager)
Set WifiRemoteStationsManager this EdcaTxopN is associated to.
Definition: edca-txop-n.cc:348
bool HasBar(struct Bar &bar)
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:786
bool IsBroadcast(void) const
virtual bool IsEdca(void) const
Definition: edca-txop-n.cc:54
void SetBlockAckType(enum BlockAckType bAckType)
WifiMacHeader m_currentHdr
Definition: edca-txop-n.h:551
void NotifySleep(void)
When sleep operation occurs, re-insert pending packet into front of the queue.
Definition: edca-txop-n.cc:729
void ReportAmpduTxStatus(Mac48Address address, uint8_t tid, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
void SetAction(enum CategoryValue type, ActionValue action)
Set action for this Action header.
Definition: mgt-headers.cc:720
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:145
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate ACK.
void SetAifsn(uint32_t aifsn)
Definition: dcf-manager.cc:56
bool IsBlockAck(void) const
Return true if the header is a Block ACK header.
virtual void Cancel(void)
Invoked if this transmission was canceled one way or another.
Definition: edca-txop-n.cc:130
void UpdateFragmentationThreshold(void)
Typically called to update the fragmentation threshold at the start of a new transmission.
bool IsLastFragment(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
virtual Ptr< MsduAggregator > GetMsduAggregator(void) const
Definition: edca-txop-n.cc:208
CategoryValue GetCategory()
Return the category value.
Definition: mgt-headers.cc:754
virtual Ptr< const Packet > PeekNextPacketInBaQueue(WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp)
Definition: edca-txop-n.cc:188
bool HasPackets(void) const
Returns true if there are packets that need of retransmission or at least a BAR is scheduled...
void ResetCw(void)
Update the value of the CW variable to take into account a transmission success or a transmission abo...
Definition: dcf-manager.cc:102
void PrepareForQueue(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
Ptr< MsduAggregator > m_msduAggregator
Definition: edca-txop-n.h:552
ns3::Time timeout
void SetTid(uint8_t)
Set Traffic ID (TID).
Block Ack Request.
friend class TransmissionListener
Definition: edca-txop-n.h:532
listen to events coming from ns3::MacLow.
Definition: mac-low.h:63
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
virtual void MissedAck(void)
ns3::MacLow did not receive an expected ACK within AckTimeout.
Definition: edca-txop-n.cc:114
void Add(DcfState *dcf)
Definition: dcf-manager.cc:405
void NextFragment(void)
Continue to the next fragment.
bool IsQosAmsdu(void) const
Check if the A-MSDU present bit is set in the QoS control field.
void SetTxOkCallback(TxOk callback)
Definition: edca-txop-n.cc:334
BlockAckManager * m_baManager
Definition: edca-txop-n.h:556
control how a packet is transmitted.
Definition: mac-low.h:305
bool NeedRtsRetransmission(void)
Check if RTS should be re-transmitted if CTS was missed.
Definition: edca-txop-n.cc:997
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
struct Bar m_currentBar
Definition: edca-txop-n.h:564
virtual void DoNotifyChannelSwitching(void)
Called by DcfManager to notify a DcfState subclass that a channel switching occured.
Definition: edca-txop-n.cc:72
virtual uint32_t GetAifsn(void) const
Return the number of slots that make up an AIFS.
Definition: edca-txop-n.cc:412
virtual bool GetBlockAckAgreementExists(Mac48Address address, uint8_t tid)
Definition: edca-txop-n.cc:196
Handles sequence numbering of IEEE 802.11 data frames.
Definition: mac-tx-middle.h:39
void MissedBlockAck(uint32_t nMpdus)
Event handler when a Block ACK timeout has occurred.
Definition: edca-txop-n.cc:873
Ptr< MpduAggregator > m_mpduAggregator
Definition: edca-txop-n.h:553
Ptr< const Packet > PeekNextPacket(WifiMacHeader &hdr, Mac48Address recipient, uint8_t tid, Time *timestamp)
virtual void DoNotifyCollision(void)
Called by DcfManager to notify a DcfState subclass that a normal collision occured, that is, that the medium was busy when access was requested.
Definition: edca-txop-n.cc:68
void SetTxFailedCallback(TxFailed callback)
DcfManager * m_manager
Definition: edca-txop-n.h:534
void MissedAck(void)
Event handler when an ACK is missed.
Definition: edca-txop-n.cc:803
enum TypeOfStation GetTypeOfStation(void) const
Return type of station.
Definition: edca-txop-n.cc:363
void SetLow(Ptr< MacLow > low)
Set MacLow associated with this EdcaTxopN.
Definition: edca-txop-n.cc:433
Ptr< MacLow > Low(void)
Return the MacLow associated with this EdcaTxopN.
Definition: edca-txop-n.cc:426
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
Definition: packet.cc:228
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Ptr< WifiRemoteStationManager > m_stationManager
Definition: edca-txop-n.h:543
uint8_t GetTidInfo(void) const
Return the Traffic ID (TID).
void DestroyBlockAckAgreement(Mac48Address originator, uint8_t tid)
Definition: mac-low.cc:2514
This queue contains packets for a particular access class.
Definition: edca-txop-n.h:85
void GotDelBaFrame(const MgtDelBaHeader *delBaHdr, Mac48Address recipient)
void SetQueue(Ptr< WifiMacQueue > queue)
void NotifyAccessGranted(void)
Notify the EDCAF that access has been granted.
Definition: edca-txop-n.cc:469
RandomStream * m_rng
Definition: edca-txop-n.h:542
void RemoveRetransmitPacket(uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
Remove a packet after you peek in the retransmit queue and get it.
Definition: edca-txop-n.cc:463
void ReportFinalDataFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportDataFailed if NeedDataRetransmission returns false...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:220
void NotifyInternalCollision(void)
Notify the EDCAF that internal collision has occurred.
Definition: edca-txop-n.cc:625
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
std::map< Mac48Address, bool > m_aMpduEnabled
Definition: edca-txop-n.h:102
virtual uint32_t GetNRetryNeededPackets(Mac48Address recipient, uint8_t tid) const
Definition: edca-txop-n.cc:204
void UpdateAgreement(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
virtual void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: edca-txop-n.cc:377
uint32_t GetNRetryNeededPackets(Mac48Address recipient, uint8_t tid) const
void SendAddBaRequest(Mac48Address recipient, uint8_t tid, uint16_t startSeq, uint16_t timeout, bool immediateBAck)
Sends an ADDBA Request to establish a block ack agreement with sta addressed by recipient for tid tid...
Ptr< const Packet > PeekNextRetransmitPacket(WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp)
Definition: edca-txop-n.cc:457
void SendDelbaFrame(Mac48Address addr, uint8_t tid, bool byOriginator)
virtual void GotAck(double snr, WifiMode txMode)
Definition: edca-txop-n.cc:110
uint16_t GetSequenceControl(void) const
Return the raw Sequence Control field.
bool GetBaAgreementExists(Mac48Address address, uint8_t tid)
Definition: edca-txop-n.cc:302
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ACK mechanism.
void NotifyAgreementUnsuccessful(Mac48Address recipient, uint8_t tid)
MacTxMiddle * m_txMiddle
Definition: edca-txop-n.h:539
void MissedCts(void)
Event handler when a CTS timeout has occurred.
Definition: edca-txop-n.cc:647
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
Definition: dcf-manager.h:262
virtual void GotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address source, double rxSnr, WifiMode txMode, double dataSnr)
Definition: edca-txop-n.cc:118
enum BlockAckActionValue blockAck
Definition: mgt-headers.h:579
bool GetAmpduExist(Mac48Address dest)
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > manager)
Set up WifiRemoteStationManager associated with this BlockAckManager.
uint16_t PeekNextSequenceNumberfor(WifiMacHeader *hdr)
Return the next sequence number for the Traffic ID and destination, but do not pick it (i...
Definition: edca-txop-n.cc:451
keep track of the state needed for a single DCF function.
Definition: dcf-manager.h:46
virtual void SetAmpdu(Mac48Address dest, bool enableAmpdu)
Definition: edca-txop-n.cc:172
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:349
bool IsQosBlockAck(void) const
Return if the QoS ACK policy is Block ACK.
Headers for Block ack response.
Definition: ctrl-headers.h:186
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1480
void NotifyChannelSwitching(void)
When a channel switching occurs, enqueued packets are removed.
Definition: edca-txop-n.cc:721
Mac48Address GetAddress(void) const
Return the MAC address of this MacLow.
Definition: mac-low.cc:627
void SetTxMiddle(MacTxMiddle *txMiddle)
bool IsAccessRequested(void) const
Definition: dcf-manager.cc:150
void SetBlockDestinationCallback(Callback< void, Mac48Address, uint8_t > callback)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Ptr< Packet > GetFragmentPacket(WifiMacHeader *hdr)
Get the next fragment from the packet with appropriate Wifi header for the fragment.
virtual ~EdcaTxopN()
Definition: edca-txop-n.cc:272
virtual void StartNext(void)
Invoked when ns3::MacLow wants to start a new transmission as configured by MacLowTransmissionParamet...
Definition: edca-txop-n.cc:126
uint32_t GetNRetryNeededPackets(Mac48Address recipient, uint8_t tid) const
Definition: edca-txop-n.cc:314
virtual void DoNotifyWakeUp(void)
Called by DcfManager to notify a DcfState subclass that the device has begun to wake up...
Definition: edca-txop-n.cc:80
uint8_t m_fragmentNumber
Definition: edca-txop-n.h:544
void SetTxOkCallback(TxOk callback)
Time m_currentPacketTimestamp
Definition: edca-txop-n.h:562
uint32_t GetCwMax(void) const
Return the maximum congestion window size.
Definition: dcf-manager.cc:96
void SetCwMin(uint32_t minCw)
Set the minimum congestion window size.
Definition: dcf-manager.cc:62
virtual void GotCts(double snr, WifiMode txMode)
Definition: edca-txop-n.cc:102
virtual void StartTransmission(Ptr< const Packet > packet, const WifiMacHeader *hdr, MacLowTransmissionParameters parameters, MacLowTransmissionListener *listener)
Definition: mac-low.cc:724
Mac48Address recipient
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:122
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Definition: packet.cc:278
void SetByOriginator(void)
Set the initiator bit in the DELBA.
void SetTidInfo(uint8_t tid)
Set Traffic ID (TID).
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
uint32_t GetFragmentOffset(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
EdcaTxopN * m_txop
Definition: edca-txop-n.cc:85
virtual uint32_t GetMinCw(void) const
Return the minimum contention window size.
Definition: edca-txop-n.cc:398
void SetByRecipient(void)
Un-set the initiator bit in the DELBA.
void EndTxNoAck(void)
Event handler when a transmission that does not require an ACK has completed.
void StartBackoffNow(uint32_t nSlots)
Definition: dcf-manager.cc:123
void SetNoRetry(void)
Un-set the Retry bit in the Frame Control field.
bool NeedFragmentation(void) const
Check if the current packet should be fragmented.
Ptr< MpduAggregator > GetMpduAggregator(void) const
Definition: edca-txop-n.cc:967
void EnableCompressedBlockAck(void)
Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame.
Definition: mac-low.cc:173
virtual void CompleteTransfer(Mac48Address recipient, uint8_t tid)
Definition: edca-txop-n.cc:168
virtual void MissedCts(void)
ns3::MacLow did not receive an expected CTS within CtsTimeout.
Definition: edca-txop-n.cc:106
uint16_t GetNextSequenceNumberfor(const WifiMacHeader *hdr)
Return the next sequence number for the given header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< MsduAggregator > GetMsduAggregator(void) const
Definition: edca-txop-n.cc:961
Hold objects of type Ptr.
Definition: pointer.h:36
void SetAccessCategory(enum AcIndex ac)
Set the access category of this EDCAF.
bool IsGroup(void) const
void EnableAck(void)
Wait ACKTimeout for an ACK.
Definition: mac-low.cc:188
uint16_t PeekNextSequenceNumberfor(const WifiMacHeader *hdr)
Return the next sequence number for the Traffic ID and destination, but do not pick it (i...
bool RemovePacket(uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
Remove a packet after you peek in the queue and get it.
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
uint32_t GetFragmentSize(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Mac48Address MapDestAddressForAggregation(const WifiMacHeader &hdr)
bool ExistsAgreementInState(Mac48Address recipient, uint8_t tid, enum OriginatorBlockAckAgreement::State state) const
void SetMpduAggregator(Ptr< MpduAggregator > aggr)
bool SetupBlockAckIfNeeded()
If number of packets in the queue reaches m_blockAckThreshold value, an ADDBA Request frame is sent t...
StatusCode GetStatusCode(void) const
Return the status code.
void StartNext(void)
Start transmission for the next fragment.
an EUI-48 address
Definition: mac48-address.h:43
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
bool IsByOriginator(void) const
Check if the initiator bit in the DELBA is setted.
virtual void DoNotifySleep(void)
Called by DcfManager to notify a DcfState subclass that the device has begun to sleep.
Definition: edca-txop-n.cc:76
void SetAmpduExist(Mac48Address dest, bool enableAmpdu)
virtual Mac48Address GetSrcAddressForAggregation(const WifiMacHeader &hdr)
Definition: edca-txop-n.cc:216
Ptr< const Packet > GetNextPacket(WifiMacHeader &hdr)
void Cancel(void)
Cancel the transmission.
void BaTxOk(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
void SetManager(DcfManager *manager)
Set DcfManager this EdcaTxopN is associated to.
Definition: edca-txop-n.cc:326
void DisableRts(void)
Do not send rts and wait for cts before sending data.
Definition: mac-low.cc:203
void Queue(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Definition: edca-txop-n.cc:747
uint16_t GetNextSequenceNumberfor(WifiMacHeader *hdr)
Return the next sequence number for the given header.
Definition: edca-txop-n.cc:446
void SetMsduAggregator(Ptr< MsduAggregator > aggr)
void SetBlockAckInactivityCallback(Callback< void, Mac48Address, uint8_t, bool > callback)
void GotBlockAck(const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, WifiMode txMode, double dataSnr)
Event handler when a Block ACK is received.
uint8_t GetTid(void) const
Return the Traffic ID (TID).
uint8_t GetTidInfo(void) const
Return the Traffic ID (TID).
virtual uint16_t GetNextSequenceNumberfor(WifiMacHeader *hdr)
Return the next sequence number for the given header.
Definition: edca-txop-n.cc:180
void SetMaxPacketDelay(Time maxDelay)
void NotifyMpduTransmission(Mac48Address recipient, uint8_t tid, uint16_t nextSeqNumber, WifiMacHeader::QosAckPolicy policy)
virtual Ptr< WifiMacQueue > GetQueue(void)
Returns the EDCA queue to check if there are packets that can be aggregated with a Block Ack...
Definition: edca-txop-n.cc:164
bool NeedBarRetransmission(uint8_t tid, uint16_t seqNumber, Mac48Address recipient)
This function returns true if the lifetime of the packets a BAR refers to didn't expire yet else it r...
void PushFront(Ptr< const Packet > packet, const WifiMacHeader &hdr)
bool SwitchToBlockAckIfNeeded(Mac48Address recipient, uint8_t tid, uint16_t startingSeq)
enum BlockAckType m_blockAckType
Definition: edca-txop-n.h:561
void SetCwMax(uint32_t maxCw)
Set the maximum congestion window size.
Definition: dcf-manager.cc:73
virtual void DoNotifyAccessGranted(void)
Called by DcfManager to notify a DcfState subclass that access to the medium is granted and can start...
Definition: edca-txop-n.cc:60
virtual void BlockAckInactivityTimeout(Mac48Address address, uint8_t tid)
Typically is called in order to notify EdcaTxopN that a block ack inactivity timeout occurs for the b...
Definition: edca-txop-n.cc:160
static TypeId GetTypeId(void)
Definition: edca-txop-n.cc:232
virtual void MissedBlockAck(uint32_t nMpdus)
Definition: edca-txop-n.cc:122
void BaTxFailed(const WifiMacHeader &hdr)
The packet we sent was successfully received by the receiver.
uint32_t GetNBufferedPackets(Mac48Address recipient, uint8_t tid) const
bool MustSendHtImmediateAck(void) const
Check if the current ACK policy is immediate.
uint32_t GetNextFragmentSize(void)
Calculate the size of the next fragment.
void SetSequenceNumber(uint16_t seq)
Set the sequence number of the header.
bool IsData(void) const
Return true if the Type is DATA.
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS DATA...
void CompleteConfig(void)
Complete block ACK configuration.
virtual void RemoveFromBaQueue(uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
Remove a packet after you peek in the retransmit queue and get it.
Definition: edca-txop-n.cc:192
uint32_t GetCw(void) const
Definition: dcf-manager.cc:132
uint32_t GetAifsn(void) const
Return the number of slots that make up an AIFS.
Definition: dcf-manager.cc:84
void Unblock(Mac48Address dest, uint8_t tid)
Un-block the given destination address and TID (e.g.
bool IsBlockAckReq(void) const
Return true if the header is a Block ACK Request header.
void RestartAccessIfNeeded(void)
Restart access request if needed.
Definition: edca-txop-n.cc:973
void SetBlockAckThreshold(uint8_t nPackets)
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:758
QosBlockedDestinations * m_qosBlockedDestinations
Definition: edca-txop-n.h:555
void CompleteAmpduExchange(Mac48Address recipient, uint8_t tid)
Implement the header for management frames of type del block ack.
Definition: mgt-headers.h:879
void CompleteAmpduTransfer(Mac48Address recipient, uint8_t tid)
Definition: edca-txop-n.cc:320
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
Ptr< MacLow > m_low
Definition: edca-txop-n.h:538
typedef for union of different ActionValues
Definition: mgt-headers.h:574
Ptr< const Packet > bar
uint8_t GetBlockAckThreshold(void) const
Return the current threshold for block ACK mechanism.
friend class Dcf
Definition: edca-txop-n.h:530
void CompleteTx(void)
For now is typically invoked to complete transmission of a packets sent with ack policy Block Ack: th...
bool IsSuccess(void) const
Return whether the status code is success.
Definition: status-code.cc:44
void SetTxMiddle(MacTxMiddle *txMiddle)
Definition: edca-txop-n.cc:419
void GotCts(double snr, WifiMode txMode)
Event handler when a CTS is received.
Definition: edca-txop-n.cc:640
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
virtual Ptr< MpduAggregator > GetMpduAggregator(void) const
Definition: edca-txop-n.cc:212
void EnableNextData(uint32_t size)
Definition: mac-low.cc:143
void DoDispose()
Destructor implementation.
Definition: edca-txop-n.cc:278
void DisableOverrideDurationId(void)
Do not force the duration/id field of the packet: its value is automatically calculated by the MacLow...
Definition: mac-low.cc:158
bool IsLastFragment(void) const
Check if the current fragment is the last fragment.
void Block(Mac48Address dest, uint8_t tid)
Block the given destination address and TID from sending (e.g.
void DisableNextData(void)
Do not attempt to send data burst after current transmission.
Definition: mac-low.cc:148
virtual uint32_t GetMaxCw(void) const
Return the maximum contention window size.
Definition: edca-txop-n.cc:405
bool NeedRtsRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
Ptr< WifiMacQueue > m_queue
Definition: edca-txop-n.h:535
void StartAccessIfNeeded(void)
Request access from DCF manager if needed.
Definition: edca-txop-n.cc:985
void SetType(enum WifiMacType type)
Set Type/Subtype values with the correct values depending on the given type.
virtual uint32_t GetNext(uint32_t min, uint32_t max)=0
Get integer between min and max (including min and max).
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
tuple address
Definition: first.py:37
virtual void CompleteMpduTx(Ptr< const Packet > packet, WifiMacHeader hdr, Time tstamp)
This function stores an MPDU (part of an A-MPDU) in blockackagreement (i.e.
Definition: edca-txop-n.cc:176
void SendBlockAckRequest(const struct Bar &bar)
After that all packets, for which a block ack agreement was established, have been transmitted...
TypeOfStation
Enumeration for type of station.
Definition: edca-txop-n.h:60
void UpdateFailedCw(void)
Update the value of the CW variable to take into account a transmission failure.
Definition: dcf-manager.cc:108
Manages all block ack agreements for an originator station.
ActionValue GetAction()
Return the action value.
Definition: mgt-headers.cc:775
Headers for Block ack request.
Definition: ctrl-headers.h:50
bool ExistsAgreement(Mac48Address recipient, uint8_t tid) const
void FlushAggregateQueue(void)
This function is called to flush the aggregate queue, which is used for A-MPDU.
Definition: mac-low.cc:3237
virtual void DoNotifyInternalCollision(void)
Called by DcfManager to notify a DcfState subclass that an 'internal' collision occured, that is, that the backoff timer of a higher priority DcfState expired at the same time and that access was granted to this higher priority DcfState.
Definition: edca-txop-n.cc:64
void SetFragmentNumber(uint8_t frag)
Set the fragment number of the header.
void DisableAck(void)
Do not wait for Ack after data transmission.
Definition: mac-low.cc:193
uint32_t GetNOutstandingPacketsInBa(Mac48Address address, uint8_t tid)
Definition: edca-txop-n.cc:308
uint16_t GetNextSeqNumberByTidAndAddress(uint8_t tid, Mac48Address addr) const
Return the next sequence number for the Traffic ID and destination.
a unique identifier for an interface.
Definition: type-id.h:58
void ReportFinalRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportRtsFailed if NeedRtsRetransmission returns false.
void SetStartingSequence(uint16_t seq)
Set the starting sequence number from the given raw sequence control field.
bool NeedsAccess(void) const
Check if the EDCAF requires access.
Definition: edca-txop-n.cc:440
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:826
void SetQosAmsdu(void)
Set that A-MSDU is present.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:36
uint32_t GetFragmentOffset(void)
Calculate the offset for the current fragment.
AggregationCapableTransmissionListener * m_blockAckListener
Definition: edca-txop-n.h:541
bool IsRetry(void) const
Return if the Retry bit is set.
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:257
Implements the IEEE 802.11 MAC header.
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
void GotAddBaResponse(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
void TearDownBlockAck(Mac48Address recipient, uint8_t tid)
Implements the IEEE 802.11 MAC trailer.
virtual void SetAifsn(uint32_t aifsn)
Definition: edca-txop-n.cc:391
TypeOfStation m_typeOfStation
Definition: edca-txop-n.h:554
Mac48Address MapSrcAddressForAggregation(const WifiMacHeader &hdr)
This functions are used only to correctly set addresses in a-msdu subframe.
Ptr< WifiMacQueue > GetEdcaQueue() const
Return the packet queue associated with this EdcaTxopN.
Definition: edca-txop-n.cc:370
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
virtual Ptr< WifiMacQueue > GetQueue(void)
Definition: edca-txop-n.cc:138
uint16_t GetSequenceNumber(void) const
Return the sequence number of the header.
Dcf(EdcaTxopN *txop)
Definition: edca-txop-n.cc:49