A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
TestUlMuMimoPhyTransmission Class Reference

UL MU-MIMO PHY test. More...

+ Inheritance diagram for TestUlMuMimoPhyTransmission:
+ Collaboration diagram for TestUlMuMimoPhyTransmission:

Public Member Functions

 TestUlMuMimoPhyTransmission ()
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (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

uint16_t m_channelWidth
 channel width in MHz
 
std::vector< uint32_tm_countRxBytesFromStas
 count RX bytes from STAs
 
std::vector< uint32_tm_countRxFailureFromStas
 count RX failure from STAs
 
std::vector< uint32_tm_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
 
uint16_t m_frequency
 frequency in MHz
 
Ptr< MuMimoSpectrumWifiPhym_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...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto 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.
 
TestCaseGetParent () 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.
 

Detailed Description

UL MU-MIMO PHY test.

Definition at line 1127 of file wifi-phy-mu-mimo-test.cc.

Constructor & Destructor Documentation

◆ TestUlMuMimoPhyTransmission()

TestUlMuMimoPhyTransmission::TestUlMuMimoPhyTransmission ( )

Definition at line 1271 of file wifi-phy-mu-mimo-test.cc.

Member Function Documentation

◆ CheckPhyState()

void TestUlMuMimoPhyTransmission::CheckPhyState ( Ptr< MuMimoSpectrumWifiPhy phy,
WifiPhyState  expectedState 
)
private

Check the PHY state.

Parameters
phythe PHY
expectedStatethe expected state of the PHY

Definition at line 1489 of file wifi-phy-mu-mimo-test.cc.

References DoCheckPhyState(), and ns3::Simulator::ScheduleNow().

Referenced by ScheduleTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckRxFromSta()

void TestUlMuMimoPhyTransmission::CheckRxFromSta ( uint16_t  staId,
uint32_t  expectedSuccess,
uint32_t  expectedFailures,
uint32_t  expectedBytes 
)
private

Check the received PSDUs from a given STA.

Parameters
staIdthe ID of the STA to check
expectedSuccessthe expected number of success
expectedFailuresthe expected number of failures
expectedBytesthe 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().

+ Here is the caller graph for this function:

◆ DoCheckPhyState()

void TestUlMuMimoPhyTransmission::DoCheckPhyState ( Ptr< MuMimoSpectrumWifiPhy phy,
WifiPhyState  expectedState 
)
private

Check the PHY state.

Parameters
phythe PHY
expectedStatethe expected state of the PHY

Definition at line 1498 of file wifi-phy-mu-mimo-test.cc.

References ns3::PointerValue::Get(), ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by CheckPhyState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRun()

void TestUlMuMimoPhyTransmission::DoRun ( )
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 ns3::Simulator::Destroy(), m_channelWidth, m_delayStart, m_expectedPpduDuration, m_frequency, ns3::NanoSeconds(), NS_LOG_DEBUG, and RunOne().

+ Here is the call graph for this function:

◆ DoSetup()

void TestUlMuMimoPhyTransmission::DoSetup ( )
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::WifiPhy::ConfigureStandard(), 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.

+ Here is the call graph for this function:

◆ DoTeardown()

void TestUlMuMimoPhyTransmission::DoTeardown ( )
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.

◆ GetTxVectorForHeTbPpdu()

WifiTxVector TestUlMuMimoPhyTransmission::GetTxVectorForHeTbPpdu ( uint16_t  txStaId,
uint8_t  nss,
uint8_t  bssColor 
) const
private

Get TXVECTOR for HE TB PPDU.

Parameters
txStaIdthe ID of the TX STA
nssthe number of spatial streams used for the transmission
bssColorthe BSS color of the TX STA
Returns
the TXVECTOR for HE TB PPDU

Definition at line 1323 of file wifi-phy-mu-mimo-test.cc.

References ns3::HePhy::GetHeMcs7(), ns3::HeRu::GetRuType(), m_channelWidth, ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetNss(), ns3::WifiTxVector::SetRu(), and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by SendHeTbPpdu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LogScenario()

void TestUlMuMimoPhyTransmission::LogScenario ( const std::string &  log) const
private

Log scenario description.

Parameters
logthe 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().

+ Here is the caller graph for this function:

◆ Reset()

void TestUlMuMimoPhyTransmission::Reset ( )
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, and SetBssColor().

Referenced by RunOne(), and ScheduleTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RunOne()

void TestUlMuMimoPhyTransmission::RunOne ( )
private

Run one function.

Definition at line 1696 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RxFailure()

void TestUlMuMimoPhyTransmission::RxFailure ( Ptr< const WifiPsdu psdu)
private

Receive failure function.

Parameters
psduthe PSDU

Definition at line 1437 of file wifi-phy-mu-mimo-test.cc.

References m_countRxFailureFromStas, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ RxSuccess()

void TestUlMuMimoPhyTransmission::RxSuccess ( Ptr< const WifiPsdu psdu,
RxSignalInfo  rxSignalInfo,
WifiTxVector  txVector,
std::vector< bool >  statusPerMpdu 
)
private

Receive success function.

Parameters
psduthe PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorthe transmit vector
statusPerMpdureception status per MPDU

Definition at line 1416 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ScheduleTest()

void TestUlMuMimoPhyTransmission::ScheduleTest ( Time  delay,
const std::vector< uint16_t > &  txStaIds,
WifiPhyState  expectedStateAtEnd,
const std::vector< std::tuple< uint32_t, uint32_t, uint32_t > > &  expectedCountersPerSta 
)
private

Schedule test to perform.

The interference generation should be scheduled apart.

Parameters
delaythe reference delay to schedule the events
txStaIdsthe IDs of the STAs planned to transmit an HE TB PPDU
expectedStateAtEndthe expected state of the PHY at the end of the reception
expectedCountersPerStathe 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(), ns3::Simulator::Schedule(), SendHeSuPpdu(), SendHeTbPpdu(), SetTrigVector(), and VerifyEventsCleared().

Referenced by RunOne().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendHeSuPpdu()

void TestUlMuMimoPhyTransmission::SendHeSuPpdu ( uint16_t  txStaId,
std::size_t  payloadSize,
uint64_t  uid,
uint8_t  bssColor 
)
private

Send HE SU PPDU function.

Parameters
txStaIdthe ID of the TX STA
payloadSizethe size of the payload in bytes
uidthe UID of the trigger frame that is initiating this transmission
bssColorthe BSS color of the TX STA

Definition at line 1284 of file wifi-phy-mu-mimo-test.cc.

References ns3::HePhy::GetHeMcs7(), m_channelWidth, m_phyAp, m_phyStas, 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendHeTbPpdu()

void TestUlMuMimoPhyTransmission::SendHeTbPpdu ( uint16_t  txStaId,
uint8_t  nss,
std::size_t  payloadSize,
uint64_t  uid,
uint8_t  bssColor 
)
private

Send HE TB PPDU function.

Parameters
txStaIdthe ID of the TX STA
nssthe number of spatial streams used for the transmission
payloadSizethe size of the payload in bytes
uidthe UID of the trigger frame that is initiating this transmission
bssColorthe BSS color of the TX STA

Definition at line 1383 of file wifi-phy-mu-mimo-test.cc.

References ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetBssColor()

void TestUlMuMimoPhyTransmission::SetBssColor ( Ptr< WifiPhy phy,
uint8_t  bssColor 
)
private

Set the BSS color.

Parameters
phythe PHY
bssColorthe BSS color

Definition at line 1537 of file wifi-phy-mu-mimo-test.cc.

Referenced by Reset().

+ Here is the caller graph for this function:

◆ SetTrigVector()

void TestUlMuMimoPhyTransmission::SetTrigVector ( const std::vector< uint16_t > &  staIds,
uint8_t  bssColor 
)
private

Set TRIGVECTOR for HE TB PPDU.

Parameters
staIdsthe IDs of the STAs sollicited for the HE TB transmission
bssColorthe BSS color of the TX STA

Definition at line 1349 of file wifi-phy-mu-mimo-test.cc.

References ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::HePhy::GetHeMcs7(), ns3::WifiPhy::GetPhyBand(), ns3::WifiPhy::GetPhyEntity(), ns3::HeRu::GetRuType(), 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerifyEventsCleared()

void TestUlMuMimoPhyTransmission::VerifyEventsCleared ( )
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, and NS_TEST_ASSERT_MSG_EQ.

Referenced by ScheduleTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelWidth

uint16_t TestUlMuMimoPhyTransmission::m_channelWidth
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().

◆ m_countRxBytesFromStas

std::vector<uint32_t> TestUlMuMimoPhyTransmission::m_countRxBytesFromStas
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().

◆ m_countRxFailureFromStas

std::vector<uint32_t> TestUlMuMimoPhyTransmission::m_countRxFailureFromStas
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().

◆ m_countRxSuccessFromStas

std::vector<uint32_t> TestUlMuMimoPhyTransmission::m_countRxSuccessFromStas
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().

◆ m_delayStart

Time TestUlMuMimoPhyTransmission::m_delayStart
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().

◆ m_expectedPpduDuration

Time TestUlMuMimoPhyTransmission::m_expectedPpduDuration
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().

◆ m_frequency

uint16_t TestUlMuMimoPhyTransmission::m_frequency
private

frequency in MHz

Definition at line 1266 of file wifi-phy-mu-mimo-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_phyAp

Ptr<MuMimoSpectrumWifiPhy> TestUlMuMimoPhyTransmission::m_phyAp
private

◆ m_phyStas

std::vector<Ptr<MuMimoSpectrumWifiPhy> > TestUlMuMimoPhyTransmission::m_phyStas
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().


The documentation for this class was generated from the following file: