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

Base class for EMLSR Operations tests. More...

#include "wifi-emlsr-test.h"

+ Inheritance diagram for EmlsrOperationsTestBase:
+ Collaboration diagram for EmlsrOperationsTestBase:

Classes

struct  FrameInfo
 Information about transmitted frames. More...
 

Public Types

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...
 

Public Member Functions

 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 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< 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.
 
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.
 
- 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.
 

Protected Attributes

Ptr< ApWifiMacm_apMac
 AP wifi MAC.
 
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
 
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< 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
 

Private Member Functions

void SetSsid (uint16_t aid, Mac48Address)
 Set the SSID on the next station that needs to start the association procedure.
 
virtual void StartTraffic ()
 Start the generation of traffic (needs to be overridden)
 

Additional Inherited Members

- 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
 

Detailed Description

Base class for EMLSR Operations tests.

This base class setups and configures one AP MLD, a variable number of non-AP MLDs with EMLSR activated and a variable number of non-AP MLD with EMLSR deactivated. Every MLD has three links, each operating on a distinct PHY band (2.4 GHz, 5 GHz and 6 GHz). Therefore, it is expected that three links are setup by the non-AP MLD(s). The values for the Padding Delay, the Transition Delay and the Transition Timeout are provided as argument to the constructor of this class, along with the IDs of the links on which EMLSR mode must be enabled for the non-AP MLDs (this information is used to set the EmlsrLinkSet attribute of the DefaultEmlsrManager installed on the non-AP MLDs).

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

Member Enumeration Documentation

◆ TrafficDirection

Enumeration for traffic directions.

Enumerator
DOWNLINK 
UPLINK 

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

Constructor & Destructor Documentation

◆ EmlsrOperationsTestBase()

EmlsrOperationsTestBase::EmlsrOperationsTestBase ( const std::string & name)

Constructor.

Parameters
nameThe name of the new TestCase created

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

◆ ~EmlsrOperationsTestBase()

EmlsrOperationsTestBase::~EmlsrOperationsTestBase ( )
overridedefault

Member Function Documentation

◆ CheckAuxPhysSleepMode()

void EmlsrOperationsTestBase::CheckAuxPhysSleepMode ( Ptr< StaWifiMac > staMac,
bool sleep )
protected

Check whether aux PHYs of the given device are in sleep mode/awake.

Parameters
staMacthe MAC of the given device
sleepwhether aux PHYs should be in sleep mode

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

References ns3::Time::GetTimeStep(), m_mainPhyId, m_putAuxPhyToSleep, ns3::Simulator::Now(), NS_TEST_EXPECT_MSG_EQ, and ns3::Simulator::Schedule().

Referenced by EmlsrUlTxopTest::CheckBlockAck(), EmlsrUlTxopTest::CheckCtsFrames(), EmlsrDlTxopTest::CheckInitialControlFrame(), and EmlsrDlTxopTest::Transmit().

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

◆ CheckBlockedLink()

void EmlsrOperationsTestBase::CheckBlockedLink ( Ptr< WifiMac > mac,
Mac48Address dest,
uint8_t linkId,
WifiQueueBlockedReason reason,
bool blocked,
std::string description,
bool testUnblockedForOtherReasons = true )
protected

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.

Parameters
macthe MAC of the given device
destthe MAC address of the given destination
linkIdthe ID of the given link
reasonthe reason for blocking transmissions to test
blockedwhether transmissions are blocked for the given reason
descriptiontext indicating when this check is performed
testUnblockedForOtherReasonswhether to test if transmissions are unblocked for all the reasons other than the one provided

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

References ns3::AC_BE, NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.

Referenced by EmlsrDlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::CheckPmModeAfterAssociation(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrUlTxopTest::CheckQosFrames(), and EmlsrDlTxopTest::CheckStaEmlNotificationFrame().

+ Here is the caller graph for this function:

◆ CheckMainPhyTraceInfo()

void EmlsrOperationsTestBase::CheckMainPhyTraceInfo ( std::size_t index,
std::string_view reason,
const std::optional< uint8_t > & fromLinkId,
uint8_t toLinkId,
bool checkFromLinkId = true,
bool checkToLinkId = true )
protected

Check information provided by the EMLSR Manager MainPhySwitch trace.

Parameters
indexthe ID of the EMLSR client this check refers to
reasonthe reason for main PHY to switch
fromLinkIdthe ID of the link the main PHY is moving from (if any)
toLinkIdthe ID of the link the main PHY is moving to
checkFromLinkIdwhether to check the given fromLinkId value
checkToLinkIdwhether to check the given toLinkId value

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

References m_traceInfo, NS_TEST_ASSERT_MSG_EQ, and NS_TEST_EXPECT_MSG_EQ.

Referenced by EmlsrUlTxopTest::CheckBlockAck(), EmlsrUlTxopTest::CheckCtsFrames(), and EmlsrDlTxopTest::CheckInitialControlFrame().

+ Here is the caller graph for this function:

◆ CheckMsdTimerRunning()

void EmlsrOperationsTestBase::CheckMsdTimerRunning ( Ptr< StaWifiMac > staMac,
uint8_t linkId,
bool isRunning,
const std::string & msg )
protected

Check whether the MediumSyncDelay timer is running on the given link of the given device.

Parameters
staMacthe MAC of the given device
linkIdthe ID of the given link
isRunningwhether the MediumSyncDelay timer is running
msgmessage to print in case the check failed

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

References ns3::Time::As(), ns3::Time::MS, ns3::Simulator::Now(), NS_TEST_ASSERT_MSG_EQ, and NS_TEST_EXPECT_MSG_EQ.

Referenced by EmlsrLinkSwitchTest::CheckRtsFrame(), and Transmit().

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

◆ DoSetup()

void EmlsrOperationsTestBase::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 ns3::TestCase.

Reimplemented in EmlsrUlOfdmaTest, and EmlsrUlTxopTest.

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

References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::WifiHelper::AssignStreams(), ns3::NodeList::Begin(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DynamicCast(), ns3::NodeList::End(), ns3::NetDeviceContainer::Get(), ns3::PacketSocketHelper::Install(), m_apMac, m_dlSockets, m_duration, m_linksToEnableEmlsrOn, m_mainPhyId, m_nEmlsrStations, m_nNonEmlsrStations, m_paddingDelay, m_putAuxPhyToSleep, m_staMacs, m_transitionDelay, m_transitionTimeout, m_ulSockets, MainPhySwitchInfoCallback(), ns3::MakeCallback(), NS_ASSERT_MSG, NS_TEST_ASSERT_MSG_NE, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiPhyHelper::Set(), ns3::Config::SetDefault(), ns3::WifiPhyHelper::SetPcapCaptureType(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), SetSsid(), Transmit(), ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, and ns3::WIFI_STANDARD_80211be.

Referenced by EmlOmnExchangeTest::DoSetup(), EmlsrCcaBusyTest::DoSetup(), EmlsrDlTxopTest::DoSetup(), EmlsrLinkSwitchTest::DoSetup(), EmlsrUlOfdmaTest::DoSetup(), and EmlsrUlTxopTest::DoSetup().

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

◆ GetApplication()

Ptr< PacketSocketClient > EmlsrOperationsTestBase::GetApplication ( TrafficDirection dir,
std::size_t staId,
std::size_t count,
std::size_t pktSize ) const
protected
Parameters
dirthe traffic direction (downlink/uplink)
staIdthe index (starting at 0) of the non-AP MLD generating/receiving packets
countthe number of packets to generate
pktSizethe size of the packets to generate
Returns
an application generating the given number packets of the given size from/to the AP MLD to/from the given non-AP MLD

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

References ns3::CreateObject(), dir, DOWNLINK, m_dlSockets, m_duration, m_ulSockets, ns3::MicroSeconds(), ns3::Simulator::Now(), pktSize, and ns3::Seconds().

Referenced by EmlsrUlTxopTest::CheckBlockAck(), EmlsrDlTxopTest::CheckQosFrames(), EmlsrLinkSwitchTest::CheckQosFrames(), EmlsrUlTxopTest::CheckQosFrames(), SetSsid(), EmlsrDlTxopTest::StartTraffic(), EmlsrUlTxopTest::StartTraffic(), EmlsrUlOfdmaTest::Transmit(), and EmlsrCcaBusyTest::TransmitPacketToAp().

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

◆ MainPhySwitchInfoCallback()

void EmlsrOperationsTestBase::MainPhySwitchInfoCallback ( std::size_t index,
const EmlsrMainPhySwitchTrace & info )
protected

Callback connected to the EMLSR Manager MainPhySwitch trace source.

Parameters
indexthe index of the EMLSR client whose main PHY switch event is logged
infothe information associated with the main PHY switch event

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

References ns3::EmlsrMainPhySwitchTrace::Clone(), and m_traceInfo.

Referenced by DoSetup().

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

◆ SetSsid()

void EmlsrOperationsTestBase::SetSsid ( uint16_t aid,
Mac48Address  )
private

Set the SSID on the next station that needs to start the association procedure.

This method is connected to the ApWifiMac's AssociatedSta trace source. Start generating traffic (if needed) when all stations are associated.

Parameters
aidthe AID assigned to the previous associated STA

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

References DOWNLINK, GetApplication(), m_apMac, m_establishBaDl, m_establishBaUl, m_lastAid, m_nEmlsrStations, m_nNonEmlsrStations, m_staMacs, ns3::MilliSeconds(), ns3::Simulator::Schedule(), StartTraffic(), and UPLINK.

Referenced by DoSetup().

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

◆ StartTraffic()

virtual void EmlsrOperationsTestBase::StartTraffic ( )
inlineprivatevirtual

Start the generation of traffic (needs to be overridden)

Reimplemented in EmlsrCcaBusyTest, EmlsrDlTxopTest, EmlsrUlOfdmaTest, and EmlsrUlTxopTest.

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

Referenced by SetSsid().

+ Here is the caller graph for this function:

◆ Transmit()

void EmlsrOperationsTestBase::Transmit ( Ptr< WifiMac > mac,
uint8_t phyId,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )
protectedvirtual

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 in EmlOmnExchangeTest, EmlsrDlTxopTest, EmlsrLinkSwitchTest, EmlsrUlOfdmaTest, and EmlsrUlTxopTest.

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

References ns3::WifiPhy::CalculateTxDuration(), CheckMsdTimerRunning(), ns3::DynamicCast(), m_txPsdus, ns3::EmlsrManager::MEDIUM_SYNC_THRESHOLD_USEC, ns3::MicroSeconds(), ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, ns3::PeekPointer(), ns3::WifiActionHeader::Print(), and ns3::Simulator::Schedule().

Referenced by DoSetup(), EmlOmnExchangeTest::Transmit(), EmlsrDlTxopTest::Transmit(), EmlsrLinkSwitchTest::Transmit(), EmlsrUlOfdmaTest::Transmit(), and EmlsrUlTxopTest::Transmit().

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

Member Data Documentation

◆ m_apMac

◆ m_dlSockets

std::vector<PacketSocketAddress> EmlsrOperationsTestBase::m_dlSockets
protected

packet socket address for DL traffic

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

Referenced by DoSetup(), and GetApplication().

◆ m_duration

◆ m_establishBaDl

bool EmlsrOperationsTestBase::m_establishBaDl {false}
protected

whether BA needs to be established (for TID 0) with the AP as originator

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

Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrLinkSwitchTest::EmlsrLinkSwitchTest(), EmlsrUlOfdmaTest::EmlsrUlOfdmaTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), and SetSsid().

◆ m_establishBaUl

bool EmlsrOperationsTestBase::m_establishBaUl {false}
protected

whether BA needs to be established (for TID 0) with the AP as recipient

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

Referenced by EmlsrCcaBusyTest::EmlsrCcaBusyTest(), EmlsrUlOfdmaTest::EmlsrUlOfdmaTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), and SetSsid().

◆ m_lastAid

uint16_t EmlsrOperationsTestBase::m_lastAid {0}
protected

AID of last associated station.

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

Referenced by EmlsrDlTxopTest::EnableEmlsrMode(), SetSsid(), and EmlsrDlTxopTest::StartTraffic().

◆ m_linksToEnableEmlsrOn

◆ m_mainPhyId

◆ m_nEmlsrStations

◆ m_nNonEmlsrStations

◆ m_paddingDelay

std::vector<Time> EmlsrOperationsTestBase::m_paddingDelay
protected
Initial value:
{
{MicroSeconds(32)}}
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1368

Padding Delay advertised by the non-AP MLD.

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

Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlOmnExchangeTest::CheckEmlCapabilitiesInAssocReq(), EmlsrDlTxopTest::CheckInitialControlFrame(), EmlsrDlTxopTest::DoSetup(), and DoSetup().

◆ m_putAuxPhyToSleep

bool EmlsrOperationsTestBase::m_putAuxPhyToSleep {false}
protected

whether aux PHYs are put to sleep during DL/UL TXOPs

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

Referenced by EmlsrDlTxopTest::EmlsrDlTxopTest(), EmlsrUlTxopTest::EmlsrUlTxopTest(), CheckAuxPhysSleepMode(), and DoSetup().

◆ m_staMacs

std::vector<Ptr<StaWifiMac> > EmlsrOperationsTestBase::m_staMacs
protected

◆ m_traceInfo

std::map<std::size_t, std::shared_ptr<EmlsrMainPhySwitchTrace> > EmlsrOperationsTestBase::m_traceInfo
protected

EMLSR client ID-indexed map of trace info from last main PHY switch.

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

Referenced by EmlsrUlTxopTest::CheckBlockAck(), EmlsrUlTxopTest::CheckCtsFrames(), CheckMainPhyTraceInfo(), and MainPhySwitchInfoCallback().

◆ m_transitionDelay

◆ m_transitionTimeout

Time EmlsrOperationsTestBase::m_transitionTimeout {MicroSeconds(128)}
protected

◆ m_txPsdus

◆ m_ulSockets

std::vector<PacketSocketAddress> EmlsrOperationsTestBase::m_ulSockets
protected

packet socket address for UL traffic

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

Referenced by DoSetup(), and GetApplication().


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