Multi-Link Discovery & Setup test. More...
Public Member Functions | |
MultiLinkSetupTest (std::vector< std::string > staChannels, std::vector< std::string > apChannels, WifiScanType scanType, std::vector< std::pair< uint8_t, uint8_t > > setupLinks, std::vector< uint8_t > fixedPhyBands={}) | |
Constructor. | |
~MultiLinkSetupTest () override=default | |
![]() | |
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 | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (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 | 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. | |
![]() | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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 Member Functions | |
void | CheckAssocRequest (Ptr< WifiMpdu > mpdu, uint8_t linkId) |
Check correctness of the given Association Request frame. | |
void | CheckAssocResponse (Ptr< WifiMpdu > mpdu, uint8_t linkId) |
Check correctness of the given Association Response frame. | |
void | CheckBeacon (Ptr< WifiMpdu > mpdu, uint8_t linkId) |
Check correctness of the given Beacon frame. | |
void | CheckDisabledLinks () |
Check that links that are not setup on the non-AP MLD are disabled. | |
void | CheckMlSetup () |
Check correctness of Multi-Link Setup procedure. | |
void | CheckProbeResponse (Ptr< WifiMpdu > mpdu, uint8_t linkId) |
Check correctness of the given Probe Response frame. | |
Private Attributes | |
std::size_t | m_nProbeResp |
number of Probe Responses received by the non-AP MLD | |
WifiScanType | m_scanType |
the scan type (active or passive) | |
const std::vector< std::pair< uint8_t, uint8_t > > | m_setupLinks |
expected links to setup (STA link ID, AP link ID) | |
Additional Inherited Members | |
![]() | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
using | ChannelMap = std::map< FrequencyRange, Ptr< MultiModelSpectrumChannel > > |
PHY band-indexed map of spectrum channels. | |
enum | Direction { DL = 0 , UL } |
Uplink or Downlink direction. More... | |
![]() | |
const std::vector< std::string > | m_apChannels |
strings specifying channels for AP | |
Ptr< ApWifiMac > | m_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< FrameInfo > | m_txPsdus |
transmitted PSDUs | |
Multi-Link Discovery & Setup test.
This test sets up an AP MLD and a non-AP MLD having a variable number of links. The RF channels to set each link to are provided as input parameters through the test case constructor, along with the identifiers (starting at 0) of the links that cannot switch PHY band (if any). The links that are expected to be setup are also provided as input parameters. This test verifies that the management frames exchanged during ML discovery and ML setup contain the expected values and that the two MLDs setup the expected links.
Definition at line 587 of file wifi-mlo-test.cc.
MultiLinkSetupTest::MultiLinkSetupTest | ( | std::vector< std::string > | staChannels, |
std::vector< std::string > | apChannels, | ||
WifiScanType | scanType, | ||
std::vector< std::pair< uint8_t, uint8_t > > | setupLinks, | ||
std::vector< uint8_t > | fixedPhyBands = {} |
||
) |
Constructor.
staChannels | the strings specifying the operating channels for the STA |
apChannels | the strings specifying the operating channels for the AP |
scanType | the scan type (active or passive) |
setupLinks | a list of links (STA link ID, AP link ID) that are expected to be setup |
fixedPhyBands | list of IDs of STA links that cannot switch PHY band |
Definition at line 659 of file wifi-mlo-test.cc.
|
overridedefault |
Check correctness of the given Association Request frame.
mpdu | the given Association Request frame |
linkId | the ID of the link on which the Association Request frame was transmitted |
Definition at line 866 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), ns3::WifiMac::GetNLinks(), MultiLinkOperationsTestBase::m_apMac, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, MultiLinkOperationsTestBase::UL, and ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST.
Referenced by DoRun().
Check correctness of the given Association Response frame.
mpdu | the given Association Response frame |
linkId | the ID of the link on which the Association Response frame was transmitted |
Definition at line 928 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), MultiLinkOperationsTestBase::DL, ns3::WifiMac::GetAddress(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetLinkIdByAddress(), ns3::WifiMac::GetNLinks(), MultiLinkOperationsTestBase::m_apMac, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, and ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE.
Referenced by DoRun().
Check correctness of the given Beacon frame.
mpdu | the given Beacon frame |
linkId | the ID of the link on which the Beacon frame was transmitted |
Definition at line 749 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), MultiLinkOperationsTestBase::DL, ns3::WifiMac::GetAddress(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetNLinks(), MultiLinkOperationsTestBase::m_apMac, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, and ns3::WIFI_MAC_MGT_BEACON.
Referenced by DoRun().
|
private |
Check that links that are not setup on the non-AP MLD are disabled.
Definition at line 1066 of file wifi-mlo-test.cc.
References m_setupLinks, MultiLinkOperationsTestBase::m_staChannels, MultiLinkOperationsTestBase::m_staMacs, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
private |
Check correctness of Multi-Link Setup procedure.
Check outcome of Multi-Link Setup
Definition at line 990 of file wifi-mlo-test.cc.
References ns3::WifiMac::GetAddress(), ns3::ApWifiMac::GetAssociationId(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiPhyOperatingChannel::GetFrequency(), ns3::WifiMac::GetNLinks(), ns3::WifiPhyOperatingChannel::GetNumber(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhyOperatingChannel::GetPhyBand(), ns3::WifiPhyOperatingChannel::GetPrimaryChannelIndex(), ns3::ApWifiMac::GetStaList(), ns3::WifiPhyOperatingChannel::GetWidth(), ns3::WifiMac::GetWifiPhy(), ns3::WifiMac::GetWifiRemoteStationManager(), MultiLinkOperationsTestBase::m_apMac, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
Check correctness of the given Probe Response frame.
mpdu | the given Probe Response frame |
linkId | the ID of the link on which the Probe Response frame was transmitted |
Definition at line 807 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), MultiLinkOperationsTestBase::DL, ns3::WifiMac::GetAddress(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetNLinks(), MultiLinkOperationsTestBase::m_apMac, NS_ABORT_IF, NS_TEST_EXPECT_MSG_EQ, and ns3::WIFI_MAC_MGT_PROBE_RESPONSE.
Referenced by DoRun().
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Check content of management frames
Implements ns3::TestCase.
Definition at line 684 of file wifi-mlo-test.cc.
References CheckAssocRequest(), CheckAssocResponse(), CheckBeacon(), CheckDisabledLinks(), CheckMlSetup(), CheckProbeResponse(), ns3::Simulator::Destroy(), MultiLinkOperationsTestBase::m_apChannels, m_nProbeResp, m_scanType, MultiLinkOperationsTestBase::m_staChannels, MultiLinkOperationsTestBase::m_txPsdus, ns3::MilliSeconds(), NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Simulator::Stop(), ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE, ns3::WIFI_MAC_MGT_BEACON, and ns3::WIFI_MAC_MGT_PROBE_RESPONSE.
|
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 MultiLinkOperationsTestBase.
Definition at line 676 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::DoSetup(), m_scanType, and MultiLinkOperationsTestBase::m_staMacs.
|
private |
number of Probe Responses received by the non-AP MLD
Definition at line 656 of file wifi-mlo-test.cc.
Referenced by DoRun().
|
private |
the scan type (active or passive)
Definition at line 655 of file wifi-mlo-test.cc.
|
private |
expected links to setup (STA link ID, AP link ID)
Definition at line 654 of file wifi-mlo-test.cc.
Referenced by CheckAssocRequest(), CheckAssocResponse(), CheckDisabledLinks(), and CheckMlSetup().