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

Base class for Multi-Link Operations tests. More...

+ Inheritance diagram for MultiLinkOperationsTestBase:
+ Collaboration diagram for MultiLinkOperationsTestBase:

Classes

struct  FrameInfo
 Information about transmitted frames. More...
 

Public Member Functions

 MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, std::vector< std::string > staChannels, std::vector< std::string > apChannels, std::vector< uint8_t > fixedPhyBands={})
 Constructor.
 
 ~MultiLinkOperationsTestBase () 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 Types

using ChannelMap = std::map< FrequencyRange, Ptr< MultiModelSpectrumChannel > >
 PHY band-indexed map of spectrum channels.
 
enum  Direction { DL = 0 , UL }
 Uplink or Downlink direction. More...
 

Protected Member Functions

void CheckAddresses (Ptr< const WifiPsdu > psdu, std::optional< Direction > direction=std::nullopt)
 Check that the Address 1 and Address 2 fields of the given PSDU contain device MAC addresses.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
virtual void Transmit (uint8_t linkId, std::string context, 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, TestDuration 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

const std::vector< std::string > m_apChannels
 strings specifying channels for AP
 
Ptr< ApWifiMacm_apMac
 AP wifi MAC.
 
const std::vector< uint8_t > m_fixedPhyBands
 links on non-AP MLD with fixed PHY band
 
uint16_t m_lastAid
 AID of last associated station.
 
uint8_t m_nStations
 number of stations to create
 
const std::vector< std::string > m_staChannels
 strings specifying channels for STA
 
std::vector< Ptr< StaWifiMac > > m_staMacs
 STA wifi MACs.
 
std::vector< FrameInfom_txPsdus
 transmitted PSDUs
 

Private Member Functions

void SetChannels (SpectrumWifiPhyHelper &helper, const std::vector< std::string > &channels, const ChannelMap &channelMap)
 Reset the given PHY helper, use the given strings to set the ChannelSettings attribute of the PHY objects to create, and attach them to the given spectrum channels appropriately.
 
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

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Detailed Description

Base class for Multi-Link Operations tests.

Three spectrum channels are created, one for each band (2.4 GHz, 5 GHz and 6 GHz). Each PHY object is attached to the spectrum channel corresponding to the PHY band in which it is operating.

Definition at line 202 of file wifi-mlo-test.cc.

Member Typedef Documentation

◆ ChannelMap

PHY band-indexed map of spectrum channels.

Definition at line 240 of file wifi-mlo-test.cc.

Member Enumeration Documentation

◆ Direction

Uplink or Downlink direction.

Enumerator
DL 
UL 

Definition at line 245 of file wifi-mlo-test.cc.

Constructor & Destructor Documentation

◆ MultiLinkOperationsTestBase()

MultiLinkOperationsTestBase::MultiLinkOperationsTestBase ( const std::string &  name,
uint8_t  nStations,
std::vector< std::string >  staChannels,
std::vector< std::string >  apChannels,
std::vector< uint8_t >  fixedPhyBands = {} 
)

Constructor.

Parameters
nameThe name of the new TestCase created
nStationsthe number of stations to create
staChannelsthe strings specifying the operating channels for the STA
apChannelsthe strings specifying the operating channels for the AP
fixedPhyBandslist of IDs of STA links that cannot switch PHY band

Definition at line 309 of file wifi-mlo-test.cc.

◆ ~MultiLinkOperationsTestBase()

MultiLinkOperationsTestBase::~MultiLinkOperationsTestBase ( )
overridedefault

Member Function Documentation

◆ CheckAddresses()

void MultiLinkOperationsTestBase::CheckAddresses ( Ptr< const WifiPsdu psdu,
std::optional< Direction direction = std::nullopt 
)
protected

Check that the Address 1 and Address 2 fields of the given PSDU contain device MAC addresses.

Parameters
psduthe given PSDU
directionindicates direction for management frames (DL or UL)

Definition at line 325 of file wifi-mlo-test.cc.

References DL, ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetNLinks(), m_apMac, m_nStations, m_staMacs, NS_ASSERT, NS_TEST_EXPECT_MSG_EQ, and UL.

Referenced by MultiLinkSetupTest::CheckAssocRequest(), MultiLinkSetupTest::CheckAssocResponse(), MultiLinkSetupTest::CheckBeacon(), MultiLinkSetupTest::CheckProbeResponse(), MultiLinkTxTest::Transmit(), and MultiLinkMuTxTest::Transmit().

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

◆ DoSetup()

void MultiLinkOperationsTestBase::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 MultiLinkSetupTest, MultiLinkTxTest, MultiLinkMuTxTest, and ReleaseSeqNoAfterCtsTimeoutTest.

Definition at line 452 of file wifi-mlo-test.cc.

References ns3::Config::Connect(), m_apChannels, m_apMac, m_fixedPhyBands, m_nStations, m_staChannels, m_staMacs, ns3::MakeCallback(), ns3::WifiPhyHelper::Set(), SetChannels(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), SetSsid(), ns3::ObjectBase::TraceConnectWithoutContext(), Transmit(), ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, and ns3::WIFI_STANDARD_80211be.

Referenced by MultiLinkSetupTest::DoSetup(), MultiLinkTxTest::DoSetup(), MultiLinkMuTxTest::DoSetup(), and ReleaseSeqNoAfterCtsTimeoutTest::DoSetup().

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

◆ SetChannels()

void MultiLinkOperationsTestBase::SetChannels ( SpectrumWifiPhyHelper helper,
const std::vector< std::string > &  channels,
const ChannelMap channelMap 
)
private

Reset the given PHY helper, use the given strings to set the ChannelSettings attribute of the PHY objects to create, and attach them to the given spectrum channels appropriately.

Parameters
helperthe given PHY helper
channelsthe strings specifying the operating channels to configure
channelMapthe created spectrum channels

Definition at line 430 of file wifi-mlo-test.cc.

References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::WifiPhyHelper::Set(), and ns3::WifiPhyHelper::SetPcapDataLinkType().

Referenced by DoSetup().

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

◆ SetSsid()

void MultiLinkOperationsTestBase::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 555 of file wifi-mlo-test.cc.

References m_lastAid, m_nStations, m_staMacs, ns3::MilliSeconds(), ns3::Simulator::Schedule(), and StartTraffic().

Referenced by DoSetup().

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

◆ StartTraffic()

virtual void MultiLinkOperationsTestBase::StartTraffic ( )
inlineprivatevirtual

Start the generation of traffic (needs to be overridden)

Reimplemented in MultiLinkTxTest, MultiLinkMuTxTest, and ReleaseSeqNoAfterCtsTimeoutTest.

Definition at line 304 of file wifi-mlo-test.cc.

Referenced by SetSsid().

+ Here is the caller graph for this function:

◆ Transmit()

void MultiLinkOperationsTestBase::Transmit ( uint8_t  linkId,
std::string  context,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)
protectedvirtual

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
linkIdthe ID of the link transmitting the PSDUs
contextthe context
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

Reimplemented in MultiLinkTxTest, MultiLinkMuTxTest, and ReleaseSeqNoAfterCtsTimeoutTest.

Definition at line 398 of file wifi-mlo-test.cc.

References m_txPsdus, ns3::Simulator::Now(), NS_LOG_INFO, and ns3::PeekPointer().

Referenced by DoSetup(), MultiLinkTxTest::Transmit(), MultiLinkMuTxTest::Transmit(), and ReleaseSeqNoAfterCtsTimeoutTest::Transmit().

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

Member Data Documentation

◆ m_apChannels

const std::vector<std::string> MultiLinkOperationsTestBase::m_apChannels
protected

strings specifying channels for AP

Definition at line 271 of file wifi-mlo-test.cc.

Referenced by MultiLinkSetupTest::DoRun(), and DoSetup().

◆ m_apMac

◆ m_fixedPhyBands

const std::vector<uint8_t> MultiLinkOperationsTestBase::m_fixedPhyBands
protected

links on non-AP MLD with fixed PHY band

Definition at line 272 of file wifi-mlo-test.cc.

Referenced by DoSetup().

◆ m_lastAid

uint16_t MultiLinkOperationsTestBase::m_lastAid
protected

AID of last associated station.

Definition at line 276 of file wifi-mlo-test.cc.

Referenced by SetSsid().

◆ m_nStations

uint8_t MultiLinkOperationsTestBase::m_nStations
protected

◆ m_staChannels

const std::vector<std::string> MultiLinkOperationsTestBase::m_staChannels
protected

strings specifying channels for STA

Definition at line 270 of file wifi-mlo-test.cc.

Referenced by MultiLinkSetupTest::CheckDisabledLinks(), MultiLinkSetupTest::DoRun(), and DoSetup().

◆ m_staMacs

◆ m_txPsdus

std::vector<FrameInfo> MultiLinkOperationsTestBase::m_txPsdus
protected

transmitted PSDUs

Definition at line 269 of file wifi-mlo-test.cc.

Referenced by MultiLinkSetupTest::DoRun(), ReleaseSeqNoAfterCtsTimeoutTest::DoRun(), and Transmit().


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