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. | |
~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 |
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. | |
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 | CheckRtsFrame (const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId) |
Check that appropriate actions are taken by the EMLSR client transmitting a PPDU containing an RTS frame to the AP MLD on the given link. | |
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< 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. | |
void | AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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 | |
MHz_u | m_auxPhyMaxChWidth |
max channel width (MHz) supported by aux PHYs | |
std::size_t | m_countIcfFrames |
counter for ICF frames | |
std::size_t | m_countQoSframes |
counter for QoS data frames | |
std::size_t | m_countRtsFrames |
counter for RTS frames | |
Ptr< ListErrorModel > | m_errorModel |
error rate model to corrupt packets at AP MLD | |
bool | m_resetCamStateAndInterruptSwitch |
whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY has just switched to and whether main PHY switch can be interrupted | |
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 |
position in the vector of TX PSDUs of the first ICF | |
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... | |
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 Attributes inherited from EmlsrOperationsTestBase | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. | |
std::vector< PacketSocketAddress > | m_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< Time > | m_paddingDelay |
Padding Delay advertised by the non-AP MLD. | |
std::vector< Ptr< StaWifiMac > > | m_staMacs |
MACs of the non-AP MLDs. | |
std::vector< Time > | m_transitionDelay |
Transition Delay advertised by the non-AP MLD. | |
Time | m_transitionTimeout {MicroSeconds(128)} |
Transition Timeout advertised by the AP MLD. | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs | |
std::vector< PacketSocketAddress > | m_ulSockets |
packet socket address for UL traffic | |
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):
Afterwards, the EMLSR client transmits 2 QoS data frames; the first one on the link used for ML setup (hence, no RTS is sent), the second one on another link.
Definition at line 683 of file wifi-emlsr-test.h.
EmlsrLinkSwitchTest::EmlsrLinkSwitchTest | ( | const Params & | params | ) |
Constructor.
params | parameters for the EMLSR link switching test |
Definition at line 3485 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 (X = channel switch delay)
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│ └───┘ └──┘
... continued ...
|--------------------------------------— aux PHY B ------------------------------------— ───────────────────────────────────────────────────────────────────────────────────────────── [link 0]
|------— main PHY -------—|X|X|---------------------— aux PHY A -------------------— ┌───┐ │ACK│ ──────────┬───┬┴───┴──────────────────────────────────────────────────────────────────────── [link 1] │QoS│ └───┘
|-----— aux PHY A -------—|X|-------------------— main PHY ------------------------— ┌──┐ │BA│ ────────────────────────┬───X──────┬───┬┴──┴──────────────────────────────────────────────── [link 2] │RTS│ │QoS│ └───┘ └───┘
AUX PHY switching disabled (X = 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│ └───┘ └──┘
... continued ...
|--------------------------------------— aux PHY A ------------------------------------— ───────────────────────────────────────────────────────────────────────────────────────────── [link 0]
|-----— main PHY -----—| |— main PHY —| ┌───┐ │ACK│ ──────────┬───┬┴───┴──────────────────────────────────────────────────────────────────────── [link 1] │QoS│ └───┘
|---------------------------------------— aux PHY B -----------------------------------— |X||X| |X|-----------— main PHY -----------— ┌───┐ ┌──┐ │CTS│ │BA│ ────────────────────────┬───X───────────────┬───┬┴───┴┬───┬┴──┴───────────────────────────── [link 2] │RTS│ │RTS│ │QoS│ └───┘ └───┘ └───┘
Definition at line 3825 of file wifi-emlsr-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), EmlsrOperationsTestBase::m_apMac, m_auxPhyMaxChWidth, m_countIcfFrames, m_countQoSframes, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, m_switchAuxPhy, EmlsrOperationsTestBase::m_txPsdus, m_txPsdusPos, ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_NE, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT_OR_EQ, NS_TEST_EXPECT_MSG_LT_OR_EQ, and ns3::Simulator::Schedule().
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 3620 of file wifi-emlsr-test.cc.
References ns3::AC_BE, EmlsrOperationsTestBase::DOWNLINK, EmlsrOperationsTestBase::GetApplication(), EmlsrOperationsTestBase::m_apMac, m_countQoSframes, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::UPLINK, and ns3::WIFI_QOSDATA_QUEUE.
Referenced by Transmit().
|
protected |
Check that the simulation produced the expected results.
Definition at line 3972 of file wifi-emlsr-test.cc.
References m_countIcfFrames, m_resetCamStateAndInterruptSwitch, m_switchAuxPhy, 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().
|
protected |
Check that appropriate actions are taken by the EMLSR client transmitting a PPDU containing an RTS frame to the AP MLD on the given link.
psduMap | the PSDU carrying RTS frame |
txVector | the TXVECTOR used to send the PPDU |
linkId | the ID of the given link |
Definition at line 3916 of file wifi-emlsr-test.cc.
References ns3::AC_BE, EmlsrOperationsTestBase::m_apMac, m_countRtsFrames, m_errorModel, EmlsrOperationsTestBase::m_mainPhyId, m_resetCamStateAndInterruptSwitch, EmlsrOperationsTestBase::m_staMacs, m_switchAuxPhy, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Schedule(), ns3::ListErrorModel::SetList(), and ns3::WIFI_QOSDATA_QUEUE.
Referenced by Transmit().
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 3609 of file wifi-emlsr-test.cc.
References CheckResults(), ns3::Simulator::Destroy(), EmlsrOperationsTestBase::m_duration, ns3::Simulator::Run(), and ns3::Simulator::Stop().
|
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 ns3::TestCase.
Definition at line 3577 of file wifi-emlsr-test.cc.
References ns3::CreateObject(), EmlsrOperationsTestBase::DoSetup(), EmlsrOperationsTestBase::m_apMac, m_auxPhyMaxChWidth, m_errorModel, m_resetCamStateAndInterruptSwitch, 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.
|
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 3511 of file wifi-emlsr-test.cc.
References ns3::AC_BE, CheckInitialControlFrame(), CheckQosFrames(), CheckRtsFrame(), EmlsrOperationsTestBase::m_apMac, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::m_txPsdus, NS_ASSERT_MSG, NS_TEST_EXPECT_MSG_EQ, ns3::WifiActionHeader::Peek(), ns3::WifiActionHeader::PROTECTED_EHT, ns3::WifiActionHeader::PROTECTED_EHT_EML_OPERATING_MODE_NOTIFICATION, EmlsrOperationsTestBase::Transmit(), ns3::WIFI_MAC_CTL_RTS, 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 770 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), and DoSetup().
|
private |
counter for ICF frames
Definition at line 772 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), and CheckResults().
|
private |
counter for QoS data frames
Definition at line 771 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), and CheckQosFrames().
|
private |
counter for RTS frames
Definition at line 773 of file wifi-emlsr-test.h.
Referenced by CheckRtsFrame().
|
private |
error rate model to corrupt packets at AP MLD
Definition at line 775 of file wifi-emlsr-test.h.
Referenced by CheckRtsFrame(), and DoSetup().
|
private |
whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY has just switched to and whether main PHY switch can be interrupted
Definition at line 767 of file wifi-emlsr-test.h.
Referenced by CheckResults(), CheckRtsFrame(), and 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 764 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), CheckResults(), CheckRtsFrame(), and DoSetup().
|
private |
position in the vector of TX PSDUs of the first ICF
Definition at line 774 of file wifi-emlsr-test.h.
Referenced by CheckInitialControlFrame(), and CheckResults().