A Discrete-Event Network Simulator
API
MultiLinkSetupTest Class Reference

Test Multi-Link Discovery & Setup. More...

+ Inheritance diagram for MultiLinkSetupTest:
+ Collaboration diagram for MultiLinkSetupTest:

Classes

struct  FrameInfo
 Information about transmitted frames. More...
 

Public Member Functions

 MultiLinkSetupTest (std::initializer_list< std::string > staChannels, std::initializer_list< std::string > apChannels, std::initializer_list< std::pair< uint8_t, uint8_t > > setupLinks, std::initializer_list< uint8_t > fixedPhyBands={})
 Constructor. More...
 
 ~MultiLinkSetupTest () override
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void CheckAssocRequest (Ptr< WifiMpdu > mpdu, uint8_t linkId)
 Check correctness of the given Association Request frame. More...
 
void CheckAssocResponse (Ptr< WifiMpdu > mpdu, uint8_t linkId)
 Check correctness of the given Association Response frame. More...
 
void CheckBeacon (Ptr< WifiMpdu > mpdu, uint8_t linkId)
 Check correctness of the given Beacon frame. More...
 
void CheckDisabledLinks ()
 Check that links that are not setup on the non-AP MLD are disabled. More...
 
void CheckMlSetup ()
 Check correctness of Multi-Link Setup procedure. More...
 
void DoRun () override
 Implementation to actually run this TestCase. More...
 
WifiPhyBand GetPhyBandFromChannelStr (const std::string &str)
 
void SetChannels (SpectrumWifiPhyHelper &helper, const std::vector< std::string > &channels, const std::map< WifiPhyBand, Ptr< MultiModelSpectrumChannel > > &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. More...
 
void Transmit (uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when a FEM passes PSDUs to the PHY. More...
 

Private Attributes

std::vector< std::string > m_apChannels
 strings specifying channels for AP More...
 
Ptr< ApWifiMacm_apMac
 AP wifi MAC. More...
 
std::vector< uint8_t > m_fixedPhyBands
 links on non-AP MLD with fixed PHY band More...
 
std::vector< std::pair< uint8_t, uint8_t > > m_setupLinks
 expected links to setup (STA link ID, AP link ID) More...
 
std::vector< std::string > m_staChannels
 strings specifying channels for STA More...
 
Ptr< StaWifiMacm_staMac
 STA wifi MAC. More...
 
std::vector< FrameInfom_txPsdus
 transmitted PSDUs More...
 

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

Detailed Description

Test Multi-Link Discovery & Setup.

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 195 of file wifi-mlo-test.cc.

Constructor & Destructor Documentation

◆ MultiLinkSetupTest()

MultiLinkSetupTest::MultiLinkSetupTest ( std::initializer_list< std::string >  staChannels,
std::initializer_list< std::string >  apChannels,
std::initializer_list< std::pair< uint8_t, uint8_t > >  setupLinks,
std::initializer_list< uint8_t >  fixedPhyBands = {} 
)

Constructor.

Parameters
staChannelsthe strings specifying the operating channels for the STA
apChannelsthe strings specifying the operating channels for the AP
setupLinksa list of links (STA link ID, AP link ID) that are expected to be setup
fixedPhyBandslist of IDs of STA links that cannot switch PHY band

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

◆ ~MultiLinkSetupTest()

MultiLinkSetupTest::~MultiLinkSetupTest ( )
override

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

Member Function Documentation

◆ CheckAssocRequest()

void MultiLinkSetupTest::CheckAssocRequest ( Ptr< WifiMpdu mpdu,
uint8_t  linkId 
)
private

Check correctness of the given Association Request frame.

Parameters
mpduthe given Association Request frame
linkIdthe ID of the link on which the Association Request frame was transmitted

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

References ns3::WifiMac::GetAddress(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetLinkIdByAddress(), ns3::MgtAssocRequestHeader::GetMultiLinkElement(), ns3::WifiMac::GetNLinks(), m_apMac, m_setupLinks, m_staMac, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, and ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST.

Referenced by DoRun().

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

◆ CheckAssocResponse()

void MultiLinkSetupTest::CheckAssocResponse ( Ptr< WifiMpdu mpdu,
uint8_t  linkId 
)
private

Check correctness of the given Association Response frame.

Parameters
mpduthe given Association Response frame
linkIdthe ID of the link on which the Association Response frame was transmitted

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

References ns3::WifiMac::GetAddress(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetLinkIdByAddress(), ns3::MgtAssocResponseHeader::GetMultiLinkElement(), ns3::WifiMac::GetNLinks(), m_apMac, m_setupLinks, m_staMac, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, and ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE.

Referenced by DoRun().

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

◆ CheckBeacon()

void MultiLinkSetupTest::CheckBeacon ( Ptr< WifiMpdu mpdu,
uint8_t  linkId 
)
private

Check correctness of the given Beacon frame.

Parameters
mpduthe given Beacon frame
linkIdthe ID of the link on which the Beacon frame was transmitted

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

References ns3::WifiMac::GetAddress(), ns3::WifiMac::GetFrameExchangeManager(), ns3::MgtProbeResponseHeader::GetMultiLinkElement(), ns3::WifiMac::GetNLinks(), ns3::MgtProbeResponseHeader::GetReducedNeighborReport(), m_apMac, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, and ns3::WIFI_MAC_MGT_BEACON.

Referenced by DoRun().

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

◆ CheckDisabledLinks()

void MultiLinkSetupTest::CheckDisabledLinks ( )
private

Check that links that are not setup on the non-AP MLD are disabled.

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

References GetPhyBandFromChannelStr(), ns3::WifiPhy::GetState(), ns3::WifiMac::GetWifiPhy(), m_apChannels, m_setupLinks, m_staChannels, m_staMac, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

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

◆ CheckMlSetup()

◆ DoRun()

◆ GetPhyBandFromChannelStr()

WifiPhyBand MultiLinkSetupTest::GetPhyBandFromChannelStr ( const std::string &  str)
private
Parameters
strthe given channel string
Returns
the PHY band specified in the given channel string

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

References NS_ABORT_MSG, ns3::WIFI_PHY_BAND_2_4GHZ, ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_PHY_BAND_6GHZ, and ns3::WIFI_PHY_BAND_UNSPECIFIED.

Referenced by CheckDisabledLinks(), and SetChannels().

+ Here is the caller graph for this function:

◆ SetChannels()

void MultiLinkSetupTest::SetChannels ( SpectrumWifiPhyHelper helper,
const std::vector< std::string > &  channels,
const std::map< WifiPhyBand, Ptr< MultiModelSpectrumChannel > > &  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 343 of file wifi-mlo-test.cc.

References GetPhyBandFromChannelStr(), ns3::WifiPhyHelper::Set(), ns3::SpectrumWifiPhyHelper::SetChannel(), and ns3::WifiPhyHelper::SetPcapDataLinkType().

Referenced by DoRun().

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

◆ Transmit()

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

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

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

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

Referenced by DoRun().

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

Member Data Documentation

◆ m_apChannels

std::vector<std::string> MultiLinkSetupTest::m_apChannels
private

strings specifying channels for AP

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

Referenced by CheckDisabledLinks(), and DoRun().

◆ m_apMac

Ptr<ApWifiMac> MultiLinkSetupTest::m_apMac
private

AP wifi MAC.

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

Referenced by CheckAssocRequest(), CheckAssocResponse(), CheckBeacon(), CheckMlSetup(), and DoRun().

◆ m_fixedPhyBands

std::vector<uint8_t> MultiLinkSetupTest::m_fixedPhyBands
private

links on non-AP MLD with fixed PHY band

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

Referenced by DoRun().

◆ m_setupLinks

std::vector<std::pair<uint8_t, uint8_t> > MultiLinkSetupTest::m_setupLinks
private

expected links to setup (STA link ID, AP link ID)

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

Referenced by CheckAssocRequest(), CheckAssocResponse(), CheckDisabledLinks(), and CheckMlSetup().

◆ m_staChannels

std::vector<std::string> MultiLinkSetupTest::m_staChannels
private

strings specifying channels for STA

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

Referenced by CheckDisabledLinks(), and DoRun().

◆ m_staMac

Ptr<StaWifiMac> MultiLinkSetupTest::m_staMac
private

STA wifi MAC.

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

Referenced by CheckAssocRequest(), CheckAssocResponse(), CheckDisabledLinks(), CheckMlSetup(), and DoRun().

◆ m_txPsdus

std::vector<FrameInfo> MultiLinkSetupTest::m_txPsdus
private

transmitted PSDUs

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

Referenced by DoRun(), and Transmit().


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