Test the switching of PHYs on EMLSR clients. More...
Public Member Functions | |
EmlsrLinkSwitchTest (bool switchAuxPhy, bool resetCamState, uint16_t auxPhyMaxChWidth) | |
Constructor. | |
~EmlsrLinkSwitchTest () override=default | |
![]() | |
EmlsrOperationsTestBase (const std::string &name) | |
Constructor. | |
~EmlsrOperationsTestBase () override=default | |
![]() | |
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 | 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. | |
![]() | |
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 |
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. | |
![]() | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, TestDuration 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 | |
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 | |
![]() | |
enum | TrafficDirection : uint8_t { DOWNLINK = 0 , UPLINK } |
Enumeration for traffic directions. More... | |
![]() | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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):
Definition at line 2644 of file wifi-emlsr-test.cc.
EmlsrLinkSwitchTest::EmlsrLinkSwitchTest | ( | bool | switchAuxPhy, |
bool | resetCamState, | ||
uint16_t | auxPhyMaxChWidth | ||
) |
Constructor.
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 the Aux PHY |
resetCamState | whether to reset the state of the ChannelAccessManager associated with the link on which the main PHY has just switched to |
auxPhyMaxChWidth | max channel width (MHz) supported by aux PHYs |
Definition at line 2708 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, 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
|------— aux PHY A ------—|---— main PHY ---—| ┌───┐ ┌───┐ │ICF│ │QoS│ ──────────────────────────┴───┴┬───┬┴───┴┬──┬──────────────────────────────────────────────── [link 0] │CTS│ │BA│ └───┘ └──┘
|------— main PHY -------—| ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ICF│ │QoS│ │ICF│ │ICF│ │ICF│ ───┴───┴┬───┬┴───┴┬──┬──────────────────────────────────────────────────┴───┴──┴───┴──┴───┴── [link 1]│CTS│ │BA│ └───┘ └──┘
|------------------— aux PHY B -----------------—|------------— main PHY -----------— ┌───┐ ┌───┐ │ICF│ │QoS│ ─────────────────────────────────────────────────┴───┴┬───┬┴───┴┬──┬───────────────────────── [link 2] │CTS│ │BA│ └───┘ └──┘
Definition at line 2950 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_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT, NS_TEST_EXPECT_MSG_LT_OR_EQ, NS_TEST_EXPECT_MSG_NE, 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 2830 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 3033 of file wifi-emlsr-test.cc.
References 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().
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 2819 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 EmlsrOperationsTestBase.
Definition at line 2798 of file wifi-emlsr-test.cc.
References EmlsrOperationsTestBase::DoSetup(), EmlsrOperationsTestBase::m_apMac, m_auxPhyMaxChWidth, m_resetCamState, EmlsrOperationsTestBase::m_staMacs, m_switchAuxPhy, 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 2730 of file wifi-emlsr-test.cc.
References ns3::AC_BE, ns3::WifiActionHeader::BLOCK_ACK, ns3::WifiActionHeader::BLOCK_ACK_ADDBA_RESPONSE, 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, 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_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 2703 of file wifi-emlsr-test.cc.
Referenced by CheckInitialControlFrame(), and DoSetup().
|
private |
counter for QoS data frames
Definition at line 2704 of file wifi-emlsr-test.cc.
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 2701 of file wifi-emlsr-test.cc.
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 2699 of file wifi-emlsr-test.cc.
Referenced by CheckInitialControlFrame(), CheckResults(), and DoSetup().
|
private |
a position in the vector of TX PSDUs
Definition at line 2705 of file wifi-emlsr-test.cc.
Referenced by CheckInitialControlFrame(), CheckResults(), and Transmit().