A Discrete-Event Network Simulator
API
WifiExtractExpiredMpdusTest Class Reference

Test extraction of expired MPDUs from MAC queue container. More...

+ Inheritance diagram for WifiExtractExpiredMpdusTest:
+ Collaboration diagram for WifiExtractExpiredMpdusTest:

Public Member Functions

 WifiExtractExpiredMpdusTest ()
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase. More...
 
void Enqueue (Mac48Address rxAddr, bool inflight, Time expiryTime)
 Enqueue a new MPDU into the container. More...
 

Private Attributes

WifiMacQueueContainer m_container
 MAC queue container. More...
 
uint16_t m_currentSeqNo {0}
 sequence number of current MPDU More...
 
Mac48Address m_txAddr
 Transmitter Address of MPDUs. More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { 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. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Detailed Description

Test extraction of expired MPDUs from MAC queue container.

This test verifies the correctness of the WifiMacQueueContainer methods (ExtractExpiredMpdus and ExtractAllExpiredMpdus) that extract MPDUs with expired lifetime from the MAC queue container.

Definition at line 135 of file wifi-mac-queue-test.cc.

Constructor & Destructor Documentation

◆ WifiExtractExpiredMpdusTest()

WifiExtractExpiredMpdusTest::WifiExtractExpiredMpdusTest ( )

Definition at line 157 of file wifi-mac-queue-test.cc.

Member Function Documentation

◆ DoRun()

void WifiExtractExpiredMpdusTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

At simulation time 25ms:

Container queue for rxAddr1 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│Exp│ │ │ │ │ │ │ │ │Inf│ │Inf│ │Inf│ │Inf│ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │10 │ └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘

Container queue for rxAddr2 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│ │ │ │ │ │ │ │ │Inf│Inf│ │Inf│Inf│ │ │ │ │11 │12 │13 │14 │15 │16 │17 │18 │19 │ └───┴───┴───┴───┴───┴───┴───┴───┴───┘

Extract expired MPDUs from container queue 1

Extract expired MPDUs from container queue 2

At simulation time 50ms:

Container queue for rxAddr1 ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│Exp│Exp│Exp│Exp│ │ │ │Inf│Inf│Inf│ │Inf│ │ │ │ │ │ 0 │ 2 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │10 │ └───┴───┴───┴───┴───┴───┴───┴───┴───┘

Container queue for rxAddr2 ┌───┬───┬───┬───┬───┬───┬───┬───┐ │Exp│Exp│Exp│Exp│Exp│Exp│ │ │ │Inf│Inf│ │Inf│Inf│ │ │ │ │12 │13 │14 │15 │16 │17 │18 │19 │ └───┴───┴───┴───┴───┴───┴───┴───┘

Extract all expired MPDUs (from container queue 1 and 2)

Check MPDUs remaining in container queue 1

Check MPDUs remaining in container queue 2

Implements ns3::TestCase.

Definition at line 183 of file wifi-mac-queue-test.cc.

References Enqueue(), ns3::WifiMacQueueContainer::ExtractAllExpiredMpdus(), ns3::WifiMacQueueContainer::ExtractExpiredMpdus(), ns3::WifiMacQueueContainer::GetQueue(), m_container, m_txAddr, ns3::MilliSeconds(), NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.

+ Here is the call graph for this function:

◆ Enqueue()

void WifiExtractExpiredMpdusTest::Enqueue ( Mac48Address  rxAddr,
bool  inflight,
Time  expiryTime 
)
private

Enqueue a new MPDU into the container.

Parameters
rxAddrReceiver Address of the MPDU
inflightwhether the MPDU is inflight
expiryTimethe expity time for the MPDU

Definition at line 163 of file wifi-mac-queue-test.cc.

References ns3::WifiMacQueueContainer::GetQueue(), ns3::WifiMacQueueContainer::insert(), m_container, m_currentSeqNo, m_txAddr, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), and ns3::WIFI_MAC_QOSDATA.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_container

WifiMacQueueContainer WifiExtractExpiredMpdusTest::m_container
private

MAC queue container.

Definition at line 152 of file wifi-mac-queue-test.cc.

Referenced by DoRun(), and Enqueue().

◆ m_currentSeqNo

uint16_t WifiExtractExpiredMpdusTest::m_currentSeqNo {0}
private

sequence number of current MPDU

Definition at line 153 of file wifi-mac-queue-test.cc.

Referenced by Enqueue().

◆ m_txAddr

Mac48Address WifiExtractExpiredMpdusTest::m_txAddr
private

Transmitter Address of MPDUs.

Definition at line 154 of file wifi-mac-queue-test.cc.

Referenced by DoRun(), and Enqueue().


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