Test the switching of PHYs on EMLSR clients. More...
#include "wifi-emlsr-test.h"
Classes | |
struct | Params |
Parameters for the EMLSR link switching test. More... | |
Public Member Functions | |
EmlsrLinkSwitchTest (const Params ¶ms) | |
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 |
TestCase & | operator= (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< PacketSocketClient > | GetApplication (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... | |
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... | |
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< ApWifiMac > | m_apMac |
AP wifi MAC. More... | |
std::vector< PacketSocketAddress > | m_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< Time > | m_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< Time > | m_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< FrameInfo > | m_txPsdus |
transmitted PSDUs More... | |
std::vector< PacketSocketAddress > | m_ulSockets |
packet socket address for UL traffic More... | |
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):
Definition at line 649 of file wifi-emlsr-test.h.
EmlsrLinkSwitchTest::EmlsrLinkSwitchTest | ( | const Params & | params | ) |
Constructor.
params | parameters for the EMLSR link switching test |
Definition at line 3121 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().
|
overridedefault |
|
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.
psduMap | the PSDU carrying the MU-RTS TF |
txVector | the TXVECTOR used to send the PPDU |
linkId | the 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().
|
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.
psduMap | the PSDU(s) carrying QoS data frames |
txVector | the TXVECTOR used to send the PPDU |
linkId | the 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().
|
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().
|
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.
|
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.
|
overrideprotectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
mac | the MAC transmitting the PSDUs |
phyId | the ID of the PHY transmitting the PSDUs |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Reimplemented from EmlsrOperationsTestBase.
Definition at line 3145 of file wifi-emlsr-test.cc.
References ns3::AC_BE, check-style-clang-format::action, CheckInitialControlFrame(), CheckQosFrames(), ns3::WifiMac::GetAddress(), ns3::WifiMac::GetMacQueueScheduler(), ns3::WifiMac::GetNLinks(), EmlsrOperationsTestBase::m_apMac, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::m_txPsdus, m_txPsdusPos, third::mac, NS_ASSERT_MSG, NS_TEST_EXPECT_MSG_EQ, EmlsrOperationsTestBase::Transmit(), ns3::WIFI_MAC_CTL_TRIGGER, ns3::WIFI_MAC_MGT_ACTION, ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_QOSDATA_QUEUE.
|
private |
max channel width (MHz) supported by aux PHYs
Definition at line 717 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), and DoSetup().
|
private |
counter for QoS data frames
Definition at line 718 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), and CheckQosFrames().
|
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().
|
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().
|
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().