PHY padding exclusion test. More...
Public Member Functions | |
TestPhyPaddingExclusion () | |
~TestPhyPaddingExclusion () override | |
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 | CheckPhyState (Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState) |
Check the PHY state. | |
void | CheckRxFromSta1 (uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes) |
Check the received PSDUs from STA1. | |
void | CheckRxFromSta2 (uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes) |
Check the received PSDUs from STA2. | |
void | DoCheckPhyState (Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState) |
Check the PHY state. | |
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< SpectrumValue > interferencePsd, Time duration) |
Generate interference function. | |
void | Reset () |
Reset function. | |
void | RunOne () |
Run one function. | |
void | RxFailure (Ptr< const WifiPsdu > psdu) |
Receive failure function. | |
void | RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Receive success function. | |
void | SendHeTbPpdu (uint16_t txStaId, std::size_t index, std::size_t payloadSize, Time txDuration) |
Send HE TB PPDU function. | |
void | SetTrigVector (Time ppduDuration) |
Set TRIGVECTOR for HE TB PPDU. | |
void | StopInterference () |
Stop interference function. | |
void | VerifyEventsCleared () |
Verify all events are cleared at end of TX or RX. | |
Private Attributes | |
uint32_t | m_countRxBytesFromSta1 |
count RX bytes from STA 1 | |
uint32_t | m_countRxBytesFromSta2 |
count RX bytes from STA 2 | |
uint32_t | m_countRxFailureFromSta1 |
count RX failure from STA 1 | |
uint32_t | m_countRxFailureFromSta2 |
count RX failure from STA 2 | |
uint32_t | m_countRxSuccessFromSta1 |
count RX success from STA 1 | |
uint32_t | m_countRxSuccessFromSta2 |
count RX success from STA 2 | |
Ptr< OfdmaSpectrumWifiPhy > | m_phyAp |
PHY of AP. | |
Ptr< WaveformGenerator > | m_phyInterferer |
PHY of interferer. | |
Ptr< OfdmaSpectrumWifiPhy > | m_phySta1 |
PHY of STA 1. | |
Ptr< OfdmaSpectrumWifiPhy > | m_phySta2 |
PHY of STA 2. | |
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. | |
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. | |
PHY padding exclusion test.
Definition at line 4746 of file wifi-phy-ofdma-test.cc.
TestPhyPaddingExclusion::TestPhyPaddingExclusion | ( | ) |
Definition at line 4862 of file wifi-phy-ofdma-test.cc.
|
override |
Definition at line 4942 of file wifi-phy-ofdma-test.cc.
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 5028 of file wifi-phy-ofdma-test.cc.
References DoCheckPhyState(), and ns3::Simulator::ScheduleNow().
Referenced by DoRun().
|
private |
Check the received PSDUs from STA1.
expectedSuccess | the expected number of success |
expectedFailures | the expected number of failures |
expectedBytes | the 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().
|
private |
Check the received PSDUs from STA2.
expectedSuccess | the expected number of success |
expectedFailures | the expected number of failures |
expectedBytes | the 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().
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 5036 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
Referenced by CheckPhyState().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 5206 of file wifi-phy-ofdma-test.cc.
References CheckPhyState(), CheckRxFromSta1(), CheckRxFromSta2(), ns3::Create(), DEFAULT_CHANNEL_WIDTH, DEFAULT_FREQUENCY, ns3::Simulator::Destroy(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, GenerateInterference(), m_phyAp, ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::NanoSeconds(), Reset(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendHeTbPpdu(), SetTrigVector(), and VerifyEventsCleared().
|
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 5061 of file wifi-phy-ofdma-test.cc.
References ns3::SpectrumWifiPhy::AddChannel(), ns3::WifiPhy::AssignStreams(), ns3::WifiPhy::ConfigureStandard(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), DEFAULT_CHANNEL_WIDTH, DEFAULT_FREQUENCY, ns3::WifiPhyOperatingChannel::FindFirst(), m_phyAp, m_phyInterferer, m_phySta1, m_phySta2, ns3::MakeCallback(), RxFailure(), RxSuccess(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetMobility(), ns3::WifiPhy::SetOperatingChannel(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), 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 5165 of file wifi-phy-ofdma-test.cc.
References ns3::Object::Dispose(), m_phyAp, m_phyInterferer, m_phySta1, and m_phySta2.
|
private |
Generate interference function.
interferencePsd | the PSD of the interference to be generated |
duration | the duration of the interference |
Definition at line 4928 of file wifi-phy-ofdma-test.cc.
References m_phyInterferer, ns3::Simulator::Schedule(), and StopInterference().
Referenced by DoRun().
|
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().
|
private |
Run one function.
Receive failure function.
psdu | the PSDU |
Definition at line 4966 of file wifi-phy-ofdma-test.cc.
References m_countRxFailureFromSta1, m_countRxFailureFromSta2, and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Receive success function.
psdu | the PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | the transmit vector |
statusPerMpdu | reception status per MPDU |
Definition at line 4947 of file wifi-phy-ofdma-test.cc.
References m_countRxBytesFromSta1, m_countRxBytesFromSta2, m_countRxSuccessFromSta1, m_countRxSuccessFromSta2, and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Send HE TB PPDU function.
txStaId | the ID of the TX STA |
index | the RU index used for the transmission |
payloadSize | the size of the payload in bytes |
txDuration | the duration of the PPDU |
Definition at line 4874 of file wifi-phy-ofdma-test.cc.
References ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Create(), DEFAULT_CHANNEL_WIDTH, ns3::HePhy::GetHeMcs7(), m_phySta1, m_phySta2, ns3::NanoSeconds(), ns3::HeRu::RU_106_TONE, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by DoRun().
|
private |
Set TRIGVECTOR for HE TB PPDU.
ppduDuration | the duration of the HE TB PPDU |
Definition at line 5178 of file wifi-phy-ofdma-test.cc.
References ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), DEFAULT_CHANNEL_WIDTH, ns3::DynamicCast(), ns3::HePhy::GetHeMcs7(), ns3::WifiPhy::GetLatestPhyEntity(), ns3::WifiPhy::GetPhyBand(), m_phyAp, ns3::NanoSeconds(), ns3::HeRu::RU_106_TONE, and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by DoRun().
|
private |
Stop interference function.
Definition at line 4937 of file wifi-phy-ofdma-test.cc.
References m_phyInterferer.
Referenced by GenerateInterference().
|
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().
|
private |
count RX bytes from STA 1
Definition at line 4858 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta1(), Reset(), and RxSuccess().
|
private |
count RX bytes from STA 2
Definition at line 4859 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta2(), Reset(), and RxSuccess().
|
private |
count RX failure from STA 1
Definition at line 4856 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta1(), Reset(), and RxFailure().
|
private |
count RX failure from STA 2
Definition at line 4857 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta2(), Reset(), and RxFailure().
|
private |
count RX success from STA 1
Definition at line 4854 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta1(), Reset(), and RxSuccess().
|
private |
count RX success from STA 2
Definition at line 4855 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta2(), Reset(), and RxSuccess().
|
private |
PHY of AP.
Definition at line 4848 of file wifi-phy-ofdma-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), SetTrigVector(), and VerifyEventsCleared().
|
private |
PHY of interferer.
Definition at line 4852 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), GenerateInterference(), and StopInterference().
|
private |
PHY of STA 1.
Definition at line 4849 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), SendHeTbPpdu(), and VerifyEventsCleared().
|
private |
PHY of STA 2.
Definition at line 4850 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), SendHeTbPpdu(), and VerifyEventsCleared().