Multi-Link Discovery & Setup test. More...
Public Member Functions | |
MultiLinkSetupTest (const BaseParams &baseParams, WifiScanType scanType, const std::vector< uint8_t > &setupLinks, uint8_t apNegSupport, const std::string &dlTidToLinkMapping, const std::string &ulTidToLinkMapping) | |
Constructor. More... | |
~MultiLinkSetupTest () override=default | |
Public Member Functions inherited from MultiLinkOperationsTestBase | |
MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, const BaseParams &baseParams) | |
Constructor. More... | |
~MultiLinkOperationsTestBase () override=default | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
Protected Member Functions inherited from MultiLinkOperationsTestBase | |
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. More... | |
Ptr< PacketSocketClient > | GetApplication (const PacketSocketAddress &sockAddr, std::size_t count, std::size_t pktSize, Time delay=Seconds(0), uint8_t priority=0) const |
virtual void | L7Receive (uint8_t nodeId, Ptr< const Packet > p, const Address &addr) |
Function to trace packets received by the server application. More... | |
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. 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... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. 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... | |
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 | CheckProbeResponse (Ptr< WifiMpdu > mpdu, uint8_t linkId) |
Check correctness of the given Probe Response frame. More... | |
void | CheckQosData (Ptr< WifiMpdu > mpdu, uint8_t linkId, std::size_t index) |
Check that QoS data frames are sent on links their TID is mapped to. More... | |
void | StartTraffic () override |
Start the generation of traffic (needs to be overridden) More... | |
Private Attributes | |
uint8_t | m_apNegSupport |
TID-to-Link Mapping negotiation supported by the AP MLD. More... | |
uint8_t | m_dlTid1 |
the TID of the first set of DL QoS data frames More... | |
std::optional< uint8_t > | m_dlTid2 |
the TID of the optional set of DL QoS data frames More... | |
WifiTidLinkMapping | m_dlTidLinkMapping |
expected DL TID-to-Link Mapping requested by non-AP MLD and accepted by AP MLD More... | |
std::string | m_dlTidLinkMappingStr |
DL TID-to-Link Mapping for non-AP MLD EHT configuration. More... | |
std::size_t | m_nProbeResp |
number of Probe Responses received by the non-AP MLD More... | |
std::vector< std::size_t > | m_qosFrames1 |
indices of QoS frames of the first set in the vector of TX PSDUs More... | |
std::vector< std::size_t > | m_qosFrames2 |
indices of QoS frames of the optional set in the vector of TX PSDUs More... | |
WifiScanType | m_scanType |
the scan type (active or passive) More... | |
const std::vector< uint8_t > | m_setupLinks |
IDs of the expected links to setup. More... | |
uint8_t | m_ulTid1 |
the TID of the first set of UL QoS data frames More... | |
std::optional< uint8_t > | m_ulTid2 |
the TID of the optional set of UL QoS data frames More... | |
WifiTidLinkMapping | m_ulTidLinkMapping |
expected UL TID-to-Link Mapping requested by non-AP MLD and accepted by AP MLD More... | |
std::string | m_ulTidLinkMappingStr |
UL TID-to-Link Mapping for non-AP MLD EHT configuration. 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 Types inherited from MultiLinkOperationsTestBase | |
using | ChannelMap = std::map< FrequencyRange, Ptr< MultiModelSpectrumChannel > > |
PHY band-indexed map of spectrum channels. More... | |
enum | Direction { DL = 0 , UL } |
Uplink or Downlink direction. More... | |
Protected Attributes inherited from MultiLinkOperationsTestBase | |
const std::vector< std::string > | m_apChannels |
strings specifying channels for AP More... | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. More... | |
Time | m_duration {Seconds(1)} |
simulation duration More... | |
const std::vector< uint8_t > | m_fixedPhyBands |
links on non-AP MLD with fixed PHY band More... | |
uint16_t | m_lastAid |
AID of last associated station. More... | |
uint8_t | m_nStations |
number of stations to create More... | |
std::vector< std::size_t > | m_rxPkts |
number of packets received at application layer by each node (index is node ID) More... | |
const std::vector< std::string > | m_staChannels |
strings specifying channels for STA More... | |
std::vector< Ptr< StaWifiMac > > | m_staMacs |
STA wifi MACs. More... | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs More... | |
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.
The negotiated TID-to-link mapping is tested by verifying that generated QoS data frames of a given TID are transmitted on links which the TID is mapped to. Specifically, the following operations are performed separately for each direction (downlink and uplink). A first TID is searched such that it is not mapped on all the setup links. If no such TID is found, only QoS frames of TID 0 are generated. Otherwise, we also search for a second TID that is mapped to a link set that is disjoint with the link set to which the first TID is mapped. If such a TID is found, QoS frames of both the first TID and the second TID are generated; otherwise, only QoS frames of the first TID are generated. For each TID, a number of QoS frames equal to the number of setup links is generated. For each TID, we check that the first N QoS frames, where N is the size of the link set to which the TID is mapped, are transmitted concurrently, while the following QoS frames are sent after the first QoS frame sent on the same link. We also check that all the QoS frames are sent on a link belonging to the link set to which the TID is mapped. If QoS frames of two TIDs are generated, we also check that the first N QoS frames of a TID, where N is the size of the link set to which that TID is mapped, are sent concurrently with the first M QoS frames of the other TID, where M is the size of the link set to which the other TID is mapped.
Definition at line 813 of file wifi-mlo-test.cc.
MultiLinkSetupTest::MultiLinkSetupTest | ( | const BaseParams & | baseParams, |
WifiScanType | scanType, | ||
const std::vector< uint8_t > & | setupLinks, | ||
uint8_t | apNegSupport, | ||
const std::string & | dlTidToLinkMapping, | ||
const std::string & | ulTidToLinkMapping | ||
) |
Constructor.
baseParams | common configuration parameters |
scanType | the scan type (active or passive) |
setupLinks | a list of links that are expected to be setup. In case one of the two devices has a single link, the ID of the link on the MLD is indicated |
apNegSupport | TID-to-Link Mapping negotiation supported by the AP MLD (0, 1, or 3) |
dlTidToLinkMapping | DL TID-to-Link Mapping for EHT configuration of non-AP MLD |
ulTidToLinkMapping | UL TID-to-Link Mapping for EHT configuration of non-AP MLD |
Definition at line 913 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 1279 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), dir, ns3::WifiMac::GetNLinks(), MultiLinkOperationsTestBase::m_apMac, m_apNegSupport, m_dlTidLinkMapping, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, m_ulTidLinkMapping, NS_ABORT_IF, NS_TEST_ASSERT_MSG_EQ, 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 1409 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 1162 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 1583 of file wifi-mlo-test.cc.
References m_setupLinks, 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 1475 of file wifi-mlo-test.cc.
References ns3::AP, dir, 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_apNegSupport, m_dlTidLinkMapping, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, m_ulTidLinkMapping, third::mac, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and ns3::SINGLE_LINK_OP_ID.
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 1220 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().
|
private |
Check that QoS data frames are sent on links their TID is mapped to.
mpdu | the given QoS data frame |
linkId | the ID of the link on which the QoS data frame was transmitted |
index | index of the QoS data frame in the vector of transmitted PSDUs |
Definition at line 1611 of file wifi-mlo-test.cc.
References dir, ns3::WifiMac::GetNLinks(), ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetTidToLinkMapping(), ns3::WifiMac::GetWifiPhy(), MultiLinkOperationsTestBase::m_apMac, m_dlTid1, m_dlTid2, m_qosFrames1, m_qosFrames2, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, MultiLinkOperationsTestBase::m_txPsdus, m_ulTid1, m_ulTid2, min, NS_ABORT_MSG, NS_ASSERT_MSG, NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_NE, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT, NS_TEST_EXPECT_MSG_LT, and prev.
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 1071 of file wifi-mlo-test.cc.
References CheckAssocRequest(), CheckAssocResponse(), CheckBeacon(), CheckDisabledLinks(), CheckMlSetup(), CheckProbeResponse(), CheckQosData(), ns3::WifiMac::GetDevice(), ns3::Node::GetId(), ns3::WifiNetDevice::GetNode(), MultiLinkOperationsTestBase::m_apChannels, MultiLinkOperationsTestBase::m_apMac, m_dlTid2, MultiLinkOperationsTestBase::m_duration, m_nProbeResp, MultiLinkOperationsTestBase::m_rxPkts, m_scanType, m_setupLinks, MultiLinkOperationsTestBase::m_staChannels, MultiLinkOperationsTestBase::m_staMacs, MultiLinkOperationsTestBase::m_txPsdus, m_ulTid2, ns3::MilliSeconds(), NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST, ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE, ns3::WIFI_MAC_MGT_BEACON, ns3::WIFI_MAC_MGT_PROBE_RESPONSE, and ns3::WIFI_MAC_QOSDATA.
|
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 930 of file wifi-mlo-test.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, MultiLinkOperationsTestBase::DoSetup(), ns3::WifiMac::GetEhtConfiguration(), MultiLinkOperationsTestBase::m_apMac, m_apNegSupport, m_dlTid1, m_dlTid2, m_dlTidLinkMapping, m_dlTidLinkMappingStr, m_scanType, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, m_ulTid1, m_ulTid2, m_ulTidLinkMapping, m_ulTidLinkMappingStr, third::mac, NS_FATAL_ERROR, ns3::QosUtilsMapTidToAc(), ns3::TidToLinkMappingValidForNegType1(), and ns3::WIFI_TID_TO_LINK_MAPPING_ANY_LINK_SET.
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 1035 of file wifi-mlo-test.cc.
References ns3::Node::AddApplication(), ns3::WifiNetDevice::GetAddress(), MultiLinkOperationsTestBase::GetApplication(), ns3::WifiMac::GetDevice(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiNetDevice::GetNode(), MultiLinkOperationsTestBase::m_apMac, m_dlTid1, m_dlTid2, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, m_ulTid1, m_ulTid2, ns3::MilliSeconds(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), and ns3::PacketSocketAddress::SetSingleDevice().
|
private |
TID-to-Link Mapping negotiation supported by the AP MLD.
Definition at line 896 of file wifi-mlo-test.cc.
Referenced by CheckAssocRequest(), CheckMlSetup(), and DoSetup().
|
private |
the TID of the first set of DL QoS data frames
Definition at line 903 of file wifi-mlo-test.cc.
Referenced by CheckQosData(), DoSetup(), and StartTraffic().
|
private |
the TID of the optional set of DL QoS data frames
Definition at line 905 of file wifi-mlo-test.cc.
Referenced by CheckQosData(), DoRun(), DoSetup(), and StartTraffic().
|
private |
expected DL TID-to-Link Mapping requested by non-AP MLD and accepted by AP MLD
Definition at line 899 of file wifi-mlo-test.cc.
Referenced by CheckAssocRequest(), CheckMlSetup(), and DoSetup().
|
private |
DL TID-to-Link Mapping for non-AP MLD EHT configuration.
Definition at line 897 of file wifi-mlo-test.cc.
Referenced by DoSetup().
|
private |
number of Probe Responses received by the non-AP MLD
Definition at line 895 of file wifi-mlo-test.cc.
Referenced by DoRun().
|
private |
indices of QoS frames of the first set in the vector of TX PSDUs
Definition at line 908 of file wifi-mlo-test.cc.
Referenced by CheckQosData().
|
private |
indices of QoS frames of the optional set in the vector of TX PSDUs
Definition at line 910 of file wifi-mlo-test.cc.
Referenced by CheckQosData().
|
private |
the scan type (active or passive)
Definition at line 894 of file wifi-mlo-test.cc.
|
private |
IDs of the expected links to setup.
Definition at line 893 of file wifi-mlo-test.cc.
Referenced by CheckAssocRequest(), CheckAssocResponse(), CheckDisabledLinks(), CheckMlSetup(), CheckQosData(), DoRun(), DoSetup(), and StartTraffic().
|
private |
the TID of the first set of UL QoS data frames
Definition at line 904 of file wifi-mlo-test.cc.
Referenced by CheckQosData(), DoSetup(), and StartTraffic().
|
private |
the TID of the optional set of UL QoS data frames
Definition at line 906 of file wifi-mlo-test.cc.
Referenced by CheckQosData(), DoRun(), DoSetup(), and StartTraffic().
|
private |
expected UL TID-to-Link Mapping requested by non-AP MLD and accepted by AP MLD
Definition at line 901 of file wifi-mlo-test.cc.
Referenced by CheckAssocRequest(), CheckMlSetup(), and DoSetup().
|
private |
UL TID-to-Link Mapping for non-AP MLD EHT configuration.
Definition at line 898 of file wifi-mlo-test.cc.
Referenced by DoSetup().