A Discrete-Event Network Simulator
API
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PowerRateAdaptationTest Class Reference

Power Rate Adaptation Test. More...

+ Inheritance diagram for PowerRateAdaptationTest:

Public Member Functions

 PowerRateAdaptationTest ()
 
virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

Ptr< NodeConfigureNode ()
 Configure nde function. More...
 
void TestAparf ()
 Test aparf function. More...
 
void TestParf ()
 Test parf function. More...
 
void TestRrpaa ()
 Test rrpaa function. More...
 

Private Attributes

ObjectFactory m_manager
 manager 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

Power Rate Adaptation Test.

Definition at line 38 of file power-rate-adaptation-test.cc.

Constructor & Destructor Documentation

◆ PowerRateAdaptationTest()

PowerRateAdaptationTest::PowerRateAdaptationTest ( )

Definition at line 60 of file power-rate-adaptation-test.cc.

Member Function Documentation

◆ ConfigureNode()

Ptr< Node > PowerRateAdaptationTest::ConfigureNode ( )
private

Configure nde function.

Returns
the node

Definition at line 66 of file power-rate-adaptation-test.cc.

References third::channel, ns3::ObjectFactory::Create(), m_manager, third::mac, third::mobility, third::phy, and ns3::WIFI_PHY_STANDARD_80211a.

Referenced by TestAparf(), TestParf(), and TestRrpaa().

◆ DoRun()

void PowerRateAdaptationTest::DoRun ( void  )
virtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 1008 of file power-rate-adaptation-test.cc.

References TestAparf(), TestParf(), and TestRrpaa().

◆ TestAparf()

void PowerRateAdaptationTest::TestAparf ( )
private

◆ TestParf()

void PowerRateAdaptationTest::TestParf ( )
private

◆ TestRrpaa()

void PowerRateAdaptationTest::TestRrpaa ( )
private

Test rrpaa function.

This will be the thresholds table. The parameters of the table are:

  • Estimation Window Size (EWND)
  • Maximum Tolerable Loss Probability Threshold (MTL)
  • Opportunistic Rate Increase (and Power Decrease) Probability Threshold (ORI)

We also calculate the needed success and failures to generate a rate or power change: Rate Increase or Power Decrease limits (RI-PD) Rate Decrease or Power Increase limits (RD-PI) Power Decrease limits (PD)

Mode EWND MTL ORI RI-PD RD-PI PD succ fails succ fails OfdmRate6Mbps 8 1 0.19861 7 8 2 OfdmRate9Mbps 11 0.397219 0.14556 10 5 7 2 OfdmRate12Mbps 15 0.291121 0.189753 13 5 11 3 OfdmRate18Mbps 21 0.379507 0.13624 19 8 14 3 OfdmRate24Mbps 27 0.27248 0.174216 23 8 20 5 OfdmRate36Mbps 37 0.348432 0.120773 33 13 25 5 OfdmRate48Mbps 45 0.241546 0.0523952 43 11 35 3 OfdmRate54Mbps 50 0.10479 0 50 6 45 5

Test that 6 is not enough.

Test that 7 is enough.

Increase rate until maximal rate.

Now we need more successful transmissions to make power decrease. As we are at maximal rate, the power is decreased when it is sure that the failures will not generate a rate decrease.

As rate hasn't change the same amount of success are needed. After 16*45 successful transmissions power is decreased to zero.

After 6 failures the power should be increased.

Definition at line 574 of file power-rate-adaptation-test.cc.

References ConfigureNode(), ns3::WifiTxVector::GetChannelWidth(), ns3::WifiMode::GetDataRate(), ns3::Node::GetDevice(), ns3::WifiTxVector::GetGuardInterval(), ns3::WifiTxVector::GetMode(), ns3::WifiNetDevice::GetRemoteStationManager(), ns3::Packet::GetSize(), ns3::WifiTxVector::GetTxPowerLevel(), m_manager, NS_TEST_ASSERT_MSG_EQ, ns3::Seconds(), ns3::WifiNetDevice::Send(), ns3::ObjectBase::SetAttribute(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::ObjectFactory::SetTypeId(), and ns3::WIFI_MAC_DATA.

Referenced by DoRun().

Member Data Documentation

◆ m_manager

ObjectFactory PowerRateAdaptationTest::m_manager
private

manager

Definition at line 57 of file power-rate-adaptation-test.cc.

Referenced by ConfigureNode(), TestAparf(), TestParf(), and TestRrpaa().


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