A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
SingleLinkEmlsrTest Class Reference

Test ML setup and data exchange between an AP MLD and a single link EMLSR client. More...

#include "wifi-emlsr-test.h"

+ Inheritance diagram for SingleLinkEmlsrTest:
+ Collaboration diagram for SingleLinkEmlsrTest:

Classes

struct  Events
 Actions and checks to perform upon the transmission of each frame. More...
 

Public Member Functions

 SingleLinkEmlsrTest (bool switchAuxPhy, bool auxPhyTxCapable)
 Constructor.
 
- 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
 
TestCaseoperator= (const TestCase &)=delete
 

Protected Member Functions

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 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.
 
Ptr< PacketSocketClientGetApplication (TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const
 
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.
 
TestCaseGetParent () 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

bool m_auxPhyTxCapable
 whether aux PHYs are TX capable
 
std::list< Events >::const_iterator m_eventIt
 iterator over the list of events
 
std::list< Eventsm_events
 list of events for a test run
 
bool m_switchAuxPhy
 whether aux PHYs switch link
 

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< ApWifiMacm_apMac
 AP wifi MAC.
 
const std::array< std::string, 3 > m_channelsStr
 array of strings defining the channels for the MLD links
 
std::vector< PacketSocketAddressm_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
 
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< Timem_paddingDelay
 Padding Delay advertised by the non-AP MLD.
 
bool m_putAuxPhyToSleep {false}
 whether aux PHYs are put to sleep during DL/UL TXOPs
 
std::vector< Ptr< StaWifiMac > > m_staMacs
 MACs of the non-AP MLDs.
 
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< Timem_transitionDelay
 Transition Delay advertised by the non-AP MLD.
 
Time m_transitionTimeout {MicroSeconds(128)}
 Transition Timeout advertised by the AP MLD.
 
std::vector< FrameInfom_txPsdus
 transmitted PSDUs
 
std::vector< PacketSocketAddressm_ulSockets
 packet socket address for UL traffic
 

Detailed Description

Test ML setup and data exchange between an AP MLD and a single link EMLSR client.

A single link EMLSR client performs ML setup with an AP MLD having three links and then enables EMLSR mode on the unique link. A Block Ack agreement is established (for both the downlink and uplink directions) and QoS data frames (aggregated in an A-MPDU) are transmitted by both the AP MLD and the EMLSR client.

It is checked that:

  • the expected sequence of frames is transmitted, including ICFs before downlink transmissions
  • EMLSR mode is enabled on the single EMLSR link
  • the address of the EMLSR client is seen as an MLD address
  • the AP MLD starts the transition delay timer at the end of each TXOP

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

Constructor & Destructor Documentation

◆ SingleLinkEmlsrTest()

SingleLinkEmlsrTest::SingleLinkEmlsrTest ( bool switchAuxPhy,
bool auxPhyTxCapable )

Constructor.

Parameters
switchAuxPhywhether aux PHYs switch link
auxPhyTxCapablewhether aux PHYs are TX capable

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

References EmlsrOperationsTestBase::m_duration, EmlsrOperationsTestBase::m_establishBaDl, EmlsrOperationsTestBase::m_establishBaUl, EmlsrOperationsTestBase::m_linksToEnableEmlsrOn, EmlsrOperationsTestBase::m_mainPhyId, EmlsrOperationsTestBase::m_nEmlsrStations, EmlsrOperationsTestBase::m_nNonEmlsrStations, EmlsrOperationsTestBase::m_nPhysPerEmlsrDevice, EmlsrOperationsTestBase::m_paddingDelay, EmlsrOperationsTestBase::m_transitionDelay, ns3::MicroSeconds(), and ns3::Seconds().

+ Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void SingleLinkEmlsrTest::DoRun ( )
overrideprotectedvirtual

◆ DoSetup()

void SingleLinkEmlsrTest::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 5000 of file wifi-emlsr-test.cc.

References EmlsrOperationsTestBase::DoSetup(), m_auxPhyTxCapable, m_switchAuxPhy, ns3::MicroSeconds(), and ns3::Config::SetDefault().

+ Here is the call graph for this function:

◆ Transmit()

void SingleLinkEmlsrTest::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 5010 of file wifi-emlsr-test.cc.

References m_eventIt, m_events, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and EmlsrOperationsTestBase::Transmit().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_auxPhyTxCapable

bool SingleLinkEmlsrTest::m_auxPhyTxCapable
private

whether aux PHYs are TX capable

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

Referenced by DoSetup().

◆ m_eventIt

std::list<Events>::const_iterator SingleLinkEmlsrTest::m_eventIt
private

iterator over the list of events

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

Referenced by DoRun(), and Transmit().

◆ m_events

std::list<Events> SingleLinkEmlsrTest::m_events
private

list of events for a test run

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

Referenced by DoRun(), and Transmit().

◆ m_switchAuxPhy

bool SingleLinkEmlsrTest::m_switchAuxPhy
private

whether aux PHYs switch link

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

Referenced by DoSetup().


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