Test the exchange of EML Operating Mode Notification frames. More...
#include "wifi-emlsr-enabling-test.h"
Inheritance diagram for EmlOmnExchangeTest:
Collaboration diagram for EmlOmnExchangeTest:Public Member Functions | |
| EmlOmnExchangeTest (const std::set< uint8_t > &linksToEnableEmlsrOn, Time transitionTimeout) | |
| Constructor. | |
| ~EmlOmnExchangeTest () 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 | CheckEmlCapabilitiesInAssocReq (Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId) |
| Check the content of the EML Capabilities subfield of the Multi-Link Element included in the Association Request frame sent by the non-AP MLD. | |
| void | CheckEmlCapabilitiesInAssocResp (Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId) |
| Check the content of the EML Capabilities subfield of the Multi-Link Element included in the Association Response frame sent by the AP MLD to the EMLSR client. | |
| void | CheckEmlNotification (Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint8_t linkId) |
| Check the content of a received EML Operating Mode Notification frame. | |
| void | CheckEmlsrLinks () |
| Check that the EMLSR mode has been enabled on the expected EMLSR links. | |
| 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 | TxDropped (WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu) |
| Callback invoked when the non-AP MLD drops the given MPDU for the given reason. | |
| void | TxOk (Ptr< const WifiMpdu > mpdu) |
| Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU. | |
Protected Member Functions inherited from EmlsrOperationsTestBase | |
| void | CheckAuxPhysSleepMode (Ptr< StaWifiMac > staMac, bool sleep) |
| Check whether aux PHYs of the given device are in sleep mode/awake. | |
| 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 | CheckMainPhyTraceInfo (std::size_t index, std::string_view reason, const std::optional< uint8_t > &fromLinkId, uint8_t toLinkId, bool checkFromLinkId=true, bool checkToLinkId=true) |
| Check information provided by the EMLSR Manager MainPhySwitch trace. | |
| void | CheckMsdTimerRunning (Ptr< StaWifiMac > staMac, uint8_t linkId, bool isRunning, const std::string &msg) |
| Check whether the MediumSyncDelay timer is running on the given link of 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, uint8_t priority=0) const |
| virtual void | MainPhySwitchInfoCallback (std::size_t index, const EmlsrMainPhySwitchTrace &info) |
| Callback connected to the EMLSR Manager MainPhySwitch trace source. | |
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 | |
| std::size_t | m_checkEmlsrLinksCount |
| counter for the number of times CheckEmlsrLinks is called (should be two: when the transition timeout expires and when the EML Notification response from the AP MLD is received | |
| std::size_t | m_emlNotificationDroppedCount |
| counter for the number of times the EML Notification frame sent by the non-AP MLD has been dropped due to max retry limit | |
| Ptr< ListErrorModel > | m_errorModel |
| error rate model to corrupt packets at AP MLD | |
| std::list< uint64_t > | m_uidList |
| list of UIDs of packets to corrupt | |
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... | |
Protected Attributes inherited from EmlsrOperationsTestBase | |
| Ptr< ApWifiMac > | m_apMac |
| AP wifi MAC. | |
| std::array< std::string, 3 > | m_channelsStr |
| array of strings defining the channels for the MLD links | |
| std::vector< PacketSocketAddress > | m_dlSockets |
| packet socket address for DL traffic | |
| Time | m_duration {0} |
| simulation duration | |
| std::vector< uint8_t > | m_establishBaDl {} |
| the TIDs for which BA needs to be established with the AP as originator | |
| std::vector< uint8_t > | m_establishBaUl {} |
| the TIDs for which BA needs to be established with the AP as recipient | |
| const std::array< FrequencyRange, 3 > | m_freqRanges |
| array of frequency ranges for MLD links | |
| 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::size_t | m_nPhysPerEmlsrDevice {3} |
| number of PHYs per EMLSR client | |
| std::vector< Time > | m_paddingDelay |
| Padding Delay advertised by the non-AP MLD. | |
| bool | m_putAuxPhyToSleep {false} |
| whether aux PHYs are put to sleep during DL/UL TXOPs | |
| uint64_t | m_rngRun {1} |
| RNG run value. | |
| uint32_t | m_rngSeed {1} |
| RNG seed value. | |
| std::vector< Ptr< StaWifiMac > > | m_staMacs |
| MACs of the non-AP MLDs. | |
| uint16_t | m_startAid {1} |
| first AID to allocate to stations | |
| int64_t | m_streamNo {5} |
| RNG stream number. | |
| std::map< std::size_t, std::shared_ptr< EmlsrMainPhySwitchTrace > > | m_traceInfo |
| EMLSR client ID-indexed map of trace info from last main PHY switch. | |
| 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 exchange of EML Operating Mode Notification frames.
This test considers an AP MLD and a non-AP MLD with EMLSR activated. Upon association, the non-AP MLD sends an EML Operating Mode Notification frame, which is however corrupted by using a post reception error model (installed on the AP MLD). We keep corrupting the EML Notification frames transmitted by the non-AP MLD until the frame is dropped due to exceeded max retry limit. It is checked that:
Definition at line 57 of file wifi-emlsr-enabling-test.h.
| EmlOmnExchangeTest::EmlOmnExchangeTest | ( | const std::set< uint8_t > & | linksToEnableEmlsrOn, |
| Time | transitionTimeout ) |
Constructor.
| linksToEnableEmlsrOn | IDs of links on which EMLSR mode should be enabled |
| transitionTimeout | the Transition Timeout advertised by the AP MLD |
Definition at line 79 of file wifi-emlsr-enabling-test.cc.
References EmlsrOperationsTestBase::EmlsrOperationsTestBase(), m_checkEmlsrLinksCount, EmlsrOperationsTestBase::m_duration, m_emlNotificationDroppedCount, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_nEmlsrStations, EmlsrOperationsTestBase::m_nNonEmlsrStations, EmlsrOperationsTestBase::m_transitionTimeout, and ns3::Seconds().
Here is the call graph for this function:
|
overridedefault |
|
protected |
Check the content of the EML Capabilities subfield of the Multi-Link Element included in the Association Request frame sent by the non-AP MLD.
| mpdu | the MPDU containing the Association Request frame |
| txVector | the TXVECTOR used to transmit the frame |
| linkId | the ID of the link on which the frame was transmitted |
Definition at line 155 of file wifi-emlsr-enabling-test.cc.
References EmlsrOperationsTestBase::m_paddingDelay, EmlsrOperationsTestBase::m_transitionDelay, and NS_TEST_ASSERT_MSG_EQ.
Referenced by Transmit().
Here is the caller graph for this function:
|
protected |
Check the content of the EML Capabilities subfield of the Multi-Link Element included in the Association Response frame sent by the AP MLD to the EMLSR client.
| mpdu | the MPDU containing the Association Response frame |
| txVector | the TXVECTOR used to transmit the frame |
| linkId | the ID of the link on which the frame was transmitted |
Definition at line 180 of file wifi-emlsr-enabling-test.cc.
References EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::m_transitionTimeout, and NS_TEST_ASSERT_MSG_EQ.
Referenced by Transmit().
Here is the caller graph for this function:
|
protected |
Check the content of a received EML Operating Mode Notification frame.
| psdu | the PSDU containing the EML Operating Mode Notification frame |
| txVector | the TXVECTOR used to transmit the frame |
| linkId | the ID of the link on which the frame was transmitted |
Definition at line 212 of file wifi-emlsr-enabling-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), CheckEmlsrLinks(), ns3::MgtEmlOmn::EmlControl::emlmrMode, ns3::MgtEmlOmn::EmlControl::emlsrMode, ns3::MgtEmlOmn::EmlControl::emlsrParamUpdateCtrl, ns3::MgtEmlOmn::GetLinkBitmap(), ns3::MgtEmlOmn::EmlControl::linkBitmap, ns3::MgtEmlOmn::m_emlControl, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, ns3::MicroSeconds(), NS_LOG_DEBUG, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ns3::WifiActionHeader::Remove(), and ns3::Simulator::Schedule().
Referenced by Transmit().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Check that the EMLSR mode has been enabled on the expected EMLSR links.
Definition at line 316 of file wifi-emlsr-enabling-test.cc.
References m_checkEmlsrLinksCount, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_staMacs, and NS_TEST_EXPECT_MSG_EQ.
Referenced by CheckEmlNotification(), and TxOk().
Here is the caller graph for this function:
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 334 of file wifi-emlsr-enabling-test.cc.
References ns3::Simulator::Destroy(), m_checkEmlsrLinksCount, EmlsrOperationsTestBase::m_duration, m_emlNotificationDroppedCount, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), and ns3::Simulator::Stop().
Here is the call graph for this function:
|
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 93 of file wifi-emlsr-enabling-test.cc.
References ns3::CreateObject(), EmlsrOperationsTestBase::DoSetup(), EmlsrOperationsTestBase::m_apMac, m_errorModel, EmlsrOperationsTestBase::m_staMacs, ns3::MakeCallback(), TxDropped(), and TxOk().
Here is the call graph for this function:
|
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 110 of file wifi-emlsr-enabling-test.cc.
References CheckEmlCapabilitiesInAssocReq(), CheckEmlCapabilitiesInAssocResp(), CheckEmlNotification(), m_emlNotificationDroppedCount, m_errorModel, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::m_txPsdus, m_uidList, 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_MGT_ACTION, ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, and ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE.
Here is the call graph for this function:
|
protected |
Callback invoked when the non-AP MLD drops the given MPDU for the given reason.
| reason | the reason why the MPDU was dropped |
| mpdu | the dropped MPDU |
Definition at line 297 of file wifi-emlsr-enabling-test.cc.
References m_emlNotificationDroppedCount, ns3::WifiActionHeader::Peek(), ns3::WifiActionHeader::PROTECTED_EHT, and ns3::WifiActionHeader::PROTECTED_EHT_EML_OPERATING_MODE_NOTIFICATION.
Referenced by DoSetup().
Here is the call graph for this function:
Here is the caller graph for this function:Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU.
| mpdu | the acknowledged MPDU |
Definition at line 276 of file wifi-emlsr-enabling-test.cc.
References CheckEmlsrLinks(), EmlsrOperationsTestBase::m_transitionTimeout, ns3::NanoSeconds(), ns3::WifiActionHeader::Peek(), ns3::WifiActionHeader::PROTECTED_EHT, ns3::WifiActionHeader::PROTECTED_EHT_EML_OPERATING_MODE_NOTIFICATION, and ns3::Simulator::Schedule().
Referenced by DoSetup().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
counter for the number of times CheckEmlsrLinks is called (should be two: when the transition timeout expires and when the EML Notification response from the AP MLD is received
Definition at line 130 of file wifi-emlsr-enabling-test.h.
Referenced by EmlOmnExchangeTest(), CheckEmlsrLinks(), and DoRun().
|
private |
counter for the number of times the EML Notification frame sent by the non-AP MLD has been dropped due to max retry limit
Definition at line 134 of file wifi-emlsr-enabling-test.h.
Referenced by EmlOmnExchangeTest(), DoRun(), Transmit(), and TxDropped().
|
private |
error rate model to corrupt packets at AP MLD
Definition at line 137 of file wifi-emlsr-enabling-test.h.
Referenced by DoSetup(), and Transmit().
|
private |
list of UIDs of packets to corrupt
Definition at line 138 of file wifi-emlsr-enabling-test.h.
Referenced by Transmit().