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

Probe Request-Probe Response exchange. More...

+ Inheritance diagram for ProbeExchTest:
+ Collaboration diagram for ProbeExchTest:

Classes

struct  TxPsdu
 information on transmitted PSDU More...
 

Public Types

using ChannelMap = std::map<FrequencyRange, Ptr<MultiModelSpectrumChannel>>
 PHY band-indexed map of spectrum channels.
 
- 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

 ProbeExchTest (ProbeExchTestVector testVec, std::string testCase)
 Constructor.
 
- 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 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< WifiNetDevicem_apDev {nullptr}
 AP MLD WifiNetDevice.
 
Ptr< WifiNetDevicem_clientDev {nullptr}
 Non-AP MLD WifiNetDevice.
 
std::vector< TxPsdum_mgtPsdus {}
 Tx PSDUs.
 
ProbeExchTestVector m_testVec
 Test vector.
 

Additional Inherited Members

- 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.
 
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

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.

Member Typedef Documentation

◆ ChannelMap

PHY band-indexed map of spectrum channels.

Definition at line 114 of file wifi-probe-exchange-test.cc.

Constructor & Destructor Documentation

◆ ProbeExchTest()

ProbeExchTest::ProbeExchTest ( ProbeExchTestVector testVec,
std::string testCase )

Constructor.

Parameters
testVecthe test vector
testCasethe test case name

Definition at line 199 of file wifi-probe-exchange-test.cc.

Member Function Documentation

◆ CollectTxTrace()

void ProbeExchTest::CollectTxTrace ( uint8_t linkId,
std::string context,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )
private

Traced callback when FEM passes PSDUs to the PHY.

Parameters
linkIdthe link ID
contextthe context
psduMapthe transmitted PSDU map
txVectorthe TXVECTOR used for transmission
txPowerWthe TX power in watts

Definition at line 309 of file wifi-probe-exchange-test.cc.

References m_mgtPsdus.

Referenced by SetupTxTrace().

+ Here is the caller graph for this function:

◆ DoRun()

void ProbeExchTest::DoRun ( )
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().

+ Here is the call graph for this function:

◆ DoSetup()

void ProbeExchTest::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 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().

+ Here is the call graph for this function:

◆ DoTeardown()

void ProbeExchTest::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 457 of file wifi-probe-exchange-test.cc.

References m_apDev, m_clientDev, and m_mgtPsdus.

◆ GetLinkMacAddr()

Mac48Address ProbeExchTest::GetLinkMacAddr ( Ptr< WifiNetDevice > dev,
uint8_t linkId )
private

Get Link MAC address for input device on specified link.

Parameters
devthe input device
linkIdthe ID of the specified link
Returns
the Link MAC address for input device on specified link

Definition at line 289 of file wifi-probe-exchange-test.cc.

References NS_ASSERT.

Referenced by SendProbeReq().

+ Here is the caller graph for this function:

◆ SendProbeReq()

void ProbeExchTest::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().

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

◆ SetChannels()

void ProbeExchTest::SetChannels ( SpectrumWifiPhyHelper & helper,
const std::vector< std::string > & channels,
const ChannelMap & channelMap )
private

Setup the PHY Helper based on input channel settings.

Parameters
helperthe spectrum wifi PHY helper
channelsthe list of channels
channelMapthe 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().

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

◆ SetupDevices()

void ProbeExchTest::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().

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

◆ SetupTxTrace()

void ProbeExchTest::SetupTxTrace ( Ptr< WifiNetDevice > dev,
std::size_t nodeId )
private

Setup PSDU Tx trace.

Parameters
devthe wifi netdevice
nodeIdthe node ID

Definition at line 297 of file wifi-probe-exchange-test.cc.

References CollectTxTrace(), ns3::Config::Connect(), and ns3::MakeCallback().

Referenced by DoSetup().

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

◆ ValidateProbeReq()

void ProbeExchTest::ValidateProbeReq ( const TxPsdu & txPsdu)
private

Check Probe Request contents.

Parameters
txPsduinformation 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().

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

◆ ValidateProbeResp()

void ProbeExchTest::ValidateProbeResp ( const TxPsdu & txPsdu)
private

Check Probe Response contents.

Parameters
txPsduinformation 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().

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

◆ ValidateTest()

void ProbeExchTest::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().

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

Member Data Documentation

◆ m_apDev

Ptr<WifiNetDevice> ProbeExchTest::m_apDev {nullptr}
private

AP MLD WifiNetDevice.

Definition at line 193 of file wifi-probe-exchange-test.cc.

Referenced by DoSetup(), DoTeardown(), SendProbeReq(), and SetupDevices().

◆ m_clientDev

Ptr<WifiNetDevice> ProbeExchTest::m_clientDev {nullptr}
private

Non-AP MLD WifiNetDevice.

Definition at line 194 of file wifi-probe-exchange-test.cc.

Referenced by DoSetup(), DoTeardown(), SendProbeReq(), and SetupDevices().

◆ m_mgtPsdus

std::vector<TxPsdu> ProbeExchTest::m_mgtPsdus {}
private

Tx PSDUs.

Definition at line 196 of file wifi-probe-exchange-test.cc.

Referenced by CollectTxTrace(), DoTeardown(), and ValidateTest().

◆ m_testVec

ProbeExchTestVector ProbeExchTest::m_testVec
private

Test vector.

Definition at line 195 of file wifi-probe-exchange-test.cc.

Referenced by SendProbeReq(), SetupDevices(), ValidateProbeReq(), and ValidateProbeResp().


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