UL MU-MIMO PHY test. More...
Public Member Functions | |
TestUlMuMimoPhyTransmission () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckPhyState (Ptr< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState) |
Check the PHY state. More... | |
void | CheckRxFromSta (uint16_t staId, uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes) |
Check the received PSDUs from a given STA. More... | |
void | DoCheckPhyState (Ptr< MuMimoSpectrumWifiPhy > phy, WifiPhyState expectedState) |
Check the PHY state. More... | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
void | DoTeardown () override |
Implementation to do any local setup required for this TestCase. More... | |
WifiTxVector | GetTxVectorForHeTbPpdu (uint16_t txStaId, uint8_t nss, uint8_t bssColor) const |
Get TXVECTOR for HE TB PPDU. More... | |
void | LogScenario (const std::string &log) const |
Log scenario description. More... | |
void | Reset () |
Reset function. More... | |
void | RunOne () |
Run one function. More... | |
void | RxFailure (Ptr< const WifiPsdu > psdu) |
Receive failure function. More... | |
void | RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Receive success function. More... | |
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. 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, uint8_t nss, 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 | SetTrigVector (const std::vector< uint16_t > &staIds, uint8_t bssColor) |
Set TRIGVECTOR for HE TB PPDU. More... | |
void | VerifyEventsCleared () |
Verify all events are cleared at end of TX or RX. More... | |
Private Attributes | |
uint16_t | m_channelWidth |
channel width in MHz More... | |
std::vector< uint32_t > | m_countRxBytesFromStas |
count RX bytes from STAs More... | |
std::vector< uint32_t > | m_countRxFailureFromStas |
count RX failure from STAs More... | |
std::vector< uint32_t > | m_countRxSuccessFromStas |
count RX success from STAs More... | |
Time | m_delayStart |
delay between the start of each HE TB PPDUs More... | |
Time | m_expectedPpduDuration |
expected duration to send MU PPDU More... | |
uint16_t | m_frequency |
frequency in MHz More... | |
Ptr< MuMimoSpectrumWifiPhy > | m_phyAp |
PHY of AP. More... | |
std::vector< Ptr< MuMimoSpectrumWifiPhy > > | m_phyStas |
PHYs of STAs. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
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 TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () 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 () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () 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 MU-MIMO PHY test.
Definition at line 1127 of file wifi-phy-mu-mimo-test.cc.
TestUlMuMimoPhyTransmission::TestUlMuMimoPhyTransmission | ( | ) |
Definition at line 1271 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 1489 of file wifi-phy-mu-mimo-test.cc.
References DoCheckPhyState(), and third::phy.
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 1453 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 1498 of file wifi-phy-mu-mimo-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 1806 of file wifi-phy-mu-mimo-test.cc.
References 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 1545 of file wifi-phy-mu-mimo-test.cc.
References ns3::SpectrumWifiPhy::AddChannel(), ns3::Node::AddDevice(), ns3::WifiPhy::ConfigureStandard(), m_countRxBytesFromStas, m_countRxFailureFromStas, m_countRxSuccessFromStas, m_phyAp, m_phyStas, ns3::MakeCallback(), third::phy, RxFailure(), RxSuccess(), ns3::ObjectBase::SetAttribute(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiNetDevice::SetHeConfiguration(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiNetDevice::SetMac(), ns3::WifiNetDevice::SetPhy(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), ns3::WifiNetDevice::SetStandard(), 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 1605 of file wifi-phy-mu-mimo-test.cc.
References m_phyStas, and third::phy.
|
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 1323 of file wifi-phy-mu-mimo-test.cc.
References m_channelWidth, 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 1615 of file wifi-phy-mu-mimo-test.cc.
References NS_LOG_INFO.
Referenced by RunOne().
|
private |
Reset function.
Definition at line 1514 of file wifi-phy-mu-mimo-test.cc.
References m_countRxBytesFromStas, m_countRxFailureFromStas, m_countRxSuccessFromStas, m_phyAp, m_phyStas, third::phy, and SetBssColor().
Referenced by RunOne(), and ScheduleTest().
|
private |
Run one function.
Definition at line 1696 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiPhy::AssignStreams(), CCA_BUSY, IDLE, LogScenario(), m_channelWidth, m_frequency, m_phyAp, m_phyStas, ns3::MicroSeconds(), ns3::NanoSeconds(), third::phy, Reset(), ScheduleTest(), ns3::Seconds(), SendHeSuPpdu(), ns3::WifiPhy::SetOperatingChannel(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
Referenced by DoRun().
Receive failure function.
psdu | the PSDU |
Definition at line 1437 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiPsdu::GetAddr2(), 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 1416 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiPsdu::GetAddr2(), ns3::WifiPsdu::GetSize(), 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 1621 of file wifi-phy-mu-mimo-test.cc.
References CheckPhyState(), CheckRxFromSta(), m_delayStart, m_expectedPpduDuration, m_phyAp, ns3::MilliSeconds(), ns3::NanoSeconds(), Reset(), RX, 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 1284 of file wifi-phy-mu-mimo-test.cc.
References m_channelWidth, m_phyAp, m_phyStas, NS_LOG_FUNCTION, third::phy, 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 1383 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiPsdu::GetSize(), GetTxVectorForHeTbPpdu(), m_phyStas, 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 ScheduleTest().
Set the BSS color.
phy | the PHY |
bssColor | the BSS color |
Definition at line 1537 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiNetDevice::GetHeConfiguration(), and third::phy.
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 1349 of file wifi-phy-mu-mimo-test.cc.
References ns3::WifiPhy::GetPhyBand(), ns3::WifiPhy::GetPhyEntity(), m_channelWidth, m_expectedPpduDuration, m_phyAp, 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 1473 of file wifi-phy-mu-mimo-test.cc.
References MuMimoSpectrumWifiPhy::GetCurrentEvent(), m_phyAp, m_phyStas, NS_TEST_ASSERT_MSG_EQ, and third::phy.
Referenced by ScheduleTest().
|
private |
channel width in MHz
Definition at line 1267 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 1263 of file wifi-phy-mu-mimo-test.cc.
Referenced by CheckRxFromSta(), DoSetup(), Reset(), and RxSuccess().
|
private |
count RX failure from STAs
Definition at line 1262 of file wifi-phy-mu-mimo-test.cc.
Referenced by CheckRxFromSta(), DoSetup(), Reset(), and RxFailure().
|
private |
count RX success from STAs
Definition at line 1261 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 1265 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoRun(), and ScheduleTest().
|
private |
expected duration to send MU PPDU
Definition at line 1268 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoRun(), ScheduleTest(), and SetTrigVector().
|
private |
frequency in MHz
Definition at line 1266 of file wifi-phy-mu-mimo-test.cc.
|
private |
PHY of AP.
Definition at line 1258 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 1259 of file wifi-phy-mu-mimo-test.cc.
Referenced by DoSetup(), DoTeardown(), Reset(), RunOne(), SendHeSuPpdu(), SendHeTbPpdu(), and VerifyEventsCleared().