A Discrete-Event Network Simulator
API
TestPhyPaddingExclusion Class Reference

PHY padding exclusion test. More...

+ Inheritance diagram for TestPhyPaddingExclusion:
+ Collaboration diagram for TestPhyPaddingExclusion:

Public Member Functions

 TestPhyPaddingExclusion ()
 
 ~TestPhyPaddingExclusion () override
 
- 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 CheckPhyState (Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
 Check the PHY state. More...
 
void CheckRxFromSta1 (uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
 Check the received PSDUs from STA1. More...
 
void CheckRxFromSta2 (uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
 Check the received PSDUs from STA2. More...
 
void DoCheckPhyState (Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
 Check the PHY state. 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 GenerateInterference (Ptr< SpectrumValue > interferencePsd, Time duration)
 Generate interference function. More...
 
void Reset ()
 Reset function. More...
 
void RunOne ()
 Run one function. More...
 
void RxFailure (Ptr< const WifiPsdu > psdu)
 Receive failure function. More...
 
void RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 Receive success function. More...
 
void SendHeTbPpdu (uint16_t txStaId, std::size_t index, std::size_t payloadSize, Time txDuration)
 Send HE TB PPDU function. More...
 
void SetTrigVector (Time ppduDuration)
 Set TRIGVECTOR for HE TB PPDU. More...
 
void StopInterference ()
 Stop interference function. More...
 
void VerifyEventsCleared ()
 Verify all events are cleared at end of TX or RX. More...
 

Private Attributes

uint32_t m_countRxBytesFromSta1
 count RX bytes from STA 1 More...
 
uint32_t m_countRxBytesFromSta2
 count RX bytes from STA 2 More...
 
uint32_t m_countRxFailureFromSta1
 count RX failure from STA 1 More...
 
uint32_t m_countRxFailureFromSta2
 count RX failure from STA 2 More...
 
uint32_t m_countRxSuccessFromSta1
 count RX success from STA 1 More...
 
uint32_t m_countRxSuccessFromSta2
 count RX success from STA 2 More...
 
Ptr< OfdmaSpectrumWifiPhym_phyAp
 PHY of AP. More...
 
Ptr< WaveformGeneratorm_phyInterferer
 PHY of interferer. More...
 
Ptr< OfdmaSpectrumWifiPhym_phySta1
 PHY of STA 1. More...
 
Ptr< OfdmaSpectrumWifiPhym_phySta2
 PHY of STA 2. 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

PHY padding exclusion test.

Definition at line 4746 of file wifi-phy-ofdma-test.cc.

Constructor & Destructor Documentation

◆ TestPhyPaddingExclusion()

TestPhyPaddingExclusion::TestPhyPaddingExclusion ( )

Definition at line 4862 of file wifi-phy-ofdma-test.cc.

◆ ~TestPhyPaddingExclusion()

TestPhyPaddingExclusion::~TestPhyPaddingExclusion ( )
override

Definition at line 4942 of file wifi-phy-ofdma-test.cc.

Member Function Documentation

◆ CheckPhyState()

void TestPhyPaddingExclusion::CheckPhyState ( Ptr< OfdmaSpectrumWifiPhy phy,
WifiPhyState  expectedState 
)
private

Check the PHY state.

Parameters
phythe PHY
expectedStatethe expected state of the PHY

Definition at line 5028 of file wifi-phy-ofdma-test.cc.

References DoCheckPhyState(), and third::phy.

Referenced by DoRun().

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

◆ CheckRxFromSta1()

void TestPhyPaddingExclusion::CheckRxFromSta1 ( uint32_t  expectedSuccess,
uint32_t  expectedFailures,
uint32_t  expectedBytes 
)
private

Check the received PSDUs from STA1.

Parameters
expectedSuccessthe expected number of success
expectedFailuresthe expected number of failures
expectedBytesthe expected number of bytes

Definition at line 4980 of file wifi-phy-ofdma-test.cc.

References m_countRxBytesFromSta1, m_countRxFailureFromSta1, m_countRxSuccessFromSta1, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckRxFromSta2()

void TestPhyPaddingExclusion::CheckRxFromSta2 ( uint32_t  expectedSuccess,
uint32_t  expectedFailures,
uint32_t  expectedBytes 
)
private

Check the received PSDUs from STA2.

Parameters
expectedSuccessthe expected number of success
expectedFailuresthe expected number of failures
expectedBytesthe expected number of bytes

Definition at line 4997 of file wifi-phy-ofdma-test.cc.

References m_countRxBytesFromSta2, m_countRxFailureFromSta2, m_countRxSuccessFromSta2, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoCheckPhyState()

void TestPhyPaddingExclusion::DoCheckPhyState ( Ptr< OfdmaSpectrumWifiPhy phy,
WifiPhyState  expectedState 
)
private

Check the PHY state.

Parameters
phythe PHY
expectedStatethe expected state of the PHY

Definition at line 5036 of file wifi-phy-ofdma-test.cc.

References ns3::Now(), NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and third::phy.

Referenced by CheckPhyState().

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

◆ DoRun()

void TestPhyPaddingExclusion::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 5203 of file wifi-phy-ofdma-test.cc.

References CCA_BUSY, CheckPhyState(), CheckRxFromSta1(), CheckRxFromSta2(), DEFAULT_CHANNEL_WIDTH, DEFAULT_FREQUENCY, ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, GenerateInterference(), IDLE, m_phyAp, ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::NanoSeconds(), Reset(), RX, ns3::Seconds(), SendHeTbPpdu(), SetTrigVector(), and VerifyEventsCleared().

+ Here is the call graph for this function:

◆ DoSetup()

◆ DoTeardown()

void TestPhyPaddingExclusion::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 5162 of file wifi-phy-ofdma-test.cc.

References ns3::Object::Dispose(), m_phyAp, m_phyInterferer, m_phySta1, and m_phySta2.

+ Here is the call graph for this function:

◆ GenerateInterference()

void TestPhyPaddingExclusion::GenerateInterference ( Ptr< SpectrumValue interferencePsd,
Time  duration 
)
private

Generate interference function.

Parameters
interferencePsdthe PSD of the interference to be generated
durationthe duration of the interference

Definition at line 4928 of file wifi-phy-ofdma-test.cc.

References m_phyInterferer, ns3::WaveformGenerator::SetPeriod(), ns3::WaveformGenerator::SetTxPowerSpectralDensity(), ns3::WaveformGenerator::Start(), and StopInterference().

Referenced by DoRun().

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

◆ Reset()

void TestPhyPaddingExclusion::Reset ( )
private

Reset function.

Definition at line 5047 of file wifi-phy-ofdma-test.cc.

References m_countRxBytesFromSta1, m_countRxBytesFromSta2, m_countRxFailureFromSta1, m_countRxFailureFromSta2, m_countRxSuccessFromSta1, m_countRxSuccessFromSta2, m_phySta1, m_phySta2, OfdmaSpectrumWifiPhy::SetPpduUid(), and OfdmaSpectrumWifiPhy::SetTriggerFrameUid().

Referenced by DoRun().

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

◆ RunOne()

void TestPhyPaddingExclusion::RunOne ( )
private

Run one function.

◆ RxFailure()

void TestPhyPaddingExclusion::RxFailure ( Ptr< const WifiPsdu psdu)
private

Receive failure function.

Parameters
psduthe PSDU

Definition at line 4966 of file wifi-phy-ofdma-test.cc.

References ns3::WifiPsdu::GetAddr2(), m_countRxFailureFromSta1, m_countRxFailureFromSta2, 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 TestPhyPaddingExclusion::RxSuccess ( Ptr< const WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector,
std::vector< bool >  statusPerMpdu 
)
private

Receive success function.

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

Definition at line 4947 of file wifi-phy-ofdma-test.cc.

References ns3::WifiPsdu::GetAddr2(), ns3::WifiPsdu::GetSize(), m_countRxBytesFromSta1, m_countRxBytesFromSta2, m_countRxSuccessFromSta1, m_countRxSuccessFromSta2, and NS_LOG_FUNCTION.

Referenced by DoSetup().

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

◆ SendHeTbPpdu()

void TestPhyPaddingExclusion::SendHeTbPpdu ( uint16_t  txStaId,
std::size_t  index,
std::size_t  payloadSize,
Time  txDuration 
)
private

Send HE TB PPDU function.

Parameters
txStaIdthe ID of the TX STA
indexthe RU index used for the transmission
payloadSizethe size of the payload in bytes
txDurationthe duration of the PPDU

Definition at line 4874 of file wifi-phy-ofdma-test.cc.

References DEFAULT_CHANNEL_WIDTH, m_phySta1, m_phySta2, third::phy, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiTxVector::SetLength(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiTxVector::SetRu(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by DoRun().

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

◆ SetTrigVector()

void TestPhyPaddingExclusion::SetTrigVector ( Time  ppduDuration)
private

Set TRIGVECTOR for HE TB PPDU.

Parameters
ppduDurationthe duration of the HE TB PPDU

Definition at line 5175 of file wifi-phy-ofdma-test.cc.

References DEFAULT_CHANNEL_WIDTH, ns3::WifiPhy::GetLatestPhyEntity(), ns3::WifiPhy::GetPhyBand(), m_phyAp, ns3::WifiTxVector::SetLength(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetRu(), and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by DoRun().

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

◆ StopInterference()

void TestPhyPaddingExclusion::StopInterference ( )
private

Stop interference function.

Definition at line 4937 of file wifi-phy-ofdma-test.cc.

References m_phyInterferer, and ns3::WaveformGenerator::Stop().

Referenced by GenerateInterference().

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

◆ VerifyEventsCleared()

void TestPhyPaddingExclusion::VerifyEventsCleared ( )
private

Verify all events are cleared at end of TX or RX.

Definition at line 5014 of file wifi-phy-ofdma-test.cc.

References OfdmaSpectrumWifiPhy::GetCurrentEvent(), m_phyAp, m_phySta1, m_phySta2, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

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

Member Data Documentation

◆ m_countRxBytesFromSta1

uint32_t TestPhyPaddingExclusion::m_countRxBytesFromSta1
private

count RX bytes from STA 1

Definition at line 4858 of file wifi-phy-ofdma-test.cc.

Referenced by CheckRxFromSta1(), Reset(), and RxSuccess().

◆ m_countRxBytesFromSta2

uint32_t TestPhyPaddingExclusion::m_countRxBytesFromSta2
private

count RX bytes from STA 2

Definition at line 4859 of file wifi-phy-ofdma-test.cc.

Referenced by CheckRxFromSta2(), Reset(), and RxSuccess().

◆ m_countRxFailureFromSta1

uint32_t TestPhyPaddingExclusion::m_countRxFailureFromSta1
private

count RX failure from STA 1

Definition at line 4856 of file wifi-phy-ofdma-test.cc.

Referenced by CheckRxFromSta1(), Reset(), and RxFailure().

◆ m_countRxFailureFromSta2

uint32_t TestPhyPaddingExclusion::m_countRxFailureFromSta2
private

count RX failure from STA 2

Definition at line 4857 of file wifi-phy-ofdma-test.cc.

Referenced by CheckRxFromSta2(), Reset(), and RxFailure().

◆ m_countRxSuccessFromSta1

uint32_t TestPhyPaddingExclusion::m_countRxSuccessFromSta1
private

count RX success from STA 1

Definition at line 4854 of file wifi-phy-ofdma-test.cc.

Referenced by CheckRxFromSta1(), Reset(), and RxSuccess().

◆ m_countRxSuccessFromSta2

uint32_t TestPhyPaddingExclusion::m_countRxSuccessFromSta2
private

count RX success from STA 2

Definition at line 4855 of file wifi-phy-ofdma-test.cc.

Referenced by CheckRxFromSta2(), Reset(), and RxSuccess().

◆ m_phyAp

Ptr<OfdmaSpectrumWifiPhy> TestPhyPaddingExclusion::m_phyAp
private

PHY of AP.

Definition at line 4848 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), DoSetup(), DoTeardown(), SetTrigVector(), and VerifyEventsCleared().

◆ m_phyInterferer

Ptr<WaveformGenerator> TestPhyPaddingExclusion::m_phyInterferer
private

PHY of interferer.

Definition at line 4852 of file wifi-phy-ofdma-test.cc.

Referenced by DoSetup(), DoTeardown(), GenerateInterference(), and StopInterference().

◆ m_phySta1

Ptr<OfdmaSpectrumWifiPhy> TestPhyPaddingExclusion::m_phySta1
private

PHY of STA 1.

Definition at line 4849 of file wifi-phy-ofdma-test.cc.

Referenced by DoSetup(), DoTeardown(), Reset(), SendHeTbPpdu(), and VerifyEventsCleared().

◆ m_phySta2

Ptr<OfdmaSpectrumWifiPhy> TestPhyPaddingExclusion::m_phySta2
private

PHY of STA 2.

Definition at line 4850 of file wifi-phy-ofdma-test.cc.

Referenced by DoSetup(), DoTeardown(), Reset(), SendHeTbPpdu(), and VerifyEventsCleared().


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