Probe Request-Probe Response exchange. More...
Classes | |
struct | TxPsdu |
information on transmitted PSDU More... | |
Public Types | |
using | ChannelMap = std::map<FrequencyRange, Ptr<MultiModelSpectrumChannel>> |
PHY band-indexed map of spectrum channels. | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
ProbeExchTest (ProbeExchTestVector testVec, std::string testCase) | |
Constructor. | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CollectTxTrace (uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Traced callback when FEM passes PSDUs to the PHY. | |
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. | |
Mac48Address | GetLinkMacAddr (Ptr< WifiNetDevice > dev, uint8_t linkId) |
Get Link MAC address for input device on specified link. | |
void | SendProbeReq () |
Send Probe Request based on test vector input. | |
void | SetChannels (SpectrumWifiPhyHelper &helper, const std::vector< std::string > &channels, const ChannelMap &channelMap) |
Setup the PHY Helper based on input channel settings. | |
void | SetupDevices () |
Setup WifiNetDevices. | |
void | SetupTxTrace (Ptr< WifiNetDevice > dev, std::size_t nodeId) |
Setup PSDU Tx trace. | |
void | ValidateProbeReq (const TxPsdu &txPsdu) |
Check Probe Request contents. | |
void | ValidateProbeResp (const TxPsdu &txPsdu) |
Check Probe Response contents. | |
void | ValidateTest () |
Check expected outcome of test case run. | |
Private Attributes | |
Ptr< WifiNetDevice > | m_apDev {nullptr} |
AP MLD WifiNetDevice. | |
Ptr< WifiNetDevice > | m_clientDev {nullptr} |
Non-AP MLD WifiNetDevice. | |
std::vector< TxPsdu > | m_mgtPsdus {} |
Tx PSDUs. | |
ProbeExchTestVector | m_testVec |
Test vector. | |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
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. | |
Probe Request-Probe Response exchange.
Test suite including Probe Request and multi-link Probe Request for various cases of Probe Request frame contents and link of transmission.
Definition at line 94 of file wifi-probe-exchange-test.cc.
using ProbeExchTest::ChannelMap = std::map<FrequencyRange, Ptr<MultiModelSpectrumChannel>> |
PHY band-indexed map of spectrum channels.
Definition at line 114 of file wifi-probe-exchange-test.cc.
ProbeExchTest::ProbeExchTest | ( | ProbeExchTestVector | testVec, |
std::string | testCase ) |
Constructor.
testVec | the test vector |
testCase | the test case name |
Definition at line 199 of file wifi-probe-exchange-test.cc.
|
private |
Traced callback when FEM passes PSDUs to the PHY.
linkId | the link ID |
context | the context |
psduMap | the transmitted PSDU map |
txVector | the TXVECTOR used for transmission |
txPowerW | the TX power in watts |
Definition at line 309 of file wifi-probe-exchange-test.cc.
References m_mgtPsdus.
Referenced by SetupTxTrace().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 447 of file wifi-probe-exchange-test.cc.
References DEFAULT_PROBE_REQ_TX_TIME, DEFAULT_SIM_STOP_TIME, ns3::Simulator::Destroy(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), SendProbeReq(), ns3::Simulator::Stop(), and ValidateTest().
|
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 349 of file wifi-probe-exchange-test.cc.
References DEFAULT_RNG_RUN, DEFAULT_RNG_SEED, m_apDev, m_clientDev, ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), SetupDevices(), and SetupTxTrace().
|
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 457 of file wifi-probe-exchange-test.cc.
References m_apDev, m_clientDev, and m_mgtPsdus.
|
private |
Get Link MAC address for input device on specified link.
dev | the input device |
linkId | the ID of the specified link |
Definition at line 289 of file wifi-probe-exchange-test.cc.
References NS_ASSERT.
Referenced by SendProbeReq().
|
private |
Send Probe Request based on test vector input.
Definition at line 323 of file wifi-probe-exchange-test.cc.
References ProbeExchTestVector::addr1Bcast, ProbeExchTestVector::addr3Bcast, DEFAULT_AP_MLD_ID, ns3::DynamicCast(), ns3::Mac48Address::GetBroadcast(), GetLinkMacAddr(), ProbeExchTestVector::isMultiLinkReq, m_apDev, m_clientDev, m_testVec, NS_ASSERT, ProbeExchTestVector::reqLinkIds, ProbeExchTestVector::reqTxLinkId, and ProbeExchTestVector::respTxLinkId.
Referenced by DoRun().
|
private |
Setup the PHY Helper based on input channel settings.
helper | the spectrum wifi PHY helper |
channels | the list of channels |
channelMap | the channel map to configure |
Definition at line 270 of file wifi-probe-exchange-test.cc.
References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::WifiPhyHelper::Set(), and ns3::WifiPhyHelper::SetPcapDataLinkType().
Referenced by SetupDevices().
|
private |
Setup WifiNetDevices.
Definition at line 206 of file wifi-probe-exchange-test.cc.
References ProbeExchTestVector::apChs, ns3::WifiHelper::AssignStreams(), ProbeExchTestVector::clientChs, ns3::CreateObject(), DEFAULT_CONTROL_MODE, DEFAULT_DATA_MODE, DEFAULT_SSID, DEFAULT_STREAM_INCREMENT, DEFAULT_STREAM_INDEX, DEFAULT_WIFI_STANDARD, ns3::DynamicCast(), m_apDev, m_clientDev, m_testVec, NS_ASSERT, NS_ASSERT_MSG, SetChannels(), ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, and ns3::WIFI_SPECTRUM_6_GHZ.
Referenced by DoSetup().
|
private |
Setup PSDU Tx trace.
dev | the wifi netdevice |
nodeId | the node ID |
Definition at line 297 of file wifi-probe-exchange-test.cc.
References CollectTxTrace(), ns3::Config::Connect(), and ns3::MakeCallback().
Referenced by DoSetup().
|
private |
Check Probe Request contents.
txPsdu | information about transmitted PSDU |
Definition at line 359 of file wifi-probe-exchange-test.cc.
References ns3::WifiPsdu::GetHeader(), ProbeExchTestVector::isMultiLinkReq, ProbeExchTest::TxPsdu::linkId, m_testVec, NS_TEST_ASSERT_MSG_EQ, ProbeExchTest::TxPsdu::psdu, ProbeExchTestVector::reqLinkIds, and ProbeExchTestVector::reqTxLinkId.
Referenced by ValidateTest().
|
private |
Check Probe Response contents.
txPsdu | information about transmitted PSDU |
Definition at line 395 of file wifi-probe-exchange-test.cc.
References ProbeExchTestVector::apChs, ns3::WifiPsdu::GetHeader(), ProbeExchTest::TxPsdu::linkId, m_testVec, NS_TEST_ASSERT_MSG_EQ, ProbeExchTest::TxPsdu::psdu, ProbeExchTestVector::respLinkIds, and ProbeExchTestVector::respTxLinkId.
Referenced by ValidateTest().
|
private |
Check expected outcome of test case run.
Definition at line 435 of file wifi-probe-exchange-test.cc.
References m_mgtPsdus, NS_TEST_ASSERT_MSG_GT_OR_EQ, ValidateProbeReq(), and ValidateProbeResp().
Referenced by DoRun().
|
private |
AP MLD WifiNetDevice.
Definition at line 193 of file wifi-probe-exchange-test.cc.
Referenced by DoSetup(), DoTeardown(), SendProbeReq(), and SetupDevices().
|
private |
Non-AP MLD WifiNetDevice.
Definition at line 194 of file wifi-probe-exchange-test.cc.
Referenced by DoSetup(), DoTeardown(), SendProbeReq(), and SetupDevices().
|
private |
Tx PSDUs.
Definition at line 196 of file wifi-probe-exchange-test.cc.
Referenced by CollectTxTrace(), DoTeardown(), and ValidateTest().
|
private |
Test vector.
Definition at line 195 of file wifi-probe-exchange-test.cc.
Referenced by SendProbeReq(), SetupDevices(), ValidateProbeReq(), and ValidateProbeResp().