Power Rate Adaptation Test. More...
Public Member Functions | |
PowerRateAdaptationTest () | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
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 | |
Ptr< Node > | ConfigureNode () |
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... | |
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... | |
Power Rate Adaptation Test.
Definition at line 42 of file power-rate-adaptation-test.cc.
PowerRateAdaptationTest::PowerRateAdaptationTest | ( | ) |
Definition at line 65 of file power-rate-adaptation-test.cc.
Configure nde function.
Definition at line 71 of file power-rate-adaptation-test.cc.
References ns3::Node::AddDevice(), third::channel, ns3::ObjectFactory::Create(), m_manager, third::mac, third::mobility, third::phy, ns3::WifiNetDevice::SetMac(), ns3::WifiNetDevice::SetPhy(), ns3::WifiNetDevice::SetRemoteStationManager(), and ns3::WIFI_STANDARD_80211a.
Referenced by TestAparf(), TestParf(), and TestRrpaa().
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 1151 of file power-rate-adaptation-test.cc.
References TestAparf(), TestParf(), and TestRrpaa().
|
private |
Test aparf function.
Definition at line 381 of file power-rate-adaptation-test.cc.
References ConfigureNode(), ns3::WifiPhy::GetChannelWidth(), ns3::WifiTxVector::GetChannelWidth(), ns3::WifiMode::GetDataRate(), ns3::Node::GetDevice(), ns3::WifiTxVector::GetMode(), ns3::WifiNetDevice::GetPhy(), ns3::WifiNetDevice::GetRemoteStationManager(), ns3::WifiTxVector::GetTxPowerLevel(), m_manager, NS_TEST_ASSERT_MSG_EQ, nsclick-simple-lan::remoteAddress, ns3::WifiNetDevice::Send(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::ObjectFactory::SetTypeId(), and ns3::WIFI_MAC_DATA.
Referenced by DoRun().
|
private |
Test parf function.
Definition at line 138 of file power-rate-adaptation-test.cc.
References ConfigureNode(), ns3::WifiPhy::GetChannelWidth(), ns3::WifiTxVector::GetChannelWidth(), ns3::WifiMode::GetDataRate(), ns3::Node::GetDevice(), ns3::WifiTxVector::GetMode(), ns3::WifiNetDevice::GetPhy(), ns3::WifiNetDevice::GetRemoteStationManager(), ns3::WifiTxVector::GetTxPowerLevel(), m_manager, NS_TEST_ASSERT_MSG_EQ, nsclick-simple-lan::remoteAddress, ns3::WifiNetDevice::Send(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::ObjectFactory::SetTypeId(), and ns3::WIFI_MAC_DATA.
Referenced by DoRun().
|
private |
Test rrpaa function.
This will be the thresholds table. The parameters of the table are:
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 643 of file power-rate-adaptation-test.cc.
References ConfigureNode(), ns3::WifiPhy::GetChannelWidth(), ns3::WifiTxVector::GetChannelWidth(), ns3::WifiMode::GetDataRate(), ns3::Node::GetDevice(), ns3::WifiTxVector::GetGuardInterval(), ns3::WifiTxVector::GetMode(), ns3::WifiNetDevice::GetPhy(), ns3::WifiNetDevice::GetRemoteStationManager(), ns3::WifiTxVector::GetTxPowerLevel(), m_manager, NS_TEST_ASSERT_MSG_EQ, nsclick-simple-lan::remoteAddress, ns3::Seconds(), ns3::WifiNetDevice::Send(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::ObjectFactory::SetTypeId(), and ns3::WIFI_MAC_DATA.
Referenced by DoRun().
|
private |
manager
Definition at line 62 of file power-rate-adaptation-test.cc.
Referenced by ConfigureNode(), TestAparf(), TestParf(), and TestRrpaa().