Implements a test case to evaluate the transmission process of multiple Wi-Fi MAC Layer MPDUs. More...
| Public Types | |
| enum | TestOption : uint8_t { SINGLE_LINK_NON_QOS , MULTI_LINK_QOS } | 
| Option for the test.  More... | |
| Public Types inherited from ns3::TestCase | |
| enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } | 
| How long the test takes to execute.  More... | |
| Public Member Functions | |
| WifiTxStatsHelperTest (const std::string &testName, TestOption option) | |
| Constructor. | |
| void | Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower) | 
| Callback invoked when PHY starts transmission of a PSDU, used to record TX start time and TX duration. | |
| 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 | CheckResults (const WifiTxStatsHelper &wifiTxStats) | 
| Check correctness of test. | |
| void | DoRun () override | 
| Implementation to actually run this TestCase. | |
| void | DoSetup () override | 
| Implementation to do any local setup required for this TestCase. | |
| Private Attributes | |
| std::map< uint8_t, uint32_t > | m_aifsns | 
| Map of AIFSNs, indexed per link (for MULTI_LINK_QOS case only). | |
| std::map< uint8_t, Time > | m_aifss | 
| Map of AIFSs, indexed per link (for MULTI_LINK_QOS case only). | |
| std::map< uint8_t, uint32_t > | m_cwMins | 
| Map of CW Mins, indexed per link. | |
| Time | m_difs | 
| DIFS time (for SINGLE_LINK_NON_QOS case only). | |
| std::map< uint8_t, std::vector< Time > > | m_durations | 
| Map of vector of MPDU durations, indexed per link. | |
| TestOption | m_option | 
| Test option. | |
| Time | m_sifs | 
| SIFS time. | |
| Time | m_slot | 
| slot time | |
| int64_t | m_streamNumber | 
| Random variable stream number. | |
| std::map< uint8_t, std::vector< Time > > | m_txStartTimes | 
| Map of independently obtain vector of PhyTxBegin trace, indexed per link. | |
| NodeContainer | m_wifiApNode | 
| NodeContainer for AP. | |
| NodeContainer | m_wifiStaNodes | 
| NodeContainer for STAs. | |
| Additional Inherited Members | |
| 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 transmission process of multiple Wi-Fi MAC Layer MPDUs.
The testcase has two options. 1) SINGLE_LINK_NON_QOS: test the handling of regular ACKs. 2) MULTI_LINK_QOS: test the handling of MPDU aggregation, Block ACKs, and Multi-Link Operation.
To observe the operation of WifiTxStatsHelper, the test can be run from the command line as follows:
Definition at line 55 of file wifi-tx-stats-helper-test.cc.
| enum WifiTxStatsHelperTest::TestOption : uint8_t | 
Option for the test.
| Enumerator | |
|---|---|
| SINGLE_LINK_NON_QOS | |
| MULTI_LINK_QOS | |
Definition at line 61 of file wifi-tx-stats-helper-test.cc.
| WifiTxStatsHelperTest::WifiTxStatsHelperTest | ( | const std::string & | testName, | 
| TestOption | option ) | 
Constructor.
| testName | Test name | 
| option | Test option | 
Definition at line 116 of file wifi-tx-stats-helper-test.cc.
References ns3::TestCase::TestCase(), m_option, and m_streamNumber.
| 
 | private | 
Check correctness of test.
| wifiTxStats | Reference to the helper | 
Definition at line 512 of file wifi-tx-stats-helper-test.cc.
References ns3::WifiTxStatsHelper::GetFailureRecords(), ns3::WifiTxStatsHelper::GetFailures(), ns3::WifiTxStatsHelper::GetFailuresByNodeDevice(), ns3::WifiTxStatsHelper::GetRetransmissions(), ns3::WifiTxStatsHelper::GetRetransmissionsByNodeDevice(), ns3::WifiTxStatsHelper::GetSuccesses(), ns3::WifiTxStatsHelper::GetSuccessesByNodeDevice(), ns3::WifiTxStatsHelper::GetSuccessesByNodeDeviceLink(), ns3::WifiTxStatsHelper::GetSuccessRecords(), m_aifss, m_cwMins, m_difs, m_durations, m_option, m_sifs, m_slot, m_txStartTimes, ns3::NanoSeconds(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_GT_OR_EQ, NS_TEST_ASSERT_MSG_LT_OR_EQ, SINGLE_LINK_NON_QOS, ns3::SINGLE_LINK_OP_ID, ns3::Time::US, ns3::WIFI_MAC_DROP_QOS_OLD_PACKET, and ns3::WIFI_MAC_DROP_REACHED_RETRY_LIMIT.
Referenced by DoRun().
| 
 | overrideprivatevirtual | 
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 169 of file wifi-tx-stats-helper-test.cc.
References ns3::NetDeviceContainer::Add(), ns3::WifiHelper::AssignStreams(), ns3::NetDeviceContainer::Begin(), CheckResults(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::DynamicCast(), ns3::WifiTxStatsHelper::Enable(), ns3::NetDeviceContainer::End(), m_aifsns, m_aifss, m_cwMins, m_difs, m_option, m_sifs, m_slot, m_streamNumber, m_wifiApNode, m_wifiStaNodes, ns3::MakeCallback(), ns3::MicroSeconds(), NS_ASSERT_MSG, NS_TEST_ASSERT_MSG_EQ, ns3::Simulator::Run(), ns3::Seconds(), ns3::Config::SetDefault(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetSingleDevice(), SINGLE_LINK_NON_QOS, ns3::SINGLE_LINK_OP_ID, ns3::WifiTxStatsHelper::Start(), ns3::Simulator::Stop(), ns3::WifiTxStatsHelper::Stop(), Transmit(), ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, ns3::WIFI_STANDARD_80211a, and ns3::WIFI_STANDARD_80211be.
| 
 | 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 146 of file wifi-tx-stats-helper-test.cc.
References ns3::CreateObject(), ns3::PacketSocketHelper::Install(), m_wifiApNode, m_wifiStaNodes, ns3::RngSeedManager::SetRun(), and ns3::RngSeedManager::SetSeed().
| void WifiTxStatsHelperTest::Transmit | ( | std::string | context, | 
| WifiConstPsduMap | psduMap, | ||
| WifiTxVector | txVector, | ||
| Watt_u | txPower ) | 
Callback invoked when PHY starts transmission of a PSDU, used to record TX start time and TX duration.
| context | the context | 
| psduMap | the PSDU map | 
| txVector | the TX vector | 
| txPower | the tx power in Watts | 
Definition at line 124 of file wifi-tx-stats-helper-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), m_durations, m_txStartTimes, ns3::Simulator::Now(), NS_LOG_INFO, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PHY_BAND_6GHZ.
Referenced by DoRun().
| 
 | private | 
Map of AIFSNs, indexed per link (for MULTI_LINK_QOS case only).
Definition at line 103 of file wifi-tx-stats-helper-test.cc.
Referenced by DoRun().
| 
 | private | 
Map of AIFSs, indexed per link (for MULTI_LINK_QOS case only).
Definition at line 105 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and DoRun().
| 
 | private | 
Map of CW Mins, indexed per link.
Definition at line 101 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and DoRun().
| 
 | private | 
DIFS time (for SINGLE_LINK_NON_QOS case only).
Definition at line 96 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and DoRun().
| 
 | private | 
Map of vector of MPDU durations, indexed per link.
Definition at line 100 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and Transmit().
| 
 | private | 
Test option.
Definition at line 89 of file wifi-tx-stats-helper-test.cc.
Referenced by WifiTxStatsHelperTest(), CheckResults(), and DoRun().
| 
 | private | 
SIFS time.
Definition at line 93 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and DoRun().
| 
 | private | 
slot time
Definition at line 94 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and DoRun().
| 
 | private | 
Random variable stream number.
Definition at line 92 of file wifi-tx-stats-helper-test.cc.
Referenced by WifiTxStatsHelperTest(), and DoRun().
| 
 | private | 
Map of independently obtain vector of PhyTxBegin trace, indexed per link.
Definition at line 97 of file wifi-tx-stats-helper-test.cc.
Referenced by CheckResults(), and Transmit().
| 
 | private | 
NodeContainer for AP.
Definition at line 90 of file wifi-tx-stats-helper-test.cc.
| 
 | private | 
NodeContainer for STAs.
Definition at line 91 of file wifi-tx-stats-helper-test.cc.