Base class for Multi-Link Operations tests. More...
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 |
TestCase & | operator= (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. | |
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. | |
Protected Attributes | |
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 | |
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... | |
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.
|
protected |
PHY band-indexed map of spectrum channels.
Definition at line 240 of file wifi-mlo-test.cc.
|
protected |
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.
name | The name of the new TestCase created |
nStations | the number of stations to create |
staChannels | the strings specifying the operating channels for the STA |
apChannels | the strings specifying the operating channels for the AP |
fixedPhyBands | list of IDs of STA links that cannot switch PHY band |
Definition at line 309 of file wifi-mlo-test.cc.
|
overridedefault |
|
protected |
Check that the Address 1 and Address 2 fields of the given PSDU contain device MAC addresses.
psdu | the given PSDU |
direction | indicates 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().
|
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().
|
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.
helper | the given PHY helper |
channels | the strings specifying the operating channels to configure |
channelMap | the 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().
|
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.
aid | the 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().
|
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().
|
protectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
linkId | the ID of the link transmitting the PSDUs |
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the 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().
|
protected |
strings specifying channels for AP
Definition at line 271 of file wifi-mlo-test.cc.
Referenced by MultiLinkSetupTest::DoRun(), and DoSetup().
AP wifi MAC.
Definition at line 273 of file wifi-mlo-test.cc.
Referenced by CheckAddresses(), MultiLinkSetupTest::CheckAssocRequest(), MultiLinkSetupTest::CheckAssocResponse(), MultiLinkSetupTest::CheckBeacon(), MultiLinkTxTest::CheckBlockAck(), MultiLinkMuTxTest::CheckBlockAck(), MultiLinkSetupTest::CheckMlSetup(), MultiLinkSetupTest::CheckProbeResponse(), DoSetup(), MultiLinkTxTest::DoSetup(), MultiLinkMuTxTest::DoSetup(), MultiLinkTxTest::StartTraffic(), MultiLinkMuTxTest::StartTraffic(), ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic(), MultiLinkMuTxTest::Transmit(), and ReleaseSeqNoAfterCtsTimeoutTest::Transmit().
|
protected |
links on non-AP MLD with fixed PHY band
Definition at line 272 of file wifi-mlo-test.cc.
Referenced by DoSetup().
|
protected |
AID of last associated station.
Definition at line 276 of file wifi-mlo-test.cc.
Referenced by SetSsid().
|
protected |
number of stations to create
Definition at line 275 of file wifi-mlo-test.cc.
Referenced by CheckAddresses(), MultiLinkMuTxTest::CheckBlockAck(), DoSetup(), SetSsid(), MultiLinkMuTxTest::StartTraffic(), and MultiLinkMuTxTest::Transmit().
|
protected |
strings specifying channels for STA
Definition at line 270 of file wifi-mlo-test.cc.
Referenced by MultiLinkSetupTest::CheckDisabledLinks(), MultiLinkSetupTest::DoRun(), and DoSetup().
|
protected |
STA wifi MACs.
Definition at line 274 of file wifi-mlo-test.cc.
Referenced by CheckAddresses(), MultiLinkSetupTest::CheckAssocRequest(), MultiLinkSetupTest::CheckAssocResponse(), MultiLinkTxTest::CheckBlockAck(), MultiLinkMuTxTest::CheckBlockAck(), MultiLinkSetupTest::CheckDisabledLinks(), MultiLinkSetupTest::CheckMlSetup(), MultiLinkTxTest::DoRun(), MultiLinkMuTxTest::DoRun(), DoSetup(), MultiLinkSetupTest::DoSetup(), MultiLinkTxTest::DoSetup(), MultiLinkMuTxTest::DoSetup(), ReleaseSeqNoAfterCtsTimeoutTest::DoSetup(), SetSsid(), MultiLinkTxTest::StartTraffic(), MultiLinkMuTxTest::StartTraffic(), ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic(), and MultiLinkMuTxTest::Transmit().
|
protected |
transmitted PSDUs
Definition at line 269 of file wifi-mlo-test.cc.
Referenced by MultiLinkSetupTest::DoRun(), ReleaseSeqNoAfterCtsTimeoutTest::DoRun(), and Transmit().