A Discrete-Event Network Simulator
API
channel-access-manager-test.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "ns3/test.h"
22 #include "ns3/simulator.h"
23 #include "ns3/channel-access-manager.h"
24 #include "ns3/frame-exchange-manager.h"
25 #include "ns3/qos-txop.h"
26 
27 using namespace ns3;
28 
29 template <typename TxopType>
31 
38 template <typename TxopType>
39 class TxopTest : public TxopType
40 {
41 public:
48  TxopTest (ChannelAccessManagerTest<TxopType> *test, uint32_t i);
49 
55  void QueueTx (uint64_t txTime, uint64_t expectedGrantTime);
56 
57 private:
59  friend class ChannelAccessManagerTest<TxopType>;
60 
62  void DoDispose (void) override;
64  void NotifyChannelAccessed (Time txopDuration = Seconds (0)) override;
66  bool HasFramesToTransmit (void) override;
68  void NotifyChannelSwitching (void) override;
70  void NotifySleep (void) override;
72  void NotifyWakeUp (void) override;
74  void GenerateBackoff (void) override;
75 
76  typedef std::pair<uint64_t,uint64_t> ExpectedGrant;
77  typedef std::list<ExpectedGrant> ExpectedGrants;
78  struct ExpectedBackoff
80  {
81  uint64_t at;
82  uint32_t nSlots;
83  };
84  typedef std::list<struct ExpectedBackoff> ExpectedBackoffs;
85 
89 
96  uint32_t m_i;
97 };
98 
106 {
107 public:
109  {
110  }
116  void SetSifs (Time sifs)
117  {
118  m_sifs = sifs;
119  }
125  void SetSlot (Time slot)
126  {
127  m_slot = slot;
128  }
134  void SetEifsNoDifs (Time eifsNoDifs)
135  {
136  m_eifsNoDifs = eifsNoDifs;
137  }
138 
139 private:
140  Time GetSifs (void) const override
141  {
142  return m_sifs;
143  }
144 
145  Time GetSlot (void) const override
146  {
147  return m_slot;
148  }
149 
150  Time GetEifsNoDifs (void) const override
151  {
152  return m_eifsNoDifs;
153  }
154 
158 };
159 
166 template <typename TxopType>
168 {
169 public:
176  : m_test (test)
177  {
178  }
186  bool StartTransmission (Ptr<Txop> dcf) override
187  {
188  dcf->NotifyChannelAccessed ();
189  return true;
190  }
192  void NotifyInternalCollision (Ptr<Txop> txop) override
193  {
194  m_test->NotifyInternalCollision (DynamicCast<TxopTest<TxopType>> (txop));
195  }
196 
197 private:
199 };
200 
207 template <typename TxopType>
209 {
210 public:
212  void DoRun (void) override;
213 
218  void NotifyAccessGranted (uint32_t i);
223  void NotifyInternalCollision (Ptr<TxopTest<TxopType>> state);
228  void GenerateBackoff (uint32_t i);
233  void NotifyChannelSwitching (uint32_t i);
234 
235 
236 private:
244  void StartTest (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue = 20);
249  void AddTxop (uint32_t aifsn);
251  void EndTest (void);
258  void ExpectInternalCollision (uint64_t time, uint32_t nSlots, uint32_t from);
265  void ExpectBackoff (uint64_t time, uint32_t nSlots, uint32_t from);
271  void ExpectBusy (uint64_t time, bool busy);
276  void DoCheckBusy (bool busy);
282  void AddRxOkEvt (uint64_t at, uint64_t duration);
288  void AddRxErrorEvt (uint64_t at, uint64_t duration);
295  void AddRxErrorEvt (uint64_t at, uint64_t duration, uint64_t timeUntilError);
301  void AddRxInsideSifsEvt (uint64_t at, uint64_t duration);
307  void AddTxEvt (uint64_t at, uint64_t duration);
313  void AddNavReset (uint64_t at, uint64_t duration);
319  void AddNavStart (uint64_t at, uint64_t duration);
324  void AddAckTimeoutReset (uint64_t at);
332  void AddAccessRequest (uint64_t at, uint64_t txTime,
333  uint64_t expectedGrantTime, uint32_t from);
341  void AddAccessRequestWithAckTimeout (uint64_t at, uint64_t txTime,
342  uint64_t expectedGrantTime, uint32_t from);
351  void AddAccessRequestWithSuccessfullAck (uint64_t at, uint64_t txTime,
352  uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from);
359  void DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, Ptr<TxopTest<TxopType>> state);
365  void AddCcaBusyEvt (uint64_t at, uint64_t duration);
371  void AddSwitchingEvt (uint64_t at, uint64_t duration);
377  void AddRxStartEvt (uint64_t at, uint64_t duration);
378 
379  typedef std::vector<Ptr<TxopTest<TxopType>>> TxopTests;
380 
384  uint32_t m_ackTimeoutValue;
385 };
386 
387 template <typename TxopType>
388 void
389 TxopTest<TxopType>::QueueTx (uint64_t txTime, uint64_t expectedGrantTime)
390 {
391  m_expectedGrants.push_back (std::make_pair (txTime, expectedGrantTime));
392 }
393 
394 template <typename TxopType>
396  : m_test (test),
397  m_i (i)
398 {
399 }
400 
401 template <typename TxopType>
402 void
404 {
405  m_test = 0;
406  TxopType::DoDispose ();
407 }
408 
409 template <typename TxopType>
410 void
412 {
413  Txop::m_access = Txop::NOT_REQUESTED;
414  m_test->NotifyAccessGranted (m_i);
415 }
416 
417 template <typename TxopType>
418 void
420 {
421  m_test->GenerateBackoff (m_i);
422 }
423 
424 template <typename TxopType>
425 bool
427 {
428  return !m_expectedGrants.empty ();
429 }
430 
431 template <typename TxopType>
432 void
434 {
435  m_test->NotifyChannelSwitching (m_i);
436 }
437 
438 template <typename TxopType>
439 void
441 {
442 }
443 
444 template <typename TxopType>
445 void
447 {
448 }
449 
450 template <typename TxopType>
452  : TestCase ("ChannelAccessManager")
453 {
454 }
455 
456 template <typename TxopType>
457 void
459 {
460  Ptr<TxopTest<TxopType>> state = m_txop[i];
461  NS_TEST_EXPECT_MSG_EQ (state->m_expectedGrants.empty (), false, "Have expected grants");
462  if (!state->m_expectedGrants.empty ())
463  {
464  std::pair<uint64_t, uint64_t> expected = state->m_expectedGrants.front ();
465  state->m_expectedGrants.pop_front ();
466  NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.second), "Expected access grant is now");
467  m_ChannelAccessManager->NotifyTxStartNow (MicroSeconds (expected.first));
468  m_ChannelAccessManager->NotifyAckTimeoutStartNow (MicroSeconds (m_ackTimeoutValue + expected.first));
469  }
470 }
471 
472 template <typename TxopType>
473 void
474 ChannelAccessManagerTest<TxopType>::AddTxEvt (uint64_t at, uint64_t duration)
475 {
476  Simulator::Schedule (MicroSeconds (at) - Now (),
477  &ChannelAccessManager::NotifyTxStartNow, m_ChannelAccessManager,
478  MicroSeconds (duration));
479 }
480 
481 template <typename TxopType>
482 void
484 {
485  NS_TEST_EXPECT_MSG_EQ (state->m_expectedInternalCollision.empty (), false, "Have expected internal collisions");
486  if (!state->m_expectedInternalCollision.empty ())
487  {
488  struct TxopTest<TxopType>::ExpectedBackoff expected = state->m_expectedInternalCollision.front ();
489  state->m_expectedInternalCollision.pop_front ();
490  NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.at), "Expected internal collision time is now");
491  state->StartBackoffNow (expected.nSlots);
492  }
493 }
494 
495 template <typename TxopType>
496 void
498 {
499  Ptr<TxopTest<TxopType>> state = m_txop[i];
500  NS_TEST_EXPECT_MSG_EQ (state->m_expectedBackoff.empty (), false, "Have expected backoffs");
501  if (!state->m_expectedBackoff.empty ())
502  {
503  struct TxopTest<TxopType>::ExpectedBackoff expected = state->m_expectedBackoff.front ();
504  state->m_expectedBackoff.pop_front ();
505  NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.at), "Expected backoff is now");
506  state->StartBackoffNow (expected.nSlots);
507  }
508 }
509 
510 template <typename TxopType>
511 void
513 {
514  Ptr<TxopTest<TxopType>> state = m_txop[i];
515  if (!state->m_expectedGrants.empty ())
516  {
517  std::pair<uint64_t, uint64_t> expected = state->m_expectedGrants.front ();
518  state->m_expectedGrants.pop_front ();
519  NS_TEST_EXPECT_MSG_EQ (Simulator::Now (), MicroSeconds (expected.second), "Expected grant is now");
520  }
521  state->Txop::m_access = Txop::NOT_REQUESTED;
522 }
523 
524 template <typename TxopType>
525 void
526 ChannelAccessManagerTest<TxopType>::ExpectInternalCollision (uint64_t time, uint32_t nSlots, uint32_t from)
527 {
528  Ptr<TxopTest<TxopType>> state = m_txop[from];
529  struct TxopTest<TxopType>::ExpectedBackoff col;
530  col.at = time;
531  col.nSlots = nSlots;
532  state->m_expectedInternalCollision.push_back (col);
533 }
534 
535 template <typename TxopType>
536 void
537 ChannelAccessManagerTest<TxopType>::ExpectBackoff (uint64_t time, uint32_t nSlots, uint32_t from)
538 {
539  Ptr<TxopTest<TxopType>> state = m_txop[from];
540  struct TxopTest<TxopType>::ExpectedBackoff backoff;
541  backoff.at = time;
542  backoff.nSlots = nSlots;
543  state->m_expectedBackoff.push_back (backoff);
544 }
545 
546 template <typename TxopType>
547 void
548 ChannelAccessManagerTest<TxopType>::ExpectBusy (uint64_t time, bool busy)
549 {
550  Simulator::Schedule (MicroSeconds (time) - Now (),
552 }
553 
554 template <typename TxopType>
555 void
557 {
558  NS_TEST_EXPECT_MSG_EQ (m_ChannelAccessManager->IsBusy (), busy, "Incorrect busy/idle state");
559 }
560 
561 template <typename TxopType>
562 void
563 ChannelAccessManagerTest<TxopType>::StartTest (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue)
564 {
565  m_ChannelAccessManager = CreateObject<ChannelAccessManagerStub> ();
566  m_feManager = CreateObject<FrameExchangeManagerStub<TxopType>> (this);
567  m_ChannelAccessManager->SetupFrameExchangeManager (m_feManager);
568  m_ChannelAccessManager->SetSlot (MicroSeconds (slotTime));
569  m_ChannelAccessManager->SetSifs (MicroSeconds (sifs));
570  m_ChannelAccessManager->SetEifsNoDifs (MicroSeconds (eifsNoDifsNoSifs + sifs));
571  m_ackTimeoutValue = ackTimeoutValue;
572 }
573 
574 template <typename TxopType>
575 void
577 {
578  Ptr<TxopTest<TxopType>> txop = CreateObject<TxopTest<TxopType>> (this, m_txop.size ());
579  txop->SetAifsn (aifsn);
580  m_txop.push_back (txop);
581  txop->SetChannelAccessManager (m_ChannelAccessManager);
582 }
583 
584 template <typename TxopType>
585 void
587 {
588  Simulator::Run ();
589 
590  for (typename TxopTests::const_iterator i = m_txop.begin (); i != m_txop.end (); i++)
591  {
592  Ptr<TxopTest<TxopType>> state = *i;
593  NS_TEST_EXPECT_MSG_EQ (state->m_expectedGrants.empty (), true, "Have no expected grants");
594  NS_TEST_EXPECT_MSG_EQ (state->m_expectedInternalCollision.empty (), true, "Have no internal collisions");
595  NS_TEST_EXPECT_MSG_EQ (state->m_expectedBackoff.empty (), true, "Have no expected backoffs");
596  state->Dispose ();
597  state = 0;
598  }
599  m_txop.clear ();
600 
601  m_ChannelAccessManager->Dispose ();
602  m_ChannelAccessManager = 0;
603  m_feManager = 0;
604  Simulator::Destroy ();
605 }
606 
607 template <typename TxopType>
608 void
609 ChannelAccessManagerTest<TxopType>::AddRxOkEvt (uint64_t at, uint64_t duration)
610 {
611  Simulator::Schedule (MicroSeconds (at) - Now (),
612  &ChannelAccessManager::NotifyRxStartNow, m_ChannelAccessManager,
613  MicroSeconds (duration));
614  Simulator::Schedule (MicroSeconds (at + duration) - Now (),
615  &ChannelAccessManager::NotifyRxEndOkNow, m_ChannelAccessManager);
616 }
617 
618 template <typename TxopType>
619 void
621 {
622  Simulator::Schedule (MicroSeconds (at) - Now (),
623  &ChannelAccessManager::NotifyRxStartNow, m_ChannelAccessManager,
624  MicroSeconds (duration));
625 }
626 
627 template <typename TxopType>
628 void
630 {
631  Simulator::Schedule (MicroSeconds (at) - Now (),
632  &ChannelAccessManager::NotifyRxStartNow, m_ChannelAccessManager,
633  MicroSeconds (duration));
634  Simulator::Schedule (MicroSeconds (at + duration) - Now (),
635  &ChannelAccessManager::NotifyRxEndErrorNow, m_ChannelAccessManager);
636 }
637 
638 template <typename TxopType>
639 void
640 ChannelAccessManagerTest<TxopType>::AddRxErrorEvt (uint64_t at, uint64_t duration, uint64_t timeUntilError)
641 {
642  Simulator::Schedule (MicroSeconds (at) - Now (),
643  &ChannelAccessManager::NotifyRxStartNow, m_ChannelAccessManager,
644  MicroSeconds (duration));
645  Simulator::Schedule (MicroSeconds (at + timeUntilError) - Now (),
646  &ChannelAccessManager::NotifyRxEndErrorNow, m_ChannelAccessManager);
647 }
648 
649 
650 template <typename TxopType>
651 void
652 ChannelAccessManagerTest<TxopType>::AddNavReset (uint64_t at, uint64_t duration)
653 {
654  Simulator::Schedule (MicroSeconds (at) - Now (),
655  &ChannelAccessManager::NotifyNavResetNow, m_ChannelAccessManager,
656  MicroSeconds (duration));
657 }
658 
659 template <typename TxopType>
660 void
661 ChannelAccessManagerTest<TxopType>::AddNavStart (uint64_t at, uint64_t duration)
662 {
663  Simulator::Schedule (MicroSeconds (at) - Now (),
664  &ChannelAccessManager::NotifyNavStartNow, m_ChannelAccessManager,
665  MicroSeconds (duration));
666 }
667 
668 template <typename TxopType>
669 void
671 {
672  Simulator::Schedule (MicroSeconds (at) - Now (),
673  &ChannelAccessManager::NotifyAckTimeoutResetNow, m_ChannelAccessManager);
674 }
675 
676 template <typename TxopType>
677 void
679  uint64_t expectedGrantTime, uint32_t from)
680 {
681  AddAccessRequestWithSuccessfullAck (at, txTime, expectedGrantTime, 0, from);
682 }
683 
684 template <typename TxopType>
685 void
687  uint64_t expectedGrantTime, uint32_t from)
688 {
689  Simulator::Schedule (MicroSeconds (at) - Now (),
691  txTime, expectedGrantTime, m_txop[from]);
692 }
693 
694 template <typename TxopType>
695 void
697  uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from)
698 {
699  NS_ASSERT (ackDelay < m_ackTimeoutValue);
700  Simulator::Schedule (MicroSeconds (at) - Now (),
702  txTime, expectedGrantTime, m_txop[from]);
703  AddAckTimeoutReset (expectedGrantTime + txTime + ackDelay);
704 }
705 
706 template <typename TxopType>
707 void
708 ChannelAccessManagerTest<TxopType>::DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime,
709  Ptr<TxopTest<TxopType>> state)
710 {
711  if (m_ChannelAccessManager->NeedBackoffUponAccess (state))
712  {
713  state->GenerateBackoff ();
714  }
715  state->QueueTx (txTime, expectedGrantTime);
716  m_ChannelAccessManager->RequestAccess (state);
717 }
718 
719 template <typename TxopType>
720 void
722 {
723  Simulator::Schedule (MicroSeconds (at) - Now (),
724  &ChannelAccessManager::NotifyMaybeCcaBusyStartNow, m_ChannelAccessManager,
725  MicroSeconds (duration));
726 }
727 
728 template <typename TxopType>
729 void
731 {
732  Simulator::Schedule (MicroSeconds (at) - Now (),
733  &ChannelAccessManager::NotifySwitchingStartNow, m_ChannelAccessManager,
734  MicroSeconds (duration));
735 }
736 
737 template <typename TxopType>
738 void
740 {
741  Simulator::Schedule (MicroSeconds (at) - Now (),
742  &ChannelAccessManager::NotifyRxStartNow, m_ChannelAccessManager,
743  MicroSeconds (duration));
744 }
745 
746 /*
747  * Specialization of DoRun () method for DCF
748  */
749 template <>
750 void
752 {
753  // DCF immediate access (no backoff)
754  // 1 4 5 6 8 11 12
755  // | sifs | aifsn | tx | idle | sifs | aifsn | tx |
756  //
757  StartTest (1, 3, 10);
758  AddTxop (1);
759  AddAccessRequest (1, 1, 5, 0);
760  AddAccessRequest (8, 2, 12, 0);
761  EndTest ();
762  // Check that receiving inside SIFS shall be cancelled properly:
763  // 1 4 5 6 9 10 14 17 18
764  // | sifs | aifsn | tx | sifs | ack | idle | sifs | aifsn | tx |
765  // |
766  // 7 start rx
767  //
768 
769  StartTest (1, 3, 10);
770  AddTxop (1);
771  AddAccessRequest (1, 1, 5, 0);
772  AddRxInsideSifsEvt (7, 10);
773  AddTxEvt (9, 1);
774  AddAccessRequest (14, 2, 18, 0);
775  EndTest ();
776  // The test below mainly intends to test the case where the medium
777  // becomes busy in the middle of a backoff slot: the backoff counter
778  // must not be decremented for this backoff slot. This is the case
779  // below for the backoff slot starting at time 78us.
780  //
781  // 20 60 66 70 74 78 80 100 106 110 114 118 120
782  // | rx | sifs | aifsn | bslot0 | bslot1 | | rx | sifs | aifsn | bslot2 | bslot3 | tx |
783  // |
784  // 30 request access. backoff slots: 4
785 
786  StartTest (4, 6, 10);
787  AddTxop (1);
788  AddRxOkEvt (20, 40);
789  AddRxOkEvt (80, 20);
790  AddAccessRequest (30, 2, 118, 0);
791  ExpectBackoff (30, 4, 0); //backoff: 4 slots
792  EndTest ();
793  // Test the case where the backoff slots is zero.
794  //
795  // 20 60 66 70 72
796  // | rx | sifs | aifsn | tx |
797  // |
798  // 30 request access. backoff slots: 0
799 
800  StartTest (4, 6, 10);
801  AddTxop (1);
802  AddRxOkEvt (20, 40);
803  AddAccessRequest (30, 2, 70, 0);
804  ExpectBackoff (30, 0, 0); // backoff: 0 slots
805  EndTest ();
806  // Test shows when two frames are received without interval between
807  // them:
808  // 20 60 100 106 110 112
809  // | rx | rx |sifs | aifsn | tx |
810  // |
811  // 30 request access. backoff slots: 0
812 
813  StartTest (4, 6, 10);
814  AddTxop (1);
815  AddRxOkEvt (20, 40);
816  AddRxOkEvt (60, 40);
817  AddAccessRequest (30, 2, 110, 0);
818  ExpectBackoff (30, 0, 0); //backoff: 0 slots
819  EndTest ();
820 
821  // Requesting access within SIFS interval (DCF immediate access)
822  //
823  // 20 60 62 68 72
824  // | rx | idle | sifs | aifsn | tx |
825  //
826  StartTest (4, 6, 10);
827  AddTxop (1);
828  AddRxOkEvt (20, 40);
829  AddAccessRequest (62, 2, 72, 0);
830  EndTest ();
831 
832  // Requesting access after DIFS (DCF immediate access)
833  //
834  // 20 60 70 76 80
835  // | rx | idle | sifs | aifsn | tx |
836  //
837  StartTest (4, 6, 10);
838  AddTxop (1);
839  AddRxOkEvt (20, 40);
840  AddAccessRequest (70, 2, 80, 0);
841  EndTest ();
842 
843  // Test an EIFS
844  //
845  // 20 60 66 76 86 90 94 98 102 106
846  // | rx | sifs | acktxttime | sifs + aifsn | bslot0 | bslot1 | bslot2 | bslot3 | tx |
847  // | | <------eifs------>|
848  // 30 request access. backoff slots: 4
849  StartTest (4, 6, 10);
850  AddTxop (1);
851  AddRxErrorEvt (20, 40);
852  AddAccessRequest (30, 2, 102, 0);
853  ExpectBackoff (30, 4, 0); //backoff: 4 slots
854  EndTest ();
855 
856  // Test DCF immediate access after an EIFS (EIFS is greater)
857  //
858  // 20 60 66 76 86
859  // | <----+-eifs------>|
860  // | rx | sifs | acktxttime | sifs + aifsn | tx |
861  // | sifs + aifsn |
862  // request access 70 80
863  StartTest (4, 6, 10);
864  AddTxop (1);
865  AddRxErrorEvt (20, 40);
866  AddAccessRequest (70, 2, 86, 0);
867  EndTest ();
868 
869  // Test that channel stays busy for first frame's duration after Rx error
870  //
871  // 20 60
872  // | rx |
873  // |
874  // 40 force Rx error
875  StartTest (4, 6, 10);
876  AddTxop (1);
877  AddRxErrorEvt (20, 40, 20); // At time 20, start reception for 40, but force error 20 into frame
878  ExpectBusy (41, true); // channel should remain busy for remaining duration
879  ExpectBusy (59, true);
880  ExpectBusy (61, false);
881  EndTest ();
882 
883  // Test an EIFS which is interrupted by a successful transmission.
884  //
885  // 20 60 66 69 75 81 85 89 93 97 101 103
886  // | rx | sifs | | rx | sifs | aifsn | bslot0 | bslot1 | bslot2 | bslot3 | tx |
887  // | | <--eifs-->|
888  // 30 request access. backoff slots: 4
889  StartTest (4, 6, 10);
890  AddTxop (1);
891  AddRxErrorEvt (20, 40);
892  AddAccessRequest (30, 2, 101, 0);
893  ExpectBackoff (30, 4, 0); //backoff: 4 slots
894  AddRxOkEvt (69, 6);
895  EndTest ();
896 
897  // Test two DCFs which suffer an internal collision. the first DCF has a higher
898  // priority than the second DCF.
899  //
900  // 20 60 66 70 74 78 88
901  // DCF0 | rx | sifs | aifsn | bslot0 | bslot1 | tx |
902  // DCF1 | rx | sifs | aifsn | aifsn | aifsn | | sifs | aifsn | aifsn | aifsn | bslot | tx |
903  // 94 98 102 106 110 112
904  StartTest (4, 6, 10);
905  AddTxop (1); //high priority DCF
906  AddTxop (3); //low priority DCF
907  AddRxOkEvt (20, 40);
908  AddAccessRequest (30, 10, 78, 0);
909  ExpectBackoff (30, 2, 0); //backoff: 2 slot
910  AddAccessRequest (40, 2, 110, 1);
911  ExpectBackoff (40, 0, 1); //backoff: 0 slot
912  ExpectInternalCollision (78, 1, 1); //backoff: 1 slot
913  EndTest ();
914 
915  // Test of AckTimeout handling: First queue requests access and ack procedure fails,
916  // inside the Ack timeout second queue with higher priority requests access.
917  //
918  // 20 26 34 54 74 80
919  // DCF1 - low | sifs | aifsn | tx | Ack timeout | sifs | |
920  // DCF0 - high | | | sifs | tx |
921  // ^ request access
922  StartTest (4, 6, 10);
923  AddTxop (0); //high priority DCF
924  AddTxop (2); //low priority DCF
925  AddAccessRequestWithAckTimeout (20, 20, 34, 1);
926  AddAccessRequest (64, 10, 80, 0);
927  EndTest ();
928 
929  // Test of AckTimeout handling:
930  //
931  // First queue requests access and Ack is 2 us delayed (got Ack interval at the picture),
932  // inside this interval second queue with higher priority requests access.
933  //
934  // 20 26 34 54 56 62
935  // DCF1 - low | sifs | aifsn | tx | got Ack | sifs | |
936  // DCF0 - high | | | sifs | tx |
937  // ^ request access
938  StartTest (4, 6, 10);
939  AddTxop (0); //high priority DCF
940  AddTxop (2); //low priority DCF
941  AddAccessRequestWithSuccessfullAck (20, 20, 34, 2, 1);
942  AddAccessRequest (55, 10, 62, 0);
943  EndTest ();
944 
945  //Repeat the same but with one queue:
946  // 20 26 34 54 60 62 68 76 80
947  // DCF0 | sifs | aifsn | tx | sifs | Ack | sifs | aifsn | bslot0 | tx |
948  // ^ request access
949  StartTest (4, 6, 10);
950  AddTxop (2);
951  AddAccessRequest (20, 20, 34, 0);
952  AddRxOkEvt (60, 2); // Ack
953  AddAccessRequest (61, 10, 80, 0);
954  ExpectBackoff (61, 1, 0); // 1 slot
955  EndTest ();
956 
957  // test simple NAV count. This scenario models a simple Data+Ack handshake
958  // where the data rate used for the Ack is higher than expected by the Data source
959  // so, the data exchange completes before the end of NAV.
960  StartTest (4, 6, 10);
961  AddTxop (1);
962  AddRxOkEvt (20, 40);
963  AddNavStart (60, 15);
964  AddRxOkEvt (66, 5);
965  AddNavStart (71, 0);
966  AddAccessRequest (30, 10, 93, 0);
967  ExpectBackoff (30, 2, 0); //backoff: 2 slots
968  EndTest ();
969 
970  // test more complex NAV handling by a CF-poll. This scenario models a
971  // simple Data+Ack handshake interrupted by a CF-poll which resets the
972  // NAV counter.
973  StartTest (4, 6, 10);
974  AddTxop (1);
975  AddRxOkEvt (20, 40);
976  AddNavStart (60, 15);
977  AddRxOkEvt (66, 5);
978  AddNavReset (71, 2);
979  AddAccessRequest (30, 10, 91, 0);
980  ExpectBackoff (30, 2, 0); //backoff: 2 slots
981  EndTest ();
982 
983 
984  // 20 60 80 86 94
985  // | rx | idle | sifs | aifsn | tx |
986  // ^ request access
987  StartTest (4, 6, 10);
988  AddTxop (2);
989  AddRxOkEvt (20, 40);
990  AddAccessRequest (80, 10, 94, 0);
991  EndTest ();
992 
993 
994  StartTest (4, 6, 10);
995  AddTxop (2);
996  AddRxOkEvt (20, 40);
997  AddRxOkEvt (78, 8);
998  AddAccessRequest (30, 50, 108, 0);
999  ExpectBackoff (30, 3, 0); //backoff: 3 slots
1000  EndTest ();
1001 
1002 
1003  // Channel switching tests
1004 
1005  // 0 20 21 24 25 26
1006  // | switching | idle | sifs | aifsn | tx |
1007  // ^ access request.
1008  StartTest (1, 3, 10);
1009  AddTxop (1);
1010  AddSwitchingEvt (0, 20);
1011  AddAccessRequest (21, 1, 25, 0);
1012  EndTest ();
1013 
1014  // 20 40 50 53 54 55 56 57
1015  // | switching | busy | sifs | aifsn | bslot0 | bslot 1 | tx |
1016  // | |
1017  // 30 busy. 45 access request.
1018  //
1019  StartTest (1, 3, 10);
1020  AddTxop (1);
1021  AddSwitchingEvt (20,20);
1022  AddCcaBusyEvt (30,20);
1023  ExpectBackoff (45, 2, 0); //backoff: 2 slots
1024  AddAccessRequest (45, 1, 56, 0);
1025  EndTest ();
1026 
1027  // 20 30 50 51 54 55 56
1028  // | rx | switching | idle | sifs | aifsn | tx |
1029  // ^ access request.
1030  //
1031  StartTest (1, 3, 10);
1032  AddTxop (1);
1033  AddRxStartEvt (20, 40);
1034  AddSwitchingEvt (30, 20);
1035  AddAccessRequest (51, 1, 55, 0);
1036  EndTest ();
1037 
1038  // 20 30 50 51 54 55 56
1039  // | busy | switching | idle | sifs | aifsn | tx |
1040  // ^ access request.
1041  //
1042  StartTest (1, 3, 10);
1043  AddTxop (1);
1044  AddCcaBusyEvt (20, 40);
1045  AddSwitchingEvt (30, 20);
1046  AddAccessRequest (51, 1, 55, 0);
1047  EndTest ();
1048 
1049  // 20 30 50 51 54 55 56
1050  // | nav | switching | idle | sifs | aifsn | tx |
1051  // ^ access request.
1052  //
1053  StartTest (1, 3, 10);
1054  AddTxop (1);
1055  AddNavStart (20,40);
1056  AddSwitchingEvt (30,20);
1057  AddAccessRequest (51, 1, 55, 0);
1058  EndTest ();
1059 
1060  // 20 23 24 44 54 59 60 63 64 65
1061  // | sifs | aifsn | tx | Ack timeout | switching | idle | sifs | aifsn | tx |
1062  // | |
1063  // 49 access request. ^ access request.
1064  //
1065  StartTest (1, 3, 10);
1066  AddTxop (1);
1067  AddAccessRequestWithAckTimeout (20, 20, 24, 0);
1068  AddAccessRequest (49, 1, 54, 0);
1069  AddSwitchingEvt (54, 5);
1070  AddAccessRequest (60, 1, 64, 0);
1071  EndTest ();
1072 
1073  // 20 60 66 70 74 78 80 100 101 107 111 113
1074  // | rx | sifs | aifsn | bslot0 | bslot1 | | switching | idle | sifs | aifsn | tx |
1075  // | |
1076  // 30 access request. ^ access request.
1077  //
1078  StartTest (4, 6, 10);
1079  AddTxop (1);
1080  AddRxOkEvt (20,40);
1081  AddAccessRequest (30, 2, 80, 0);
1082  ExpectBackoff (30, 4, 0); //backoff: 4 slots
1083  AddSwitchingEvt (80,20);
1084  AddAccessRequest (101, 2, 111, 0);
1085  EndTest ();
1086 }
1087 
1088 /*
1089  * Specialization of DoRun () method for EDCA
1090  */
1091 template <>
1092 void
1094 {
1095  // Check alignment at slot boundary after successful reception (backoff = 0):
1096  // 20 50 56 60 80
1097  // | rx | sifs | aifsn | tx |
1098  // |
1099  // 52 request access
1100  StartTest (4, 6, 10);
1101  AddTxop (1);
1102  AddRxOkEvt (20, 30);
1103  AddAccessRequest (52, 20, 60, 0);
1104  EndTest ();
1105 
1106  // Check alignment at slot boundary after successful reception (backoff = 0):
1107  // 20 50 56 60 80
1108  // | rx | sifs | aifsn | tx |
1109  // |
1110  // 58 request access
1111  StartTest (4, 6, 10);
1112  AddTxop (1);
1113  AddRxOkEvt (20, 30);
1114  AddAccessRequest (58, 20, 60, 0);
1115  EndTest ();
1116 
1117  // Check alignment at slot boundary after successful reception (backoff = 0):
1118  // 20 50 56 60 64 84
1119  // | rx | sifs | aifsn | idle | tx |
1120  // |
1121  // 62 request access
1122  StartTest (4, 6, 10);
1123  AddTxop (1);
1124  AddRxOkEvt (20, 30);
1125  AddAccessRequest (62, 20, 64, 0);
1126  EndTest ();
1127 
1128  // Check alignment at slot boundary after failed reception (backoff = 0):
1129  // 20 50 56 66 76 96
1130  // | | <------eifs------>| | |
1131  // | rx | sifs | acktxttime | sifs + aifsn | tx |
1132  // |
1133  // 55 request access
1134  StartTest (4, 6, 10);
1135  AddTxop (1);
1136  AddRxErrorEvt (20, 30);
1137  AddAccessRequest (55, 20, 76, 0);
1138  EndTest ();
1139 
1140  // Check alignment at slot boundary after failed reception (backoff = 0):
1141  // 20 50 56 66 76 96
1142  // | | <------eifs------>| | |
1143  // | rx | sifs | acktxttime | sifs + aifsn | tx |
1144  // |
1145  // 70 request access
1146  StartTest (4, 6, 10);
1147  AddTxop (1);
1148  AddRxErrorEvt (20, 30);
1149  AddAccessRequest (70, 20, 76, 0);
1150  EndTest ();
1151 
1152  // Check alignment at slot boundary after failed reception (backoff = 0):
1153  // 20 50 56 66 76 84
1154  // | | <------eifs------>| | |
1155  // | rx | sifs | acktxttime | sifs + aifsn | idle | tx |
1156  // |
1157  // 82 request access
1158  StartTest (4, 6, 10);
1159  AddTxop (1);
1160  AddRxErrorEvt (20, 30);
1161  AddAccessRequest (82, 20, 84, 0);
1162  EndTest ();
1163 
1164  // Check backoff decrement at slot boundaries. Medium idle during backoff
1165  // 20 50 56 60 64 68 72 76 96
1166  // | rx | sifs | aifsn | idle | idle | idle | idle | tx |
1167  // | | | | |
1168  // 30 request access. decrement decrement decrement decrement
1169  // backoff slots: 4 slots: 3 slots: 2 slots: 1 slots: 0
1170  StartTest (4, 6, 10);
1171  AddTxop (1);
1172  AddRxOkEvt (20, 30);
1173  AddAccessRequest (30, 20, 76, 0);
1174  ExpectBackoff (30, 4, 0);
1175  EndTest ();
1176 
1177  // Check backoff decrement at slot boundaries. Medium becomes busy during backoff
1178  // 20 50 56 60 61 71 77 81 85 87 97 103 107 127
1179  // | rx | sifs | aifsn | idle | rx | sifs | aifsn | idle | idle | rx | sifs | aifsn | tx |
1180  // | | | |
1181  // 30 request access. decrement decrement decrement
1182  // backoff slots: 3 slots: 2 slots: 1 slots: 0
1183  StartTest (4, 6, 10);
1184  AddTxop (1);
1185  AddRxOkEvt (20, 30);
1186  AddRxOkEvt (61, 10);
1187  AddRxOkEvt (87, 10);
1188  AddAccessRequest (30, 20, 107, 0);
1189  ExpectBackoff (30, 3, 0);
1190  EndTest ();
1191 }
1192 
1199 class TxopTestSuite : public TestSuite
1200 {
1201 public:
1202  TxopTestSuite ();
1203 };
1204 
1206  : TestSuite ("wifi-devices-dcf", UNIT)
1207 {
1208  AddTestCase (new ChannelAccessManagerTest<Txop>, TestCase::QUICK);
1209 }
1210 
1212 
1220 {
1221 public:
1222  QosTxopTestSuite ();
1223 };
1224 
1226  : TestSuite ("wifi-devices-edca", UNIT)
1227 {
1228  AddTestCase (new ChannelAccessManagerTest<QosTxop>, TestCase::QUICK);
1229 }
1230 
TxopTest::NotifyChannelAccessed
void NotifyChannelAccessed(Time txopDuration=Seconds(0)) override
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
Definition: channel-access-manager-test.cc:411
TxopTest::ExpectedGrant
std::pair< uint64_t, uint64_t > ExpectedGrant
the expected grant typedef
Definition: channel-access-manager-test.cc:76
ChannelAccessManagerTest::GenerateBackoff
void GenerateBackoff(uint32_t i)
Generate backoff function.
Definition: channel-access-manager-test.cc:497
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
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
ChannelAccessManagerTest::NotifyAccessGranted
void NotifyAccessGranted(uint32_t i)
Notify access granted function.
Definition: channel-access-manager-test.cc:458
ChannelAccessManagerStub::SetEifsNoDifs
void SetEifsNoDifs(Time eifsNoDifs)
Set the duration of EIFS - DIFS.
Definition: channel-access-manager-test.cc:134
FrameExchangeManagerStub::m_test
ChannelAccessManagerTest< TxopType > * m_test
the test DCF/EDCA manager
Definition: channel-access-manager-test.cc:198
ns3::ChannelAccessManager
Manage a set of ns3::Txop.
Definition: channel-access-manager.h:52
ChannelAccessManagerTest::EndTest
void EndTest(void)
End test function.
Definition: channel-access-manager-test.cc:586
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TxopTest::GenerateBackoff
void GenerateBackoff(void) override
Generate a new backoff now.
Definition: channel-access-manager-test.cc:419
ChannelAccessManagerTest::m_feManager
Ptr< FrameExchangeManagerStub< TxopType > > m_feManager
the Frame Exchange Manager stubbed
Definition: channel-access-manager-test.cc:381
ChannelAccessManagerTest::m_ChannelAccessManager
Ptr< ChannelAccessManagerStub > m_ChannelAccessManager
the channel access manager
Definition: channel-access-manager-test.cc:382
ChannelAccessManagerTest::NotifyInternalCollision
void NotifyInternalCollision(Ptr< TxopTest< TxopType >> state)
Notify internal collision function.
Definition: channel-access-manager-test.cc:483
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
ChannelAccessManagerTest::AddRxInsideSifsEvt
void AddRxInsideSifsEvt(uint64_t at, uint64_t duration)
Add receive inside SIFS event function.
Definition: channel-access-manager-test.cc:620
ChannelAccessManagerStub::GetSlot
Time GetSlot(void) const override
Return the slot duration for this PHY.
Definition: channel-access-manager-test.cc:145
TxopTest::NotifyChannelSwitching
void NotifyChannelSwitching(void) override
When a channel switching occurs, enqueued packets are removed.
Definition: channel-access-manager-test.cc:433
ChannelAccessManagerTest::NotifyChannelSwitching
void NotifyChannelSwitching(uint32_t i)
Notify channel switching function.
Definition: channel-access-manager-test.cc:512
QosTxopTestSuite::QosTxopTestSuite
QosTxopTestSuite()
Definition: channel-access-manager-test.cc:1225
ChannelAccessManagerTest
Channel Access Manager Test.
Definition: channel-access-manager-test.cc:209
ns3::Txop::NotifyChannelAccessed
virtual void NotifyChannelAccessed(Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted for the given amoun...
Definition: txop.cc:348
ChannelAccessManagerTest::AddRxErrorEvt
void AddRxErrorEvt(uint64_t at, uint64_t duration)
Add receive error event function for error at end of frame.
Definition: channel-access-manager-test.cc:629
ChannelAccessManagerTest::AddAccessRequestWithAckTimeout
void AddAccessRequestWithAckTimeout(uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from)
Add access request with Ack timeout.
Definition: channel-access-manager-test.cc:686
ChannelAccessManagerTest::ExpectInternalCollision
void ExpectInternalCollision(uint64_t time, uint32_t nSlots, uint32_t from)
Expect internal collision function.
Definition: channel-access-manager-test.cc:526
ChannelAccessManagerTest::StartTest
void StartTest(uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue=20)
Start test function.
Definition: channel-access-manager-test.cc:563
ns3::TestCase
encapsulates test code
Definition: test.h:1154
TxopTest::m_test
ChannelAccessManagerTest< TxopType > * m_test
Check if the Txop has frames to transmit.
Definition: channel-access-manager-test.cc:95
FrameExchangeManagerStub::StartTransmission
bool StartTransmission(Ptr< Txop > dcf) override
Request the FrameExchangeManager to start a frame exchange sequence.
Definition: channel-access-manager-test.cc:186
ChannelAccessManagerTest::DoCheckBusy
void DoCheckBusy(bool busy)
Perform check that channel access manager is busy or idle.
Definition: channel-access-manager-test.cc:556
ns3::Ptr< Txop >
ChannelAccessManagerTest::ChannelAccessManagerTest
ChannelAccessManagerTest()
Definition: channel-access-manager-test.cc:451
TxopTest::m_i
uint32_t m_i
the index of the Txop
Definition: channel-access-manager-test.cc:96
ChannelAccessManagerStub::SetSlot
void SetSlot(Time slot)
Set the slot duration.
Definition: channel-access-manager-test.cc:125
ChannelAccessManagerTest::AddAccessRequest
void AddAccessRequest(uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from)
Add access function.
Definition: channel-access-manager-test.cc:678
TxopTest::m_expectedInternalCollision
ExpectedBackoffs m_expectedInternalCollision
expected backoff due to an internal collision
Definition: channel-access-manager-test.cc:86
ChannelAccessManagerStub
ChannelAccessManager Stub.
Definition: channel-access-manager-test.cc:106
TxopTest::NotifySleep
void NotifySleep(void) override
When sleep operation occurs, if there is a pending packet transmission, it will be reinserted to the ...
Definition: channel-access-manager-test.cc:440
ns3::Now
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
ns3::DynamicCast
Ptr< T1 > DynamicCast(Ptr< T2 > const &p)
Cast a Ptr.
Definition: ptr.h:533
ChannelAccessManagerStub::m_eifsNoDifs
Time m_eifsNoDifs
EIFS duration minus a DIFS.
Definition: channel-access-manager-test.cc:157
ChannelAccessManagerTest::AddNavReset
void AddNavReset(uint64_t at, uint64_t duration)
Add NAV reset function.
Definition: channel-access-manager-test.cc:652
TxopTestSuite::TxopTestSuite
TxopTestSuite()
Definition: channel-access-manager-test.cc:1205
ChannelAccessManagerStub::GetEifsNoDifs
Time GetEifsNoDifs(void) const override
Return the EIFS duration minus a DIFS.
Definition: channel-access-manager-test.cc:150
TxopTest::m_expectedBackoff
ExpectedBackoffs m_expectedBackoff
expected backoff (not due to an internal collision)
Definition: channel-access-manager-test.cc:87
TxopTest::QueueTx
void QueueTx(uint64_t txTime, uint64_t expectedGrantTime)
Queue transmit function.
Definition: channel-access-manager-test.cc:389
ChannelAccessManagerTest::AddSwitchingEvt
void AddSwitchingEvt(uint64_t at, uint64_t duration)
Add switching event function.
Definition: channel-access-manager-test.cc:730
NS_TEST_EXPECT_MSG_EQ
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Definition: test.h:283
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ChannelAccessManagerTest::DoRun
void DoRun(void) override
ChannelAccessManagerTest::AddRxOkEvt
void AddRxOkEvt(uint64_t at, uint64_t duration)
Add receive OK event function.
Definition: channel-access-manager-test.cc:609
QosTxopTestSuite
QosTxop Test Suite.
Definition: channel-access-manager-test.cc:1220
ChannelAccessManagerTest::AddNavStart
void AddNavStart(uint64_t at, uint64_t duration)
Add NAV start function.
Definition: channel-access-manager-test.cc:661
TxopTest::ExpectedGrants
std::list< ExpectedGrant > ExpectedGrants
the collection of expected grants typedef
Definition: channel-access-manager-test.cc:77
g_edcaTestSuite
static QosTxopTestSuite g_edcaTestSuite
Definition: channel-access-manager-test.cc:1231
TxopTest
TxopTest Txop Test.
Definition: channel-access-manager-test.cc:40
ChannelAccessManagerTest::AddAccessRequestWithSuccessfullAck
void AddAccessRequestWithSuccessfullAck(uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from)
Add access request with successful ack.
Definition: channel-access-manager-test.cc:696
TxopTest::TxopTest
TxopTest(ChannelAccessManagerTest< TxopType > *test, uint32_t i)
Constructor.
Definition: channel-access-manager-test.cc:395
ns3::TestSuite
A suite of tests to run.
Definition: test.h:1344
g_dcfTestSuite
static TxopTestSuite g_dcfTestSuite
Definition: channel-access-manager-test.cc:1211
FrameExchangeManagerStub
Frame Exchange Manager Stub.
Definition: channel-access-manager-test.cc:168
FrameExchangeManagerStub::FrameExchangeManagerStub
FrameExchangeManagerStub(ChannelAccessManagerTest< TxopType > *test)
Constructor.
Definition: channel-access-manager-test.cc:175
ChannelAccessManagerStub::SetSifs
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS).
Definition: channel-access-manager-test.cc:116
ChannelAccessManagerStub::ChannelAccessManagerStub
ChannelAccessManagerStub()
Definition: channel-access-manager-test.cc:108
TxopTest::m_expectedGrants
ExpectedGrants m_expectedGrants
expected grants
Definition: channel-access-manager-test.cc:88
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ChannelAccessManagerTest::DoAccessRequest
void DoAccessRequest(uint64_t txTime, uint64_t expectedGrantTime, Ptr< TxopTest< TxopType >> state)
Add access request with successful Ack.
Definition: channel-access-manager-test.cc:708
ns3::FrameExchangeManager
FrameExchangeManager is a base class handling the basic frame exchange sequences for non-QoS stations...
Definition: frame-exchange-manager.h:52
TxopTest::ExpectedBackoffs
std::list< struct ExpectedBackoff > ExpectedBackoffs
expected backoffs typedef
Definition: channel-access-manager-test.cc:84
ChannelAccessManagerTest::m_txop
TxopTests m_txop
the vector of Txop test instances
Definition: channel-access-manager-test.cc:383
ChannelAccessManagerStub::m_sifs
Time m_sifs
SIFS duration.
Definition: channel-access-manager-test.cc:156
ChannelAccessManagerTest::AddTxop
void AddTxop(uint32_t aifsn)
Add Txop function.
Definition: channel-access-manager-test.cc:576
ChannelAccessManagerStub::GetSifs
Time GetSifs(void) const override
Return the Short Interframe Space (SIFS) for this PHY.
Definition: channel-access-manager-test.cc:140
TxopTest::HasFramesToTransmit
bool HasFramesToTransmit(void) override
Check if the Txop has frames to transmit.
Definition: channel-access-manager-test.cc:426
TxopTest::DoDispose
void DoDispose(void) override
Destructor implementation.
Definition: channel-access-manager-test.cc:403
ChannelAccessManagerTest::AddCcaBusyEvt
void AddCcaBusyEvt(uint64_t at, uint64_t duration)
Add CCA busy event function.
Definition: channel-access-manager-test.cc:721
TxopTest::ExpectedBackoff::nSlots
uint32_t nSlots
number of slots
Definition: channel-access-manager-test.cc:82
ChannelAccessManagerStub::m_slot
Time m_slot
slot duration
Definition: channel-access-manager-test.cc:155
TxopTest::NotifyWakeUp
void NotifyWakeUp(void) override
When wake up operation occurs, channel access will be restarted.
Definition: channel-access-manager-test.cc:446
TxopTest::ExpectedBackoff
ExpectedBackoff structure.
Definition: channel-access-manager-test.cc:80
ChannelAccessManagerTest::AddRxStartEvt
void AddRxStartEvt(uint64_t at, uint64_t duration)
Add receive start event function.
Definition: channel-access-manager-test.cc:739
ChannelAccessManagerTest::m_ackTimeoutValue
uint32_t m_ackTimeoutValue
the Ack timeout value
Definition: channel-access-manager-test.cc:384
ChannelAccessManagerTest::TxopTests
std::vector< Ptr< TxopTest< TxopType > > > TxopTests
the TXOP tests typedef
Definition: channel-access-manager-test.cc:379
FrameExchangeManagerStub::NotifyInternalCollision
void NotifyInternalCollision(Ptr< Txop > txop) override
Notify that an internal collision has occurred for the given Txop.
Definition: channel-access-manager-test.cc:192
ChannelAccessManagerTest::AddAckTimeoutReset
void AddAckTimeoutReset(uint64_t at)
Add Ack timeout reset function.
Definition: channel-access-manager-test.cc:670
TxopTest::ExpectedBackoff::at
uint64_t at
at
Definition: channel-access-manager-test.cc:81
ChannelAccessManagerTest::AddTxEvt
void AddTxEvt(uint64_t at, uint64_t duration)
Add transmit event function.
Definition: channel-access-manager-test.cc:474
TxopTestSuite
Txop Test Suite.
Definition: channel-access-manager-test.cc:1200