A Discrete-Event Network Simulator
API
TestNonHtDuplicatePhyReception Class Reference

non-HT duplicate PHY reception test The test consists in an AP sending a single non-HT duplicate PPDU of a given channel width (multiple of 20 MHz) over a spectrum channel and it checks whether the STAs attached to the channel receive the PPDU. More...

+ Inheritance diagram for TestNonHtDuplicatePhyReception:
+ Collaboration diagram for TestNonHtDuplicatePhyReception:

Public Types

using StasParams = std::vector< std::tuple< WifiStandard, uint16_t, uint8_t > >
 A vector containing parameters per STA: the standard, the center frequency and the P20 index. More...
 
- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Public Member Functions

 TestNonHtDuplicatePhyReception (WifiStandard apStandard, uint16_t apFrequency, uint8_t apP20Index, StasParams stasParams, std::vector< bool > per20MhzInterference={})
 Constructor. More...
 
- 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 CheckResults (std::size_t index, uint32_t expectedRxSuccess, uint32_t expectedRxFailure)
 Check the 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 GenerateInterference (Ptr< WaveformGenerator > interferer, Ptr< SpectrumValue > interferencePsd, Time duration)
 Generate interference function. More...
 
void ResetResults ()
 Reset the results. More...
 
void RxFailure (std::size_t index, Ptr< const WifiPsdu > psdu)
 Receive failure function. More...
 
void RxSuccess (std::size_t index, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 Receive success function. More...
 
void SendNonHtDuplicatePpdu (uint16_t channelWidth)
 Send non-HT duplicate PPDU function. More...
 
void StopInterference (Ptr< WaveformGenerator > interferer)
 Stop interference function. More...
 

Private Attributes

uint16_t m_apFrequency
 the center frequency of the AP (in MHz) More...
 
uint8_t m_apP20Index
 the index of the primary 20 MHz channel of the AP More...
 
WifiStandard m_apStandard
 the standard to use for the AP More...
 
std::vector< uint32_t > m_countRxFailureStas
 count RX failure for STAs More...
 
std::vector< uint32_t > m_countRxSuccessStas
 count RX success for STAs More...
 
std::vector< bool > m_per20MhzInterference
 flags per 20 MHz subchannel whether an interference should be generated on that subchannel More...
 
Ptr< SpectrumWifiPhym_phyAp
 PHY of AP. More...
 
std::vector< Ptr< WaveformGenerator > > m_phyInterferers
 PHYs of interferers (1 interferer per 20 MHz subchannel) More...
 
std::vector< Ptr< SpectrumWifiPhy > > m_phyStas
 PHYs of STAs. More...
 
StasParams m_stasParams
 the parameters of the STAs More...
 

Additional Inherited Members

- 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

non-HT duplicate PHY reception test The test consists in an AP sending a single non-HT duplicate PPDU of a given channel width (multiple of 20 MHz) over a spectrum channel and it checks whether the STAs attached to the channel receive the PPDU.

If an interference is injected on a given 20 MHz subchannel, the payload reception should fail, otherwise it should succeed.

Definition at line 201 of file wifi-non-ht-dup-test.cc.

Member Typedef Documentation

◆ StasParams

using TestNonHtDuplicatePhyReception::StasParams = std::vector<std::tuple<WifiStandard, uint16_t, uint8_t> >

A vector containing parameters per STA: the standard, the center frequency and the P20 index.

Definition at line 205 of file wifi-non-ht-dup-test.cc.

Constructor & Destructor Documentation

◆ TestNonHtDuplicatePhyReception()

TestNonHtDuplicatePhyReception::TestNonHtDuplicatePhyReception ( WifiStandard  apStandard,
uint16_t  apFrequency,
uint8_t  apP20Index,
StasParams  stasParams,
std::vector< bool >  per20MhzInterference = {} 
)

Constructor.

Parameters
apStandardthe standard to use for the AP
apFrequencythe center frequency of the AP (in MHz)
apP20Indexthe index of the primary 20 MHz channel of the AP
stasParamsthe parameters of the STAs (
See also
StasParams)
Parameters
per20MhzInterferenceflags per 20 MHz subchannel whether an interference should be generated on that subchannel. An empty vector means that the test will not generate any interference.

Definition at line 301 of file wifi-non-ht-dup-test.cc.

Member Function Documentation

◆ CheckResults()

void TestNonHtDuplicatePhyReception::CheckResults ( std::size_t  index,
uint32_t  expectedRxSuccess,
uint32_t  expectedRxFailure 
)
private

Check the results.

Parameters
indexindex of the RX STA
expectedRxSuccessthe expected number of RX success
expectedRxFailurethe expected number of RX failures

Definition at line 405 of file wifi-non-ht-dup-test.cc.

References m_countRxFailureStas, m_countRxSuccessStas, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

◆ DoSetup()

void TestNonHtDuplicatePhyReception::DoSetup ( )
overrideprivatevirtual

◆ DoTeardown()

void TestNonHtDuplicatePhyReception::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 496 of file wifi-non-ht-dup-test.cc.

References ns3::Object::Dispose(), m_phyAp, m_phyInterferers, and m_phyStas.

+ Here is the call graph for this function:

◆ GenerateInterference()

void TestNonHtDuplicatePhyReception::GenerateInterference ( Ptr< WaveformGenerator interferer,
Ptr< SpectrumValue interferencePsd,
Time  duration 
)
private

Generate interference function.

Parameters
interfererthe PHY of the interferer to use to generate the signal
interferencePsdthe PSD of the interference to be generated
durationthe duration of the interference

Definition at line 360 of file wifi-non-ht-dup-test.cc.

References NS_LOG_FUNCTION, 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:

◆ ResetResults()

void TestNonHtDuplicatePhyReception::ResetResults ( )
private

Reset the results.

Definition at line 320 of file wifi-non-ht-dup-test.cc.

References m_countRxFailureStas, and m_countRxSuccessStas.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RxFailure()

void TestNonHtDuplicatePhyReception::RxFailure ( std::size_t  index,
Ptr< const WifiPsdu psdu 
)
private

Receive failure function.

Parameters
indexindex of the RX STA
psduthe PSDU

Definition at line 398 of file wifi-non-ht-dup-test.cc.

References m_countRxFailureStas, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ RxSuccess()

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

Receive success function.

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

Definition at line 382 of file wifi-non-ht-dup-test.cc.

References ns3::WifiPhy::GetChannelWidth(), ns3::WifiTxVector::GetChannelWidth(), m_countRxSuccessStas, m_phyAp, m_phyStas, min, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoSetup().

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

◆ SendNonHtDuplicatePpdu()

void TestNonHtDuplicatePhyReception::SendNonHtDuplicatePpdu ( uint16_t  channelWidth)
private

Send non-HT duplicate PPDU function.

Parameters
channelWidththe channel width to use to transmit the non-HT PPDU (in MHz)

Definition at line 333 of file wifi-non-ht-dup-test.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::WifiPhy::GetPhyBand(), ns3::WifiPsdu::GetSize(), m_phyAp, NS_LOG_FUNCTION, ns3::WifiPhy::Send(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::SU_STA_ID, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_LONG.

Referenced by DoRun().

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

◆ StopInterference()

void TestNonHtDuplicatePhyReception::StopInterference ( Ptr< WaveformGenerator interferer)
private

Stop interference function.

Parameters
interfererthe PHY of the interferer that was used to generate the signal

Definition at line 375 of file wifi-non-ht-dup-test.cc.

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

Referenced by GenerateInterference().

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

Member Data Documentation

◆ m_apFrequency

uint16_t TestNonHtDuplicatePhyReception::m_apFrequency
private

the center frequency of the AP (in MHz)

Definition at line 284 of file wifi-non-ht-dup-test.cc.

Referenced by DoRun(), and DoSetup().

◆ m_apP20Index

uint8_t TestNonHtDuplicatePhyReception::m_apP20Index
private

the index of the primary 20 MHz channel of the AP

Definition at line 285 of file wifi-non-ht-dup-test.cc.

Referenced by DoRun().

◆ m_apStandard

WifiStandard TestNonHtDuplicatePhyReception::m_apStandard
private

the standard to use for the AP

Definition at line 283 of file wifi-non-ht-dup-test.cc.

Referenced by DoRun(), and DoSetup().

◆ m_countRxFailureStas

std::vector<uint32_t> TestNonHtDuplicatePhyReception::m_countRxFailureStas
private

count RX failure for STAs

Definition at line 292 of file wifi-non-ht-dup-test.cc.

Referenced by CheckResults(), DoSetup(), ResetResults(), and RxFailure().

◆ m_countRxSuccessStas

std::vector<uint32_t> TestNonHtDuplicatePhyReception::m_countRxSuccessStas
private

count RX success for STAs

Definition at line 291 of file wifi-non-ht-dup-test.cc.

Referenced by CheckResults(), DoSetup(), ResetResults(), and RxSuccess().

◆ m_per20MhzInterference

std::vector<bool> TestNonHtDuplicatePhyReception::m_per20MhzInterference
private

flags per 20 MHz subchannel whether an interference should be generated on that subchannel

Definition at line 288 of file wifi-non-ht-dup-test.cc.

Referenced by DoRun(), and DoSetup().

◆ m_phyAp

Ptr<SpectrumWifiPhy> TestNonHtDuplicatePhyReception::m_phyAp
private

PHY of AP.

Definition at line 294 of file wifi-non-ht-dup-test.cc.

Referenced by DoRun(), DoSetup(), DoTeardown(), RxSuccess(), and SendNonHtDuplicatePpdu().

◆ m_phyInterferers

std::vector<Ptr<WaveformGenerator> > TestNonHtDuplicatePhyReception::m_phyInterferers
private

PHYs of interferers (1 interferer per 20 MHz subchannel)

Definition at line 298 of file wifi-non-ht-dup-test.cc.

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

◆ m_phyStas

std::vector<Ptr<SpectrumWifiPhy> > TestNonHtDuplicatePhyReception::m_phyStas
private

PHYs of STAs.

Definition at line 295 of file wifi-non-ht-dup-test.cc.

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

◆ m_stasParams

StasParams TestNonHtDuplicatePhyReception::m_stasParams
private

the parameters of the STAs

Definition at line 286 of file wifi-non-ht-dup-test.cc.

Referenced by DoRun(), and DoSetup().


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