A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
IdealRateManagerChannelWidthTest Class Reference

Make sure that Ideal rate manager properly selects MCS based on the configured channel width. More...

+ Inheritance diagram for IdealRateManagerChannelWidthTest:
+ Collaboration diagram for IdealRateManagerChannelWidthTest:

Public Member Functions

 IdealRateManagerChannelWidthTest ()
 
 ~IdealRateManagerChannelWidthTest () override
 
void DoRun () override
 Implementation to actually run this TestCase.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void ChangeChannelWidth (MHz_u channelWidth)
 Change the configured channel width for all nodes.
 
void CheckLastSelectedMode (WifiMode expectedMode)
 Check if the selected WifiMode is correct.
 
void SendPacket (Ptr< NetDevice > sourceDevice, Address &destination)
 Triggers the transmission of a 1000 Byte-long data packet from the source device.
 
void TxCallback (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback that indicates a PSDU is being transmitted.
 

Private Attributes

WifiMode m_txMode
 Store the last selected mode to send data packet.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
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.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

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 2956 of file wifi-test.cc.

Constructor & Destructor Documentation

◆ IdealRateManagerChannelWidthTest()

IdealRateManagerChannelWidthTest::IdealRateManagerChannelWidthTest ( )

Definition at line 2998 of file wifi-test.cc.

◆ ~IdealRateManagerChannelWidthTest()

IdealRateManagerChannelWidthTest::~IdealRateManagerChannelWidthTest ( )
override

Definition at line 3003 of file wifi-test.cc.

Member Function Documentation

◆ ChangeChannelWidth()

void IdealRateManagerChannelWidthTest::ChangeChannelWidth ( MHz_u channelWidth)
private

Change the configured channel width for all nodes.

Parameters
channelWidththe channel width

Definition at line 3008 of file wifi-test.cc.

References ns3::Config::Set().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckLastSelectedMode()

void IdealRateManagerChannelWidthTest::CheckLastSelectedMode ( WifiMode expectedMode)
private

Check if the selected WifiMode is correct.

Parameters
expectedModethe expected WifiMode

Definition at line 3035 of file wifi-test.cc.

References m_txMode, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void IdealRateManagerChannelWidthTest::DoRun ( )
overridevirtual

◆ SendPacket()

void IdealRateManagerChannelWidthTest::SendPacket ( Ptr< NetDevice > sourceDevice,
Address & destination )
private

Triggers the transmission of a 1000 Byte-long data packet from the source device.

Parameters
sourceDevicepointer to the source NetDevice
destinationaddress of the destination device

Definition at line 3016 of file wifi-test.cc.

References ns3::Create().

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TxCallback()

void IdealRateManagerChannelWidthTest::TxCallback ( std::string context,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )
private

Callback that indicates a PSDU is being transmitted.

Parameters
contextthe context
psduMapthe PSDU map to transmit
txVectorthe TX vector
txPowerWthe TX power (W)

Definition at line 3023 of file wifi-test.cc.

References ns3::WifiTxVector::GetMode(), and m_txMode.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_txMode

WifiMode IdealRateManagerChannelWidthTest::m_txMode
private

Store the last selected mode to send data packet.

Definition at line 2995 of file wifi-test.cc.

Referenced by CheckLastSelectedMode(), and TxCallback().


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