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

Unsupported Bandwidth Reception Test This test checks whether a PHY receiving a PPDU sent over a channel width larger than the one supported by the PHY is getting dropped at the expected time. More...

+ Inheritance diagram for TestUnsupportedBandwidthReception:
+ Collaboration diagram for TestUnsupportedBandwidthReception:

Public Member Functions

 TestUnsupportedBandwidthReception ()
 
- 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 CheckRx (uint32_t expectedCountRxSuccess, uint32_t expectedCountRxFailure, uint32_t expectedCountRxDropped, std::optional< Time > expectedLastRxSucceeded, std::optional< Time > expectedLastRxFailed, std::optional< Time > expectedLastRxDropped)
 Check the reception results.
 
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 RxDropped (Ptr< const Packet > packet, WifiPhyRxfailureReason reason)
 Function called upon a PSDU dropped by the PHY.
 
void RxFailure (Ptr< const WifiPsdu > psdu)
 Function called upon a PSDU received unsuccessfuly.
 
void RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 Function called upon a PSDU received successfully.
 
void SendPpdu (MHz_u centerFreq, MHz_u bandwidth)
 Function to create a PPDU.
 

Private Attributes

uint32_t m_countRxDropped
 count RX drop
 
uint32_t m_countRxFailure
 count RX failure
 
uint32_t m_countRxSuccess
 count RX success
 
std::optional< Timem_lastRxDropped
 time of last RX drop, if any
 
std::optional< Timem_lastRxFailed
 time of last RX failure, if any
 
std::optional< Timem_lastRxSucceeded
 time of last RX success, if any
 
Ptr< SpectrumWifiPhym_rxPhy
 RX PHY.
 
Ptr< SpectrumWifiPhym_txPhy
 TX PHY.
 

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

Unsupported Bandwidth Reception Test This test checks whether a PHY receiving a PPDU sent over a channel width larger than the one supported by the PHY is getting dropped at the expected time.

The expected time corresponds to the moment the PHY header indicating the channel width used to transmit the PPDU is received. Since we are considering 802.11ax for this test, this corresponds to the time HE-SIG-A is received.

Definition at line 4177 of file wifi-phy-reception-test.cc.

Constructor & Destructor Documentation

◆ TestUnsupportedBandwidthReception()

TestUnsupportedBandwidthReception::TestUnsupportedBandwidthReception ( )

Definition at line 4250 of file wifi-phy-reception-test.cc.

Member Function Documentation

◆ CheckRx()

void TestUnsupportedBandwidthReception::CheckRx ( uint32_t expectedCountRxSuccess,
uint32_t expectedCountRxFailure,
uint32_t expectedCountRxDropped,
std::optional< Time > expectedLastRxSucceeded,
std::optional< Time > expectedLastRxFailed,
std::optional< Time > expectedLastRxDropped )
private

Check the reception results.

Parameters
expectedCountRxSuccessthe expected number of RX success
expectedCountRxFailurethe expected number of RX failure
expectedCountRxDroppedthe expected number of RX drop
expectedLastRxSucceededthe expected time the last RX success occurred or std::nullopt if the expected number of RX success is not strictly positive
expectedLastRxFailedthe expected time the last RX failure occurred or std::nullopt if the expected number of RX failure is not strictly positive
expectedLastRxDroppedthe expected time the last RX drop occurred or std::nullopt if the expected number of RX drop is not strictly positive

Definition at line 4330 of file wifi-phy-reception-test.cc.

References m_countRxDropped, m_countRxFailure, m_countRxSuccess, m_lastRxDropped, m_lastRxFailed, m_lastRxSucceeded, NS_ASSERT, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void TestUnsupportedBandwidthReception::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 4422 of file wifi-phy-reception-test.cc.

References CheckRx(), ns3::Simulator::Destroy(), m_rxPhy, m_txPhy, ns3::MicroSeconds(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendPpdu(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and ns3::WIFI_PHY_BAND_5GHZ.

+ Here is the call graph for this function:

◆ DoSetup()

void TestUnsupportedBandwidthReception::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 4378 of file wifi-phy-reception-test.cc.

References ns3::CreateObject(), m_rxPhy, m_txPhy, ns3::MakeCallback(), RxDropped(), RxFailure(), RxSuccess(), and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ DoTeardown()

void TestUnsupportedBandwidthReception::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 4412 of file wifi-phy-reception-test.cc.

References m_rxPhy, and m_txPhy.

◆ RxDropped()

void TestUnsupportedBandwidthReception::RxDropped ( Ptr< const Packet > packet,
WifiPhyRxfailureReason reason )
private

Function called upon a PSDU dropped by the PHY.

Parameters
packetthe packet that was dropped
reasonthe reason the packet was dropped

Definition at line 4321 of file wifi-phy-reception-test.cc.

References m_countRxDropped, m_lastRxDropped, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::UNSUPPORTED_SETTINGS.

Referenced by DoSetup().

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

◆ RxFailure()

void TestUnsupportedBandwidthReception::RxFailure ( Ptr< const WifiPsdu > psdu)
private

Function called upon a PSDU received unsuccessfuly.

Parameters
psduthe PSDU

Definition at line 4313 of file wifi-phy-reception-test.cc.

References m_countRxFailure, m_lastRxFailed, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by DoSetup().

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

◆ RxSuccess()

void TestUnsupportedBandwidthReception::RxSuccess ( Ptr< const WifiPsdu > psdu,
RxSignalInfo rxSignalInfo,
WifiTxVector txVector,
std::vector< bool > statusPerMpdu )
private

Function called upon a PSDU received successfully.

Parameters
psduthe PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorthe transmit vector
statusPerMpdureception status per MPDU

Definition at line 4302 of file wifi-phy-reception-test.cc.

References m_countRxSuccess, m_lastRxSucceeded, ns3::Simulator::Now(), and NS_LOG_FUNCTION.

Referenced by DoSetup().

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

◆ SendPpdu()

void TestUnsupportedBandwidthReception::SendPpdu ( MHz_u centerFreq,
MHz_u bandwidth )
private

Function to create a PPDU.

Parameters
centerFreqthe center frequency used for the transmission of the PPDU
bandwidththe bandwidth used for the transmission of the PPDU

Definition at line 4263 of file wifi-phy-reception-test.cc.

References ns3::Create(), ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::DbmToW(), ns3::HePhy::GetHeMcs0(), m_rxPhy, m_txPhy, ns3::NanoSeconds(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by DoRun().

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

Member Data Documentation

◆ m_countRxDropped

uint32_t TestUnsupportedBandwidthReception::m_countRxDropped
private

count RX drop

Definition at line 4240 of file wifi-phy-reception-test.cc.

Referenced by CheckRx(), and RxDropped().

◆ m_countRxFailure

uint32_t TestUnsupportedBandwidthReception::m_countRxFailure
private

count RX failure

Definition at line 4239 of file wifi-phy-reception-test.cc.

Referenced by CheckRx(), and RxFailure().

◆ m_countRxSuccess

uint32_t TestUnsupportedBandwidthReception::m_countRxSuccess
private

count RX success

Definition at line 4238 of file wifi-phy-reception-test.cc.

Referenced by CheckRx(), and RxSuccess().

◆ m_lastRxDropped

std::optional<Time> TestUnsupportedBandwidthReception::m_lastRxDropped
private

time of last RX drop, if any

Definition at line 4244 of file wifi-phy-reception-test.cc.

Referenced by CheckRx(), and RxDropped().

◆ m_lastRxFailed

std::optional<Time> TestUnsupportedBandwidthReception::m_lastRxFailed
private

time of last RX failure, if any

Definition at line 4243 of file wifi-phy-reception-test.cc.

Referenced by CheckRx(), and RxFailure().

◆ m_lastRxSucceeded

std::optional<Time> TestUnsupportedBandwidthReception::m_lastRxSucceeded
private

time of last RX success, if any

Definition at line 4242 of file wifi-phy-reception-test.cc.

Referenced by CheckRx(), and RxSuccess().

◆ m_rxPhy

Ptr<SpectrumWifiPhy> TestUnsupportedBandwidthReception::m_rxPhy
private

RX PHY.

Definition at line 4246 of file wifi-phy-reception-test.cc.

Referenced by DoRun(), DoSetup(), DoTeardown(), and SendPpdu().

◆ m_txPhy

Ptr<SpectrumWifiPhy> TestUnsupportedBandwidthReception::m_txPhy
private

TX PHY.

Definition at line 4247 of file wifi-phy-reception-test.cc.

Referenced by DoRun(), DoSetup(), DoTeardown(), and SendPpdu().


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