A Discrete-Event Network Simulator
API
EmlOmnExchangeTest Class Reference

Test the exchange of EML Operating Mode Notification frames. More...

#include "wifi-emlsr-test.h"

+ Inheritance diagram for EmlOmnExchangeTest:
+ Collaboration diagram for EmlOmnExchangeTest:

Public Member Functions

 EmlOmnExchangeTest (const std::set< uint8_t > &linksToEnableEmlsrOn, Time transitionTimeout)
 Constructor. More...
 
 ~EmlOmnExchangeTest () 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
 
TestCaseoperator= (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. More...
 
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. More...
 
void CheckEmlNotification (Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint8_t linkId)
 Check the content of a received EML Operating Mode Notification frame. More...
 
void CheckEmlsrLinks ()
 Check that the EMLSR mode has been enabled on the expected EMLSR links. 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...
 
void TxDropped (WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
 Callback invoked when the non-AP MLD drops the given MPDU for the given reason. More...
 
void TxOk (Ptr< const WifiMpdu > mpdu)
 Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU. 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< PacketSocketClientGetApplication (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...
 
TestCaseGetParent () 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

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 More...
 
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 More...
 
Ptr< ListErrorModelm_errorModel
 error rate model to corrupt packets at AP MLD More...
 
std::list< uint64_t > m_uidList
 list of UIDs of packets to corrupt 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< ApWifiMacm_apMac
 AP wifi MAC. More...
 
std::vector< PacketSocketAddressm_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< Timem_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< Timem_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< FrameInfom_txPsdus
 transmitted PSDUs More...
 
std::vector< PacketSocketAddressm_ulSockets
 packet socket address for UL traffic More...
 

Detailed Description

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:

  • the Association Request contains a Multi-Link Element including an EML Capabilities field that contains the expected values for Padding Delay and Transition Delay
  • the Association Response contains a Multi-Link Element including an EML Capabilities field that contains the expected value for Transition Timeout
  • all EML Notification frames contain the expected values for EMLSR Mode, EMLMR Mode and Link Bitmap fields and are transmitted on the link used for association
  • the correct EMLSR link set is stored by the EMLSR Manager, both when the transition timeout expires and when an EML Notification response is received from the AP MLD (thus, the correct EMLSR link set is stored after whichever of the two events occur first)

Definition at line 214 of file wifi-emlsr-test.h.

Constructor & Destructor Documentation

◆ EmlOmnExchangeTest()

EmlOmnExchangeTest::EmlOmnExchangeTest ( const std::set< uint8_t > &  linksToEnableEmlsrOn,
Time  transitionTimeout 
)

Constructor.

Parameters
linksToEnableEmlsrOnIDs of links on which EMLSR mode should be enabled
transitionTimeoutthe Transition Timeout advertised by the AP MLD

Definition at line 429 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::m_duration, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_nEmlsrStations, EmlsrOperationsTestBase::m_nNonEmlsrStations, EmlsrOperationsTestBase::m_transitionTimeout, and ns3::Seconds().

+ Here is the call graph for this function:

◆ ~EmlOmnExchangeTest()

EmlOmnExchangeTest::~EmlOmnExchangeTest ( )
overridedefault

Member Function Documentation

◆ CheckEmlCapabilitiesInAssocReq()

void EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocReq ( Ptr< const WifiMpdu mpdu,
const WifiTxVector txVector,
uint8_t  linkId 
)
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.

Parameters
mpduthe MPDU containing the Association Request frame
txVectorthe TXVECTOR used to transmit the frame
linkIdthe ID of the link on which the frame was transmitted

Definition at line 505 of file wifi-emlsr-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:

◆ CheckEmlCapabilitiesInAssocResp()

void EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocResp ( Ptr< const WifiMpdu mpdu,
const WifiTxVector txVector,
uint8_t  linkId 
)
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.

Parameters
mpduthe MPDU containing the Association Response frame
txVectorthe TXVECTOR used to transmit the frame
linkIdthe ID of the link on which the frame was transmitted

Definition at line 530 of file wifi-emlsr-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:

◆ CheckEmlNotification()

void EmlOmnExchangeTest::CheckEmlNotification ( Ptr< const WifiPsdu psdu,
const WifiTxVector txVector,
uint8_t  linkId 
)
protected

Check the content of a received EML Operating Mode Notification frame.

Parameters
psduthe PSDU containing the EML Operating Mode Notification frame
txVectorthe TXVECTOR used to transmit the frame
linkIdthe ID of the link on which the frame was transmitted

Definition at line 562 of file wifi-emlsr-test.cc.

References ns3::WifiPsdu::begin(), 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, and NS_TEST_EXPECT_MSG_EQ.

Referenced by Transmit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckEmlsrLinks()

void EmlOmnExchangeTest::CheckEmlsrLinks ( )
protected

Check that the EMLSR mode has been enabled on the expected EMLSR links.

Definition at line 666 of file wifi-emlsr-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:

◆ DoRun()

void EmlOmnExchangeTest::DoRun ( )
overrideprotectedvirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 684 of file wifi-emlsr-test.cc.

References m_checkEmlsrLinksCount, EmlsrOperationsTestBase::m_duration, m_emlNotificationDroppedCount, and NS_TEST_EXPECT_MSG_EQ.

◆ DoSetup()

void EmlOmnExchangeTest::DoSetup ( )
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 443 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::DoSetup(), ns3::WifiMac::GetNLinks(), ns3::WifiMac::GetWifiPhy(), EmlsrOperationsTestBase::m_apMac, m_errorModel, EmlsrOperationsTestBase::m_staMacs, ns3::MakeCallback(), ns3::WifiPhy::SetPostReceptionErrorModel(), TxDropped(), and TxOk().

+ Here is the call graph for this function:

◆ Transmit()

void EmlOmnExchangeTest::Transmit ( Ptr< WifiMac mac,
uint8_t  phyId,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)
overrideprotectedvirtual

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
macthe MAC transmitting the PSDUs
phyIdthe ID of the PHY transmitting the PSDUs
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

Reimplemented from EmlsrOperationsTestBase.

Definition at line 460 of file wifi-emlsr-test.cc.

References check-style-clang-format::action, CheckEmlCapabilitiesInAssocReq(), CheckEmlCapabilitiesInAssocResp(), CheckEmlNotification(), m_emlNotificationDroppedCount, m_errorModel, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_staMacs, EmlsrOperationsTestBase::m_txPsdus, m_uidList, third::mac, NS_TEST_EXPECT_MSG_EQ, ns3::ListErrorModel::SetList(), 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:

◆ TxDropped()

void EmlOmnExchangeTest::TxDropped ( WifiMacDropReason  reason,
Ptr< const WifiMpdu mpdu 
)
protected

Callback invoked when the non-AP MLD drops the given MPDU for the given reason.

Parameters
reasonthe reason why the MPDU was dropped
mpduthe dropped MPDU

Definition at line 647 of file wifi-emlsr-test.cc.

References check-style-clang-format::action, and m_emlNotificationDroppedCount.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ TxOk()

void EmlOmnExchangeTest::TxOk ( Ptr< const WifiMpdu mpdu)
protected

Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU.

Parameters
mpduthe acknowledged MPDU

Definition at line 626 of file wifi-emlsr-test.cc.

References check-style-clang-format::action, CheckEmlsrLinks(), EmlsrOperationsTestBase::m_transitionTimeout, and ns3::NanoSeconds().

Referenced by DoSetup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_checkEmlsrLinksCount

std::size_t EmlOmnExchangeTest::m_checkEmlsrLinksCount
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 287 of file wifi-emlsr-test.h.

Referenced by CheckEmlsrLinks(), and DoRun().

◆ m_emlNotificationDroppedCount

std::size_t EmlOmnExchangeTest::m_emlNotificationDroppedCount
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 291 of file wifi-emlsr-test.h.

Referenced by DoRun(), Transmit(), and TxDropped().

◆ m_errorModel

Ptr<ListErrorModel> EmlOmnExchangeTest::m_errorModel
private

error rate model to corrupt packets at AP MLD

Definition at line 294 of file wifi-emlsr-test.h.

Referenced by DoSetup(), and Transmit().

◆ m_uidList

std::list<uint64_t> EmlOmnExchangeTest::m_uidList
private

list of UIDs of packets to corrupt

Definition at line 295 of file wifi-emlsr-test.h.

Referenced by Transmit().


The documentation for this class was generated from the following files: