A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
TestWifiPhyRxTraceHelperMloStr Class Reference

Implements a test case to evaluate the reception process of WiFi Physical Layer (PHY) frames (PPDU) containing multiple MAC Protocol Data Units (MPDUs) in Multi-Link Operation (MLO) contexts. More...

+ Inheritance diagram for TestWifiPhyRxTraceHelperMloStr:
+ Collaboration diagram for TestWifiPhyRxTraceHelperMloStr:

Public Member Functions

 TestWifiPhyRxTraceHelperMloStr ()
 Constructs a TestWifiPhyRxTraceHelperMloStr instance for MLO reception testing.
 
- 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 CheckAllStats (uint64_t expectedPpduSuccess, uint64_t expectedPpduFailure, uint64_t expectedMpduSuccess, uint64_t expectedMpduFailure, uint64_t expectedOverlaps, uint64_t expectedNonOverlaps)
 Checks the statistics of PPDU and MPDU reception success and failure in MLO scenarios.
 
void CheckRecords (uint64_t expectedRecordCount)
 Checks the statistics of PPDU and MPDU reception success and failure.
 
void CheckStats (WifiPhyTraceStatistics expectedStats, uint32_t nodeId)
 Checks the statistics of PPDU and MPDU reception success and failure.
 
void CheckStats (WifiPhyTraceStatistics expectedStats, uint32_t nodeId, uint32_t deviceId)
 Checks the statistics of PPDU and MPDU reception success and failure.
 
void CheckStats (WifiPhyTraceStatistics expectedStats, uint32_t nodeId, uint32_t deviceId, uint32_t linkId)
 Checks the statistics of PPDU and MPDU reception success and failure.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
void DoTeardown () override
 Implementation to do any local setup required for this TestCase.
 
void SendPpduWithOneMpdu (double rxPowerDbm, Mac48Address add1, Ptr< ns3::SpectrumWifiPhy > tx_phy)
 Sends a PPDU containing one MPDU addressed to a specific receiver, within an MLO setup.
 
void SendPpduWithTwoMpdus (double rxPowerDbm, Mac48Address add1, Mac48Address add2, Ptr< ns3::SpectrumWifiPhy > tx_phy)
 Sends a PPDU containing two MPDUs addressed to specific receivers, simulating an MLO scenario.
 

Private Attributes

Mac48Address correctReceiver
 The MAC address representing the correct receiver, used for testing in MLO.
 
Ptr< SpectrumWifiPhym_rxA {nullptr}
 The receive function for node 2, link A.
 
Ptr< SpectrumWifiPhym_rxB {nullptr}
 The receive function for node 2, link B.
 
WifiPhyRxTraceHelper m_rxTraceHelper
 The helper being tested for tracking PHY reception events in MLO scenarios.
 
Ptr< SpectrumWifiPhym_tx0A {nullptr}
 The transmit function for node 0, link A.
 
Ptr< SpectrumWifiPhym_tx0B {nullptr}
 The transmit function for node 0, link B.
 
Ptr< SpectrumWifiPhym_tx1A {nullptr}
 The transmit function for node 1, link A.
 
Ptr< SpectrumWifiPhym_tx1B {nullptr}
 The transmit function for node 1, link B.
 
std::map< ns3::Mac48Address, uint32_tMacToNodeId
 Maps MAC addresses to node IDs for MLO test configuration.
 
NodeContainer wifiNodes
 All wifi nodes.
 
Mac48Address wrongReceiver
 The MAC address representing an incorrect receiver, used for testing in MLO.
 

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 TestDuration = 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

Implements a test case to evaluate the reception process of WiFi Physical Layer (PHY) frames (PPDU) containing multiple MAC Protocol Data Units (MPDUs) in Multi-Link Operation (MLO) contexts.

This class extends the TestCase class to simulate and analyze the reception of PPDUs containing either one or two MPDUs in MLO setups. It specifically assesses the WifiPhyRxTraceHelper ability to manage MLO by handling multiple MPDUs addressed to specific receivers across different links, measuring success and failure rates. The simulation setup includes configuring transmit and receive power levels and provides functionality to check statistics related to PPDU and MPDU reception success and failure, as well overlaps and non-overlaps in reception events.

Definition at line 854 of file wifi-phy-rx-trace-helper-test.cc.

Constructor & Destructor Documentation

◆ TestWifiPhyRxTraceHelperMloStr()

TestWifiPhyRxTraceHelperMloStr::TestWifiPhyRxTraceHelperMloStr ( )

Constructs a TestWifiPhyRxTraceHelperMloStr instance for MLO reception testing.

Definition at line 967 of file wifi-phy-rx-trace-helper-test.cc.

Member Function Documentation

◆ CheckAllStats()

void TestWifiPhyRxTraceHelperMloStr::CheckAllStats ( uint64_t  expectedPpduSuccess,
uint64_t  expectedPpduFailure,
uint64_t  expectedMpduSuccess,
uint64_t  expectedMpduFailure,
uint64_t  expectedOverlaps,
uint64_t  expectedNonOverlaps 
)
private

Checks the statistics of PPDU and MPDU reception success and failure in MLO scenarios.

Parameters
expectedPpduSuccessThe expected number of successful PPDU receptions.
expectedPpduFailureThe expected number of failed PPDU receptions.
expectedMpduSuccessThe expected number of successful MPDU receptions within PPDUs.
expectedMpduFailureThe expected number of failed MPDU receptions within PPDUs.
expectedOverlapsThe expected number of overlapping reception events.
expectedNonOverlapsThe expected number of non-overlapping reception events.

Definition at line 1286 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::WifiPhyRxTraceHelper::GetStatistics(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPhyTraceStatistics::m_receivedMpdus, ns3::WifiPhyTraceStatistics::m_receivedPpdus, m_rxTraceHelper, NS_TEST_ASSERT_MSG_EQ, and ns3::WifiPhyRxTraceHelper::Reset().

Referenced by DoRun().

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

◆ CheckRecords()

void TestWifiPhyRxTraceHelperMloStr::CheckRecords ( uint64_t  expectedRecordCount)
private

Checks the statistics of PPDU and MPDU reception success and failure.

Parameters
expectedRecordCountThe expected number of records.

Definition at line 1318 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::WifiPhyRxTraceHelper::GetPpduRecords(), m_rxTraceHelper, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

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

◆ CheckStats() [1/3]

void TestWifiPhyRxTraceHelperMloStr::CheckStats ( WifiPhyTraceStatistics  expectedStats,
uint32_t  nodeId 
)
private

Checks the statistics of PPDU and MPDU reception success and failure.

Parameters
expectedStatsThe expected counts for PPDU and MPDU reception.
nodeIdThe node ID for which to check the received stats.

Definition at line 1190 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::NodeContainer::Get(), ns3::Node::GetDevice(), ns3::WifiPhyRxTraceHelper::GetStatistics(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPhyTraceStatistics::m_receivedMpdus, ns3::WifiPhyTraceStatistics::m_receivedPpdus, m_rxTraceHelper, NS_TEST_ASSERT_MSG_EQ, and wifiNodes.

Referenced by DoRun().

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

◆ CheckStats() [2/3]

void TestWifiPhyRxTraceHelperMloStr::CheckStats ( WifiPhyTraceStatistics  expectedStats,
uint32_t  nodeId,
uint32_t  deviceId 
)
private

Checks the statistics of PPDU and MPDU reception success and failure.

Parameters
expectedStatsThe expected counts for PPDU and MPDU reception.
nodeIdThe node ID for which to check the received stats.
deviceIdThe device ID for which to check the received stats.

Definition at line 1224 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::NodeContainer::Get(), ns3::Node::GetDevice(), ns3::WifiPhyRxTraceHelper::GetStatistics(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPhyTraceStatistics::m_receivedMpdus, ns3::WifiPhyTraceStatistics::m_receivedPpdus, m_rxTraceHelper, NS_TEST_ASSERT_MSG_EQ, and wifiNodes.

+ Here is the call graph for this function:

◆ CheckStats() [3/3]

void TestWifiPhyRxTraceHelperMloStr::CheckStats ( WifiPhyTraceStatistics  expectedStats,
uint32_t  nodeId,
uint32_t  deviceId,
uint32_t  linkId 
)
private

Checks the statistics of PPDU and MPDU reception success and failure.

Parameters
expectedStatsThe expected counts for PPDU and MPDU reception.
nodeIdThe node ID for which to check the received stats.
deviceIdThe device ID for which to check the received stats.
linkIdThe link ID for which to check the received stats.

Definition at line 1258 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::WifiPhyRxTraceHelper::GetStatistics(), ns3::WifiPhyTraceStatistics::m_failedMpdus, ns3::WifiPhyTraceStatistics::m_failedPpdus, ns3::WifiPhyTraceStatistics::m_nonOverlappingPpdus, ns3::WifiPhyTraceStatistics::m_overlappingPpdus, ns3::WifiPhyTraceStatistics::m_receivedMpdus, ns3::WifiPhyTraceStatistics::m_receivedPpdus, m_rxTraceHelper, and NS_TEST_ASSERT_MSG_EQ.

+ Here is the call graph for this function:

◆ DoRun()

◆ DoSetup()

void TestWifiPhyRxTraceHelperMloStr::DoSetup ( )
overrideprivatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Reimplemented from ns3::TestCase.

Definition at line 973 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::NodeContainer::Add(), ns3::SpectrumWifiPhy::AddChannel(), ns3::WifiPhy::ConfigureStandard(), ns3::WifiPhyRxTraceHelper::Enable(), m_rxA, m_rxB, m_rxTraceHelper, m_tx0A, m_tx0B, m_tx1A, m_tx1B, MacToNodeId, ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetOperatingChannel(), ns3::WifiPhy::SetPreambleDetectionModel(), ns3::WifiPhy::SetTxPowerEnd(), ns3::WifiPhy::SetTxPowerStart(), ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_STANDARD_80211be, and wifiNodes.

+ Here is the call graph for this function:

◆ DoTeardown()

void TestWifiPhyRxTraceHelperMloStr::DoTeardown ( )
overrideprivatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test teardown

Reimplemented from ns3::TestCase.

Definition at line 1112 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::Object::Dispose(), m_rxA, m_rxB, m_tx0A, m_tx0B, m_tx1A, and m_tx1B.

+ Here is the call graph for this function:

◆ SendPpduWithOneMpdu()

void TestWifiPhyRxTraceHelperMloStr::SendPpduWithOneMpdu ( double  rxPowerDbm,
Mac48Address  add1,
Ptr< ns3::SpectrumWifiPhy tx_phy 
)
private

Sends a PPDU containing one MPDU addressed to a specific receiver, within an MLO setup.

Parameters
rxPowerDbmThe transmit power in dBm.
add1The MAC address of the receiver.
tx_phyThe transmitting PHY object for MLO.

Definition at line 1157 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::HePhy::GetHeMcs0(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by DoRun().

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

◆ SendPpduWithTwoMpdus()

void TestWifiPhyRxTraceHelperMloStr::SendPpduWithTwoMpdus ( double  rxPowerDbm,
Mac48Address  add1,
Mac48Address  add2,
Ptr< ns3::SpectrumWifiPhy tx_phy 
)
private

Sends a PPDU containing two MPDUs addressed to specific receivers, simulating an MLO scenario.

Parameters
rxPowerDbmThe transmit power in dBm.
add1The MAC address of the first receiver.
add2The MAC address of the second receiver.
tx_phyThe transmitting PHY object for MLO.

Definition at line 1123 of file wifi-phy-rx-trace-helper-test.cc.

References ns3::HePhy::GetHeMcs0(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by DoRun().

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

Member Data Documentation

◆ correctReceiver

Mac48Address TestWifiPhyRxTraceHelperMloStr::correctReceiver
private
Initial value:
=
Mac48Address("00:00:00:00:00:03")

The MAC address representing the correct receiver, used for testing in MLO.

Definition at line 943 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun().

◆ m_rxA

Ptr<SpectrumWifiPhy> TestWifiPhyRxTraceHelperMloStr::m_rxA {nullptr}
private

The receive function for node 2, link A.

Definition at line 960 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ m_rxB

Ptr<SpectrumWifiPhy> TestWifiPhyRxTraceHelperMloStr::m_rxB {nullptr}
private

The receive function for node 2, link B.

Definition at line 961 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ m_rxTraceHelper

WifiPhyRxTraceHelper TestWifiPhyRxTraceHelperMloStr::m_rxTraceHelper
private

The helper being tested for tracking PHY reception events in MLO scenarios.

Definition at line 963 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by CheckAllStats(), CheckRecords(), CheckStats(), DoRun(), and DoSetup().

◆ m_tx0A

Ptr<SpectrumWifiPhy> TestWifiPhyRxTraceHelperMloStr::m_tx0A {nullptr}
private

The transmit function for node 0, link A.

Definition at line 956 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ m_tx0B

Ptr<SpectrumWifiPhy> TestWifiPhyRxTraceHelperMloStr::m_tx0B {nullptr}
private

The transmit function for node 0, link B.

Definition at line 957 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ m_tx1A

Ptr<SpectrumWifiPhy> TestWifiPhyRxTraceHelperMloStr::m_tx1A {nullptr}
private

The transmit function for node 1, link A.

Definition at line 958 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ m_tx1B

Ptr<SpectrumWifiPhy> TestWifiPhyRxTraceHelperMloStr::m_tx1B {nullptr}
private

The transmit function for node 1, link B.

Definition at line 959 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ MacToNodeId

std::map<ns3::Mac48Address, uint32_t> TestWifiPhyRxTraceHelperMloStr::MacToNodeId
private
Initial value:
= {
{Mac48Address("00:00:00:00:00:04"), 0},
{Mac48Address("00:00:00:00:00:05"), 1},
Mac48Address correctReceiver
The MAC address representing the correct receiver, used for testing in MLO.
Mac48Address wrongReceiver
The MAC address representing an incorrect receiver, used for testing in MLO.
an EUI-48 address
Definition: mac48-address.h:46

Maps MAC addresses to node IDs for MLO test configuration.

This is done since there is no MAC layer configured and therefore the helper cannot obtain the MAC addresses automatically.

Definition at line 947 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoSetup().

◆ wifiNodes

NodeContainer TestWifiPhyRxTraceHelperMloStr::wifiNodes
private

All wifi nodes.

Definition at line 955 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by CheckStats(), DoRun(), and DoSetup().

◆ wrongReceiver

Mac48Address TestWifiPhyRxTraceHelperMloStr::wrongReceiver
private
Initial value:
=
Mac48Address("00:00:00:00:00:01")

The MAC address representing an incorrect receiver, used for testing in MLO.

Definition at line 940 of file wifi-phy-rx-trace-helper-test.cc.

Referenced by DoRun().


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