A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

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

Private Attributes

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

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...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::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

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 124 of file wifi-mac-queue-test.cc.

Constructor & Destructor Documentation

◆ WifiExtractExpiredMpdusTest()

WifiExtractExpiredMpdusTest::WifiExtractExpiredMpdusTest ( )

Definition at line 146 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 172 of file wifi-mac-queue-test.cc.

References ns3::Mac48Address::Allocate(), ns3::Simulator::Destroy(), Enqueue(), ns3::WifiMacQueueContainer::ExtractAllExpiredMpdus(), ns3::WifiMacQueueContainer::ExtractExpiredMpdus(), ns3::WifiMacQueueContainer::GetQueue(), m_container, m_txAddr, ns3::MilliSeconds(), NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), ns3::Simulator::Schedule(), 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 152 of file wifi-mac-queue-test.cc.

References ns3::Create(), ns3::WifiMacQueueContainer::GetQueue(), ns3::WifiMacQueueContainer::GetQueueId(), 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 141 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 142 of file wifi-mac-queue-test.cc.

Referenced by Enqueue().

◆ m_txAddr

Mac48Address WifiExtractExpiredMpdusTest::m_txAddr
private

Transmitter Address of MPDUs.

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

Referenced by DoRun(), and Enqueue().


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