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/wifi-default-protection-manager.h"
31 #include "ns3/wifi-default-ack-manager.h"
46 void DoRun (
void)
override;
86 protectionManager->SetWifiMac (
mac);
87 fem->SetProtectionManager (protectionManager);
90 ackManager->SetWifiMac (
mac);
91 fem->SetAckManager (ackManager);
103 phy->SetDevice (dev);
110 phy->SetNTxPower (18);
111 phy->SetTxPowerStart (0);
112 phy->SetTxPowerEnd (17);
123 mac->SetAddress (Mac48Address::Allocate ());
127 node->AddDevice (dev);
151 packetHeader.
SetAddr1 (remoteAddress);
162 dev->
Send (p, remoteAddress, 1);
182 for (
int i = 0; i < 10; i++)
215 for (
int i = 0; i < 7; i++)
266 for (
int i = 0; i < 10; i++)
299 for (
int i = 0; i < 10; i++)
317 for (
int i = 0; i < 10; i++)
337 for (
int i = 0; i < 2; i++)
349 Simulator::Destroy ();
373 packetHeader.
SetAddr1 (remoteAddress);
384 dev->
Send (p, remoteAddress, 1);
405 for (
int i = 0; i < 3; i++)
439 for (
int i = 0; i < 10; i++)
458 for (
int i = 0; i < 3; i++)
476 for (
int i = 0; i < 16 * 3; i++)
509 for (
int i = 0; i < 16; i++)
543 for (
int i = 0; i < 3; i++)
563 for (
int i = 0; i < 9 * 3; i++)
575 for (
int i = 0; i < 3; i++)
587 Simulator::Destroy ();
617 packetHeader.
SetAddr1 (remoteAddress);
628 dev->
Send (p, remoteAddress, 1);
678 for (
int i = 0; i < 6; i++)
708 for (
int i = 0; i < 4; i++)
735 for (
int i = 0; i < 7; i++)
747 for (
int i = 0; i < 10; i++)
759 for (
int i = 0; i < 13; i++)
771 for (
int i = 0; i < 19; i++)
783 for (
int i = 0; i < 23; i++)
795 for (
int i = 0; i < 33; i++)
807 for (
int i = 0; i < 43; i++)
827 for (
int i = 0; i < 49; i++)
855 for (
int i = 0; i < 16 * 50; i++)
873 for (
int i = 0; i < 6; i++)
891 for (
int i = 0; i < 16 * 6; i++)
909 for (
int i = 0; i < 6; i++)
925 for (
int i = 0; i < 11; i++)
945 for (
int i = 0; i < 25; i++)
957 for (
int i = 0; i < 5; i++)
969 for (
int i = 0; i < 5; i++)
981 for (
int i = 0; i < 25; i++)
999 for (
int i = 0; i < 16; i++)
1001 for (
int j = 0; j < 25; j++)
1006 for (
int j = 0; j < 5; j++)
1019 Simulator::Stop (
Seconds (10.0));
1022 Simulator::Destroy ();
1048 :
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.
@ WIFI_PHY_STANDARD_80211a
OFDM PHY (Clause 17)
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static PowerRateAdaptationTestSuite g_powerRateAdaptationTestSuite
the test suite