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

Test FILS frames. More...

+ Inheritance diagram for WifiFilsFrameTest:
+ Collaboration diagram for WifiFilsFrameTest:

Classes

struct  PsduCapture
 Transmitted PSDUs. More...
 
struct  TimeStats
 Timing statistic for test validation. More...
 

Public Member Functions

 WifiFilsFrameTest (const WifiFilsFrameTestParams &params)
 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 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.
 
std::optional< FilsDiscHeaderGetFilsDiscFrame (const PsduCapture &psduCapt)
 Get the FILS Discovery header, if present in the given frame.
 
void PsduTxCallback (WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 callback connected to PSDU TX begin trace source
 
Ptr< WifiNetDeviceSetupDevice (Ptr< YansWifiChannel > &channel, bool isAp)
 setup a WifiNetDevice
 
void ValidateCnt (const PsduCapture &psduCapt)
 Check the number of FILS Discovery frames or unsolicited Probe Response frames transmitted since the last Beacon frame.
 
void ValidateFilsDiscFrame (const FilsDiscHeader &filsDisc)
 validate the given FILS Discovery frame
 
void ValidateTest ()
 check the correctness of the test
 
void ValidateTiming (const PsduCapture &psduCapt)
 check the timing of the transmitted FILS Discovery or unsolicited Probe Response
 

Private Attributes

Ptr< WifiNetDevicem_ap {nullptr}
 AP device.
 
Ptr< WifiNetDevicem_client {nullptr}
 Client device.
 
WifiFilsFrameTestParams m_params
 Test parameters.
 
TimeStats m_timeStats
 collected timing statistic
 
std::vector< PsduCapturem_txPsdus {}
 TX PSDUS frame infos.
 

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

Test FILS frames.

Definition at line 102 of file wifi-fils-frame-test.cc.

Constructor & Destructor Documentation

◆ WifiFilsFrameTest()

WifiFilsFrameTest::WifiFilsFrameTest ( const WifiFilsFrameTestParams params)

constructor

Parameters
paramsthe parameters for this test

Definition at line 173 of file wifi-fils-frame-test.cc.

Member Function Documentation

◆ DoRun()

void WifiFilsFrameTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 357 of file wifi-fils-frame-test.cc.

References DEFAULT_SIM_STOP_TIME, ns3::Simulator::Destroy(), ns3::Simulator::Run(), ns3::Simulator::Stop(), and ValidateTest().

+ Here is the call graph for this function:

◆ DoSetup()

void WifiFilsFrameTest::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 247 of file wifi-fils-frame-test.cc.

References ns3::YansWifiChannelHelper::Create(), ns3::YansWifiChannelHelper::Default(), DEFAULT_RNG_RUN, DEFAULT_RNG_SEED, ns3::WifiNetDevice::GetPhy(), m_ap, m_client, ns3::MakeCallback(), PsduTxCallback(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and SetupDevice().

+ Here is the call graph for this function:

◆ DoTeardown()

void WifiFilsFrameTest::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 366 of file wifi-fils-frame-test.cc.

References ns3::Object::Dispose(), m_ap, m_client, and m_txPsdus.

+ Here is the call graph for this function:

◆ GetFilsDiscFrame()

std::optional< FilsDiscHeader > WifiFilsFrameTest::GetFilsDiscFrame ( const PsduCapture psduCapt)
private

Get the FILS Discovery header, if present in the given frame.

Parameters
psduCaptinformation about the given frame
Returns
the FILS Discovery header, if present

Definition at line 294 of file wifi-fils-frame-test.cc.

References ns3::Packet::Copy(), ns3::WifiActionHeader::FILS_DISCOVERY, ns3::WifiActionHeader::GetAction(), ns3::WifiActionHeader::GetCategory(), ns3::WifiPsdu::GetPayload(), WifiFilsFrameTest::PsduCapture::psdu, ns3::WifiActionHeader::PUBLIC, and ns3::WifiActionHeader::ActionValue::publicAction.

Referenced by ValidateTest().

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

◆ PsduTxCallback()

void WifiFilsFrameTest::PsduTxCallback ( WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)
private

callback connected to PSDU TX begin trace source

Parameters
psduMapthe transmitted PSDU map
txVectorthe TXVECTOR
txPowerWthe TX power in Watts

Definition at line 239 of file wifi-fils-frame-test.cc.

References m_txPsdus, ns3::Simulator::Now(), NS_LOG_DEBUG, and ns3::SU_STA_ID.

Referenced by DoSetup().

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

◆ SetupDevice()

Ptr< WifiNetDevice > WifiFilsFrameTest::SetupDevice ( Ptr< YansWifiChannel > &  channel,
bool  isAp 
)
private

setup a WifiNetDevice

Parameters
channelthe channel to attach to
isApwhether the device is an AP
Returns
the created WifiNetDevice

Definition at line 180 of file wifi-fils-frame-test.cc.

References WifiFilsFrameTestParams::bcnIntrvl, WifiFilsFrameTestParams::bw, ns3::NodeContainer::Create(), DEFAULT_AP_LOC, DEFAULT_BAND, DEFAULT_CLIENT_LOC, DEFAULT_ENABLE_PCAP, DEFAULT_OUTDIR, DEFAULT_PCAP_PREFIX, DEFAULT_PRIMARY_INDEX, DEFAULT_STANDARD, DEFAULT_STREAM_INDEX, ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, WifiFilsFrameTestParams::filsIntrvl, ns3::NodeContainer::Get(), ns3::Object::GetObject(), INVALID_CHAN_NUM, m_params, WifiFilsFrameTestParams::nss, ns3::TupleValue< Args >::Set(), WifiFilsFrameTestParams::ssid, and WifiFilsFrameTestParams::unsolProbeRespEn.

Referenced by DoSetup().

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

◆ ValidateCnt()

void WifiFilsFrameTest::ValidateCnt ( const PsduCapture psduCapt)
private

Check the number of FILS Discovery frames or unsolicited Probe Response frames transmitted since the last Beacon frame.

Parameters
psduCaptinformation about the transmitted Beacon frame

Definition at line 262 of file wifi-fils-frame-test.cc.

References WifiFilsFrameTestParams::bcnIntrvl, WifiFilsFrameTest::TimeStats::bcnTimeSt, WifiFilsFrameTest::TimeStats::cntBcns, WifiFilsFrameTest::TimeStats::cntFilsOrUnsolProbeResps, WifiFilsFrameTestParams::filsIntrvl, m_params, m_timeStats, NS_TEST_ASSERT_MSG_EQ, and WifiFilsFrameTest::PsduCapture::timeSt.

Referenced by ValidateTest().

+ Here is the caller graph for this function:

◆ ValidateFilsDiscFrame()

void WifiFilsFrameTest::ValidateFilsDiscFrame ( const FilsDiscHeader filsDisc)
private

validate the given FILS Discovery frame

Parameters
filsDiscthe FILS Discovery frame

Definition at line 342 of file wifi-fils-frame-test.cc.

References WifiFilsFrameTestParams::expChWidFld, WifiFilsFrameTestParams::expNssFld, ns3::FilsDiscHeader::GetSsid(), ns3::FilsDiscHeader::m_fdCap, m_params, NS_TEST_ASSERT_MSG_EQ, WifiFilsFrameTestParams::ssid, and WIFI_6GHZ_FD_PHY_IDX.

Referenced by ValidateTest().

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

◆ ValidateTest()

void WifiFilsFrameTest::ValidateTest ( )
private

check the correctness of the test

Definition at line 310 of file wifi-fils-frame-test.cc.

References WifiFilsFrameTestParams::bcnIntrvl, WifiFilsFrameTest::TimeStats::cntBcns, DEFAULT_SIM_STOP_TIME, GetFilsDiscFrame(), m_params, m_timeStats, m_txPsdus, WifiFilsFrameTestParams::unsolProbeRespEn, ValidateCnt(), ValidateFilsDiscFrame(), and ValidateTiming().

Referenced by DoRun().

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

◆ ValidateTiming()

void WifiFilsFrameTest::ValidateTiming ( const PsduCapture psduCapt)
private

check the timing of the transmitted FILS Discovery or unsolicited Probe Response

Parameters
psduCaptinformation about the FILS Discovery or unsolicited Probe Response

Definition at line 277 of file wifi-fils-frame-test.cc.

References WifiFilsFrameTest::TimeStats::bcnTimeSt, WifiFilsFrameTest::TimeStats::cntFilsOrUnsolProbeResps, DEFAULT_TIMING_TOLERANCE, WifiFilsFrameTestParams::filsIntrvl, WifiFilsFrameTest::TimeStats::filsOrUnsolProbeRespTimeDelta, WifiFilsFrameTest::TimeStats::filsOrUnsolProbeRespTimeSt, ns3::Time::GetTimeStep(), m_params, m_timeStats, NS_TEST_ASSERT_MSG_EQ_TOL, and WifiFilsFrameTest::PsduCapture::timeSt.

Referenced by ValidateTest().

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

Member Data Documentation

◆ m_ap

Ptr<WifiNetDevice> WifiFilsFrameTest::m_ap {nullptr}
private

AP device.

Definition at line 167 of file wifi-fils-frame-test.cc.

Referenced by DoSetup(), and DoTeardown().

◆ m_client

Ptr<WifiNetDevice> WifiFilsFrameTest::m_client {nullptr}
private

Client device.

Definition at line 168 of file wifi-fils-frame-test.cc.

Referenced by DoSetup(), and DoTeardown().

◆ m_params

WifiFilsFrameTestParams WifiFilsFrameTest::m_params
private

Test parameters.

Definition at line 169 of file wifi-fils-frame-test.cc.

Referenced by SetupDevice(), ValidateCnt(), ValidateFilsDiscFrame(), ValidateTest(), and ValidateTiming().

◆ m_timeStats

TimeStats WifiFilsFrameTest::m_timeStats
private

collected timing statistic

Definition at line 166 of file wifi-fils-frame-test.cc.

Referenced by ValidateCnt(), ValidateTest(), and ValidateTiming().

◆ m_txPsdus

std::vector<PsduCapture> WifiFilsFrameTest::m_txPsdus {}
private

TX PSDUS frame infos.

Definition at line 170 of file wifi-fils-frame-test.cc.

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


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