A Discrete-Event Network Simulator
API
TestUlOfdmaPowerControl Class Reference

UL-OFDMA power control test. More...

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

Public Member Functions

 TestUlOfdmaPowerControl ()
 
virtual ~TestUlOfdmaPowerControl ()
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
virtual void DoSetup (void)
 Implementation to do any local setup required for this TestCase. More...
 
virtual void DoTeardown (void)
 Implementation to do any local setup required for this TestCase. More...
 
void ReceiveOkCallbackAtAp (Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
 Receive OK callback function at AP. More...
 
void ReplaceReceiveOkCallbackOfAp (void)
 Replace the AP's MacLow callback on its PHY's ReceiveOkCallback by the ReceiveOkCallbackAtAp method. More...
 
void RunOne (bool setupBa)
 Run one simulation with an optional BA session set up phase. More...
 
void SendMuBar (std::vector< uint16_t > staIds)
 Send a MU BAR through the AP to the STAs listed in the provided vector. More...
 
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). More...
 

Private Attributes

Ptr< WifiNetDevicem_apDev
 network device of AP More...
 
uint8_t m_bssColor
 BSS color. More...
 
Ptr< SpectrumWifiPhym_phyAp
 PHY of AP. More...
 
double m_requestedRssiSta1
 requested RSSI (in dBm) from STA 1 at AP for HE TB PPDUs More...
 
double m_requestedRssiSta2
 requested RSSI (in dBm) from STA 2 at AP for HE TB PPDUs More...
 
double m_rssiSta1
 expected RSSI (in dBm) from STA 1 at AP for HE TB PPDUs More...
 
double m_rssiSta2
 expected RSSI (in dBm) from STA 2 at AP for HE TB PPDUs More...
 
Ptr< WifiNetDevicem_sta1Dev
 network device of STA 1 More...
 
Ptr< WifiNetDevicem_sta2Dev
 network device of STA 2 More...
 
double m_tol
 tolerance (in dB) between received and expected RSSIs More...
 
double m_txPowerAp
 transmit power (in dBm) of AP More...
 
double m_txPowerEnd
 maximum transmission power (in dBm) for STAs More...
 
uint8_t m_txPowerLevels
 number of transmission power levels for STAs More...
 
double m_txPowerStart
 minimum transmission power (in dBm) for 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...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) 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 (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) 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...
 

Detailed Description

UL-OFDMA power control test.

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

Constructor & Destructor Documentation

◆ TestUlOfdmaPowerControl()

TestUlOfdmaPowerControl::TestUlOfdmaPowerControl ( )

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

◆ ~TestUlOfdmaPowerControl()

TestUlOfdmaPowerControl::~TestUlOfdmaPowerControl ( )
virtual

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

References m_apDev, m_phyAp, m_sta1Dev, and m_sta2Dev.

Member Function Documentation

◆ DoRun()

void TestUlOfdmaPowerControl::DoRun ( void  )
privatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

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

References 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()

◆ DoTeardown()

void TestUlOfdmaPowerControl::DoTeardown ( void  )
privatevirtual

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 3515 of file wifi-phy-ofdma-test.cc.

References ns3::Object::Dispose(), m_apDev, m_phyAp, m_sta1Dev, and m_sta2Dev.

+ Here is the call graph for this function:

◆ ReceiveOkCallbackAtAp()

void TestUlOfdmaPowerControl::ReceiveOkCallbackAtAp ( Ptr< 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 3422 of file wifi-phy-ofdma-test.cc.

References ns3::WifiPsdu::GetAddr2(), ns3::WifiNetDevice::GetAddress(), ns3::WifiPsdu::GetHeader(), ns3::WifiPsdu::GetNMpdus(), 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 ( void  )
private

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

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

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

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 3528 of file wifi-phy-ofdma-test.cc.

References ns3::WifiPhy::AssignStreams(), ns3::WifiNetDevice::GetAddress(), ns3::WifiNetDevice::GetMac(), ns3::WifiNetDevice::GetPhy(), m_apDev, m_phyAp, m_sta1Dev, m_sta2Dev, m_txPowerAp, m_txPowerEnd, m_txPowerLevels, m_txPowerStart, ns3::MilliSeconds(), NS_ASSERT, ReplaceReceiveOkCallbackOfAp(), SendMuBar(), ns3::ObjectBase::SetAttribute(), and SetupBa().

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 3327 of file wifi-phy-ofdma-test.cc.

References ns3::Packet::AddHeader(), ns3::WifiPhy::CalculateTxDuration(), DEFAULT_CHANNEL_WIDTH, DEFAULT_FREQUENCY, ns3::WifiNetDevice::GetAddress(), ns3::GetBlockAckSize(), ns3::WifiNetDevice::GetMac(), ns3::WifiNetDevice::GetPhy(), ns3::WifiPhy::GetSifs(), m_apDev, m_bssColor, m_phyAp, m_requestedRssiSta1, m_requestedRssiSta2, m_sta1Dev, m_sta2Dev, m_txPowerAp, ns3::MicroSeconds(), ns3::MU_BAR_TRIGGER, NS_ABORT_MSG, NS_ASSERT, ns3::WifiPhy::Send(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::CtrlTriggerUserInfoField::SetAid12(), ns3::WifiMacHeader::SetDsFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiPsdu::SetDuration(), 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::WifiMacHeader::SetType(), ns3::CtrlTriggerHeader::SetType(), ns3::CtrlTriggerUserInfoField::SetUlDcm(), ns3::CtrlTriggerUserInfoField::SetUlFecCodingType(), ns3::CtrlTriggerUserInfoField::SetUlMcs(), ns3::CtrlTriggerUserInfoField::SetUlTargetRssi(), 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 3319 of file wifi-phy-ofdma-test.cc.

References m_apDev, and ns3::WifiNetDevice::Send().

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 3275 of file wifi-phy-ofdma-test.cc.

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

◆ m_bssColor

uint8_t TestUlOfdmaPowerControl::m_bssColor
private

BSS color.

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

Referenced by DoSetup(), and SendMuBar().

◆ m_phyAp

Ptr<SpectrumWifiPhy> TestUlOfdmaPowerControl::m_phyAp
private

◆ m_requestedRssiSta1

double TestUlOfdmaPowerControl::m_requestedRssiSta1
private

requested RSSI (in dBm) from STA 1 at AP for HE TB PPDUs

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

Referenced by DoRun(), and SendMuBar().

◆ m_requestedRssiSta2

double TestUlOfdmaPowerControl::m_requestedRssiSta2
private

requested RSSI (in dBm) from STA 2 at AP for HE TB PPDUs

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

Referenced by DoRun(), and SendMuBar().

◆ m_rssiSta1

double TestUlOfdmaPowerControl::m_rssiSta1
private

expected RSSI (in dBm) from STA 1 at AP for HE TB PPDUs

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

Referenced by DoRun(), and ReceiveOkCallbackAtAp().

◆ m_rssiSta2

double TestUlOfdmaPowerControl::m_rssiSta2
private

expected RSSI (in dBm) from STA 2 at AP for HE TB PPDUs

Definition at line 3290 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 3276 of file wifi-phy-ofdma-test.cc.

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

◆ m_sta2Dev

Ptr<WifiNetDevice> TestUlOfdmaPowerControl::m_sta2Dev
private

network device of STA 2

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

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

◆ m_tol

double TestUlOfdmaPowerControl::m_tol
private

tolerance (in dB) between received and expected RSSIs

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

Referenced by ReceiveOkCallbackAtAp().

◆ m_txPowerAp

double TestUlOfdmaPowerControl::m_txPowerAp
private

transmit power (in dBm) of AP

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

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

◆ m_txPowerEnd

double TestUlOfdmaPowerControl::m_txPowerEnd
private

maximum transmission power (in dBm) for STAs

Definition at line 3283 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 3284 of file wifi-phy-ofdma-test.cc.

Referenced by DoRun(), and RunOne().

◆ m_txPowerStart

double TestUlOfdmaPowerControl::m_txPowerStart
private

minimum transmission power (in dBm) for STAs

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

Referenced by DoRun(), and RunOne().


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