Test extraction of expired MPDUs from MAC queue container. More...
Public Member Functions | |
WifiExtractExpiredMpdusTest () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (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. | |
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. | |
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.
WifiExtractExpiredMpdusTest::WifiExtractExpiredMpdusTest | ( | ) |
Definition at line 146 of file wifi-mac-queue-test.cc.
|
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.
|
private |
Enqueue a new MPDU into the container.
rxAddr | Receiver Address of the MPDU |
inflight | whether the MPDU is inflight |
expiryTime | the 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().
|
private |
MAC queue container.
Definition at line 141 of file wifi-mac-queue-test.cc.
|
private |
sequence number of current MPDU
Definition at line 142 of file wifi-mac-queue-test.cc.
Referenced by Enqueue().
|
private |
Transmitter Address of MPDUs.
Definition at line 143 of file wifi-mac-queue-test.cc.