Channel Access Manager Test. More...
Inheritance diagram for ChannelAccessManagerTest< TxopType >:
Collaboration diagram for ChannelAccessManagerTest< TxopType >:Classes | |
| struct | Params |
| Input parameters for the StartTest function. More... | |
Public Member Functions | |
| ChannelAccessManagerTest () | |
| void | DoRun () |
| Implementation to actually run this TestCase. | |
| void | DoRun () |
| Implementation to actually run this TestCase. | |
| void | DoRun () override |
| Implementation to actually run this TestCase. | |
| void | GenerateBackoff (uint32_t i) |
| Generate backoff function. | |
| void | NotifyAccessGranted (uint32_t i) |
| Notify access granted function. | |
| void | NotifyChannelSwitching () |
| Notify channel switching function. | |
| void | NotifyInternalCollision (Ptr< TxopTest< TxopType > > state) |
| Notify internal collision function. | |
Public Member Functions inherited from ns3::TestCase | |
| TestCase (const TestCase &)=delete | |
| virtual | ~TestCase () |
| Destructor. | |
| std::string | GetName () const |
| TestCase & | operator= (const TestCase &)=delete |
Private Types | |
| typedef std::vector< Ptr< TxopTest< TxopType > > > | TxopTests |
| the TXOP tests typedef | |
Private Member Functions | |
| void | AddAccessRequest (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from) |
| Add access function. | |
| void | AddAccessRequestWithAckTimeout (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t from) |
| Add access request with Ack timeout. | |
| void | AddAccessRequestWithSuccessfulAck (uint64_t at, uint64_t txTime, uint64_t expectedGrantTime, uint32_t ackDelay, uint32_t from) |
| Add access request with successful ack. | |
| void | AddAckTimeoutReset (uint64_t at) |
| Add Ack timeout reset function. | |
| void | AddCcaBusyEvt (uint64_t at, uint64_t duration, WifiChannelListType channelType=WIFI_CHANLIST_PRIMARY) |
| Add CCA busy event function. | |
| void | AddNavReset (uint64_t at, uint64_t duration) |
| Add NAV reset function. | |
| void | AddNavStart (uint64_t at, uint64_t duration) |
| Add NAV start function. | |
| void | AddPhyDisconnectEvt (uint64_t at, uint64_t duration, uint32_t from) |
| Add a PHY disconnect event consisting in the PHY leaving the link and returning after a given time. | |
| void | AddPhyOffEvt (uint64_t at, uint64_t duration) |
| Add PHY off/on events. | |
| void | AddPhyReconnectEvt (uint64_t at, uint64_t duration) |
| Add a PHY reconnect event consisting in another PHY operating on the link for the given time. | |
| void | AddPhySleepEvt (uint64_t at, uint64_t duration) |
| Add PHY sleep/resume events. | |
| void | AddRxErrorEvt (uint64_t at, uint64_t duration) |
| Add receive error event function for error at end of frame. | |
| void | AddRxErrorEvt (uint64_t at, uint64_t duration, uint64_t timeUntilError) |
| Add receive error event function for error during frame. | |
| void | AddRxInsideSifsEvt (uint64_t at, uint64_t duration) |
| Add receive inside SIFS event function. | |
| void | AddRxOkEvt (uint64_t at, uint64_t duration) |
| Add receive OK event function. | |
| void | AddRxStartEvt (uint64_t at, uint64_t duration) |
| Add receive start event function. | |
| void | AddSwitchingEvt (uint64_t at, uint64_t duration) |
| Add switching event function. | |
| void | AddTxEvt (uint64_t at, uint64_t duration) |
| Add transmit event function. | |
| void | AddTxop (uint32_t aifsn) |
| Add Txop function. | |
| void | DoAccessRequest (uint64_t txTime, uint64_t expectedGrantTime, Ptr< TxopTest< TxopType > > state) |
| Add access request with successful Ack. | |
| void | DoCheckBusy (bool busy) |
| Perform check that channel access manager is busy or idle. | |
| void | EndTest () |
| End test function. | |
| void | ExpectBackoff (uint64_t time, uint32_t nSlots, uint32_t from) |
| Expect generate backoff function. | |
| void | ExpectBusy (uint64_t time, bool busy) |
| Schedule a check that the channel access manager is busy or idle. | |
| void | ExpectInternalCollision (uint64_t time, uint32_t nSlots, uint32_t from) |
| Expect internal collision function. | |
| void | StartTest (const Params ¶ms) |
| Start test function. | |
Private Attributes | |
| uint32_t | m_ackTimeoutValue |
| the Ack timeout value | |
| Ptr< ChannelAccessManagerStub > | m_ChannelAccessManager |
| the channel access manager | |
| Ptr< FrameExchangeManagerStub< TxopType > > | m_feManager |
| the Frame Exchange Manager stubbed | |
| Ptr< SpectrumWifiPhy > | m_phy |
| the PHY object | |
| TxopTests | m_txop |
| the vector of Txop test instances | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
| enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
| How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
| TestCase (std::string name) | |
| Constructor. | |
| void | AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK) |
| Add an individual child TestCase to this test suite. | |
| TestCase * | GetParent () const |
| Get the parent of this TestCase. | |
| bool | IsStatusFailure () const |
| Check if any tests failed. | |
| bool | IsStatusSuccess () const |
| Check if all tests passed. | |
| void | SetDataDir (std::string directory) |
| Set the data directory where reference trace files can be found. | |
| void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
| Log the failure of this TestCase. | |
| bool | MustAssertOnFailure () const |
| Check if this run should assert on failure. | |
| bool | MustContinueOnFailure () const |
| Check if this run should continue on failure. | |
| std::string | CreateDataDirFilename (std::string filename) |
| Construct the full path to a file in the data directory. | |
| std::string | CreateTempDirFilename (std::string filename) |
| Construct the full path to a file in a temporary directory. | |
Channel Access Manager Test.
Definition at line 238 of file channel-access-manager-test.cc.
|
private |
the TXOP tests typedef
Definition at line 458 of file channel-access-manager-test.cc.
| ChannelAccessManagerTest< TxopType >::ChannelAccessManagerTest | ( | ) |
Definition at line 512 of file channel-access-manager-test.cc.
References ns3::TestCase::TestCase().
Referenced by ExpectBackoff(), ExpectBusy(), GenerateBackoff(), and NotifyChannelSwitching().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add access function.
| at | the event time |
| txTime | the transmit time |
| expectedGrantTime | the expected grant time |
| from | the index of the requesting Txop |
Definition at line 827 of file channel-access-manager-test.cc.
References AddAccessRequestWithSuccessfulAck().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add access request with Ack timeout.
| at | time to schedule DoAccessRequest event |
| txTime | the transmit time |
| expectedGrantTime | the expected grant time |
| from | the index of the requesting Txop |
Definition at line 837 of file channel-access-manager-test.cc.
References DoAccessRequest(), m_txop, ns3::MicroSeconds(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add access request with successful ack.
| at | time to schedule DoAccessRequest event |
| txTime | the transmit time |
| expectedGrantTime | the expected grant time |
| ackDelay | the delay of the Ack after txEnd |
| from | the index of the requesting Txop |
Definition at line 852 of file channel-access-manager-test.cc.
References AddAckTimeoutReset(), DoAccessRequest(), m_ackTimeoutValue, m_txop, ns3::MicroSeconds(), ns3::Now(), NS_ASSERT, and ns3::Simulator::Schedule().
Referenced by AddAccessRequest(), and DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add Ack timeout reset function.
| at | the event time |
Definition at line 818 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyAckTimeoutResetNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by AddAccessRequestWithSuccessfulAck().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add CCA busy event function.
| at | the event time |
| duration | the duration |
| channelType | the channel type |
Definition at line 885 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, m_phy, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyCcaBusyStartNow(), ns3::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add NAV reset function.
| at | the event time |
| duration | the duration |
Definition at line 798 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyNavResetNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add NAV start function.
| at | the event time |
| duration | the duration |
Definition at line 808 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyNavStartNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add a PHY disconnect event consisting in the PHY leaving the link and returning after a given time.
| at | the event time |
| duration | the duration of the interval during which no PHY is connected |
| from | the index of the Txop that has to request channel access when PHY is reconnected |
Definition at line 922 of file channel-access-manager-test.cc.
References ns3::TimeValue::Get(), m_ChannelAccessManager, m_phy, m_txop, ns3::MicroSeconds(), ns3::Now(), ns3::ChannelAccessManager::RemovePhyListener(), ns3::Simulator::Schedule(), and ns3::SINGLE_LINK_OP_ID.
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add PHY off/on events.
| at | the event time |
| duration | the duration of the interval during which the PHY is in off state |
Definition at line 983 of file channel-access-manager-test.cc.
References m_phy, ns3::MicroSeconds(), ns3::Now(), ns3::WifiPhy::ResumeFromOff(), ns3::Simulator::Schedule(), and ns3::WifiPhy::SetOffMode().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add a PHY reconnect event consisting in another PHY operating on the link for the given time.
| at | the event time |
| duration | the duration of the interval during which another PHY is connected |
Definition at line 952 of file channel-access-manager-test.cc.
References ns3::CreateObject(), ns3::DynamicCast(), m_ChannelAccessManager, m_phy, ns3::MicroSeconds(), ns3::Now(), ns3::Simulator::Schedule(), and ns3::WIFI_STANDARD_80211be.
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add PHY sleep/resume events.
| at | the event time |
| duration | the duration of the interval during which the PHY is in sleep state |
Definition at line 975 of file channel-access-manager-test.cc.
References m_phy, ns3::MicroSeconds(), ns3::Now(), ns3::WifiPhy::ResumeFromSleep(), ns3::Simulator::Schedule(), and ns3::WifiPhy::SetSleepMode().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add receive error event function for error at end of frame.
| at | the event time |
| duration | the duration |
Definition at line 736 of file channel-access-manager-test.cc.
References ns3::OfdmPhy::GetOfdmRate6Mbps(), m_ChannelAccessManager, ns3::MicroSeconds(), ns3::NanoSeconds(), ns3::ChannelAccessManager::NotifyRxEndErrorNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), ns3::Simulator::Schedule(), and ns3::WIFI_PREAMBLE_LONG.
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add receive error event function for error during frame.
| at | the event time |
| duration | the duration |
| timeUntilError | the time after event time to force the error |
Definition at line 763 of file channel-access-manager-test.cc.
References ns3::OfdmPhy::GetOfdmRate6Mbps(), m_ChannelAccessManager, ns3::MicroSeconds(), ns3::NanoSeconds(), ns3::ChannelAccessManager::NotifyCcaBusyStartNow(), ns3::ChannelAccessManager::NotifyRxEndErrorNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), ns3::Simulator::Schedule(), ns3::WIFI_CHANLIST_PRIMARY, and ns3::WIFI_PREAMBLE_LONG.
Here is the call graph for this function:
|
private |
Add receive inside SIFS event function.
| at | the event time |
| duration | the duration |
Definition at line 726 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add receive OK event function.
| at | the event time |
| duration | the duration |
Definition at line 713 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxEndOkNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add receive start event function.
| at | the event time |
| duration | the duration |
Definition at line 912 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add switching event function.
| at | the event time |
| duration | the duration |
Definition at line 901 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add transmit event function.
| at | the event time |
| duration | the duration |
Definition at line 538 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyTxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add Txop function.
| aifsn | the AIFSN |
Definition at line 668 of file channel-access-manager-test.cc.
References ns3::CreateObject(), ns3::CreateObjectWithAttributes(), m_ChannelAccessManager, m_phy, and m_txop.
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add access request with successful Ack.
| txTime | the transmit time |
| expectedGrantTime | the expected grant time |
| state | TxopTest |
Definition at line 870 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, and ns3::SINGLE_LINK_OP_ID.
Referenced by AddAccessRequestWithAckTimeout(), and AddAccessRequestWithSuccessfulAck().
Here is the caller graph for this function:
|
private |
Perform check that channel access manager is busy or idle.
| busy | whether expected state is busy |
Definition at line 636 of file channel-access-manager-test.cc.
References m_ChannelAccessManager, and NS_TEST_EXPECT_MSG_EQ.
Referenced by ExpectBusy().
Here is the caller graph for this function:
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 994 of file channel-access-manager-test.cc.
References AddAccessRequest(), AddAccessRequestWithAckTimeout(), AddAccessRequestWithSuccessfulAck(), AddCcaBusyEvt(), AddNavReset(), AddNavStart(), AddRxErrorEvt(), AddRxInsideSifsEvt(), AddRxOkEvt(), AddRxStartEvt(), AddSwitchingEvt(), AddTxEvt(), AddTxop(), EndTest(), ExpectBackoff(), ExpectBusy(), ExpectInternalCollision(), and StartTest().
Here is the call graph for this function:
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 1337 of file channel-access-manager-test.cc.
References AddAccessRequest(), AddCcaBusyEvt(), AddPhyDisconnectEvt(), AddPhyOffEvt(), AddPhyReconnectEvt(), AddPhySleepEvt(), AddRxErrorEvt(), AddRxOkEvt(), AddTxop(), EndTest(), ExpectBackoff(), StartTest(), ns3::WIFI_CHANLIST_SECONDARY, ns3::WIFI_CHANLIST_SECONDARY160, ns3::WIFI_CHANLIST_SECONDARY40, and ns3::WIFI_CHANLIST_SECONDARY80.
Here is the call graph for this function:
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
References ns3::WIFI_CHANLIST_PRIMARY.
|
private |
End test function.
Definition at line 685 of file channel-access-manager-test.cc.
References ns3::Simulator::Destroy(), m_ChannelAccessManager, m_feManager, m_phy, m_txop, NS_TEST_EXPECT_MSG_EQ, and ns3::Simulator::Run().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Expect generate backoff function.
| time | the expected time |
| nSlots | the number of slots |
| from | the expected from |
Definition at line 615 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest(), ExpectBackoff(), TxopTest< TxopType >::m_expectedBackoff, and m_txop.
Referenced by DoRun(), and ExpectBackoff().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Schedule a check that the channel access manager is busy or idle.
| time | the expected time |
| busy | whether the manager is expected to be busy |
Definition at line 626 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest(), DoCheckBusy(), ExpectBusy(), ns3::MicroSeconds(), ns3::Now(), and ns3::Simulator::Schedule().
Referenced by DoRun(), and ExpectBusy().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Expect internal collision function.
| time | the expected time |
| nSlots | the number of slots |
| from | the expected from |
Definition at line 602 of file channel-access-manager-test.cc.
References TxopTest< TxopType >::m_expectedInternalCollision, and m_txop.
Referenced by DoRun().
Here is the caller graph for this function:| void ChannelAccessManagerTest< TxopType >::GenerateBackoff | ( | uint32_t | i | ) |
Generate backoff function.
| i | the index of the Txop |
Definition at line 567 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest(), GenerateBackoff(), TxopTest< TxopType >::m_expectedBackoff, m_txop, and NS_TEST_EXPECT_MSG_EQ.
Referenced by GenerateBackoff().
Here is the call graph for this function:
Here is the caller graph for this function:| void ChannelAccessManagerTest< TxopType >::NotifyAccessGranted | ( | uint32_t | i | ) |
Notify access granted function.
| i | the index of the Txop |
Definition at line 519 of file channel-access-manager-test.cc.
References m_ackTimeoutValue, m_ChannelAccessManager, m_txop, ns3::MicroSeconds(), ns3::Simulator::Now(), and NS_TEST_EXPECT_MSG_EQ.
Here is the call graph for this function:| void ChannelAccessManagerTest< TxopType >::NotifyChannelSwitching | ( | ) |
Notify channel switching function.
Definition at line 584 of file channel-access-manager-test.cc.
References ChannelAccessManagerTest(), m_txop, ns3::MicroSeconds(), ns3::Txop::NOT_REQUESTED, NotifyChannelSwitching(), ns3::Simulator::Now(), and NS_TEST_EXPECT_MSG_EQ.
Referenced by NotifyChannelSwitching().
Here is the call graph for this function:
Here is the caller graph for this function:| void ChannelAccessManagerTest< TxopType >::NotifyInternalCollision | ( | Ptr< TxopTest< TxopType > > | state | ) |
Notify internal collision function.
| state | the Txop |
Definition at line 548 of file channel-access-manager-test.cc.
References TxopTest< TxopType >::m_expectedInternalCollision, and NS_TEST_EXPECT_MSG_EQ.
|
private |
Start test function.
| params | the parameters for this function |
Definition at line 643 of file channel-access-manager-test.cc.
References ns3::CreateObject(), ns3::CreateObjectWithAttributes(), m_ackTimeoutValue, m_ChannelAccessManager, m_feManager, m_phy, ns3::MicroSeconds(), ns3::WIFI_PHY_BAND_6GHZ, and ns3::WIFI_STANDARD_80211be.
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
the Ack timeout value
Definition at line 464 of file channel-access-manager-test.cc.
Referenced by AddAccessRequestWithSuccessfulAck(), NotifyAccessGranted(), and StartTest().
|
private |
the channel access manager
Definition at line 461 of file channel-access-manager-test.cc.
Referenced by AddAckTimeoutReset(), AddCcaBusyEvt(), AddNavReset(), AddNavStart(), AddPhyDisconnectEvt(), AddPhyReconnectEvt(), AddRxErrorEvt(), AddRxErrorEvt(), AddRxInsideSifsEvt(), AddRxOkEvt(), AddRxStartEvt(), AddSwitchingEvt(), AddTxEvt(), AddTxop(), DoAccessRequest(), DoCheckBusy(), EndTest(), NotifyAccessGranted(), and StartTest().
|
private |
the Frame Exchange Manager stubbed
Definition at line 460 of file channel-access-manager-test.cc.
Referenced by EndTest(), and StartTest().
|
private |
the PHY object
Definition at line 462 of file channel-access-manager-test.cc.
Referenced by AddCcaBusyEvt(), AddPhyDisconnectEvt(), AddPhyOffEvt(), AddPhyReconnectEvt(), AddPhySleepEvt(), AddTxop(), EndTest(), and StartTest().
|
private |
the vector of Txop test instances
Definition at line 463 of file channel-access-manager-test.cc.
Referenced by AddAccessRequestWithAckTimeout(), AddAccessRequestWithSuccessfulAck(), AddPhyDisconnectEvt(), AddTxop(), EndTest(), ExpectBackoff(), ExpectInternalCollision(), GenerateBackoff(), NotifyAccessGranted(), and NotifyChannelSwitching().