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...
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 |
TestCase & | operator= (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< SpectrumWifiPhy > | m_rxA {nullptr} |
The receive function for node 2, link A. | |
Ptr< SpectrumWifiPhy > | m_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< SpectrumWifiPhy > | m_tx0A {nullptr} |
The transmit function for node 0, link A. | |
Ptr< SpectrumWifiPhy > | m_tx0B {nullptr} |
The transmit function for node 0, link B. | |
Ptr< SpectrumWifiPhy > | m_tx1A {nullptr} |
The transmit function for node 1, link A. | |
Ptr< SpectrumWifiPhy > | m_tx1B {nullptr} |
The transmit function for node 1, link B. | |
std::map< ns3::Mac48Address, uint32_t > | MacToNodeId |
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... | |
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. | |
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 857 of file wifi-phy-rx-trace-helper-test.cc.
TestWifiPhyRxTraceHelperMloStr::TestWifiPhyRxTraceHelperMloStr | ( | ) |
Constructs a TestWifiPhyRxTraceHelperMloStr instance for MLO reception testing.
Definition at line 970 of file wifi-phy-rx-trace-helper-test.cc.
|
private |
Checks the statistics of PPDU and MPDU reception success and failure in MLO scenarios.
expectedPpduSuccess | The expected number of successful PPDU receptions. |
expectedPpduFailure | The expected number of failed PPDU receptions. |
expectedMpduSuccess | The expected number of successful MPDU receptions within PPDUs. |
expectedMpduFailure | The expected number of failed MPDU receptions within PPDUs. |
expectedOverlaps | The expected number of overlapping reception events. |
expectedNonOverlaps | The expected number of non-overlapping reception events. |
Definition at line 1296 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().
|
private |
Checks the statistics of PPDU and MPDU reception success and failure.
expectedRecordCount | The expected number of records. |
Definition at line 1328 of file wifi-phy-rx-trace-helper-test.cc.
References ns3::WifiPhyRxTraceHelper::GetPpduRecords(), m_rxTraceHelper, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoRun().
|
private |
Checks the statistics of PPDU and MPDU reception success and failure.
expectedStats | The expected counts for PPDU and MPDU reception. |
nodeId | The node ID for which to check the received stats. |
Definition at line 1200 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().
|
private |
Checks the statistics of PPDU and MPDU reception success and failure.
expectedStats | The expected counts for PPDU and MPDU reception. |
nodeId | The node ID for which to check the received stats. |
deviceId | The device ID for which to check the received stats. |
Definition at line 1234 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.
|
private |
Checks the statistics of PPDU and MPDU reception success and failure.
expectedStats | The expected counts for PPDU and MPDU reception. |
nodeId | The node ID for which to check the received stats. |
deviceId | The device ID for which to check the received stats. |
linkId | The link ID for which to check the received stats. |
Definition at line 1268 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.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 1337 of file wifi-phy-rx-trace-helper-test.cc.
References CheckAllStats(), CheckRecords(), CheckStats(), correctReceiver, ns3::Simulator::Destroy(), ns3::NodeContainer::Get(), ns3::Node::GetId(), 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_rxA, m_rxB, m_rxTraceHelper, m_tx0A, m_tx0B, m_tx1A, m_tx1B, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendPpduWithOneMpdu(), SendPpduWithTwoMpdus(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::WifiPhyRxTraceHelper::Start(), ns3::WifiPhyRxTraceHelper::Stop(), wifiNodes, and wrongReceiver.
|
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 976 of file wifi-phy-rx-trace-helper-test.cc.
References ns3::NodeContainer::Add(), ns3::CreateObject(), ns3::WifiPhyRxTraceHelper::Enable(), m_rxA, m_rxB, m_rxTraceHelper, m_tx0A, m_tx0B, m_tx1A, m_tx1B, MacToNodeId, 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.
|
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 1115 of file wifi-phy-rx-trace-helper-test.cc.
References m_rxA, m_rxB, m_tx0A, m_tx0B, m_tx1A, and m_tx1B.
|
private |
Sends a PPDU containing one MPDU addressed to a specific receiver, within an MLO setup.
rxPowerDbm | The transmit power in dBm. |
add1 | The MAC address of the receiver. |
tx_phy | The transmitting PHY object for MLO. |
Definition at line 1167 of file wifi-phy-rx-trace-helper-test.cc.
References ns3::Create(), ns3::HePhy::GetHeMcs0(), ns3::NanoSeconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by DoRun().
|
private |
Sends a PPDU containing two MPDUs addressed to specific receivers, simulating an MLO scenario.
rxPowerDbm | The transmit power in dBm. |
add1 | The MAC address of the first receiver. |
add2 | The MAC address of the second receiver. |
tx_phy | The transmitting PHY object for MLO. |
Definition at line 1126 of file wifi-phy-rx-trace-helper-test.cc.
References ns3::Create(), ns3::HePhy::GetHeMcs0(), ns3::NanoSeconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by DoRun().
|
private |
The MAC address representing the correct receiver, used for testing in MLO.
Definition at line 946 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun().
|
private |
The receive function for node 2, link A.
Definition at line 963 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
The receive function for node 2, link B.
Definition at line 964 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
The helper being tested for tracking PHY reception events in MLO scenarios.
Definition at line 966 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by CheckAllStats(), CheckRecords(), CheckStats(), CheckStats(), CheckStats(), DoRun(), and DoSetup().
|
private |
The transmit function for node 0, link A.
Definition at line 959 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
The transmit function for node 0, link B.
Definition at line 960 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
The transmit function for node 1, link A.
Definition at line 961 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
The transmit function for node 1, link B.
Definition at line 962 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
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 950 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoSetup().
|
private |
All wifi nodes.
Definition at line 958 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by CheckStats(), CheckStats(), DoRun(), and DoSetup().
|
private |
The MAC address representing an incorrect receiver, used for testing in MLO.
Definition at line 943 of file wifi-phy-rx-trace-helper-test.cc.
Referenced by DoRun().