Multi-Link Discovery & Setup test. More...
#include "wifi-mlo-test.h"
Public Member Functions | |
MultiLinkSetupTest (const BaseParams &baseParams, WifiScanType scanType, const std::vector< uint8_t > &setupLinks, WifiTidToLinkMappingNegSupport apNegSupport, const std::string &dlTidToLinkMapping, const std::string &ulTidToLinkMapping, bool support160MHzOp=true) | |
Constructor. | |
~MultiLinkSetupTest () override=default | |
Public Member Functions inherited from MultiLinkOperationsTestBase | |
MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, const BaseParams &baseParams) | |
Constructor. | |
~MultiLinkOperationsTestBase () override=default | |
Public Member Functions inherited from ns3::TestCase | |
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. | |
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. | |
void | CheckCapabilities (Ptr< WifiMpdu > mpdu, Ptr< WifiMac > mac, uint8_t phyId) |
Check that the expected Capabilities information elements are present in the given management frame based on the band in which the given link is operating. | |
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. | |
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 | 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. | |
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. | |
void | CheckQosData (Ptr< WifiMpdu > mpdu, const WifiTxVector &txvector, uint8_t linkId, std::size_t index) |
Check that QoS data frames are sent on links their TID is mapped to and with the correct TX width. | |
void | StartTraffic () override |
Start the generation of traffic (needs to be overridden) | |
Private Attributes | |
WifiTidToLinkMappingNegSupport | m_apNegSupport |
TID-to-Link Mapping negotiation supported by the AP MLD. | |
uint8_t | m_dlTid1 |
the TID of the first set of DL QoS data frames | |
std::optional< uint8_t > | m_dlTid2 |
the TID of the optional set of DL QoS data frames | |
WifiTidLinkMapping | m_dlTidLinkMapping |
expected DL TID-to-Link Mapping requested by non-AP MLD and accepted by AP MLD | |
std::string | m_dlTidLinkMappingStr |
DL TID-to-Link Mapping for non-AP MLD EHT configuration. | |
std::size_t | m_nProbeResp |
number of Probe Responses received by the non-AP MLD | |
std::vector< std::size_t > | m_qosFrames1 |
indices of QoS frames of the first set in the vector of TX PSDUs | |
std::vector< std::size_t > | m_qosFrames2 |
indices of QoS frames of the optional set in the vector of TX PSDUs | |
WifiScanType | m_scanType |
the scan type (active or passive) | |
const std::vector< uint8_t > | m_setupLinks |
IDs of the expected links to setup. | |
bool | m_support160MHzOp |
whether non-AP MLDs support 160 MHz operations | |
uint8_t | m_ulTid1 |
the TID of the first set of UL QoS data frames | |
std::optional< uint8_t > | m_ulTid2 |
the TID of the optional set of UL QoS data frames | |
WifiTidLinkMapping | m_ulTidLinkMapping |
expected UL TID-to-Link Mapping requested by non-AP MLD and accepted by AP MLD | |
std::string | m_ulTidLinkMappingStr |
UL TID-to-Link Mapping for non-AP MLD EHT configuration. | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
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 |
Protected Types inherited from MultiLinkOperationsTestBase | |
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 Attributes inherited from MultiLinkOperationsTestBase | |
const std::vector< std::string > | m_apChannels |
strings specifying channels for AP | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. | |
Time | m_duration {Seconds(1)} |
simulation duration | |
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 | |
std::vector< std::size_t > | m_rxPkts |
number of packets received at application layer by each node (index is node ID) | |
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.
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 353 of file wifi-mlo-test.h.
MultiLinkSetupTest::MultiLinkSetupTest | ( | const BaseParams & | baseParams, |
WifiScanType | scanType, | ||
const std::vector< uint8_t > & | setupLinks, | ||
WifiTidToLinkMappingNegSupport | apNegSupport, | ||
const std::string & | dlTidToLinkMapping, | ||
const std::string & | ulTidToLinkMapping, | ||
bool | support160MHzOp = true ) |
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 |
support160MHzOp | whether non-AP MLDs support 160 MHz operations |
Definition at line 804 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 1184 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), ns3::Create(), dir, 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 1315 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), ns3::Create(), MultiLinkOperationsTestBase::DL, 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 1067 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), ns3::Create(), MultiLinkOperationsTestBase::DL, 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.
Also, on the AP side, check that the queue storing QoS data frames destined to the non-AP MLD has a mask for a link if and only if the link has been setup by the non-AO MLD.
Definition at line 1517 of file wifi-mlo-test.cc.
References ns3::AC_BE, MultiLinkOperationsTestBase::m_apMac, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
Referenced by DoRun().
|
private |
Check correctness of Multi-Link Setup procedure.
Check outcome of Multi-Link Setup
Definition at line 1381 of file wifi-mlo-test.cc.
References ns3::AP, dir, MultiLinkOperationsTestBase::m_apMac, m_apNegSupport, m_dlTidLinkMapping, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, m_support160MHzOp, m_ulTidLinkMapping, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ns3::SINGLE_LINK_OP_ID, and ns3::WIFI_STANDARD_80211be.
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 1125 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), ns3::Create(), MultiLinkOperationsTestBase::DL, 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 and with the correct TX width.
mpdu | the given QoS data frame |
txvector | the TXVECTOR used to send the 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 1564 of file wifi-mlo-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), dir, ns3::WifiTxVector::GetChannelWidth(), MultiLinkOperationsTestBase::m_apMac, m_dlTid1, m_dlTid2, m_qosFrames1, m_qosFrames2, m_setupLinks, MultiLinkOperationsTestBase::m_staMacs, m_support160MHzOp, MultiLinkOperationsTestBase::m_txPsdus, m_ulTid1, m_ulTid2, 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 976 of file wifi-mlo-test.cc.
References CheckAssocRequest(), CheckAssocResponse(), CheckBeacon(), CheckDisabledLinks(), CheckMlSetup(), CheckProbeResponse(), CheckQosData(), ns3::Simulator::Destroy(), 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::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Simulator::Stop(), 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 823 of file wifi-mlo-test.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, MultiLinkOperationsTestBase::DoSetup(), MultiLinkOperationsTestBase::m_apMac, m_apNegSupport, m_dlTid1, m_dlTid2, m_dlTidLinkMapping, m_dlTidLinkMappingStr, m_scanType, m_setupLinks, MultiLinkOperationsTestBase::m_staChannels, MultiLinkOperationsTestBase::m_staMacs, m_support160MHzOp, m_ulTid1, m_ulTid2, m_ulTidLinkMapping, m_ulTidLinkMappingStr, NS_FATAL_ERROR, ns3::QosUtilsMapTidToAc(), and ns3::TidToLinkMappingValidForNegType1().
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 940 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::GetApplication(), 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 446 of file wifi-mlo-test.h.
Referenced by CheckAssocRequest(), CheckMlSetup(), and DoSetup().
|
private |
the TID of the first set of DL QoS data frames
Definition at line 453 of file wifi-mlo-test.h.
Referenced by CheckQosData(), DoSetup(), and StartTraffic().
|
private |
the TID of the optional set of DL QoS data frames
Definition at line 455 of file wifi-mlo-test.h.
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 449 of file wifi-mlo-test.h.
Referenced by CheckAssocRequest(), CheckMlSetup(), and DoSetup().
|
private |
DL TID-to-Link Mapping for non-AP MLD EHT configuration.
Definition at line 447 of file wifi-mlo-test.h.
Referenced by DoSetup().
|
private |
number of Probe Responses received by the non-AP MLD
Definition at line 444 of file wifi-mlo-test.h.
Referenced by DoRun().
|
private |
indices of QoS frames of the first set in the vector of TX PSDUs
Definition at line 458 of file wifi-mlo-test.h.
Referenced by CheckQosData().
|
private |
indices of QoS frames of the optional set in the vector of TX PSDUs
Definition at line 460 of file wifi-mlo-test.h.
Referenced by CheckQosData().
|
private |
the scan type (active or passive)
Definition at line 443 of file wifi-mlo-test.h.
|
private |
IDs of the expected links to setup.
Definition at line 442 of file wifi-mlo-test.h.
Referenced by CheckAssocRequest(), CheckAssocResponse(), CheckDisabledLinks(), CheckMlSetup(), CheckQosData(), DoRun(), DoSetup(), and StartTraffic().
|
private |
whether non-AP MLDs support 160 MHz operations
Definition at line 461 of file wifi-mlo-test.h.
Referenced by CheckMlSetup(), CheckQosData(), and DoSetup().
|
private |
the TID of the first set of UL QoS data frames
Definition at line 454 of file wifi-mlo-test.h.
Referenced by CheckQosData(), DoSetup(), and StartTraffic().
|
private |
the TID of the optional set of UL QoS data frames
Definition at line 456 of file wifi-mlo-test.h.
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 451 of file wifi-mlo-test.h.
Referenced by CheckAssocRequest(), CheckMlSetup(), and DoSetup().
|
private |
UL TID-to-Link Mapping for non-AP MLD EHT configuration.
Definition at line 448 of file wifi-mlo-test.h.
Referenced by DoSetup().