UL MU-MIMO PHY test. More...
Public Member Functions | |
TestUlMuMimoPhyTransmission () | |
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< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState) |
Check the PHY state. | |
void | CheckRxFromSta (uint16_t staId, uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes) |
Check the received PSDUs from a given STA. | |
void | DoCheckPhyState (Ptr< MuMimoSpectrumWifiPhy > 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. | |
WifiTxVector | GetTxVectorForHeTbPpdu (uint16_t txStaId, uint8_t nss, uint8_t bssColor) const |
Get TXVECTOR for HE TB PPDU. | |
void | LogScenario (const 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, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Receive success function. | |
void | ScheduleTest (Time delay, const std::vector< uint16_t > &txStaIds, WifiPhyState expectedStateAtEnd, const std::vector< std::tuple< uint32_t, uint32_t, uint32_t > > &expectedCountersPerSta) |
Schedule test to perform. | |
void | SendHeSuPpdu (uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor) |
Send HE SU PPDU function. | |
void | SendHeTbPpdu (uint16_t txStaId, uint8_t nss, std::size_t payloadSize, uint64_t uid, uint8_t bssColor) |
Send HE TB PPDU function. | |
void | SetBssColor (Ptr< WifiPhy > phy, uint8_t bssColor) |
Set the BSS color. | |
void | SetTrigVector (const std::vector< uint16_t > &staIds, uint8_t bssColor) |
Set TRIGVECTOR for HE TB PPDU. | |
void | VerifyEventsCleared () |
Verify all events are cleared at end of TX or RX. | |
Private Attributes | |
MHz_u | m_channelWidth |
channel width | |
std::vector< uint32_t > | m_countRxBytesFromStas |
count RX bytes from STAs | |
std::vector< uint32_t > | m_countRxFailureFromStas |
count RX failure from STAs | |
std::vector< uint32_t > | m_countRxSuccessFromStas |
count RX success from STAs | |
Time | m_delayStart |
delay between the start of each HE TB PPDUs | |
Time | m_expectedPpduDuration |
expected duration to send MU PPDU | |
MHz_u | m_frequency |
frequency | |
Ptr< MuMimoSpectrumWifiPhy > | m_phyAp |
PHY of AP. | |
std::vector< Ptr< MuMimoSpectrumWifiPhy > > | m_phyStas |
PHYs of STAs. | |
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. | |
UL MU-MIMO PHY test.
Definition at line 1119 of file wifi-phy-mu-mimo-test.cc.
TestUlMuMimoPhyTransmission::TestUlMuMimoPhyTransmission | ( | ) |
Definition at line 1263 of file wifi-phy-mu-mimo-test.cc.
|
private |
Check the PHY state.
phy | the PHY |
expectedState | the expected state of the PHY |
Definition at line 1481 of file wifi-phy-mu-mimo-test.cc.
References DoCheckPhyState(), and ns3::Simulator::ScheduleNow().
Referenced by ScheduleTest().
|
private |
Check the received PSDUs from a given STA.
staId | the ID of the STA to check |
expectedSuccess | the expected number of success |
expectedFailures | the expected number of failures |
expectedBytes | the expected number of bytes |
Definition at line 1445 of file wifi-phy-mu-mimo-test.cc.
References m_countRxBytesFromStas, m_countRxFailureFromStas, m_countRxSuccessFromStas, NS_LOG_FUNCTION, 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 1490 of file wifi-phy-mu-mimo-test.cc.
References ns3::DynamicCast(), ns3::PointerValue::Get(), 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 1801 of file wifi-phy-mu-mimo-test.cc.
References ns3::Simulator::Destroy(), m_channelWidth, m_delayStart, 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 1537 of file wifi-phy-mu-mimo-test.cc.
References ns3::SpectrumWifiPhy::AddChannel(), ns3::WifiPhy::ConfigureStandard(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), m_countRxBytesFromStas, m_countRxFailureFromStas, m_countRxSuccessFromStas, m_phyAp, m_phyStas, ns3::MakeCallback(), RxFailure(), RxSuccess(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), 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 1599 of file wifi-phy-mu-mimo-test.cc.
References m_phyStas.
|
private |
Get TXVECTOR for HE TB PPDU.
txStaId | the ID of the TX STA |
nss | the number of spatial streams used for the transmission |
bssColor | the BSS color of the TX STA |
Definition at line 1315 of file wifi-phy-mu-mimo-test.cc.
References ns3::HePhy::GetHeMcs7(), ns3::HeRu::GetRuType(), m_channelWidth, ns3::NanoSeconds(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetRu(), and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by SendHeTbPpdu().
|
private |
Log scenario description.
log | the scenario description to add to log |
Definition at line 1609 of file wifi-phy-mu-mimo-test.cc.
References NS_LOG_INFO.
Referenced by RunOne().
|
private |
Reset function.
Definition at line 1506 of file wifi-phy-mu-mimo-test.cc.
References m_countRxBytesFromStas, m_countRxFailureFromStas, m_countRxSuccessFromStas, m_phyAp, m_phyStas, and SetBssColor().
Referenced by RunOne(), and ScheduleTest().
|
private |
Run one function.
Definition at line 1690 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiPhy::AssignStreams(), ns3::WifiPhyOperatingChannel::FindFirst(), LogScenario(), m_channelWidth, m_frequency, m_phyAp, m_phyStas, ns3::MicroSeconds(), ns3::NanoSeconds(), Reset(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ScheduleTest(), ns3::Seconds(), SendHeSuPpdu(), ns3::WifiPhy::SetOperatingChannel(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
Referenced by DoRun().
Receive failure function.
psdu | the PSDU |
Definition at line 1429 of file wifi-phy-mu-mimo-test.cc.
References m_countRxFailureFromStas, 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 1408 of file wifi-phy-mu-mimo-test.cc.
References m_countRxBytesFromStas, m_countRxSuccessFromStas, NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_EQ, ns3::RatioToDb(), and ns3::RxSignalInfo::snr.
Referenced by DoSetup().
|
private |
Schedule test to perform.
The interference generation should be scheduled apart.
delay | the reference delay to schedule the events |
txStaIds | the IDs of the STAs planned to transmit an HE TB PPDU |
expectedStateAtEnd | the expected state of the PHY at the end of the reception |
expectedCountersPerSta | the expected counters per STA |
Definition at line 1615 of file wifi-phy-mu-mimo-test.cc.
References CheckPhyState(), CheckRxFromSta(), m_delayStart, m_expectedPpduDuration, m_phyAp, ns3::MilliSeconds(), ns3::NanoSeconds(), Reset(), ns3::Simulator::Schedule(), SendHeSuPpdu(), SendHeTbPpdu(), SetTrigVector(), 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 1276 of file wifi-phy-mu-mimo-test.cc.
References ns3::Create(), ns3::HePhy::GetHeMcs7(), m_channelWidth, m_phyAp, m_phyStas, 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, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by RunOne(), and ScheduleTest().
|
private |
Send HE TB PPDU function.
txStaId | the ID of the TX STA |
nss | the number of spatial streams 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 1375 of file wifi-phy-mu-mimo-test.cc.
References ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Create(), GetTxVectorForHeTbPpdu(), m_phyStas, NS_LOG_FUNCTION, 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 ScheduleTest().
Set the BSS color.
phy | the PHY |
bssColor | the BSS color |
Definition at line 1529 of file wifi-phy-mu-mimo-test.cc.
References ns3::DynamicCast().
Referenced by Reset().
|
private |
Set TRIGVECTOR for HE TB PPDU.
staIds | the IDs of the STAs sollicited for the HE TB transmission |
bssColor | the BSS color of the TX STA |
Definition at line 1341 of file wifi-phy-mu-mimo-test.cc.
References ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::DynamicCast(), ns3::HePhy::GetHeMcs7(), ns3::WifiPhy::GetPhyBand(), ns3::WifiPhy::GetPhyEntity(), ns3::HeRu::GetRuType(), m_channelWidth, m_expectedPpduDuration, m_phyAp, ns3::NanoSeconds(), ns3::WifiTxVector::SetLength(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetRu(), ns3::WIFI_MOD_CLASS_HE, and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by ScheduleTest().
|
private |
Verify all events are cleared at end of TX or RX.
Definition at line 1465 of file wifi-phy-mu-mimo-test.cc.
References MuMimoSpectrumWifiPhy::GetCurrentEvent(), m_phyAp, m_phyStas, and NS_TEST_ASSERT_MSG_EQ.
Referenced by ScheduleTest().
|
private |
channel width
Definition at line 1259 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoRun(), GetTxVectorForHeTbPpdu(), RunOne(), SendHeSuPpdu(), and SetTrigVector().
|
private |
count RX bytes from STAs
Definition at line 1255 of file wifi-phy-mu-mimo-test.cc.
Referenced by CheckRxFromSta(), DoSetup(), Reset(), and RxSuccess().
|
private |
count RX failure from STAs
Definition at line 1254 of file wifi-phy-mu-mimo-test.cc.
Referenced by CheckRxFromSta(), DoSetup(), Reset(), and RxFailure().
|
private |
count RX success from STAs
Definition at line 1253 of file wifi-phy-mu-mimo-test.cc.
Referenced by CheckRxFromSta(), DoSetup(), Reset(), and RxSuccess().
|
private |
delay between the start of each HE TB PPDUs
Definition at line 1257 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoRun(), and ScheduleTest().
|
private |
expected duration to send MU PPDU
Definition at line 1260 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoRun(), ScheduleTest(), and SetTrigVector().
|
private |
frequency
Definition at line 1258 of file wifi-phy-mu-mimo-test.cc.
|
private |
PHY of AP.
Definition at line 1250 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoSetup(), Reset(), RunOne(), ScheduleTest(), SendHeSuPpdu(), SetTrigVector(), and VerifyEventsCleared().
|
private |
PHYs of STAs.
Definition at line 1251 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), RunOne(), SendHeSuPpdu(), SendHeTbPpdu(), and VerifyEventsCleared().