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

UL-OFDMA power control test. More...

+ Inheritance diagram for TestUlOfdmaPowerControl:
+ Collaboration diagram for TestUlOfdmaPowerControl:

Public Member Functions

 TestUlOfdmaPowerControl ()
 
 ~TestUlOfdmaPowerControl () override
 
- 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 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 ReceiveOkCallbackAtAp (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 Receive OK callback function at AP.
 
void ReplaceReceiveOkCallbackOfAp ()
 Replace the AP's callback on its PHY's ReceiveOkCallback by the ReceiveOkCallbackAtAp method.
 
void RunOne (bool setupBa)
 Run one simulation with an optional BA session set up phase.
 
void SendMuBar (std::vector< uint16_t > staIds)
 Send a MU BAR through the AP to the STAs listed in the provided vector.
 
void SetupBa (Address destination)
 Send a QoS Data packet to the destination station in order to set up a block Ack session (so that the MU-BAR may have a reply).
 

Private Attributes

Ptr< WifiNetDevicem_apDev
 network device of AP
 
uint8_t m_bssColor
 BSS color.
 
Ptr< SpectrumWifiPhym_phyAp
 PHY of AP.
 
dBm_u m_requestedRssiSta1
 requested RSSI from STA 1 at AP for HE TB PPDUs
 
dBm_u m_requestedRssiSta2
 requested RSSI from STA 2 at AP for HE TB PPDUs
 
dBm_u m_rssiSta1
 expected RSSI from STA 1 at AP for HE TB PPDUs
 
dBm_u m_rssiSta2
 expected RSSI from STA 2 at AP for HE TB PPDUs
 
Ptr< WifiNetDevicem_sta1Dev
 network device of STA 1
 
Ptr< WifiNetDevicem_sta2Dev
 network device of STA 2
 
dB_u m_tol
 tolerance between received and expected RSSIs
 
dBm_u m_txPowerAp
 transmit power of AP
 
dBm_u m_txPowerEnd
 maximum transmission power for STAs
 
uint8_t m_txPowerLevels
 number of transmission power levels for STAs
 
dBm_u m_txPowerStart
 minimum transmission power for 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.
 
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-OFDMA power control test.

Definition at line 5332 of file wifi-phy-ofdma-test.cc.

Constructor & Destructor Documentation

◆ TestUlOfdmaPowerControl()

TestUlOfdmaPowerControl::TestUlOfdmaPowerControl ( )

Definition at line 5408 of file wifi-phy-ofdma-test.cc.

◆ ~TestUlOfdmaPowerControl()

TestUlOfdmaPowerControl::~TestUlOfdmaPowerControl ( )
override

Definition at line 5423 of file wifi-phy-ofdma-test.cc.

References m_apDev, m_phyAp, m_sta1Dev, and m_sta2Dev.

Member Function Documentation

◆ DoRun()

void TestUlOfdmaPowerControl::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 5758 of file wifi-phy-ofdma-test.cc.

References ns3::Simulator::Destroy(), m_requestedRssiSta1, m_requestedRssiSta2, m_rssiSta1, m_rssiSta2, m_txPowerAp, m_txPowerEnd, m_txPowerLevels, m_txPowerStart, and RunOne().

+ Here is the call graph for this function:

◆ DoSetup()

void TestUlOfdmaPowerControl::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 5595 of file wifi-phy-ofdma-test.cc.

References ns3::WifiHelper::AssignStreams(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NodeContainer::Get(), ns3::Object::GetObject(), m_apDev, m_bssColor, m_phyAp, m_sta1Dev, m_sta2Dev, ns3::MicroSeconds(), NS_ASSERT, ns3::WifiPhyHelper::Set(), ns3::SpectrumWifiPhyHelper::SetChannel(), ns3::WifiPhyHelper::SetErrorRateModel(), and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ DoTeardown()

void TestUlOfdmaPowerControl::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 5665 of file wifi-phy-ofdma-test.cc.

References m_apDev, m_phyAp, m_sta1Dev, and m_sta2Dev.

◆ ReceiveOkCallbackAtAp()

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

Receive OK callback function at AP.

This method will be plugged into the AP PHY's ReceiveOkCallback once the block Ack session has been set up. This is done in the Reset function.

Parameters
psduthe PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorthe TXVECTOR used for the packet
statusPerMpdureception status per MPDU

Definition at line 5552 of file wifi-phy-ofdma-test.cc.

References ns3::WifiTxVector::GetPreambleType(), m_rssiSta1, m_rssiSta2, m_sta1Dev, m_sta2Dev, m_tol, NS_ABORT_MSG, NS_ASSERT, NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_EQ_TOL, ns3::RxSignalInfo::rssi, ns3::WIFI_MAC_CTL_BACKRESP, and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by ReplaceReceiveOkCallbackOfAp().

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

◆ ReplaceReceiveOkCallbackOfAp()

void TestUlOfdmaPowerControl::ReplaceReceiveOkCallbackOfAp ( )
private

Replace the AP's callback on its PHY's ReceiveOkCallback by the ReceiveOkCallbackAtAp method.

Definition at line 5587 of file wifi-phy-ofdma-test.cc.

References m_phyAp, ns3::MakeCallback(), and ReceiveOkCallbackAtAp().

Referenced by RunOne().

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

◆ RunOne()

void TestUlOfdmaPowerControl::RunOne ( bool setupBa)
private

Run one simulation with an optional BA session set up phase.

Parameters
setupBatrue if BA session should be set up (i.e. upon first run), false otherwise

Definition at line 5678 of file wifi-phy-ofdma-test.cc.

References ns3::DynamicCast(), m_apDev, m_phyAp, m_sta1Dev, m_sta2Dev, m_txPowerAp, m_txPowerEnd, m_txPowerLevels, m_txPowerStart, ns3::MilliSeconds(), NS_ASSERT, ReplaceReceiveOkCallbackOfAp(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), SendMuBar(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), SetupBa(), and ns3::Simulator::Stop().

Referenced by DoRun().

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

◆ SendMuBar()

void TestUlOfdmaPowerControl::SendMuBar ( std::vector< uint16_t > staIds)
private

Send a MU BAR through the AP to the STAs listed in the provided vector.

Parameters
staIdsthe vector of STA-IDs of STAs to address the MU-BAR to

Definition at line 5440 of file wifi-phy-ofdma-test.cc.

References ns3::CtrlTriggerHeader::AddUserInfoField(), ns3::BlockAckReqType::COMPRESSED, ns3::BlockAckType::COMPRESSED, ns3::Mac48Address::ConvertFrom(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Create(), DEFAULT_CHANNEL_WIDTH, DEFAULT_WIFI_BAND, ns3::DynamicCast(), ns3::GetBlockAckSize(), ns3::Mac48Address::GetBroadcast(), ns3::HePhy::GetHeMcs7(), ns3::CtrlTriggerHeader::GetHeTbTxVector(), m_apDev, m_bssColor, m_phyAp, m_requestedRssiSta1, m_requestedRssiSta2, m_sta1Dev, m_sta2Dev, m_txPowerAp, ns3::MicroSeconds(), ns3::NanoSeconds(), NS_ABORT_MSG, NS_ASSERT, ns3::HeRu::RU_106_TONE, ns3::HeRu::RU_242_TONE, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::CtrlTriggerUserInfoField::SetAid12(), ns3::CtrlTriggerHeader::SetApTxPower(), ns3::CtrlTriggerHeader::SetCsRequired(), ns3::WifiMacHeader::SetDsFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::CtrlTriggerHeader::SetGiAndLtfType(), ns3::CtrlTriggerHeader::SetMoreTF(), ns3::CtrlTriggerUserInfoField::SetMuBarTriggerDepUserInfo(), ns3::WifiMacHeader::SetNoMoreFragments(), ns3::WifiMacHeader::SetNoRetry(), ns3::CtrlTriggerUserInfoField::SetRuAllocation(), ns3::CtrlTriggerUserInfoField::SetSsAllocation(), ns3::CtrlBAckRequestHeader::SetStartingSequence(), ns3::CtrlBAckRequestHeader::SetTidInfo(), ns3::CtrlBAckRequestHeader::SetType(), ns3::CtrlTriggerHeader::SetType(), ns3::WifiMacHeader::SetType(), ns3::CtrlTriggerHeader::SetUlBandwidth(), ns3::CtrlTriggerUserInfoField::SetUlDcm(), ns3::CtrlTriggerUserInfoField::SetUlFecCodingType(), ns3::CtrlTriggerHeader::SetUlLength(), ns3::CtrlTriggerUserInfoField::SetUlMcs(), ns3::CtrlTriggerHeader::SetUlSpatialReuse(), ns3::CtrlTriggerUserInfoField::SetUlTargetRssi(), ns3::SU_STA_ID, ns3::WIFI_MAC_CTL_TRIGGER, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by RunOne().

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

◆ SetupBa()

void TestUlOfdmaPowerControl::SetupBa ( Address destination)
private

Send a QoS Data packet to the destination station in order to set up a block Ack session (so that the MU-BAR may have a reply).

Parameters
destinationthe address of the destination station

Definition at line 5432 of file wifi-phy-ofdma-test.cc.

References ns3::Create(), and m_apDev.

Referenced by RunOne().

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

Member Data Documentation

◆ m_apDev

Ptr<WifiNetDevice> TestUlOfdmaPowerControl::m_apDev
private

network device of AP

Definition at line 5388 of file wifi-phy-ofdma-test.cc.

Referenced by ~TestUlOfdmaPowerControl(), DoSetup(), DoTeardown(), RunOne(), SendMuBar(), and SetupBa().

◆ m_bssColor

uint8_t TestUlOfdmaPowerControl::m_bssColor
private

BSS color.

Definition at line 5386 of file wifi-phy-ofdma-test.cc.

Referenced by DoSetup(), and SendMuBar().

◆ m_phyAp

Ptr<SpectrumWifiPhy> TestUlOfdmaPowerControl::m_phyAp
private

◆ m_requestedRssiSta1

dBm_u TestUlOfdmaPowerControl::m_requestedRssiSta1
private

requested RSSI from STA 1 at AP for HE TB PPDUs

Definition at line 5399 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and SendMuBar().

◆ m_requestedRssiSta2

dBm_u TestUlOfdmaPowerControl::m_requestedRssiSta2
private

requested RSSI from STA 2 at AP for HE TB PPDUs

Definition at line 5400 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and SendMuBar().

◆ m_rssiSta1

dBm_u TestUlOfdmaPowerControl::m_rssiSta1
private

expected RSSI from STA 1 at AP for HE TB PPDUs

Definition at line 5402 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and ReceiveOkCallbackAtAp().

◆ m_rssiSta2

dBm_u TestUlOfdmaPowerControl::m_rssiSta2
private

expected RSSI from STA 2 at AP for HE TB PPDUs

Definition at line 5403 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and ReceiveOkCallbackAtAp().

◆ m_sta1Dev

Ptr<WifiNetDevice> TestUlOfdmaPowerControl::m_sta1Dev
private

network device of STA 1

Definition at line 5389 of file wifi-phy-ofdma-test.cc.

Referenced by ~TestUlOfdmaPowerControl(), DoSetup(), DoTeardown(), ReceiveOkCallbackAtAp(), RunOne(), and SendMuBar().

◆ m_sta2Dev

Ptr<WifiNetDevice> TestUlOfdmaPowerControl::m_sta2Dev
private

network device of STA 2

Definition at line 5390 of file wifi-phy-ofdma-test.cc.

Referenced by ~TestUlOfdmaPowerControl(), DoSetup(), DoTeardown(), ReceiveOkCallbackAtAp(), RunOne(), and SendMuBar().

◆ m_tol

dB_u TestUlOfdmaPowerControl::m_tol
private

tolerance between received and expected RSSIs

Definition at line 5405 of file wifi-phy-ofdma-test.cc.

Referenced by ReceiveOkCallbackAtAp().

◆ m_txPowerAp

dBm_u TestUlOfdmaPowerControl::m_txPowerAp
private

transmit power of AP

Definition at line 5394 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), RunOne(), and SendMuBar().

◆ m_txPowerEnd

dBm_u TestUlOfdmaPowerControl::m_txPowerEnd
private

maximum transmission power for STAs

Definition at line 5396 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_txPowerLevels

uint8_t TestUlOfdmaPowerControl::m_txPowerLevels
private

number of transmission power levels for STAs

Definition at line 5397 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_txPowerStart

dBm_u TestUlOfdmaPowerControl::m_txPowerStart
private

minimum transmission power for STAs

Definition at line 5395 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and RunOne().


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