A Discrete-Event Network Simulator
API
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. More...
 
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. More...
 
void DoRun () override
 Implementation to actually run this TestCase. More...
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase. More...
 
void DoTeardown () override
 Implementation to do any local setup required for this TestCase. More...
 
void RxDropped (Ptr< const Packet > packet, WifiPhyRxfailureReason reason)
 Function called upon a PSDU dropped by the PHY. More...
 
void RxFailure (Ptr< const WifiPsdu > psdu)
 Function called upon a PSDU received unsuccessfuly. More...
 
void RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 Function called upon a PSDU received successfully. More...
 
void SendPpdu (uint16_t centerFreqMhz, uint16_t bandwidthMhz)
 Function to create a PPDU. More...
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { 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. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

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 4215 of file wifi-phy-reception-test.cc.

Constructor & Destructor Documentation

◆ TestUnsupportedBandwidthReception()

TestUnsupportedBandwidthReception::TestUnsupportedBandwidthReception ( )

Definition at line 4288 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 4362 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 4454 of file wifi-phy-reception-test.cc.

References ns3::WifiPhy::AssignStreams(), CheckRx(), m_rxPhy, m_txPhy, ns3::MicroSeconds(), ns3::Seconds(), SendPpdu(), ns3::WifiPhy::SetOperatingChannel(), and ns3::WIFI_PHY_BAND_5GHZ.

+ Here is the call graph for this function:

◆ DoSetup()

void TestUnsupportedBandwidthReception::DoSetup ( )
overrideprivatevirtual

◆ 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 4444 of file wifi-phy-reception-test.cc.

References ns3::Object::Dispose(), m_rxPhy, and m_txPhy.

+ Here is the call graph for this function:

◆ 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 4353 of file wifi-phy-reception-test.cc.

References m_countRxDropped, m_lastRxDropped, ns3::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 4345 of file wifi-phy-reception-test.cc.

References m_countRxFailure, m_lastRxFailed, ns3::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 4334 of file wifi-phy-reception-test.cc.

References m_countRxSuccess, m_lastRxSucceeded, ns3::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 ( uint16_t  centerFreqMhz,
uint16_t  bandwidthMhz 
)
private

Function to create a PPDU.

Parameters
centerFreqMhzthe center frequency used for the transmission of the PPDU (in MHz)
bandwidthMhzthe bandwidth used for the transmission of the PPDU (in MHz)

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

References ns3::WifiPhy::CalculateTxDuration(), ns3::DbmToW(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhy::GetPhyBand(), ns3::WifiPsdu::GetSize(), m_rxPhy, m_txPhy, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::SpectrumWifiPhy::StartRx(), 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 4278 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 4277 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 4276 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 4282 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 4281 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 4280 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 4284 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 4285 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: