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

PHY CCA thresholds test. More...

+ Inheritance diagram for WifiPhyCcaThresholdsTest:
+ Collaboration diagram for WifiPhyCcaThresholdsTest:

Public Member Functions

 WifiPhyCcaThresholdsTest ()
 
- 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

Ptr< HePpduCreateDummyHePpdu (MHz_u bandwidth, const WifiPhyOperatingChannel &channel)
 Create a HE PPDU.
 
Ptr< HtPpduCreateDummyHtPpdu (MHz_u bandwidth, const WifiPhyOperatingChannel &channel)
 Create a HT PPDU.
 
Ptr< OfdmPpduCreateDummyNonHtPpdu (const WifiPhyOperatingChannel &channel)
 Create a non-HT PPDU.
 
Ptr< WifiPsduCreateDummyPsdu ()
 Create a dummy PSDU whose payload is 1000 bytes.
 
Ptr< VhtPpduCreateDummyVhtPpdu (MHz_u bandwidth, const WifiPhyOperatingChannel &channel)
 Create a VHT PPDU.
 
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 RunOne ()
 Run tests for given CCA attributes.
 
void VerifyCcaThreshold (const Ptr< PhyEntity > phy, const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType, dBm_u expectedCcaThreshold)
 Function to verify the CCA threshold that is being reported by a given PHY entity upon reception of a signal or a PPDU.
 

Private Attributes

dBm_u m_CcaEdThreshold
 The current CCA-ED threshold for a 20 MHz subchannel.
 
dBm_u m_CcaSensitivity
 The current CCA sensitivity threshold for signals that occupy the primary 20 MHz channel.
 
Ptr< WifiNetDevicem_device
 The WifiNetDevice.
 
Ptr< ObssPdAlgorithmm_obssPdAlgorithm
 The OBSS-PD algorithm.
 
dBm_u m_obssPdLevel
 The current OBSS-PD level.
 
Ptr< SpectrumWifiPhym_phy
 The spectrum PHY.
 
VhtConfiguration::SecondaryCcaSensitivityThresholds m_secondaryCcaSensitivityThresholds
 The current CCA sensitivity thresholds for signals that do not occupy the primary 20 MHz channel.
 
Ptr< VhtConfigurationm_vhtConfiguration
 The VHT configuration.
 

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

PHY CCA thresholds test.

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

Constructor & Destructor Documentation

◆ WifiPhyCcaThresholdsTest()

WifiPhyCcaThresholdsTest::WifiPhyCcaThresholdsTest ( )

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

Member Function Documentation

◆ CreateDummyHePpdu()

Ptr< HePpdu > WifiPhyCcaThresholdsTest::CreateDummyHePpdu ( MHz_u bandwidth,
const WifiPhyOperatingChannel & channel )
private

Create a HE PPDU.

Parameters
bandwidththe bandwidth used for the transmission the PPDU
channelthe operating channel of the PHY used for the transmission
Returns
a HE PPDU

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

References ns3::Create(), CreateDummyPsdu(), ns3::HePhy::GetHeMcs0(), ns3::MicroSeconds(), ns3::NanoSeconds(), and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by RunOne().

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

◆ CreateDummyHtPpdu()

Ptr< HtPpdu > WifiPhyCcaThresholdsTest::CreateDummyHtPpdu ( MHz_u bandwidth,
const WifiPhyOperatingChannel & channel )
private

Create a HT PPDU.

Parameters
bandwidththe bandwidth used for the transmission the PPDU
channelthe operating channel of the PHY used for the transmission
Returns
a HT PPDU

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

References ns3::Create(), CreateDummyPsdu(), ns3::HtPhy::GetHtMcs0(), ns3::MicroSeconds(), ns3::NanoSeconds(), and ns3::WIFI_PREAMBLE_HT_MF.

Referenced by RunOne().

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

◆ CreateDummyNonHtPpdu()

Ptr< OfdmPpdu > WifiPhyCcaThresholdsTest::CreateDummyNonHtPpdu ( const WifiPhyOperatingChannel & channel)
private

Create a non-HT PPDU.

Parameters
channelthe operating channel of the PHY used for the transmission
Returns
a non-HT PPDU

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

References ns3::Create(), CreateDummyPsdu(), ns3::OfdmPhy::GetOfdmRate6Mbps(), ns3::NanoSeconds(), and ns3::WIFI_PREAMBLE_LONG.

Referenced by RunOne().

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

◆ CreateDummyPsdu()

Ptr< WifiPsdu > WifiPhyCcaThresholdsTest::CreateDummyPsdu ( )
private

Create a dummy PSDU whose payload is 1000 bytes.

Returns
a dummy PSDU whose payload is 1000 bytes

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

References ns3::Create(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_QOSDATA.

Referenced by CreateDummyHePpdu(), CreateDummyHtPpdu(), CreateDummyNonHtPpdu(), and CreateDummyVhtPpdu().

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

◆ CreateDummyVhtPpdu()

Ptr< VhtPpdu > WifiPhyCcaThresholdsTest::CreateDummyVhtPpdu ( MHz_u bandwidth,
const WifiPhyOperatingChannel & channel )
private

Create a VHT PPDU.

Parameters
bandwidththe bandwidth used for the transmission the PPDU
channelthe operating channel of the PHY used for the transmission
Returns
a VHT PPDU

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

References ns3::Create(), CreateDummyPsdu(), ns3::VhtPhy::GetVhtMcs0(), ns3::MicroSeconds(), ns3::NanoSeconds(), and ns3::WIFI_PREAMBLE_VHT_SU.

Referenced by RunOne().

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

◆ DoRun()

void WifiPhyCcaThresholdsTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

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

References ns3::Simulator::Destroy(), m_CcaEdThreshold, m_CcaSensitivity, m_obssPdLevel, m_secondaryCcaSensitivityThresholds, and RunOne().

+ Here is the call graph for this function:

◆ DoSetup()

void WifiPhyCcaThresholdsTest::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-phy-cca-test.cc.

References ns3::CreateObject(), ns3::WifiPhyOperatingChannel::FindFirst(), m_device, m_obssPdAlgorithm, m_phy, m_vhtConfiguration, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ DoTeardown()

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

References m_device.

◆ RunOne()

void WifiPhyCcaThresholdsTest::RunOne ( )
private

Run tests for given CCA attributes.

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

References CreateDummyHePpdu(), CreateDummyHtPpdu(), CreateDummyNonHtPpdu(), CreateDummyVhtPpdu(), m_CcaEdThreshold, m_CcaSensitivity, m_obssPdAlgorithm, m_obssPdLevel, m_phy, m_secondaryCcaSensitivityThresholds, m_vhtConfiguration, VerifyCcaThreshold(), ns3::WIFI_CHANLIST_PRIMARY, ns3::WIFI_CHANLIST_SECONDARY, ns3::WIFI_CHANLIST_SECONDARY40, ns3::WIFI_CHANLIST_SECONDARY80, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_MOD_CLASS_HT, ns3::WIFI_MOD_CLASS_OFDM, and ns3::WIFI_MOD_CLASS_VHT.

Referenced by DoRun().

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

◆ VerifyCcaThreshold()

void WifiPhyCcaThresholdsTest::VerifyCcaThreshold ( const Ptr< PhyEntity > phy,
const Ptr< const WifiPpdu > ppdu,
WifiChannelListType channelType,
dBm_u expectedCcaThreshold )
private

Function to verify the CCA threshold that is being reported by a given PHY entity upon reception of a signal or a PPDU.

Parameters
phythe PHY entity to verify
ppduthe incoming PPDU or signal (if nullptr)
channelTypethe channel list type that indicates which channel the PPDU or the signal occupies
expectedCcaThresholdthe CCA threshold that is expected to be reported

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

References NS_LOG_FUNCTION, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ_TOL.

Referenced by RunOne().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_CcaEdThreshold

dBm_u WifiPhyCcaThresholdsTest::m_CcaEdThreshold
private

The current CCA-ED threshold for a 20 MHz subchannel.

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

Referenced by DoRun(), and RunOne().

◆ m_CcaSensitivity

dBm_u WifiPhyCcaThresholdsTest::m_CcaSensitivity
private

The current CCA sensitivity threshold for signals that occupy the primary 20 MHz channel.

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

Referenced by DoRun(), and RunOne().

◆ m_device

Ptr<WifiNetDevice> WifiPhyCcaThresholdsTest::m_device
private

The WifiNetDevice.

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

Referenced by DoSetup(), and DoTeardown().

◆ m_obssPdAlgorithm

Ptr<ObssPdAlgorithm> WifiPhyCcaThresholdsTest::m_obssPdAlgorithm
private

The OBSS-PD algorithm.

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

Referenced by DoSetup(), and RunOne().

◆ m_obssPdLevel

dBm_u WifiPhyCcaThresholdsTest::m_obssPdLevel
private

The current OBSS-PD level.

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

Referenced by DoRun(), and RunOne().

◆ m_phy

Ptr<SpectrumWifiPhy> WifiPhyCcaThresholdsTest::m_phy
private

The spectrum PHY.

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

Referenced by DoSetup(), and RunOne().

◆ m_secondaryCcaSensitivityThresholds

VhtConfiguration::SecondaryCcaSensitivityThresholds WifiPhyCcaThresholdsTest::m_secondaryCcaSensitivityThresholds
private

The current CCA sensitivity thresholds for signals that do not occupy the primary 20 MHz channel.

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

Referenced by DoRun(), and RunOne().

◆ m_vhtConfiguration

Ptr<VhtConfiguration> WifiPhyCcaThresholdsTest::m_vhtConfiguration
private

The VHT configuration.

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

Referenced by DoSetup(), and RunOne().


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