Test the transmission of UL frames from EMLSR clients. More...
#include "wifi-emlsr-test.h"
Classes | |
struct | Params |
Parameters for the EMLSR UL TXOP test. More... | |
Public Member Functions | |
EmlsrUlTxopTest (const Params ¶ms) | |
Constructor. More... | |
~EmlsrUlTxopTest () 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 | CheckBlockAck (const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId) |
Check that appropriate actions are taken when an MLD transmits a PPDU containing BlockAck frames on the given link. More... | |
void | CheckCtsFrames (Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId) |
Check that appropriate actions are taken by the EMLSR client when receiving a CTS frame on the given link. More... | |
void | CheckQosFrames (const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId) |
Check that appropriate actions are taken when an MLD transmits a PPDU containing QoS data frames on the given link. More... | |
void | CheckResults () |
Check that the simulation produced the expected results. More... | |
void | CheckRtsFrames (Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId) |
Check that appropriate actions are taken by the EMLSR client when transmitting an RTS frame on the given link. 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 Member Functions | |
void | BackoffGenerated (uint32_t backoff, uint8_t linkId) |
Callback invoked when a new backoff value is generated by the EMLSR client. More... | |
void | StartTraffic () override |
Start the generation of traffic (needs to be overridden) More... | |
Private Attributes | |
uint16_t | m_auxPhyChannelWidth |
max width (MHz) supported by aux PHYs More... | |
std::optional< Time > | m_backoffEndTime |
expected backoff end time on main PHY link More... | |
uint16_t | m_channelWidth |
width (MHz) of the channels used by MLDs More... | |
bool | m_checkBackoffStarted |
whether we are checking the generated backoff values More... | |
std::optional< bool > | m_corruptCts |
whether the transmitted CTS must be corrupted More... | |
std::size_t | m_countBlockAck |
counter for BlockAck frames More... | |
std::size_t | m_countQoSframes |
counter for QoS frames More... | |
std::size_t | m_countRtsframes |
counter for RTS frames More... | |
Time | m_emlsrEnabledTime |
when EMLSR mode has been enabled on all EMLSR clients More... | |
std::set< uint8_t > | m_emlsrLinks |
IDs of the links on which EMLSR mode has to be enabled. More... | |
Ptr< ListErrorModel > | m_errorModel |
error rate model to corrupt packets More... | |
Time | m_firstUlPktsGenTime |
generation time of the first two UL packets More... | |
bool | m_genBackoffIfTxopWithoutTx |
whether the backoff should be invoked when the AC gains the right to start a TXOP but it does not transmit any frame More... | |
Time | m_lastMsdExpiryTime |
expiry time of the last MediumSyncDelay timer More... | |
Time | m_mediumSyncDuration |
duration of the MediumSyncDelay timer More... | |
uint8_t | m_msdMaxNTxops |
Max number of TXOPs that an EMLSR client is allowed to attempt to initiate while the MediumSyncDelay timer is running (zero indicates no limit) More... | |
std::optional< uint8_t > | m_nonEmlsrLink |
ID of the non-EMLSR link (if any) More... | |
const Time | m_unblockMainPhyLinkDelay |
delay between the time the first two UL packets are generated and the time transmissions are unblocked on the link where the main PHY is operating on 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 transmission of UL frames from EMLSR clients.
This test considers an AP MLD and a non-AP MLD that support EMLSR. The non-AP MLD setups three links, while the set of EMLSR links is configurable. Block ack agreements (for TID 0) for both DL and UL directions are established after that the EML Operating Mode Notification frames are exchanged to enable the EMLSR mode on the EMLSR links. Aux PHYs on the EMLSR client do not switch link, hence the main PHY will switch link (if needed) when terminating a TXOP.
It is checked that:
Definition at line 509 of file wifi-emlsr-test.h.
EmlsrUlTxopTest::EmlsrUlTxopTest | ( | const Params & | params | ) |
Constructor.
params | parameters for the EMLSR UL TXOP test |
Definition at line 2255 of file wifi-emlsr-test.cc.
References EmlsrOperationsTestBase::m_duration, m_emlsrLinks, EmlsrOperationsTestBase::m_establishBaDl, EmlsrOperationsTestBase::m_establishBaUl, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_nEmlsrStations, EmlsrOperationsTestBase::m_nNonEmlsrStations, m_nonEmlsrLink, EmlsrOperationsTestBase::m_transitionDelay, ns3::MicroSeconds(), NS_ABORT_MSG_IF, two-ray-to-three-gpp-ch-calibration::params, and ns3::Seconds().
|
overridedefault |
|
private |
Callback invoked when a new backoff value is generated by the EMLSR client.
backoff | the generated backoff value |
linkId | the ID of the link for which the backoff value has been generated |
Definition at line 2346 of file wifi-emlsr-test.cc.
References ns3::AC_BE, m_backoffEndTime, m_checkBackoffStarted, m_genBackoffIfTxopWithoutTx, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, ns3::Now(), NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoSetup().
|
protected |
Check that appropriate actions are taken when an MLD transmits a PPDU containing BlockAck frames on the given link.
psduMap | the PSDU carrying BlockAck frames |
txVector | the TXVECTOR used to send the PPDU |
linkId | the ID of the given link |
Definition at line 2606 of file wifi-emlsr-test.cc.
References ns3::AC_BE, ns3::Time::As(), ns3::WifiMac::GetAddress(), EmlsrOperationsTestBase::GetApplication(), ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetWifiPhy(), EmlsrOperationsTestBase::m_apMac, m_backoffEndTime, m_checkBackoffStarted, m_countBlockAck, m_lastMsdExpiryTime, EmlsrOperationsTestBase::m_mainPhyId, m_nonEmlsrLink, EmlsrOperationsTestBase::m_staMacs, Max, ns3::NanoSeconds(), ns3::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, EmlsrOperationsTestBase::UPLINK, and ns3::WIFI_QOSDATA_QUEUE.
Referenced by Transmit().
|
protected |
Check that appropriate actions are taken by the EMLSR client when receiving a CTS frame on the given link.
mpdu | the MPDU carrying the CTS frame |
txVector | the TXVECTOR used to send the PPDU |
linkId | the ID of the given link |
Definition at line 2791 of file wifi-emlsr-test.cc.
References ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetWifiPhy(), EmlsrOperationsTestBase::m_apMac, m_corruptCts, m_errorModel, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, and ns3::ListErrorModel::SetList().
Referenced by Transmit().
|
protected |
Check that appropriate actions are taken when an MLD transmits a PPDU containing QoS data frames 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 2471 of file wifi-emlsr-test.cc.
References ns3::AC_BE, EmlsrOperationsTestBase::CheckBlockedLink(), ns3::WifiMac::GetAddress(), EmlsrOperationsTestBase::GetApplication(), ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetWifiPhy(), EmlsrOperationsTestBase::m_apMac, m_countQoSframes, EmlsrOperationsTestBase::m_mainPhyId, m_nonEmlsrLink, EmlsrOperationsTestBase::m_staMacs, ns3::MicroSeconds(), NS_LOG_INFO, EmlsrOperationsTestBase::UPLINK, and ns3::WIFI_QOSDATA_QUEUE.
Referenced by Transmit().
|
protected |
Check that the simulation produced the expected results.
EMLSR client with EMLSR mode enabled on all links (main PHY ID = 1).
main PHY│ blocked,│ aux PHYs││main PHY blocked│ cannot │ transmit│ │ ┌───┐ ┌──┐ [link 0] │CTS│ │BA│ ────────────────────────┬───┬┴───┴┬───┬───┬┴──┴───────────────────────────────────────── │RTS│ │QoS│QoS│ └───┘ │ 6 │ 7 │ └───┴───┘ gen backoff gen backoff if MediumSyncDelay ┌──┐ (also many times) not running timer expired ┌──┐ [link 1] │BA│ │ if allowed │ │ │BA│ ─────────┬───┬───┬┴──┴───────────────────────────┬───┬─────┬───┬────┬───┬───┬┴──┴─────── │QoS│QoS│ │RTS│ ... │RTS│ │QoS│QoS│ │ 4 │ 5 │ └───┘ └───┘ │ 8 │ 9 │ └───┴───┘ └───┴───┘
[link 2] ───────────────────────────────────────────────────────────────────────────
EMLSR client with EMLSR mode enabled on links 0 and 1 (main PHY ID = 1).
main PHY │ and │ non-EMLSR│ link │ blocked,│ aux PHYs││main PHY blocked│ cannot │ transmit│ │ ┌───┐ ┌──┐ [link 0] │CTS│ │BA│ ────────────────────────┬───┬┴───┴┬───┬───┬┴──┴───────────────────────────────────────── │RTS│ │QoS│QoS│ └───┘ │ 8 │ 9 │ └───┴───┘ gen backoff gen backoff if MediumSyncDelay ┌──┐ (also many times) not running timer expired ┌──┐ [link 1] │BA│ │ if allowed │ │ │BA│ ─────────┬───┬───┬┴──┴───────────────────────────┬───┬─────┬───┬────┬───┬───┬┴──┴─────── │QoS│QoS│ │RTS│ ... │RTS│ │QoS│QoS│ │ 4 │ 5 │ └───┘ └───┘ │ 10│ 11│ └───┴───┘ └───┴───┘ ┌──┐ [link 2] │BA│ ──────────┬───┬───┬┴──┴──────────────────────────────────────────────────────────── │QoS│QoS│ │ 6 │ 7 │ └───┴───┘
For both scenarios, after the last frame exchange on the main PHY link, we have the following frame exchange on an EMLSR link where an aux PHY is operating on:
┌───┐ ┌───┐ ┌──┐ │CTS│ │CTS│ │BA│
──────┬───┬┴───X─────────┬───┬┴───┴┬───┬───┬┴──┴───────────────────────────────────── │RTS│ │RTS│ │QoS│QoS│ └───┘ └───┘ │ X │ Y │ └───┴───┘ For all EMLSR links scenario, X=10, Y=11; otherwise, X=12, Y=13.
Definition at line 2827 of file wifi-emlsr-test.cc.
References ns3::CtrlTriggerHeader::IsMuRts(), m_auxPhyChannelWidth, m_countRtsframes, m_firstUlPktsGenTime, m_lastMsdExpiryTime, EmlsrOperationsTestBase::m_mainPhyId, m_msdMaxNTxops, m_nonEmlsrLink, EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::m_txPsdus, m_unblockMainPhyLinkDelay, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT_OR_EQ, NS_TEST_EXPECT_MSG_LT, NS_TEST_EXPECT_MSG_LT_OR_EQ, and NS_TEST_EXPECT_MSG_NE.
Referenced by DoRun().
|
protected |
Check that appropriate actions are taken by the EMLSR client when transmitting an RTS frame on the given link.
mpdu | the MPDU carrying the RTS frame |
txVector | the TXVECTOR used to send the PPDU |
linkId | the ID of the given link |
Definition at line 2753 of file wifi-emlsr-test.cc.
References ns3::WifiTxVector::GetChannelWidth(), ns3::Time::IsZero(), m_corruptCts, m_countRtsframes, m_errorModel, m_firstUlPktsGenTime, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, and ns3::ListErrorModel::SetList().
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 2816 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 2297 of file wifi-emlsr-test.cc.
References ns3::AC_BE, BackoffGenerated(), EmlsrOperationsTestBase::DoSetup(), ns3::WifiMac::GetWifiPhy(), EmlsrOperationsTestBase::m_apMac, m_auxPhyChannelWidth, m_channelWidth, m_errorModel, m_genBackoffIfTxopWithoutTx, EmlsrOperationsTestBase::m_mainPhyId, m_mediumSyncDuration, m_msdMaxNTxops, EmlsrOperationsTestBase::m_staMacs, third::mac, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::Config::SetDefault(), ns3::WifiPhy::SetPostReceptionErrorModel(), ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PHY_BAND_6GHZ.
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from EmlsrOperationsTestBase.
Definition at line 2427 of file wifi-emlsr-test.cc.
References ns3::WifiMac::GetAddress(), EmlsrOperationsTestBase::GetApplication(), EmlsrOperationsTestBase::m_apMac, m_firstUlPktsGenTime, EmlsrOperationsTestBase::m_mainPhyId, m_nonEmlsrLink, EmlsrOperationsTestBase::m_staMacs, m_unblockMainPhyLinkDelay, ns3::MilliSeconds(), ns3::Now(), NS_LOG_INFO, and EmlsrOperationsTestBase::UPLINK.
|
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 2387 of file wifi-emlsr-test.cc.
References CheckBlockAck(), CheckCtsFrames(), CheckQosFrames(), CheckRtsFrames(), EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_txPsdus, third::mac, NS_ASSERT_MSG, NS_TEST_EXPECT_MSG_EQ, EmlsrOperationsTestBase::Transmit(), ns3::WIFI_MAC_CTL_BACKRESP, ns3::WIFI_MAC_CTL_CTS, ns3::WIFI_MAC_CTL_RTS, ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, and ns3::WIFI_MAC_QOSDATA.
|
private |
max width (MHz) supported by aux PHYs
Definition at line 609 of file wifi-emlsr-test.h.
Referenced by CheckResults(), and DoSetup().
|
private |
expected backoff end time on main PHY link
Definition at line 622 of file wifi-emlsr-test.h.
Referenced by BackoffGenerated(), and CheckBlockAck().
|
private |
width (MHz) of the channels used by MLDs
Definition at line 608 of file wifi-emlsr-test.h.
Referenced by DoSetup().
|
private |
whether we are checking the generated backoff values
Definition at line 621 of file wifi-emlsr-test.h.
Referenced by BackoffGenerated(), and CheckBlockAck().
|
private |
whether the transmitted CTS must be corrupted
Definition at line 630 of file wifi-emlsr-test.h.
Referenced by CheckCtsFrames(), and CheckRtsFrames().
|
private |
counter for BlockAck frames
Definition at line 625 of file wifi-emlsr-test.h.
Referenced by CheckBlockAck().
|
private |
counter for QoS frames
Definition at line 624 of file wifi-emlsr-test.h.
Referenced by CheckQosFrames().
|
private |
counter for RTS frames
Definition at line 626 of file wifi-emlsr-test.h.
Referenced by CheckResults(), and CheckRtsFrames().
|
private |
when EMLSR mode has been enabled on all EMLSR clients
Definition at line 615 of file wifi-emlsr-test.h.
|
private |
IDs of the links on which EMLSR mode has to be enabled.
Definition at line 607 of file wifi-emlsr-test.h.
Referenced by EmlsrUlTxopTest().
|
private |
error rate model to corrupt packets
Definition at line 623 of file wifi-emlsr-test.h.
Referenced by CheckCtsFrames(), CheckRtsFrames(), and DoSetup().
|
private |
generation time of the first two UL packets
Definition at line 616 of file wifi-emlsr-test.h.
Referenced by CheckResults(), CheckRtsFrames(), and StartTraffic().
|
private |
whether the backoff should be invoked when the AC gains the right to start a TXOP but it does not transmit any frame
Definition at line 627 of file wifi-emlsr-test.h.
Referenced by BackoffGenerated(), and DoSetup().
|
private |
expiry time of the last MediumSyncDelay timer
Definition at line 620 of file wifi-emlsr-test.h.
Referenced by CheckBlockAck(), and CheckResults().
|
private |
duration of the MediumSyncDelay timer
Definition at line 610 of file wifi-emlsr-test.h.
Referenced by DoSetup().
|
private |
Max number of TXOPs that an EMLSR client is allowed to attempt to initiate while the MediumSyncDelay timer is running (zero indicates no limit)
Definition at line 611 of file wifi-emlsr-test.h.
Referenced by CheckResults(), and DoSetup().
|
private |
ID of the non-EMLSR link (if any)
Definition at line 614 of file wifi-emlsr-test.h.
Referenced by EmlsrUlTxopTest(), CheckBlockAck(), CheckQosFrames(), CheckResults(), and StartTraffic().
|
private |
delay between the time the first two UL packets are generated and the time transmissions are unblocked on the link where the main PHY is operating on
Definition at line 617 of file wifi-emlsr-test.h.
Referenced by CheckResults(), and StartTraffic().