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

A configurable number of non-AP STAs associate with an AP. More...

Inheritance diagram for WifiQueueSchedulerTest:
Collaboration diagram for WifiQueueSchedulerTest:

Classes

struct  ExpectedResults
 Expected results. More...
struct  InputParams
 Input parameters. More...

Public Member Functions

 WifiQueueSchedulerTest (const InputParams &params, const ExpectedResults &results)
 Constructor.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCaseoperator= (const TestCase &)=delete

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase.
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
void EnqueuePackets ()
 Enqueue packets according to input parameters.
Ptr< PacketSocketClientGetApplication (std::size_t staId, std::size_t count, std::size_t pktSize) const
 Get an application generating packets according to given parameters.
void Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower)
 Callback invoked when a FEM passes PSDUs to the PHY.

Private Attributes

Ptr< ApWifiMacm_apMac
 the AP wifi MAC
std::vector< PacketSocketAddressm_dlSockets
 packet socket addresses for DL traffic
const Time m_duration {MilliSeconds(100)}
 simulation duration
ExpectedResults m_expectedResults
 expected results
InputParams m_params
 input parameters
std::list< std::size_t > m_servedStas
 IDs of STAs in the order they are actually served.
std::vector< Ptr< StaWifiMac > > m_staMacs
 the STA wifi MACs

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...
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

A configurable number of non-AP STAs associate with an AP.

All devices have the same number of links (1 or 2). The MAC queue scheduler to be installed on the devices is configurable, too. The test input is represented by a list of DL packets addressed to the non-AP STAs, along with the interval between the generation of consecutive packets. A-MPDU aggregation is disabled, so that one packet at a time is transmitted by the AP. The sequence of packets transmitted by the AP is compared to the expected sequence of packets based on the configured MAC queue scheduler.

Definition at line 48 of file wifi-queue-scheduler-test.cc.

Constructor & Destructor Documentation

◆ WifiQueueSchedulerTest()

WifiQueueSchedulerTest::WifiQueueSchedulerTest ( const InputParams & params,
const ExpectedResults & results )

Constructor.

Parameters
paramsthe input parameters
resultsthe expected parameters

Definition at line 137 of file wifi-queue-scheduler-test.cc.

References ns3::TestCase::TestCase(), m_expectedResults, m_params, and NS_TEST_ASSERT_MSG_EQ.

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void WifiQueueSchedulerTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 357 of file wifi-queue-scheduler-test.cc.

References ns3::Simulator::Destroy(), EnqueuePackets(), m_duration, m_expectedResults, m_servedStas, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), and ns3::Simulator::Stop().

Here is the call graph for this function:

◆ DoSetup()

void WifiQueueSchedulerTest::DoSetup ( )
overrideprivatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.

Reimplemented from ns3::TestCase.

Definition at line 151 of file wifi-queue-scheduler-test.cc.

References ns3::AC_BE, ns3::WifiHelper::AssignStreams(), ns3::NodeList::Begin(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NodeList::End(), ns3::PacketSocketHelper::Install(), m_apMac, m_dlSockets, m_duration, m_params, m_staMacs, ns3::MakeCallback(), NS_ASSERT, NS_TEST_ASSERT_MSG_NE, ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::WifiStaticSetupHelper::SetStaticAssociation(), ns3::WifiStaticSetupHelper::SetStaticBlockAck(), ns3::StaticCast(), Transmit(), and ns3::WIFI_STANDARD_80211be.

Here is the call graph for this function:

◆ EnqueuePackets()

void WifiQueueSchedulerTest::EnqueuePackets ( )
private

Enqueue packets according to input parameters.

Definition at line 344 of file wifi-queue-scheduler-test.cc.

References ns3::Node::AddApplication(), GetApplication(), m_apMac, m_params, and ns3::Simulator::Schedule().

Referenced by DoRun().

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

◆ GetApplication()

Ptr< PacketSocketClient > WifiQueueSchedulerTest::GetApplication ( std::size_t staId,
std::size_t count,
std::size_t pktSize ) const
private

Get an application generating packets according to given parameters.

Parameters
staIdthe ID of the STA the packets are addressed to
countthe number of packets to generate
pktSizethe size of the packets to generate
Returns
an application generating the given number packets from the AP to the given STA

Definition at line 328 of file wifi-queue-scheduler-test.cc.

References ns3::CreateObject(), m_dlSockets, m_duration, and ns3::Simulator::Now().

Referenced by EnqueuePackets().

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

◆ Transmit()

void WifiQueueSchedulerTest::Transmit ( Ptr< WifiMac > mac,
uint8_t phyId,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
Watt_u txPower )
private

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
macthe MAC transmitting the PSDUs
phyIdthe ID of the PHY transmitting the PSDUs
psduMapthe PSDU map
txVectorthe TX vector
txPowerthe tx power

Definition at line 265 of file wifi-queue-scheduler-test.cc.

References m_apMac, m_expectedResults, m_servedStas, m_staMacs, ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_LT, NS_TEST_ASSERT_MSG_NE, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoSetup().

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

Member Data Documentation

◆ m_apMac

Ptr<ApWifiMac> WifiQueueSchedulerTest::m_apMac
private

the AP wifi MAC

Definition at line 118 of file wifi-queue-scheduler-test.cc.

Referenced by DoSetup(), EnqueuePackets(), and Transmit().

◆ m_dlSockets

std::vector<PacketSocketAddress> WifiQueueSchedulerTest::m_dlSockets
private

packet socket addresses for DL traffic

Definition at line 120 of file wifi-queue-scheduler-test.cc.

Referenced by DoSetup(), and GetApplication().

◆ m_duration

const Time WifiQueueSchedulerTest::m_duration {MilliSeconds(100)}
private

simulation duration

Definition at line 121 of file wifi-queue-scheduler-test.cc.

Referenced by DoRun(), DoSetup(), and GetApplication().

◆ m_expectedResults

ExpectedResults WifiQueueSchedulerTest::m_expectedResults
private

expected results

Definition at line 116 of file wifi-queue-scheduler-test.cc.

Referenced by WifiQueueSchedulerTest(), DoRun(), and Transmit().

◆ m_params

InputParams WifiQueueSchedulerTest::m_params
private

input parameters

Definition at line 115 of file wifi-queue-scheduler-test.cc.

Referenced by WifiQueueSchedulerTest(), DoSetup(), and EnqueuePackets().

◆ m_servedStas

std::list<std::size_t> WifiQueueSchedulerTest::m_servedStas
private

IDs of STAs in the order they are actually served.

Definition at line 117 of file wifi-queue-scheduler-test.cc.

Referenced by DoRun(), and Transmit().

◆ m_staMacs

std::vector<Ptr<StaWifiMac> > WifiQueueSchedulerTest::m_staMacs
private

the STA wifi MACs

Definition at line 119 of file wifi-queue-scheduler-test.cc.

Referenced by DoSetup(), and Transmit().


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