A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ChannelAccessManagerTest< TxopType > Class Template Reference

Channel Access Manager Test. More...

+ Inheritance diagram for ChannelAccessManagerTest< TxopType >:
+ Collaboration diagram for ChannelAccessManagerTest< TxopType >:

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
 
TestCaseoperator= (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, const std::vector< Time > &per20MhzDurations={})
 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 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 (uint64_t slotTime, uint64_t sifs, uint64_t eifsNoDifsNoSifs, uint32_t ackTimeoutValue=20, uint16_t chWidth=20)
 Start test function.
 

Private Attributes

uint32_t m_ackTimeoutValue
 the Ack timeout value
 
Ptr< ChannelAccessManagerStubm_ChannelAccessManager
 the channel access manager
 
Ptr< FrameExchangeManagerStub< TxopType > > m_feManager
 the Frame Exchange Manager stubbed
 
Ptr< SpectrumWifiPhym_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...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 
- 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.
 
TestCaseGetParent () 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.
 

Detailed Description

template<typename TxopType>
class ChannelAccessManagerTest< TxopType >

Channel Access Manager Test.

Definition at line 226 of file channel-access-manager-test.cc.

Member Typedef Documentation

◆ TxopTests

template<typename TxopType >
typedef std::vector<Ptr<TxopTest<TxopType> > > ChannelAccessManagerTest< TxopType >::TxopTests
private

the TXOP tests typedef

Definition at line 411 of file channel-access-manager-test.cc.

Constructor & Destructor Documentation

◆ ChannelAccessManagerTest()

Member Function Documentation

◆ AddAccessRequest()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddAccessRequest ( uint64_t  at,
uint64_t  txTime,
uint64_t  expectedGrantTime,
uint32_t  from 
)
private

Add access function.

Parameters
atthe event time
txTimethe transmit time
expectedGrantTimethe expected grant time
fromthe index of the requesting Txop

Definition at line 762 of file channel-access-manager-test.cc.

◆ AddAccessRequestWithAckTimeout()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddAccessRequestWithAckTimeout ( uint64_t  at,
uint64_t  txTime,
uint64_t  expectedGrantTime,
uint32_t  from 
)
private

Add access request with Ack timeout.

Parameters
attime to schedule DoAccessRequest event
txTimethe transmit time
expectedGrantTimethe expected grant time
fromthe index of the requesting Txop

Definition at line 772 of file channel-access-manager-test.cc.

References ChannelAccessManagerTest< TxopType >::DoAccessRequest(), ns3::MicroSeconds(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddAccessRequestWithSuccessfulAck()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddAccessRequestWithSuccessfulAck ( uint64_t  at,
uint64_t  txTime,
uint64_t  expectedGrantTime,
uint32_t  ackDelay,
uint32_t  from 
)
private

Add access request with successful ack.

Parameters
attime to schedule DoAccessRequest event
txTimethe transmit time
expectedGrantTimethe expected grant time
ackDelaythe delay of the Ack after txEnd
fromthe index of the requesting Txop

Definition at line 787 of file channel-access-manager-test.cc.

References ChannelAccessManagerTest< TxopType >::DoAccessRequest(), ns3::MicroSeconds(), ns3::Now(), NS_ASSERT, and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddAckTimeoutReset()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddAckTimeoutReset ( uint64_t  at)
private

Add Ack timeout reset function.

Parameters
atthe event time

Definition at line 753 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyAckTimeoutResetNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddCcaBusyEvt()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddCcaBusyEvt ( uint64_t  at,
uint64_t  duration,
WifiChannelListType  channelType = WIFI_CHANLIST_PRIMARY,
const std::vector< Time > &  per20MhzDurations = {} 
)
private

Add CCA busy event function.

Parameters
atthe event time
durationthe duration
channelTypethe channel type
per20MhzDurationsvector that indicates for how long each 20 MHz subchannel is busy

Definition at line 820 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyCcaBusyStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddNavReset()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddNavReset ( uint64_t  at,
uint64_t  duration 
)
private

Add NAV reset function.

Parameters
atthe event time
durationthe duration

Definition at line 733 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyNavResetNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddNavStart()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddNavStart ( uint64_t  at,
uint64_t  duration 
)
private

Add NAV start function.

Parameters
atthe event time
durationthe duration

Definition at line 743 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyNavStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddRxErrorEvt() [1/2]

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddRxErrorEvt ( uint64_t  at,
uint64_t  duration 
)
private

Add receive error event function for error at end of frame.

Parameters
atthe event time
durationthe duration

Definition at line 699 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxEndErrorNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddRxErrorEvt() [2/2]

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddRxErrorEvt ( uint64_t  at,
uint64_t  duration,
uint64_t  timeUntilError 
)
private

Add receive error event function for error during frame.

Parameters
atthe event time
durationthe duration
timeUntilErrorthe time after event time to force the error

Definition at line 712 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyCcaBusyStartNow(), ns3::ChannelAccessManager::NotifyRxEndErrorNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), ns3::Simulator::Schedule(), and ns3::WIFI_CHANLIST_PRIMARY.

+ Here is the call graph for this function:

◆ AddRxInsideSifsEvt()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddRxInsideSifsEvt ( uint64_t  at,
uint64_t  duration 
)
private

Add receive inside SIFS event function.

Parameters
atthe event time
durationthe duration

Definition at line 689 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddRxOkEvt()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddRxOkEvt ( uint64_t  at,
uint64_t  duration 
)
private

Add receive OK event function.

Parameters
atthe event time
durationthe duration

Definition at line 676 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxEndOkNow(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddRxStartEvt()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddRxStartEvt ( uint64_t  at,
uint64_t  duration 
)
private

Add receive start event function.

Parameters
atthe event time
durationthe duration

Definition at line 846 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyRxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddSwitchingEvt()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddSwitchingEvt ( uint64_t  at,
uint64_t  duration 
)
private

Add switching event function.

Parameters
atthe event time
durationthe duration

Definition at line 835 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddTxEvt()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddTxEvt ( uint64_t  at,
uint64_t  duration 
)
private

Add transmit event function.

Parameters
atthe event time
durationthe duration

Definition at line 503 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::ChannelAccessManager::NotifyTxStartNow(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ AddTxop()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::AddTxop ( uint32_t  aifsn)
private

Add Txop function.

Parameters
aifsnthe AIFSN

Definition at line 635 of file channel-access-manager-test.cc.

◆ DoAccessRequest()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::DoAccessRequest ( uint64_t  txTime,
uint64_t  expectedGrantTime,
Ptr< TxopTest< TxopType > >  state 
)
private

Add access request with successful Ack.

Parameters
txTimethe transmit time
expectedGrantTimethe expected grant time
stateTxopTest

Definition at line 805 of file channel-access-manager-test.cc.

References ns3::SINGLE_LINK_OP_ID.

Referenced by ChannelAccessManagerTest< TxopType >::AddAccessRequestWithAckTimeout(), and ChannelAccessManagerTest< TxopType >::AddAccessRequestWithSuccessfulAck().

+ Here is the caller graph for this function:

◆ DoCheckBusy()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::DoCheckBusy ( bool  busy)
private

Perform check that channel access manager is busy or idle.

Parameters
busywhether expected state is busy

Definition at line 601 of file channel-access-manager-test.cc.

References NS_TEST_EXPECT_MSG_EQ.

Referenced by ChannelAccessManagerTest< TxopType >::ExpectBusy().

+ Here is the caller graph for this function:

◆ DoRun() [1/3]

void ChannelAccessManagerTest< Txop >::DoRun ( )
virtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 859 of file channel-access-manager-test.cc.

◆ DoRun() [2/3]

void ChannelAccessManagerTest< QosTxop >::DoRun ( )
virtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 1202 of file channel-access-manager-test.cc.

References ns3::WIFI_CHANLIST_SECONDARY, ns3::WIFI_CHANLIST_SECONDARY40, and ns3::WIFI_CHANLIST_SECONDARY80.

◆ DoRun() [3/3]

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::DoRun ( )
overridevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

◆ EndTest()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::EndTest
private

End test function.

Definition at line 649 of file channel-access-manager-test.cc.

References ns3::Simulator::Destroy(), NS_TEST_EXPECT_MSG_EQ, and ns3::Simulator::Run().

+ Here is the call graph for this function:

◆ ExpectBackoff()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::ExpectBackoff ( uint64_t  time,
uint32_t  nSlots,
uint32_t  from 
)
private

Expect generate backoff function.

Parameters
timethe expected time
nSlotsthe number of slots
fromthe expected from

Definition at line 580 of file channel-access-manager-test.cc.

References TxopTest< TxopType >::m_expectedBackoff.

◆ ExpectBusy()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::ExpectBusy ( uint64_t  time,
bool  busy 
)
private

Schedule a check that the channel access manager is busy or idle.

Parameters
timethe expected time
busywhether the manager is expected to be busy

Definition at line 591 of file channel-access-manager-test.cc.

References ChannelAccessManagerTest< TxopType >::DoCheckBusy(), ns3::MicroSeconds(), ns3::Now(), and ns3::Simulator::Schedule().

+ Here is the call graph for this function:

◆ ExpectInternalCollision()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::ExpectInternalCollision ( uint64_t  time,
uint32_t  nSlots,
uint32_t  from 
)
private

Expect internal collision function.

Parameters
timethe expected time
nSlotsthe number of slots
fromthe expected from

Definition at line 567 of file channel-access-manager-test.cc.

References TxopTest< TxopType >::m_expectedInternalCollision.

◆ GenerateBackoff()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::GenerateBackoff ( uint32_t  i)

Generate backoff function.

Parameters
ithe index of the Txop

Definition at line 532 of file channel-access-manager-test.cc.

References TxopTest< TxopType >::m_expectedBackoff, and NS_TEST_EXPECT_MSG_EQ.

◆ NotifyAccessGranted()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::NotifyAccessGranted ( uint32_t  i)

Notify access granted function.

Parameters
ithe index of the Txop

Definition at line 484 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::Simulator::Now(), and NS_TEST_EXPECT_MSG_EQ.

+ Here is the call graph for this function:

◆ NotifyChannelSwitching()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::NotifyChannelSwitching

Notify channel switching function.

Definition at line 549 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::Txop::NOT_REQUESTED, ns3::Simulator::Now(), and NS_TEST_EXPECT_MSG_EQ.

+ Here is the call graph for this function:

◆ NotifyInternalCollision()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::NotifyInternalCollision ( Ptr< TxopTest< TxopType > >  state)

Notify internal collision function.

Parameters
statethe Txop

Definition at line 513 of file channel-access-manager-test.cc.

References TxopTest< TxopType >::m_expectedInternalCollision, and NS_TEST_EXPECT_MSG_EQ.

◆ StartTest()

template<typename TxopType >
void ChannelAccessManagerTest< TxopType >::StartTest ( uint64_t  slotTime,
uint64_t  sifs,
uint64_t  eifsNoDifsNoSifs,
uint32_t  ackTimeoutValue = 20,
uint16_t  chWidth = 20 
)
private

Start test function.

Parameters
slotTimethe slot time
sifsthe SIFS
eifsNoDifsNoSifsthe EIFS no DIFS no SIFS
ackTimeoutValuethe Ack timeout value
chWidththe channel width in MHz

Definition at line 608 of file channel-access-manager-test.cc.

References ns3::MicroSeconds(), ns3::WIFI_PHY_BAND_UNSPECIFIED, and ns3::WIFI_STANDARD_80211ac.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_ackTimeoutValue

template<typename TxopType >
uint32_t ChannelAccessManagerTest< TxopType >::m_ackTimeoutValue
private

the Ack timeout value

Definition at line 417 of file channel-access-manager-test.cc.

◆ m_ChannelAccessManager

template<typename TxopType >
Ptr<ChannelAccessManagerStub> ChannelAccessManagerTest< TxopType >::m_ChannelAccessManager
private

the channel access manager

Definition at line 414 of file channel-access-manager-test.cc.

◆ m_feManager

template<typename TxopType >
Ptr<FrameExchangeManagerStub<TxopType> > ChannelAccessManagerTest< TxopType >::m_feManager
private

the Frame Exchange Manager stubbed

Definition at line 413 of file channel-access-manager-test.cc.

◆ m_phy

template<typename TxopType >
Ptr<SpectrumWifiPhy> ChannelAccessManagerTest< TxopType >::m_phy
private

the PHY object

Definition at line 415 of file channel-access-manager-test.cc.

◆ m_txop

template<typename TxopType >
TxopTests ChannelAccessManagerTest< TxopType >::m_txop
private

the vector of Txop test instances

Definition at line 416 of file channel-access-manager-test.cc.


The documentation for this class was generated from the following file: