UL-OFDMA PHY test. More...
Public Types | |
enum | TrigVectorInfo { NONE = 0 , CHANNEL_WIDTH , UL_LENGTH , AID } |
Erroneous info included in a TRIGVECTOR. More... | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Public Member Functions | |
TestUlOfdmaPhyTransmission () | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckApRxEnd (uint32_t expectedNotifications, Time expectedLastNotification, bool expectedSuccess) |
Check the the number of RX end notifications at the AP as well as the last time a RX end has been notified. | |
void | CheckApRxStart (uint32_t expectedNotifications, Time expectedLastNotification) |
Check the the number of RX start notifications at the AP as well as the last time a RX start has been notified. | |
void | CheckNonOfdmaRxPower (Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > phy, WifiSpectrumBandInfo band, Watt_u expectedRxPower) |
Check the received power for the non-OFDMA of the HE TB PPDUs over the given band. | |
void | CheckOfdmaRxPower (Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > phy, WifiSpectrumBandInfo band, Watt_u expectedRxPower) |
Check the received power for the OFDMA part of the HE TB PPDUs over the given band. | |
void | CheckPhyState (Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > 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< LatestPhyEntityType > > 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. | |
WifiTxVector | GetTxVectorForTbPpdu (uint16_t txStaId, std::size_t index, uint8_t bssColor) const |
Get TXVECTOR for HE PPDU. | |
void | LogScenario (std::string log) const |
Log scenario description. | |
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, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu) |
Receive success function. | |
void | SchedulePowerMeasurementChecks (Time delay, Watt_u rxPowerNonOfdmaRu1, Watt_u rxPowerNonOfdmaRu2, Watt_u rxPowerOfdmaRu1, Watt_u rxPowerOfdmaRu2) |
Schedule power measurement related checks. | |
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, Time ulTimeDifference=Seconds(0), WifiPhyState expectedStateBeforeEnd=WifiPhyState::RX, TrigVectorInfo error=NONE) |
Schedule test to perform. | |
void | SendSuPpdu (uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor) |
Send HE SU PPDU function. | |
void | SendTbPpdu (uint16_t txStaId, std::size_t index, std::size_t payloadSize, uint64_t uid, uint8_t bssColor, bool incrementUid) |
Send HE TB PPDU function. | |
void | SetBssColor (Ptr< WifiPhy > phy, uint8_t bssColor) |
Set the BSS color. | |
void | SetPsdLimit (Ptr< WifiPhy > phy, dBm_per_MHz_u psdLimit) |
Set the PSD limit. | |
void | SetTrigVector (uint8_t bssColor, TrigVectorInfo error) |
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 | |
std::shared_ptr< OfdmaTestPhyListener > | m_apPhyStateListener |
listener for AP PHY state transitions | |
MHz_u | m_channelWidth {DEFAULT_CHANNEL_WIDTH} |
channel width | |
uint32_t | m_countRxBytesFromSta1 {0} |
count RX bytes from STA 1 | |
uint32_t | m_countRxBytesFromSta2 {0} |
count RX bytes from STA 2 | |
uint32_t | m_countRxFailureFromSta1 {0} |
count RX failure from STA 1 | |
uint32_t | m_countRxFailureFromSta2 {0} |
count RX failure from STA 2 | |
uint32_t | m_countRxSuccessFromSta1 {0} |
count RX success from STA 1 | |
uint32_t | m_countRxSuccessFromSta2 {0} |
count RX success from STA 2 | |
Time | m_expectedPpduDuration |
expected duration to send MU PPDU | |
MHz_u | m_frequency {DEFAULT_FREQUENCY} |
frequency | |
WifiModulationClass | m_modClass |
the modulation class to consider for the test | |
Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > | m_phyAp |
PHY of AP. | |
Ptr< WaveformGenerator > | m_phyInterferer |
PHY of interferer. | |
Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > | m_phySta1 |
PHY of STA 1. | |
Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > | m_phySta2 |
PHY of STA 2. | |
Ptr< OfdmaSpectrumWifiPhy< LatestPhyEntityType > > | m_phySta3 |
PHY of STA 3. | |
Additional Inherited Members | |
![]() | |
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 |
![]() | |
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. | |
UL-OFDMA PHY test.
Definition at line 3194 of file wifi-phy-ofdma-test.cc.
enum TestUlOfdmaPhyTransmission::TrigVectorInfo |
Erroneous info included in a TRIGVECTOR.
Enumerator | |
---|---|
NONE | |
CHANNEL_WIDTH | |
UL_LENGTH | |
AID |
Definition at line 3200 of file wifi-phy-ofdma-test.cc.
TestUlOfdmaPhyTransmission< LatestPhyEntityType >::TestUlOfdmaPhyTransmission | ( | ) |
Definition at line 3461 of file wifi-phy-ofdma-test.cc.
|
private |
Check the the number of RX end notifications at the AP as well as the last time a RX end has been notified.
expectedNotifications | the expected number of RX end notifications at the AP |
expectedLastNotification | the expected time of the last RX end notification at the AP |
expectedSuccess | true if the last RX notification indicates a success, false otherwise |
Definition at line 3973 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.
|
private |
Check the the number of RX start notifications at the AP as well as the last time a RX start has been notified.
expectedNotifications | the expected number of RX start notifications at the AP |
expectedLastNotification | the expected time of the last RX start notification at the AP |
Definition at line 3954 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.
|
private |
Check the received power for the non-OFDMA of the HE TB PPDUs over the given band.
phy | the PHY |
band | the indices of the band over which the power is measured |
expectedRxPower | the expected received power |
Definition at line 3850 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ_TOL.
|
private |
Check the received power for the OFDMA part of the HE TB PPDUs over the given band.
phy | the PHY |
band | the indices of the band over which the power is measured |
expectedRxPower | the expected received power |
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 3870 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 3922 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::ScheduleNow().
|
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 3814 of file wifi-phy-ofdma-test.cc.
References NS_TEST_ASSERT_MSG_EQ.
|
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 3832 of file wifi-phy-ofdma-test.cc.
References NS_TEST_ASSERT_MSG_EQ.
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 3936 of file wifi-phy-ofdma-test.cc.
References ns3::DynamicCast(), ns3::PointerValue::Get(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 5099 of file wifi-phy-ofdma-test.cc.
References ns3::Simulator::Destroy(), ns3::NanoSeconds(), and ns3::WIFI_MOD_CLASS_EHT.
|
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 4034 of file wifi-phy-ofdma-test.cc.
References ns3::CreateObject(), ns3::CreateObjectWithAttributes(), ns3::MakeCallback(), ns3::WIFI_MOD_CLASS_EHT, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_STANDARD_80211ax, and ns3::WIFI_STANDARD_80211be.
|
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 4186 of file wifi-phy-ofdma-test.cc.
|
private |
Generate interference function.
interferencePsd | the PSD of the interference to be generated |
duration | the duration of the interference |
Definition at line 3756 of file wifi-phy-ofdma-test.cc.
References NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
|
private |
Get TXVECTOR for HE 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 3532 of file wifi-phy-ofdma-test.cc.
References ns3::EhtPhy::GetEhtMcs7(), ns3::HePhy::GetHeMcs7(), ns3::EhtRu::GetIndexIn80MHzSegment(), ns3::HeRu::GetIndexIn80MHzSegment(), ns3::HeRu::GetPrimary80MHzFlag(), ns3::EhtRu::GetPrimaryFlags(), ns3::NanoSeconds(), NS_ASSERT_MSG, ns3::WIFI_MOD_CLASS_EHT, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_PREAMBLE_EHT_TB, and ns3::WIFI_PREAMBLE_HE_TB.
|
private |
Log scenario description.
log | the scenario description to add to log |
Definition at line 4202 of file wifi-phy-ofdma-test.cc.
References NS_LOG_INFO.
|
private |
Reset function.
Definition at line 3999 of file wifi-phy-ofdma-test.cc.
|
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 mimicking trigger frame reception).
Definition at line 4481 of file wifi-phy-ofdma-test.cc.
References CHANNEL_WIDTH, ns3::Create(), ns3::DbmToW(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::WifiPhyOperatingChannel::FindFirst(), ns3::BandInfo::fl, ns3::MHzToHz(), ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::NanoSeconds(), NS_LOG_DEBUG, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_PHY_BAND_6GHZ, ns3::WIFI_STANDARD_80211ax, and ns3::WIFI_STANDARD_80211be.
|
private |
Receive failure function.
psdu | the PSDU |
Definition at line 3799 of file wifi-phy-ofdma-test.cc.
References NS_LOG_FUNCTION.
|
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 3778 of file wifi-phy-ofdma-test.cc.
References NS_LOG_FUNCTION.
|
private |
Schedule power measurement related checks.
delay | the reference delay used to schedule the events |
rxPowerNonOfdmaRu1 | the received power on the non-OFDMA part of RU1 |
rxPowerNonOfdmaRu2 | the received power on the non-OFDMA part of RU2 |
rxPowerOfdmaRu1 | the received power on RU1 |
rxPowerOfdmaRu2 | the received power 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 4341 of file wifi-phy-ofdma-test.cc.
References ns3::DynamicCast(), ns3::WifiPhy::GetPreambleDetectionDuration(), ns3::NanoSeconds(), NS_ASSERT, and ns3::Simulator::Schedule().
|
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 |
ulTimeDifference | delay between HE TB PPDU from STA 1 and HE TB PPDU from STA 2 are received |
expectedStateBeforeEnd | the expected state of the PHY before the end of the transmission |
error | the erroneous info (if any) in the TRIGVECTOR to set |
Definition at line 4209 of file wifi-phy-ofdma-test.cc.
References ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::NanoSeconds(), ns3::Simulator::Now(), OfdmaTestPhyListener::Reset(), and ns3::Simulator::Schedule().
|
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 3475 of file wifi-phy-ofdma-test.cc.
References ns3::Create(), ns3::EhtPhy::GetEhtMcs7(), ns3::HePhy::GetHeMcs7(), ns3::NanoSeconds(), NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::SU_STA_ID, ns3::WIFI_MAC_QOSDATA, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_PREAMBLE_EHT_MU, and ns3::WIFI_PREAMBLE_HE_SU.
|
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 |
incrementUid | whether UID shall be incremented |
Definition at line 3700 of file wifi-phy-ofdma-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Create(), NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_QOSDATA.
|
private |
Set the BSS color.
phy | the PHY |
bssColor | the BSS color |
Definition at line 4016 of file wifi-phy-ofdma-test.cc.
References ns3::DynamicCast().
|
private |
Set the PSD limit.
phy | the PHY |
psdLimit | the PSD limit |
Definition at line 4025 of file wifi-phy-ofdma-test.cc.
References NS_LOG_FUNCTION.
|
private |
Set TRIGVECTOR for HE TB PPDU.
bssColor | the BSS color of the TX STA |
error | the erroneous info (if any) in the TRIGVECTOR to set |
Definition at line 3610 of file wifi-phy-ofdma-test.cc.
References CHANNEL_WIDTH, ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::EhtPhy::GetEhtMcs7(), ns3::HePhy::GetHeMcs7(), ns3::GetMaximumChannelWidth(), ns3::NanoSeconds(), NS_ASSERT_MSG, ns3::WifiTxVector::SetLength(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetRu(), ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_PREAMBLE_EHT_TB, and ns3::WIFI_PREAMBLE_HE_TB.
|
private |
Stop interference function.
Definition at line 3771 of file wifi-phy-ofdma-test.cc.
|
private |
Verify all events are cleared at end of TX or RX.
Definition at line 3907 of file wifi-phy-ofdma-test.cc.
References NS_TEST_ASSERT_MSG_EQ.
|
private |
listener for AP PHY state transitions
Definition at line 3444 of file wifi-phy-ofdma-test.cc.
|
private |
channel width
Definition at line 3456 of file wifi-phy-ofdma-test.cc.
|
private |
count RX bytes from STA 1
Definition at line 3452 of file wifi-phy-ofdma-test.cc.
|
private |
count RX bytes from STA 2
Definition at line 3453 of file wifi-phy-ofdma-test.cc.
|
private |
count RX failure from STA 1
Definition at line 3450 of file wifi-phy-ofdma-test.cc.
|
private |
count RX failure from STA 2
Definition at line 3451 of file wifi-phy-ofdma-test.cc.
|
private |
count RX success from STA 1
Definition at line 3448 of file wifi-phy-ofdma-test.cc.
|
private |
count RX success from STA 2
Definition at line 3449 of file wifi-phy-ofdma-test.cc.
|
private |
expected duration to send MU PPDU
Definition at line 3457 of file wifi-phy-ofdma-test.cc.
|
private |
frequency
Definition at line 3455 of file wifi-phy-ofdma-test.cc.
|
private |
the modulation class to consider for the test
Definition at line 3436 of file wifi-phy-ofdma-test.cc.
|
private |
PHY of AP.
Definition at line 3438 of file wifi-phy-ofdma-test.cc.
|
private |
PHY of interferer.
Definition at line 3446 of file wifi-phy-ofdma-test.cc.
|
private |
PHY of STA 1.
Definition at line 3439 of file wifi-phy-ofdma-test.cc.
|
private |
PHY of STA 2.
Definition at line 3440 of file wifi-phy-ofdma-test.cc.
|
private |
PHY of STA 3.
Definition at line 3441 of file wifi-phy-ofdma-test.cc.