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...
Public Types | |
using | StasParams = std::vector<std::tuple<WifiStandard, MHz_u, uint8_t>> |
A vector containing parameters per STA: the standard, the center frequency and the P20 index. | |
Public Types inherited from ns3::TestCase | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
TestNonHtDuplicatePhyReception (WifiStandard apStandard, MHz_u apFrequency, uint8_t apP20Index, StasParams stasParams, std::vector< bool > per20MhzInterference={}) | |
Constructor. | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckResults (std::size_t index, uint32_t expectedRxSuccess, uint32_t expectedRxFailure) |
Check the 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 | GenerateInterference (Ptr< WaveformGenerator > interferer, Ptr< SpectrumValue > interferencePsd, Time duration) |
Generate interference function. | |
void | ResetResults () |
Reset the results. | |
void | RxFailure (std::size_t index, Ptr< const WifiPsdu > psdu) |
Receive failure function. | |
void | RxSuccess (std::size_t index, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Receive success function. | |
void | SendNonHtDuplicatePpdu (MHz_u channelWidth) |
Send non-HT duplicate PPDU function. | |
void | StopInterference (Ptr< WaveformGenerator > interferer) |
Stop interference function. | |
Private Attributes | |
MHz_u | m_apFrequency |
the center frequency of the AP | |
uint8_t | m_apP20Index |
the index of the primary 20 MHz channel of the AP | |
WifiStandard | m_apStandard |
the standard to use for the AP | |
std::vector< uint32_t > | m_countRxFailureStas |
count RX failure for STAs | |
std::vector< uint32_t > | m_countRxSuccessStas |
count RX success for STAs | |
std::vector< bool > | m_per20MhzInterference |
flags per 20 MHz subchannel whether an interference should be generated on that subchannel | |
Ptr< SpectrumWifiPhy > | m_phyAp |
PHY of AP. | |
std::vector< Ptr< WaveformGenerator > > | m_phyInterferers |
PHYs of interferers (1 interferer per 20 MHz subchannel) | |
std::vector< Ptr< SpectrumWifiPhy > > | m_phyStas |
PHYs of STAs. | |
StasParams | m_stasParams |
the parameters of the STAs | |
Additional Inherited Members | |
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. | |
TestCase * | GetParent () 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. | |
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 193 of file wifi-non-ht-dup-test.cc.
using TestNonHtDuplicatePhyReception::StasParams = std::vector<std::tuple<WifiStandard, MHz_u, uint8_t>> |
A vector containing parameters per STA: the standard, the center frequency and the P20 index.
Definition at line 197 of file wifi-non-ht-dup-test.cc.
TestNonHtDuplicatePhyReception::TestNonHtDuplicatePhyReception | ( | WifiStandard | apStandard, |
MHz_u | apFrequency, | ||
uint8_t | apP20Index, | ||
StasParams | stasParams, | ||
std::vector< bool > | per20MhzInterference = {} ) |
Constructor.
apStandard | the standard to use for the AP |
apFrequency | the center frequency of the AP |
apP20Index | the index of the primary 20 MHz channel of the AP |
stasParams | the parameters of the STAs ( |
per20MhzInterference | flags 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 293 of file wifi-non-ht-dup-test.cc.
|
private |
Check the results.
index | index of the RX STA |
expectedRxSuccess | the expected number of RX success |
expectedRxFailure | the expected number of RX failures |
Definition at line 397 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().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 505 of file wifi-non-ht-dup-test.cc.
References CheckResults(), ns3::Create(), ns3::Simulator::Destroy(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::WifiPhyOperatingChannel::FindFirst(), ns3::BandInfo::fl, GenerateInterference(), m_apFrequency, m_apP20Index, m_apStandard, m_per20MhzInterference, m_phyAp, m_phyInterferers, m_phyStas, m_stasParams, ResetResults(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendNonHtDuplicatePpdu(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and ns3::WIFI_PHY_BAND_5GHZ.
|
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 413 of file wifi-non-ht-dup-test.cc.
References ns3::CreateObject(), ns3::WifiPhyOperatingChannel::FindFirst(), m_apFrequency, m_apStandard, m_countRxFailureStas, m_countRxSuccessStas, m_per20MhzInterference, m_phyAp, m_phyInterferers, m_phyStas, m_stasParams, ns3::MakeCallback(), NS_ASSERT, RxFailure(), RxSuccess(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
|
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 488 of file wifi-non-ht-dup-test.cc.
References m_phyAp, m_phyInterferers, and m_phyStas.
|
private |
Generate interference function.
interferer | the PHY of the interferer to use to generate the signal |
interferencePsd | the PSD of the interference to be generated |
duration | the duration of the interference |
Definition at line 352 of file wifi-non-ht-dup-test.cc.
References NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and StopInterference().
Referenced by DoRun().
|
private |
Reset the results.
Definition at line 312 of file wifi-non-ht-dup-test.cc.
References m_countRxFailureStas, and m_countRxSuccessStas.
Referenced by DoRun().
|
private |
Receive failure function.
index | index of the RX STA |
psdu | the PSDU |
Definition at line 390 of file wifi-non-ht-dup-test.cc.
References m_countRxFailureStas, and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Receive success function.
index | index of the RX STA |
psdu | the PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | the transmit vector |
statusPerMpdu | reception status per MPDU |
Definition at line 374 of file wifi-non-ht-dup-test.cc.
References ns3::WifiTxVector::GetChannelWidth(), m_countRxSuccessStas, m_phyAp, m_phyStas, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoSetup().
|
private |
Send non-HT duplicate PPDU function.
channelWidth | the channel width to use to transmit the non-HT PPDU |
Definition at line 325 of file wifi-non-ht-dup-test.cc.
References ns3::Create(), ns3::OfdmPhy::GetOfdmRate24Mbps(), m_phyAp, ns3::NanoSeconds(), NS_LOG_FUNCTION, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::SU_STA_ID, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_LONG.
Referenced by DoRun().
|
private |
Stop interference function.
interferer | the PHY of the interferer that was used to generate the signal |
Definition at line 367 of file wifi-non-ht-dup-test.cc.
References NS_LOG_FUNCTION.
Referenced by GenerateInterference().
|
private |
the center frequency of the AP
Definition at line 276 of file wifi-non-ht-dup-test.cc.
|
private |
the index of the primary 20 MHz channel of the AP
Definition at line 277 of file wifi-non-ht-dup-test.cc.
Referenced by DoRun().
|
private |
the standard to use for the AP
Definition at line 275 of file wifi-non-ht-dup-test.cc.
|
private |
count RX failure for STAs
Definition at line 284 of file wifi-non-ht-dup-test.cc.
Referenced by CheckResults(), DoSetup(), ResetResults(), and RxFailure().
|
private |
count RX success for STAs
Definition at line 283 of file wifi-non-ht-dup-test.cc.
Referenced by CheckResults(), DoSetup(), ResetResults(), and RxSuccess().
|
private |
flags per 20 MHz subchannel whether an interference should be generated on that subchannel
Definition at line 280 of file wifi-non-ht-dup-test.cc.
|
private |
PHY of AP.
Definition at line 286 of file wifi-non-ht-dup-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), RxSuccess(), and SendNonHtDuplicatePpdu().
|
private |
PHYs of interferers (1 interferer per 20 MHz subchannel)
Definition at line 290 of file wifi-non-ht-dup-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
PHYs of STAs.
Definition at line 287 of file wifi-non-ht-dup-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), and RxSuccess().
|
private |
the parameters of the STAs
Definition at line 278 of file wifi-non-ht-dup-test.cc.