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

Test CCA_BUSY indication provided by the PHY. More...

Inheritance diagram for WifiPhyCcaIndicationTest:
Collaboration diagram for WifiPhyCcaIndicationTest:

Classes

struct  CcaCheckPoint
 structure that holds information to perform CCA check More...
struct  CcaThresholdUpdatePoint
 structure that holds information to perform CCA threshold update More...
struct  StateCheckPoint
 structure that holds information to perform PHY state check More...
struct  TxPpduInfo
 structure that holds information to generate PPDUs More...
struct  TxSignalInfo
 structure that holds information to generate signals More...

Public Member Functions

 WifiPhyCcaIndicationTest (WifiStandard standard)
 Constructor.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCaseoperator= (const TestCase &)=delete

Private Member Functions

void CheckCcaBusyNotifications (const std::string &scenario, std::size_t expectedCcaNotifications, Time expectedStartTime, Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector< Time > &expectedPer20MhzDurations)
 Check the CCA-BUSY notifications.
void CheckPhyState (const std::string &scenario, WifiPhyState expectedState)
 Check the PHY state.
void DoCheckCcaBusyNotifications (const std::string &scenario, std::size_t expectedCcaNotifications, Time expectedStartTime, Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector< Time > &expectedPer20MhzDurations)
 Check the CCA-BUSY notifications.
void DoCheckPhyState (const std::string &scenario, WifiPhyState expectedState)
 Check the PHY state.
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 LogScenario (const std::string &scenario) const
 Log scenario description.
void Reset ()
 Reset function.
void ResetExpectedPer20MhzCcaBusyDurations ()
 Reset the expected Per 20 MHz CCA durations.
void RunOne ()
 Run one function.
void ScheduleTest (Time delay, const std::string &scenario, const std::vector< TxSignalInfo > &generatedSignals, const std::vector< TxPpduInfo > &generatedPpdus, const std::vector< StateCheckPoint > &stateCheckpoints, const std::vector< CcaCheckPoint > &ccaCheckpoints, const std::vector< CcaThresholdUpdatePoint > &ccaThresholdUpdates={})
 Schedule test to perform.
void SendSuPpdu (dBm_u txPower, MHz_u frequency, MHz_u bandwidth)
 Send a HE or EHT SU PPDU.
void StartSignal (Ptr< WaveformGenerator > signalGenerator, dBm_u txPower, MHz_u frequency, MHz_u bandwidth, Time duration)
 Start to generate a signal.
void StopSignal (Ptr< WaveformGenerator > signalGenerator)
 Stop to generate a signal.
void UpdateCcaThreshold (dBm_u ccaThreshold)
 Update the CCA threshold of the PHY.

Private Attributes

MHz_u m_channelWidth
 Operating channel width.
std::vector< std::vector< Time > > m_expectedPer20MhzCcaBusyDurations {}
 expected Per 20Mhz CCA durations per check
MHz_u m_frequency
 Operating frequency.
std::size_t m_numSignalGenerators
 The number of non-wifi signals generators needed for the test.
Ptr< SpectrumWifiPhym_rxPhy
 PHY object of the receiver.
std::shared_ptr< CcaTestPhyListenerm_rxPhyStateListener
 Listener for PHY state transitions.
std::vector< Ptr< WaveformGenerator > > m_signalGenerators
 Generators of non-wifi signals.
WifiStandard m_standard
 The standard to use for the test.
Ptr< SpectrumWifiPhym_uxPhy
 PHY object of the transmitter.

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...
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 CCA_BUSY indication provided by the PHY.

Many scenarios are being tested, where one or more PPDUs are being received and/or one or more (non-wifi) signals are being received. The tests verify the PHY states at different time points, and the CCA_BUSY indication at various point in time (amount of notifications, start and end of CCA_BUSY periods and per-20MHz bitmaps). The tests are run for all possible channel width and PPDU/signal widths combinations.

Definition at line 898 of file wifi-phy-cca-test.cc.

Constructor & Destructor Documentation

◆ WifiPhyCcaIndicationTest()

WifiPhyCcaIndicationTest::WifiPhyCcaIndicationTest ( WifiStandard standard)

Constructor.

Parameters
standardthe standard to use for the test

Definition at line 1091 of file wifi-phy-cca-test.cc.

References ns3::TestCase::TestCase(), m_channelWidth, m_frequency, m_numSignalGenerators, m_standard, P20_CENTER_FREQUENCY, and ns3::WIFI_STANDARD_80211ax.

Here is the call graph for this function:

Member Function Documentation

◆ CheckCcaBusyNotifications()

void WifiPhyCcaIndicationTest::CheckCcaBusyNotifications ( const std::string & scenario,
std::size_t expectedCcaNotifications,
Time expectedStartTime,
Time expectedEndTime,
WifiChannelListType expectedChannelType,
const std::vector< Time > & expectedPer20MhzDurations )
private

Check the CCA-BUSY notifications.

Parameters
scenariothe scenario under test
expectedCcaNotificationsthe expected number of CCA_BUSY notifications
expectedStartTimethe expected CCA-BUSY start time
expectedEndTimethe expected CCA-BUSY end time
expectedChannelTypethe expected channel type
expectedPer20MhzDurationsthe expected per-20 MHz CCA-BUSY durations

Definition at line 1201 of file wifi-phy-cca-test.cc.

References DoCheckCcaBusyNotifications(), and ns3::Simulator::ScheduleNow().

Referenced by ScheduleTest().

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

◆ CheckPhyState()

void WifiPhyCcaIndicationTest::CheckPhyState ( const std::string & scenario,
WifiPhyState expectedState )
private

Check the PHY state.

Parameters
scenariothe scenario under test
expectedStatethe expected state of the PHY

Definition at line 1172 of file wifi-phy-cca-test.cc.

References DoCheckPhyState(), NS_LOG_FUNCTION, and ns3::Simulator::ScheduleNow().

Referenced by ScheduleTest().

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

◆ DoCheckCcaBusyNotifications()

void WifiPhyCcaIndicationTest::DoCheckCcaBusyNotifications ( const std::string & scenario,
std::size_t expectedCcaNotifications,
Time expectedStartTime,
Time expectedEndTime,
WifiChannelListType expectedChannelType,
const std::vector< Time > & expectedPer20MhzDurations )
private

Check the CCA-BUSY notifications.

Parameters
scenariothe scenario under test
expectedCcaNotificationsthe expected number of CCA_BUSY notifications
expectedStartTimethe expected CCA-BUSY start time
expectedEndTimethe expected CCA-BUSY end time
expectedChannelTypethe expected channel type
expectedPer20MhzDurationsthe expected per-20 MHz CCA-BUSY durations

Definition at line 1220 of file wifi-phy-cca-test.cc.

References m_channelWidth, m_rxPhyStateListener, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and v.

Referenced by CheckCcaBusyNotifications().

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

◆ DoCheckPhyState()

void WifiPhyCcaIndicationTest::DoCheckPhyState ( const std::string & scenario,
WifiPhyState expectedState )
private

Check the PHY state.

Parameters
scenariothe scenario under test
expectedStatethe expected state of the PHY

Definition at line 1184 of file wifi-phy-cca-test.cc.

References ns3::DynamicCast(), ns3::PointerValue::Get(), m_channelWidth, m_rxPhy, ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by CheckPhyState().

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

◆ DoRun()

void WifiPhyCcaIndicationTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 3740 of file wifi-phy-cca-test.cc.

References ns3::Simulator::Destroy(), m_channelWidth, m_frequency, m_standard, P160_CENTER_FREQUENCY, P20_CENTER_FREQUENCY, P320_CENTER_FREQUENCY, P40_CENTER_FREQUENCY, P80_CENTER_FREQUENCY, RunOne(), and ns3::WIFI_STANDARD_80211ax.

Here is the call graph for this function:

◆ DoSetup()

void WifiPhyCcaIndicationTest::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 1477 of file wifi-phy-cca-test.cc.

References ns3::CreateObject(), m_numSignalGenerators, m_rxPhy, m_rxPhyStateListener, m_signalGenerators, m_standard, m_uxPhy, ns3::Seconds(), and ns3::WIFI_STANDARD_80211ax.

Here is the call graph for this function:

◆ DoTeardown()

void WifiPhyCcaIndicationTest::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 3769 of file wifi-phy-cca-test.cc.

References m_rxPhy, m_signalGenerators, and m_uxPhy.

◆ LogScenario()

void WifiPhyCcaIndicationTest::LogScenario ( const std::string & scenario) const
private

Log scenario description.

Parameters
scenariothe scenario description to add to log

Definition at line 1286 of file wifi-phy-cca-test.cc.

References NS_LOG_INFO.

Referenced by ScheduleTest().

Here is the caller graph for this function:

◆ Reset()

void WifiPhyCcaIndicationTest::Reset ( )
private

Reset function.

Definition at line 1375 of file wifi-phy-cca-test.cc.

References m_rxPhy, m_rxPhyStateListener, m_standard, NS_LOG_FUNCTION, and UpdateCcaThreshold().

Referenced by ScheduleTest().

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

◆ ResetExpectedPer20MhzCcaBusyDurations()

void WifiPhyCcaIndicationTest::ResetExpectedPer20MhzCcaBusyDurations ( )
private

Reset the expected Per 20 MHz CCA durations.

Definition at line 1384 of file wifi-phy-cca-test.cc.

References m_channelWidth, m_expectedPer20MhzCcaBusyDurations, and ns3::MicroSeconds().

Referenced by RunOne().

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

◆ RunOne()

◆ ScheduleTest()

void WifiPhyCcaIndicationTest::ScheduleTest ( Time delay,
const std::string & scenario,
const std::vector< TxSignalInfo > & generatedSignals,
const std::vector< TxPpduInfo > & generatedPpdus,
const std::vector< StateCheckPoint > & stateCheckpoints,
const std::vector< CcaCheckPoint > & ccaCheckpoints,
const std::vector< CcaThresholdUpdatePoint > & ccaThresholdUpdates = {} )
private

Schedule test to perform.

Parameters
delaythe reference delay to schedule the events
scenariodescription of the scenario to test
generatedSignalsthe vector of signals to be generated
generatedPpdusthe vector of PPDUs to be generated
stateCheckpointsthe vector of PHY state checks
ccaCheckpointsthe vector of PHY CCA checks
ccaThresholdUpdatesthe vector of CCA threshold updates

Definition at line 1292 of file wifi-phy-cca-test.cc.

References CheckCcaBusyNotifications(), CheckPhyState(), LogScenario(), m_signalGenerators, ns3::Simulator::Now(), Reset(), ns3::Simulator::Schedule(), SendSuPpdu(), StartSignal(), testStep, UpdateCcaThreshold(), and ns3::WIFI_CHANLIST_PRIMARY.

Referenced by RunOne().

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

◆ SendSuPpdu()

void WifiPhyCcaIndicationTest::SendSuPpdu ( dBm_u txPower,
MHz_u frequency,
MHz_u bandwidth )
private

Send a HE or EHT SU PPDU.

Parameters
txPowerthe transmit power
frequencythe center frequency the transmitter is operating on
bandwidththe bandwidth to use for the transmission

Definition at line 1136 of file wifi-phy-cca-test.cc.

References ns3::Create(), ns3::WifiPhyOperatingChannel::FindFirst(), ns3::EhtPhy::GetEhtMcs0(), ns3::HePhy::GetHeMcs0(), m_standard, m_uxPhy, ns3::NanoSeconds(), NS_LOG_FUNCTION, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, ns3::WIFI_MIN_TX_PWR_LEVEL, ns3::WIFI_PHY_BAND_6GHZ, ns3::WIFI_PREAMBLE_EHT_MU, ns3::WIFI_PREAMBLE_HE_SU, and ns3::WIFI_STANDARD_80211ax.

Referenced by ScheduleTest().

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

◆ StartSignal()

void WifiPhyCcaIndicationTest::StartSignal ( Ptr< WaveformGenerator > signalGenerator,
dBm_u txPower,
MHz_u frequency,
MHz_u bandwidth,
Time duration )
private

Start to generate a signal.

Parameters
signalGeneratorthe signal generator to use
txPowerthe transmit power
frequencythe center frequency of the signal to send
bandwidththe bandwidth of the signal to send
durationthe duration of the signal

Definition at line 1103 of file wifi-phy-cca-test.cc.

References ns3::Create(), ns3::DbmToW(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, ns3::MHzToHz(), NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and StopSignal().

Referenced by ScheduleTest().

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

◆ StopSignal()

void WifiPhyCcaIndicationTest::StopSignal ( Ptr< WaveformGenerator > signalGenerator)
private

Stop to generate a signal.

Parameters
signalGeneratorthe signal generator to use

Definition at line 1129 of file wifi-phy-cca-test.cc.

References NS_LOG_FUNCTION.

Referenced by StartSignal().

Here is the caller graph for this function:

◆ UpdateCcaThreshold()

void WifiPhyCcaIndicationTest::UpdateCcaThreshold ( dBm_u ccaThreshold)
private

Update the CCA threshold of the PHY.

Parameters
ccaThresholdthe new CCA threshold value to be set

Definition at line 1165 of file wifi-phy-cca-test.cc.

References m_rxPhy, and NS_LOG_FUNCTION.

Referenced by Reset(), and ScheduleTest().

Here is the caller graph for this function:

Member Data Documentation

◆ m_channelWidth

MHz_u WifiPhyCcaIndicationTest::m_channelWidth
private

◆ m_expectedPer20MhzCcaBusyDurations

std::vector<std::vector<Time> > WifiPhyCcaIndicationTest::m_expectedPer20MhzCcaBusyDurations {}
private

expected Per 20Mhz CCA durations per check

Definition at line 1088 of file wifi-phy-cca-test.cc.

Referenced by ResetExpectedPer20MhzCcaBusyDurations(), and RunOne().

◆ m_frequency

MHz_u WifiPhyCcaIndicationTest::m_frequency
private

Operating frequency.

Definition at line 1084 of file wifi-phy-cca-test.cc.

Referenced by WifiPhyCcaIndicationTest(), DoRun(), and RunOne().

◆ m_numSignalGenerators

std::size_t WifiPhyCcaIndicationTest::m_numSignalGenerators
private

The number of non-wifi signals generators needed for the test.

Definition at line 1078 of file wifi-phy-cca-test.cc.

Referenced by WifiPhyCcaIndicationTest(), and DoSetup().

◆ m_rxPhy

Ptr<SpectrumWifiPhy> WifiPhyCcaIndicationTest::m_rxPhy
private

PHY object of the receiver.

Definition at line 1074 of file wifi-phy-cca-test.cc.

Referenced by DoCheckPhyState(), DoSetup(), DoTeardown(), Reset(), RunOne(), and UpdateCcaThreshold().

◆ m_rxPhyStateListener

std::shared_ptr<CcaTestPhyListener> WifiPhyCcaIndicationTest::m_rxPhyStateListener
private

Listener for PHY state transitions.

Definition at line 1082 of file wifi-phy-cca-test.cc.

Referenced by DoCheckCcaBusyNotifications(), DoSetup(), and Reset().

◆ m_signalGenerators

std::vector<Ptr<WaveformGenerator> > WifiPhyCcaIndicationTest::m_signalGenerators
private

Generators of non-wifi signals.

Definition at line 1077 of file wifi-phy-cca-test.cc.

Referenced by DoSetup(), DoTeardown(), and ScheduleTest().

◆ m_standard

WifiStandard WifiPhyCcaIndicationTest::m_standard
private

The standard to use for the test.

Definition at line 1072 of file wifi-phy-cca-test.cc.

Referenced by WifiPhyCcaIndicationTest(), DoRun(), DoSetup(), Reset(), RunOne(), and SendSuPpdu().

◆ m_uxPhy

Ptr<SpectrumWifiPhy> WifiPhyCcaIndicationTest::m_uxPhy
private

PHY object of the transmitter.

Definition at line 1075 of file wifi-phy-cca-test.cc.

Referenced by DoSetup(), DoTeardown(), RunOne(), and SendSuPpdu().


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