UL-OFDMA PHY test. More...
Public Member Functions | |
TestUlOfdmaPhyTransmission () | |
virtual | ~TestUlOfdmaPhyTransmission () |
![]() | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
Private Member Functions | |
void | CheckNonOfdmaRxPower (Ptr< OfdmaSpectrumWifiPhy > phy, WifiSpectrumBand band, double expectedRxPower) |
Check the received power for the non-OFDMA of the HE TB PPDUs over the given band. More... | |
void | CheckOfdmaRxPower (Ptr< OfdmaSpectrumWifiPhy > phy, WifiSpectrumBand band, double expectedRxPower) |
Check the received power for the OFDMA part of the HE TB PPDUs over the given band. More... | |
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 (void) override |
Implementation to actually run this TestCase. More... | |
void | DoSetup (void) override |
Implementation to do any local setup required for this TestCase. More... | |
void | DoTeardown (void) override |
Implementation to do any local setup required for this TestCase. More... | |
void | GenerateInterference (Ptr< SpectrumValue > interferencePsd, Time duration) |
Generate interference function. More... | |
WifiTxVector | GetTxVectorForHeTbPpdu (uint16_t txStaId, std::size_t index, uint8_t bssColor) const |
Get TXVECTOR for HE TB PPDU. More... | |
void | LogScenario (std::string log) const |
Log scenario description. More... | |
void | Reset () |
Reset function. More... | |
void | RunOne () |
Run one function. More... | |
void | RxFailure (Ptr< WifiPsdu > psdu) |
Receive failure function. More... | |
void | RxSuccess (Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Receive success function. More... | |
void | SchedulePowerMeasurementChecks (Time delay, double rxPowerNonOfdmaRu1, double rxPowerNonOfdmaRu2, double rxPowerOfdmaRu1, double rxPowerOfdmaRu2) |
Schedule power measurement related checks. More... | |
void | ScheduleTest (Time delay, bool solicited, WifiPhyState expectedStateAtEnd, uint32_t expectedSuccessFromSta1, uint32_t expectedFailuresFromSta1, uint32_t expectedBytesFromSta1, uint32_t expectedSuccessFromSta2, uint32_t expectedFailuresFromSta2, uint32_t expectedBytesFromSta2, bool scheduleTxSta1=true, WifiPhyState expectedStateBeforeEnd=WifiPhyState::RX) |
Schedule test to perform. More... | |
void | SendHeSuPpdu (uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor) |
Send HE SU PPDU function. More... | |
void | SendHeTbPpdu (uint16_t txStaId, std::size_t index, std::size_t payloadSize, uint64_t uid, uint8_t bssColor) |
Send HE TB PPDU function. More... | |
void | SetBssColor (Ptr< WifiPhy > phy, uint8_t bssColor) |
Set the BSS color. More... | |
void | SetPsdLimit (Ptr< WifiPhy > phy, double psdLimit) |
Set the PSD limit. More... | |
void | StopInterference (void) |
Stop interference function. More... | |
void | VerifyEventsCleared (void) |
Verify all events are cleared at end of TX or RX. More... | |
Private Attributes | |
uint16_t | m_channelWidth |
channel width in MHz More... | |
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... | |
Time | m_expectedPpduDuration |
expected duration to send MU PPDU More... | |
uint16_t | m_frequency |
frequency in MHz More... | |
Ptr< OfdmaSpectrumWifiPhy > | m_phyAp |
PHY of AP. More... | |
Ptr< WaveformGenerator > | m_phyInterferer |
PHY of interferer. More... | |
Ptr< OfdmaSpectrumWifiPhy > | m_phySta1 |
PHY of STA 1. More... | |
Ptr< OfdmaSpectrumWifiPhy > | m_phySta2 |
PHY of STA 2. More... | |
Ptr< OfdmaSpectrumWifiPhy > | m_phySta3 |
PHY of STA 3. More... | |
Additional Inherited Members | |
![]() | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) 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 (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) 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... | |
UL-OFDMA PHY test.
Definition at line 1634 of file wifi-phy-ofdma-test.cc.
TestUlOfdmaPhyTransmission::TestUlOfdmaPhyTransmission | ( | ) |
Definition at line 1825 of file wifi-phy-ofdma-test.cc.
|
virtual |
Definition at line 1977 of file wifi-phy-ofdma-test.cc.
|
private |
Check the received power for the non-OFDMA of the HE TB PPDUs over the given band.
phy | the PHY |
band | the WifiSpectrumBand over which the power is measured |
expectedRxPower | the expected received power in W |
Definition at line 2028 of file wifi-phy-ofdma-test.cc.
References ns3::Now(), NS_ASSERT, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ_TOL, and third::phy.
Referenced by SchedulePowerMeasurementChecks().
|
private |
Check the received power for the OFDMA part of the HE TB PPDUs over the given band.
phy | the PHY |
band | the WifiSpectrumBand over which the power is measured |
expectedRxPower | the expected received power in W |
The current event cannot be used since it points to the preamble part of the HE TB PPDU. We will have to check if the expected power is indeed the max power returning a positive duration when calling GetEnergyDuration.
Definition at line 2039 of file wifi-phy-ofdma-test.cc.
References ns3::Now(), NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and third::phy.
Referenced by SchedulePowerMeasurementChecks().
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 2071 of file wifi-phy-ofdma-test.cc.
References DoCheckPhyState(), and third::phy.
Referenced by RunOne(), and ScheduleTest().
|
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 2012 of file wifi-phy-ofdma-test.cc.
References m_countRxBytesFromSta1, m_countRxFailureFromSta1, m_countRxSuccessFromSta1, and NS_TEST_ASSERT_MSG_EQ.
Referenced by ScheduleTest().
|
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 2020 of file wifi-phy-ofdma-test.cc.
References m_countRxBytesFromSta2, m_countRxFailureFromSta2, m_countRxSuccessFromSta2, and NS_TEST_ASSERT_MSG_EQ.
Referenced by ScheduleTest().
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 2078 of file wifi-phy-ofdma-test.cc.
References ns3::PointerValue::Get(), ns3::Now(), NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, and third::phy.
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 2748 of file wifi-phy-ofdma-test.cc.
References m_channelWidth, m_expectedPpduDuration, m_frequency, ns3::NanoSeconds(), NS_LOG_DEBUG, and RunOne().
|
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 2120 of file wifi-phy-ofdma-test.cc.
References ns3::Node::AddDevice(), ns3::Object::AggregateObject(), ns3::SpectrumWifiPhy::ConfigureStandardAndBand(), ns3::SpectrumWifiPhy::CreateWifiSpectrumPhyInterface(), m_frequency, m_phyAp, m_phyInterferer, m_phySta1, m_phySta2, m_phySta3, ns3::MakeCallback(), third::phy, RxFailure(), RxSuccess(), ns3::SpectrumWifiPhy::SetChannel(), ns3::WaveformGenerator::SetChannel(), ns3::WifiPhy::SetDevice(), ns3::WaveformGenerator::SetDevice(), ns3::WaveformGenerator::SetDutyCycle(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiNetDevice::SetHeConfiguration(), ns3::WifiNetDevice::SetMac(), ns3::WifiPhy::SetMobility(), ns3::WifiNetDevice::SetPhy(), ns3::WifiPhy::SetPreambleDetectionModel(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PHY_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 2222 of file wifi-phy-ofdma-test.cc.
References ns3::Object::Dispose(), m_phyAp, m_phyInterferer, m_phySta1, m_phySta2, and m_phySta3.
|
private |
Generate interference function.
interferencePsd | the PSD of the interference to be generated |
duration | the duration of the interference |
Definition at line 1962 of file wifi-phy-ofdma-test.cc.
References m_phyInterferer, NS_LOG_FUNCTION, ns3::WaveformGenerator::SetPeriod(), ns3::WaveformGenerator::SetTxPowerSpectralDensity(), ns3::WaveformGenerator::Start(), and StopInterference().
Referenced by RunOne().
|
private |
Get TXVECTOR for HE TB PPDU.
txStaId | the ID of the TX STA |
index | the RU index used for the transmission |
bssColor | the BSS color of the TX STA |
Definition at line 1881 of file wifi-phy-ofdma-test.cc.
References m_channelWidth, NS_ASSERT_MSG, ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::HeRu::RuSpec::SetPhyIndex(), ns3::WifiTxVector::SetRu(), and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by SchedulePowerMeasurementChecks(), and SendHeTbPpdu().
|
private |
Log scenario description.
log | the scenario description to add to log |
Definition at line 2237 of file wifi-phy-ofdma-test.cc.
References NS_LOG_INFO.
Referenced by RunOne().
|
private |
Reset function.
Definition at line 2090 of file wifi-phy-ofdma-test.cc.
References m_countRxBytesFromSta1, m_countRxBytesFromSta2, m_countRxFailureFromSta1, m_countRxFailureFromSta2, m_countRxSuccessFromSta1, m_countRxSuccessFromSta2, m_phyAp, m_phySta1, m_phySta2, SetBssColor(), OfdmaSpectrumWifiPhy::SetPpduUid(), and OfdmaSpectrumWifiPhy::SetTriggerFrameUid().
Referenced by RunOne(), and ScheduleTest().
|
private |
Run one function.
In all the following tests, 2 HE TB PPDUs of the same UL MU transmission are sent on RU 1 for STA 1 and RU 2 for STA 2. The difference between solicited and unsolicited lies in that their PPDU ID correspond to the one of the immediately preceding HE SU PPDU (thus mimicing trigger frame reception).
Definition at line 2359 of file wifi-phy-ofdma-test.cc.
References ns3::WifiPhy::AssignStreams(), CCA_BUSY, CheckPhyState(), ns3::DbmToW(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, GenerateInterference(), IDLE, LogScenario(), m_channelWidth, m_expectedPpduDuration, m_frequency, m_phyAp, m_phySta1, m_phySta2, m_phySta3, ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::NanoSeconds(), Reset(), RX, SchedulePowerMeasurementChecks(), ScheduleTest(), ns3::Seconds(), SendHeSuPpdu(), SendHeTbPpdu(), SetBssColor(), ns3::SpectrumWifiPhy::SetChannelWidth(), ns3::SpectrumWifiPhy::SetFrequency(), SetPsdLimit(), and VerifyEventsCleared().
Referenced by DoRun().
Receive failure function.
psdu | the PSDU |
Definition at line 1998 of file wifi-phy-ofdma-test.cc.
References ns3::WifiPsdu::GetAddr2(), 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 1982 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().
|
private |
Schedule power measurement related checks.
delay | the reference delay used to schedule the events |
rxPowerNonOfdmaRu1 | the received power (in watts) on the non-OFDMA part of RU1 |
rxPowerNonOfdmaRu2 | the received power (in watts) on the non-OFDMA part of RU2 |
rxPowerOfdmaRu1 | the received power (in watts) on RU1 |
rxPowerOfdmaRu2 | the received power (in watts) on RU2 |
Perform checks at AP
Perform checks for non-transmitting STA (STA 3). Cannot use CheckNonOfdmaRxPower method since current event may be reset if preamble not detected (e.g. not on primary).
Perform checks for transmitting STA (STA 2) to ensure it has correctly logged power received from other transmitting STA (STA 1). Cannot use CheckNonOfdmaRxPower method since current event not set.
Definition at line 2277 of file wifi-phy-ofdma-test.cc.
References CheckNonOfdmaRxPower(), CheckOfdmaRxPower(), OfdmaSpectrumWifiPhy::GetHePhy(), GetTxVectorForHeTbPpdu(), m_channelWidth, m_expectedPpduDuration, m_phyAp, m_phySta2, m_phySta3, ns3::NanoSeconds(), and NS_ASSERT.
Referenced by RunOne().
|
private |
Schedule test to perform.
The interference generation should be scheduled apart.
delay | the reference delay to schedule the events |
solicited | flag indicating if HE TB PPDUs were solicited by the AP |
expectedStateAtEnd | the expected state of the PHY at the end of the reception |
expectedSuccessFromSta1 | the expected number of success from STA 1 |
expectedFailuresFromSta1 | the expected number of failures from STA 1 |
expectedBytesFromSta1 | the expected number of bytes from STA 1 |
expectedSuccessFromSta2 | the expected number of success from STA 2 |
expectedFailuresFromSta2 | the expected number of failures from STA 2 |
expectedBytesFromSta2 | the expected number of bytes from STA 2 |
scheduleTxSta1 | flag indicating to schedule a HE TB PPDU from STA 1 |
expectedStateBeforeEnd | the expected state of the PHY before the end of the transmission |
Definition at line 2243 of file wifi-phy-ofdma-test.cc.
References CheckPhyState(), CheckRxFromSta1(), CheckRxFromSta2(), m_expectedPpduDuration, m_phyAp, ns3::MilliSeconds(), ns3::NanoSeconds(), Reset(), SendHeSuPpdu(), SendHeTbPpdu(), and VerifyEventsCleared().
Referenced by RunOne().
|
private |
Send HE SU PPDU function.
txStaId | the ID of the TX STA |
payloadSize | the size of the payload in bytes |
uid | the UID of the trigger frame that is initiating this transmission |
bssColor | the BSS color of the TX STA |
Definition at line 1840 of file wifi-phy-ofdma-test.cc.
References m_channelWidth, m_phyAp, m_phySta1, m_phySta2, m_phySta3, NS_LOG_FUNCTION, third::phy, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), SU_STA_ID, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by RunOne(), and ScheduleTest().
|
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 |
uid | the UID of the trigger frame that is initiating this transmission |
bssColor | the BSS color of the TX STA |
Definition at line 1922 of file wifi-phy-ofdma-test.cc.
References ns3::WifiPsdu::GetSize(), GetTxVectorForHeTbPpdu(), m_phySta1, m_phySta2, m_phySta3, NS_LOG_FUNCTION, third::phy, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiTxVector::SetLength(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_QOSDATA.
Referenced by RunOne(), and ScheduleTest().
Set the BSS color.
phy | the PHY |
bssColor | the BSS color |
Definition at line 2105 of file wifi-phy-ofdma-test.cc.
References ns3::WifiNetDevice::GetHeConfiguration(), and third::phy.
Referenced by Reset(), and RunOne().
Set the PSD limit.
phy | the PHY |
psdLimit | the PSD limit in dBm/MHz |
Definition at line 2113 of file wifi-phy-ofdma-test.cc.
References NS_LOG_FUNCTION, and third::phy.
Referenced by RunOne().
|
private |
Stop interference function.
Definition at line 1972 of file wifi-phy-ofdma-test.cc.
References m_phyInterferer, and ns3::WaveformGenerator::Stop().
Referenced by GenerateInterference().
|
private |
Verify all events are cleared at end of TX or RX.
Definition at line 2063 of file wifi-phy-ofdma-test.cc.
References OfdmaSpectrumWifiPhy::GetCurrentEvent(), m_phyAp, m_phySta1, m_phySta2, and NS_TEST_ASSERT_MSG_EQ.
Referenced by RunOne(), and ScheduleTest().
|
private |
channel width in MHz
Definition at line 1821 of file wifi-phy-ofdma-test.cc.
Referenced by DoRun(), GetTxVectorForHeTbPpdu(), RunOne(), SchedulePowerMeasurementChecks(), and SendHeSuPpdu().
|
private |
count RX bytes from STA 1
Definition at line 1817 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta1(), Reset(), and RxSuccess().
|
private |
count RX bytes from STA 2
Definition at line 1818 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta2(), Reset(), and RxSuccess().
|
private |
count RX failure from STA 1
Definition at line 1815 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta1(), Reset(), and RxFailure().
|
private |
count RX failure from STA 2
Definition at line 1816 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta2(), Reset(), and RxFailure().
|
private |
count RX success from STA 1
Definition at line 1813 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta1(), Reset(), and RxSuccess().
|
private |
count RX success from STA 2
Definition at line 1814 of file wifi-phy-ofdma-test.cc.
Referenced by CheckRxFromSta2(), Reset(), and RxSuccess().
|
private |
expected duration to send MU PPDU
Definition at line 1822 of file wifi-phy-ofdma-test.cc.
Referenced by DoRun(), RunOne(), SchedulePowerMeasurementChecks(), and ScheduleTest().
|
private |
frequency in MHz
Definition at line 1820 of file wifi-phy-ofdma-test.cc.
|
private |
PHY of AP.
Definition at line 1806 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), RunOne(), SchedulePowerMeasurementChecks(), ScheduleTest(), SendHeSuPpdu(), and VerifyEventsCleared().
|
private |
PHY of interferer.
Definition at line 1811 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), GenerateInterference(), and StopInterference().
|
private |
PHY of STA 1.
Definition at line 1807 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), RunOne(), SendHeSuPpdu(), SendHeTbPpdu(), and VerifyEventsCleared().
|
private |
PHY of STA 2.
Definition at line 1808 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), RunOne(), SchedulePowerMeasurementChecks(), SendHeSuPpdu(), SendHeTbPpdu(), and VerifyEventsCleared().
|
private |
PHY of STA 3.
Definition at line 1809 of file wifi-phy-ofdma-test.cc.
Referenced by DoSetup(), DoTeardown(), RunOne(), SchedulePowerMeasurementChecks(), SendHeSuPpdu(), and SendHeTbPpdu().