22 #include "ns3/wifi-net-device.h"
23 #include "ns3/yans-wifi-channel.h"
24 #include "ns3/yans-wifi-phy.h"
25 #include "ns3/adhoc-wifi-mac.h"
26 #include "ns3/constant-position-mobility-model.h"
27 #include "ns3/simulator.h"
29 #include "ns3/frame-exchange-manager.h"
30 #include "ns3/interference-helper.h"
31 #include "ns3/wifi-default-protection-manager.h"
32 #include "ns3/wifi-default-ack-manager.h"
47 void DoRun (
void)
override;
87 protectionManager->SetWifiMac (
mac);
88 fem->SetProtectionManager (protectionManager);
91 ackManager->SetWifiMac (
mac);
92 fem->SetAckManager (ackManager);
104 phy->SetInterferenceHelper (interferenceHelper);
106 phy->SetDevice (dev);
113 phy->SetNTxPower (18);
114 phy->SetTxPowerStart (0);
115 phy->SetTxPowerEnd (17);
126 mac->SetAddress (Mac48Address::Allocate ());
130 node->AddDevice (dev);
154 packetHeader.
SetAddr1 (remoteAddress);
165 dev->
Send (p, remoteAddress, 1);
185 for (
int i = 0; i < 10; i++)
218 for (
int i = 0; i < 7; i++)
269 for (
int i = 0; i < 10; i++)
302 for (
int i = 0; i < 10; i++)
320 for (
int i = 0; i < 10; i++)
340 for (
int i = 0; i < 2; i++)
352 Simulator::Destroy ();
376 packetHeader.
SetAddr1 (remoteAddress);
387 dev->
Send (p, remoteAddress, 1);
408 for (
int i = 0; i < 3; i++)
442 for (
int i = 0; i < 10; i++)
461 for (
int i = 0; i < 3; i++)
479 for (
int i = 0; i < 16 * 3; i++)
512 for (
int i = 0; i < 16; i++)
546 for (
int i = 0; i < 3; i++)
566 for (
int i = 0; i < 9 * 3; i++)
578 for (
int i = 0; i < 3; i++)
590 Simulator::Destroy ();
620 packetHeader.
SetAddr1 (remoteAddress);
631 dev->
Send (p, remoteAddress, 1);
681 for (
int i = 0; i < 6; i++)
711 for (
int i = 0; i < 4; i++)
738 for (
int i = 0; i < 7; i++)
750 for (
int i = 0; i < 10; i++)
762 for (
int i = 0; i < 13; i++)
774 for (
int i = 0; i < 19; i++)
786 for (
int i = 0; i < 23; i++)
798 for (
int i = 0; i < 33; i++)
810 for (
int i = 0; i < 43; i++)
830 for (
int i = 0; i < 49; i++)
858 for (
int i = 0; i < 16 * 50; i++)
876 for (
int i = 0; i < 6; i++)
894 for (
int i = 0; i < 16 * 6; i++)
912 for (
int i = 0; i < 6; i++)
928 for (
int i = 0; i < 11; i++)
948 for (
int i = 0; i < 25; i++)
960 for (
int i = 0; i < 5; i++)
972 for (
int i = 0; i < 5; i++)
984 for (
int i = 0; i < 25; i++)
1002 for (
int i = 0; i < 16; i++)
1004 for (
int j = 0; j < 25; j++)
1009 for (
int j = 0; j < 5; j++)
1022 Simulator::Stop (
Seconds (10.0));
1025 Simulator::Destroy ();
1051 :
TestSuite (
"wifi-power-rate-adaptation", UNIT)
Power Rate Adaptation Test.
void TestParf()
Test parf function.
void TestAparf()
Test aparf function.
Ptr< Node > ConfigureNode()
Configure nde function.
void DoRun(void) override
Implementation to actually run this TestCase.
PowerRateAdaptationTest()
void TestRrpaa()
Test rrpaa function.
ObjectFactory m_manager
manager
Power Rate Adaptation Test Suite.
PowerRateAdaptationTestSuite()
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Hold an unsigned integer type.
represent a single transmission mode
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
void SetMac(const Ptr< WifiMac > mac)
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Ptr< WifiRemoteStationManager > GetRemoteStationManager(void) const
void SetPhy(const Ptr< WifiPhy > phy)
hold a list of per-remote-station state.
void ReportDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
WifiTxVector GetDataTxVector(const WifiMacHeader &header)
void ReportDataOk(Ptr< const WifiMacQueueItem > mpdu, double ackSnr, WifiMode ackMode, double dataSnr, WifiTxVector dataTxVector)
Should be invoked whenever we receive the ACK associated to a data packet we just sent.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
uint8_t GetTxPowerLevel(void) const
uint16_t GetChannelWidth(void) const
uint16_t GetGuardInterval(void) const
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static PowerRateAdaptationTestSuite g_powerRateAdaptationTestSuite
the test suite