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

Test the switching of PHYs on EMLSR clients. More...

#include "wifi-emlsr-test.h"

+ Inheritance diagram for EmlsrLinkSwitchTest:
+ Collaboration diagram for EmlsrLinkSwitchTest:

Classes

struct  Params
 Parameters for the EMLSR link switching test. More...
 

Public Member Functions

 EmlsrLinkSwitchTest (const Params &params)
 Constructor.
 
 ~EmlsrLinkSwitchTest () override=default
 
- Public Member Functions inherited from EmlsrOperationsTestBase
 EmlsrOperationsTestBase (const std::string &name)
 Constructor.
 
 ~EmlsrOperationsTestBase () override=default
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

void CheckInitialControlFrame (const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
 Check that the Main PHY (and possibly the Aux PHY) correctly switches channel when the reception of an ICF ends.
 
void CheckQosFrames (const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
 Check that appropriate actions are taken by the AP MLD transmitting a PPDU containing QoS data frames to the EMLSR client on the given link.
 
void CheckResults ()
 Check that the simulation produced the expected results.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
void Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override
 Callback invoked when a FEM passes PSDUs to the PHY.
 
- Protected Member Functions inherited from EmlsrOperationsTestBase
void CheckBlockedLink (Ptr< WifiMac > mac, Mac48Address dest, uint8_t linkId, WifiQueueBlockedReason reason, bool blocked, std::string description, bool testUnblockedForOtherReasons=true)
 Check whether QoS data unicast transmissions addressed to the given destination on the given link are blocked or unblocked for the given reason on the given device.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
Ptr< PacketSocketClientGetApplication (TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const
 
virtual void Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when a FEM passes PSDUs to the PHY.
 
- 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.
 

Private Attributes

uint16_t m_auxPhyMaxChWidth
 max channel width (MHz) supported by aux PHYs
 
std::size_t m_countQoSframes
 counter for QoS data frames
 
bool m_resetCamState
 whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY has just switched to
 
bool m_switchAuxPhy
 whether AUX PHY should switch channel to operate on the link on which the Main PHY was operating before moving to the link of Aux PHY
 
std::size_t m_txPsdusPos
 a position in the vector of TX PSDUs
 

Additional Inherited Members

- Public Types inherited from EmlsrOperationsTestBase
enum  TrafficDirection : uint8_t { DOWNLINK = 0 , UPLINK }
 Enumeration for traffic directions. More...
 
- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
using TestDuration = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 
- Protected Attributes inherited from EmlsrOperationsTestBase
Ptr< ApWifiMacm_apMac
 AP wifi MAC.
 
std::vector< PacketSocketAddressm_dlSockets
 packet socket address for DL traffic
 
Time m_duration {0}
 simulation duration
 
bool m_establishBaDl {false}
 whether BA needs to be established (for TID 0) with the AP as originator
 
bool m_establishBaUl {false}
 whether BA needs to be established (for TID 0) with the AP as recipient
 
uint16_t m_lastAid {0}
 AID of last associated station.
 
std::set< uint8_t > m_linksToEnableEmlsrOn
 IDs of the links on which EMLSR mode has to be enabled.
 
uint8_t m_mainPhyId {0}
 ID of the main PHY.
 
std::size_t m_nEmlsrStations {1}
 number of stations to create that activate EMLSR
 
std::size_t m_nNonEmlsrStations {0}
 number of stations to create that do not activate EMLSR
 
std::vector< Timem_paddingDelay
 Padding Delay advertised by the non-AP MLD.
 
std::vector< Ptr< StaWifiMac > > m_staMacs
 MACs of the non-AP MLDs.
 
std::vector< Timem_transitionDelay
 Transition Delay advertised by the non-AP MLD.
 
Time m_transitionTimeout {MicroSeconds(128)}
 Transition Timeout advertised by the AP MLD.
 
std::vector< FrameInfom_txPsdus
 transmitted PSDUs
 
std::vector< PacketSocketAddressm_ulSockets
 packet socket address for UL traffic
 

Detailed Description

Test the switching of PHYs on EMLSR clients.

An AP MLD and an EMLSR client setup 3 links, on which EMLSR mode is enabled. The AP MLD transmits 4 QoS data frames (one after another, each protected by ICF):

  • the first one on the link used for ML setup, hence no PHY switch occurs
  • the second one on another link, thus causing the main PHY to switch link
  • the third one on the remaining link, thus causing the main PHY to switch link again
  • the fourth one on the link used for ML setup; if the aux PHYs switches link, there is one aux PHY listening on such a link and the main PHY switches to this link, otherwise no PHY is listening on such a link and there is no response to the ICF sent by the AP MLD

Definition at line 661 of file wifi-emlsr-test.h.

Constructor & Destructor Documentation

◆ EmlsrLinkSwitchTest()

EmlsrLinkSwitchTest::EmlsrLinkSwitchTest ( const Params params)

Constructor.

Parameters
paramsparameters for the EMLSR link switching test

Definition at line 3252 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::m_duration, EmlsrOperationsTestBase::m_establishBaDl, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_nEmlsrStations, EmlsrOperationsTestBase::m_nNonEmlsrStations, EmlsrOperationsTestBase::m_transitionDelay, ns3::MicroSeconds(), and ns3::Seconds().

+ Here is the call graph for this function:

◆ ~EmlsrLinkSwitchTest()

EmlsrLinkSwitchTest::~EmlsrLinkSwitchTest ( )
overridedefault

Member Function Documentation

◆ CheckInitialControlFrame()

void EmlsrLinkSwitchTest::CheckInitialControlFrame ( const WifiConstPsduMap psduMap,
const WifiTxVector txVector,
uint8_t  linkId 
)
protected

Check that the Main PHY (and possibly the Aux PHY) correctly switches channel when the reception of an ICF ends.

AUX PHY switching enabled.

Parameters
psduMapthe PSDU carrying the MU-RTS TF
txVectorthe TXVECTOR used to send the PPDU
linkIdthe ID of the given link

|------— aux PHY A ------—|---— main PHY ---—|-----------— aux PHY B ----------— ┌───┐ ┌───┐ │ICF│ │QoS│ ──────────────────────────┴───┴┬───┬┴───┴┬──┬──────────────────────────────────────────────── [link 0] │CTS│ │BA│ └───┘ └──┘

|------— main PHY -------—|---------------— aux PHY A -------------—|— main PHY — ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ICF│ │QoS│ │ICF│ │QoS│ ───┴───┴┬───┬┴───┴┬──┬──────────────────────────────────────────────────┴───┴┬───┬┴───┴┬──┬── [link 1]│CTS│ │BA│ │CTS│ │BA│ └───┘ └──┘ └───┘ └──┘

|------------------— aux PHY B -----------------—|---— main PHY ---—|– aux PHY A — ┌───┐ ┌───┐ │ICF│ │QoS│ ─────────────────────────────────────────────────┴───┴┬───┬┴───┴┬──┬───────────────────────── [link 2] │CTS│ │BA│ └───┘ └──┘

AUX PHY switching disabled (X = main PHY channel switch delay)

|---------------------------------------— aux PHY A ------------------------------------— |– main PHY –|X| ┌───┐ ┌───┐ │ICF│ │QoS│ ──────────────────────────┴───┴┬───┬┴───┴┬──┬──────────────────────────────────────────────── [link 0] │CTS│ │BA│ └───┘ └──┘

            |-main|

|------— main PHY -------—| |-PHY-| |---— main PHY ---— ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ICF│ │QoS│ │ICF│ │QoS│ ───┴───┴┬───┬┴───┴┬──┬──────────────────────────────────────────────────┴───┴┬───┬┴───┴┬──┬── [link 1]│CTS│ │BA│ │CTS│ │BA│ └───┘ └──┘ └───┘ └──┘

|---------------------------------------— aux PHY B ------------------------------------— |– main PHY –|X| ┌───┐ ┌───┐ │ICF│ │QoS│ ─────────────────────────────────────────────────┴───┴┬───┬┴───┴┬──┬───────────────────────── [link 2] │CTS│ │BA│ └───┘ └──┘

Definition at line 3499 of file wifi-emlsr-test.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetWifiPhy(), EmlsrOperationsTestBase::m_apMac, m_auxPhyMaxChWidth, m_countQoSframes, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, m_switchAuxPhy, m_txPsdusPos, ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_NE, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT, NS_TEST_EXPECT_MSG_LT_OR_EQ, and ns3::Simulator::Schedule().

Referenced by Transmit().

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

◆ CheckQosFrames()

void EmlsrLinkSwitchTest::CheckQosFrames ( const WifiConstPsduMap psduMap,
const WifiTxVector txVector,
uint8_t  linkId 
)
protected

Check that appropriate actions are taken by the AP MLD transmitting a PPDU containing QoS data frames to the EMLSR client on the given link.

Parameters
psduMapthe PSDU(s) carrying QoS data frames
txVectorthe TXVECTOR used to send the PPDU
linkIdthe ID of the given link

Definition at line 3377 of file wifi-emlsr-test.cc.

References ns3::AC_BE, ns3::Node::AddApplication(), EmlsrOperationsTestBase::DOWNLINK, ns3::WifiMac::GetAddress(), EmlsrOperationsTestBase::GetApplication(), ns3::WifiMac::GetDevice(), ns3::WifiMac::GetMacQueueScheduler(), ns3::WifiNetDevice::GetNode(), EmlsrOperationsTestBase::m_apMac, m_countQoSframes, EmlsrOperationsTestBase::m_staMacs, and ns3::WIFI_QOSDATA_QUEUE.

Referenced by Transmit().

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

◆ CheckResults()

void EmlsrLinkSwitchTest::CheckResults ( )
protected

Check that the simulation produced the expected results.

Definition at line 3586 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::m_txPsdus, m_txPsdusPos, NS_TEST_ASSERT_MSG_GT_OR_EQ, NS_TEST_ASSERT_MSG_NE, NS_TEST_EXPECT_MSG_EQ, and ns3::SU_STA_ID.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void EmlsrLinkSwitchTest::DoRun ( )
overrideprotectedvirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 3366 of file wifi-emlsr-test.cc.

References CheckResults(), ns3::Simulator::Destroy(), EmlsrOperationsTestBase::m_duration, ns3::Simulator::Run(), and ns3::Simulator::Stop().

+ Here is the call graph for this function:

◆ DoSetup()

void EmlsrLinkSwitchTest::DoSetup ( )
overrideprotectedvirtual

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

Definition at line 3344 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::DoSetup(), EmlsrOperationsTestBase::m_apMac, m_auxPhyMaxChWidth, m_resetCamState, EmlsrOperationsTestBase::m_staMacs, m_switchAuxPhy, ns3::MicroSeconds(), ns3::Config::SetDefault(), ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PHY_BAND_6GHZ.

+ Here is the call graph for this function:

◆ Transmit()

void EmlsrLinkSwitchTest::Transmit ( Ptr< WifiMac mac,
uint8_t  phyId,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)
overrideprotectedvirtual

Member Data Documentation

◆ m_auxPhyMaxChWidth

uint16_t EmlsrLinkSwitchTest::m_auxPhyMaxChWidth
private

max channel width (MHz) supported by aux PHYs

Definition at line 729 of file wifi-emlsr-test.h.

Referenced by CheckInitialControlFrame(), and DoSetup().

◆ m_countQoSframes

std::size_t EmlsrLinkSwitchTest::m_countQoSframes
private

counter for QoS data frames

Definition at line 730 of file wifi-emlsr-test.h.

Referenced by CheckInitialControlFrame(), and CheckQosFrames().

◆ m_resetCamState

bool EmlsrLinkSwitchTest::m_resetCamState
private

whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY has just switched to

Definition at line 727 of file wifi-emlsr-test.h.

Referenced by DoSetup().

◆ m_switchAuxPhy

bool EmlsrLinkSwitchTest::m_switchAuxPhy
private

whether AUX PHY should switch channel to operate on the link on which the Main PHY was operating before moving to the link of Aux PHY

Definition at line 725 of file wifi-emlsr-test.h.

Referenced by CheckInitialControlFrame(), and DoSetup().

◆ m_txPsdusPos

std::size_t EmlsrLinkSwitchTest::m_txPsdusPos
private

a position in the vector of TX PSDUs

Definition at line 731 of file wifi-emlsr-test.h.

Referenced by CheckInitialControlFrame(), CheckResults(), and Transmit().


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