Make sure that Ideal rate manager properly selects MCS based on the configured channel width. More...
Public Member Functions | |
IdealRateManagerChannelWidthTest () | |
~IdealRateManagerChannelWidthTest () override | |
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 | |
void | ChangeChannelWidth (uint16_t channelWidth) |
Change the configured channel width for all nodes. More... | |
void | CheckLastSelectedMode (WifiMode expectedMode) |
Check if the selected WifiMode is correct. More... | |
void | SendPacket (Ptr< NetDevice > sourceDevice, Address &destination) |
Triggers the transmission of a 1000 Byte-long data packet from the source device. More... | |
void | TxCallback (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback that indicates a PSDU is being transmitted. More... | |
Private Attributes | |
WifiMode | m_txMode |
Store the last selected mode to send data packet. 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... | |
Make sure that Ideal rate manager properly selects MCS based on the configured channel width.
The scenario considers an access point and a fixed station. The access point first sends a 80 MHz PPDU to the station, for which Ideal rate manager should select VH-MCS 0 based on the distance (no interference generated in this test). Then, the access point sends a 20 MHz PPDU to the station, which corresponds to a SNR 6 dB higher than previously, hence VHT-MCS 2 should be selected. Finally, the access point sends a 40 MHz PPDU to the station, which means corresponds to a SNR 3 dB lower than previously, hence VHT-MCS 1 should be selected.
Definition at line 2938 of file wifi-test.cc.
IdealRateManagerChannelWidthTest::IdealRateManagerChannelWidthTest | ( | ) |
Definition at line 2980 of file wifi-test.cc.
|
override |
Definition at line 2985 of file wifi-test.cc.
|
private |
Change the configured channel width for all nodes.
channelWidth | the channel width (in MHz) |
Definition at line 2990 of file wifi-test.cc.
References ns3::Config::Set(), and nlohmann::to_string().
Referenced by DoRun().
|
private |
Check if the selected WifiMode is correct.
expectedMode | the expected WifiMode |
Definition at line 3016 of file wifi-test.cc.
References m_txMode, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoRun().
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 3025 of file wifi-test.cc.
References ChangeChannelWidth(), third::channel, CheckLastSelectedMode(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), third::mac, ns3::MakeCallback(), third::mobility, third::phy, ns3::Seconds(), SendPacket(), TxCallback(), third::wifi, ns3::WIFI_STANDARD_80211ac, and third::wifiApNode.
|
private |
Triggers the transmission of a 1000 Byte-long data packet from the source device.
sourceDevice | pointer to the source NetDevice |
destination | address of the destination device |
Definition at line 2997 of file wifi-test.cc.
Referenced by DoRun().
|
private |
Callback that indicates a PSDU is being transmitted.
context | the context |
psduMap | the PSDU map to transmit |
txVector | the TX vector |
txPowerW | the TX power (W) |
Definition at line 3004 of file wifi-test.cc.
References ns3::WifiTxVector::GetMode(), and m_txMode.
Referenced by DoRun().
|
private |
Store the last selected mode to send data packet.
Definition at line 2977 of file wifi-test.cc.
Referenced by CheckLastSelectedMode(), and TxCallback().