A Discrete-Event Network Simulator
API
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. More...
 
 ~EmlsrLinkSwitchTest () override=default
 
- Public Member Functions inherited from EmlsrOperationsTestBase
 EmlsrOperationsTestBase (const std::string &name)
 Constructor. More...
 
 ~EmlsrOperationsTestBase () override=default
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
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. More...
 
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. More...
 
void CheckResults ()
 Check that the simulation produced the expected results. More...
 
void DoRun () override
 Implementation to actually run this TestCase. More...
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase. More...
 
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. More...
 
- 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. More...
 
Ptr< PacketSocketClientGetApplication (TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const
 
- 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...
 
TestCaseGetParent () 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...
 

Private Attributes

uint16_t m_auxPhyMaxChWidth
 max channel width (MHz) supported by aux PHYs More...
 
std::size_t m_countQoSframes
 counter for QoS data frames More...
 
bool m_resetCamState
 whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY has just switched to More...
 
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 More...
 
std::size_t m_txPsdusPos
 a position in the vector of TX PSDUs More...
 

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

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 649 of file wifi-emlsr-test.h.

Constructor & Destructor Documentation

◆ EmlsrLinkSwitchTest()

EmlsrLinkSwitchTest::EmlsrLinkSwitchTest ( const Params params)

◆ ~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 3367 of file wifi-emlsr-test.cc.

References 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, and NS_TEST_EXPECT_MSG_LT_OR_EQ.

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 3245 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 3454 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 3234 of file wifi-emlsr-test.cc.

References CheckResults(), and EmlsrOperationsTestBase::m_duration.

+ 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 3213 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::DoSetup(), EmlsrOperationsTestBase::m_apMac, m_auxPhyMaxChWidth, m_resetCamState, EmlsrOperationsTestBase::m_staMacs, m_switchAuxPhy, third::mac, 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 717 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 718 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 715 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 713 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 719 of file wifi-emlsr-test.h.

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


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