Base class for Multi-Link Operations tests. More...
#include "wifi-mlo-test.h"
Classes | |
struct | BaseParams |
Configuration parameters common to all subclasses. More... | |
struct | FrameInfo |
Information about transmitted frames. More... | |
Public Member Functions | |
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 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 | 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. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
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. | |
Protected Attributes | |
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 | |
Private Member Functions | |
virtual void | StartTraffic () |
Start the generation of traffic (needs to be overridden) | |
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 |
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 169 of file wifi-mlo-test.h.
|
protected |
PHY band-indexed map of spectrum channels.
Definition at line 250 of file wifi-mlo-test.h.
|
protected |
MultiLinkOperationsTestBase::MultiLinkOperationsTestBase | ( | const std::string & | name, |
uint8_t | nStations, | ||
const BaseParams & | baseParams ) |
Constructor.
name | The name of the new TestCase created |
nStations | the number of stations to create |
baseParams | common configuration parameters |
Definition at line 410 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 425 of file wifi-mlo-test.cc.
References DL, 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(), MultiLinkMuTxTest::Transmit(), and MultiLinkTxTest::Transmit().
|
protected |
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.
mpdu | the given management frame |
mac | the MAC transmitting the management frame |
phyId | the ID of the PHY transmitting the management frame |
Definition at line 525 of file wifi-mlo-test.cc.
References 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_REQUEST, ns3::WIFI_MAC_MGT_PROBE_RESPONSE, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_PHY_BAND_6GHZ.
Referenced by 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, ReleaseSeqNoAfterCtsTimeoutTest, and StartSeqNoUpdateAfterAddBaTimeoutTest.
Definition at line 634 of file wifi-mlo-test.cc.
References ns3::WifiHelper::AssignStreams(), ns3::NodeList::Begin(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NodeList::End(), ns3::NodeList::GetNNodes(), ns3::PacketSocketHelper::Install(), L7Receive(), m_apChannels, m_apMac, m_duration, m_fixedPhyBands, m_nStations, m_staChannels, m_staMacs, ns3::MakeCallback(), NS_TEST_ASSERT_MSG_NE, ns3::Seconds(), ns3::WifiPhyHelper::Set(), SetChannels(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), SetSsid(), Transmit(), ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, and ns3::WIFI_STANDARD_80211be.
Referenced by MultiLinkMuTxTest::DoSetup(), MultiLinkSetupTest::DoSetup(), MultiLinkTxTest::DoSetup(), ReleaseSeqNoAfterCtsTimeoutTest::DoSetup(), and StartSeqNoUpdateAfterAddBaTimeoutTest::DoSetup().
|
protected |
sockAddr | the packet socket address identifying local outgoing interface and remote address |
count | the number of packets to generate |
pktSize | the size of the packets to generate |
delay | the delay with which traffic generation starts |
priority | user priority for generated packets |
Definition at line 766 of file wifi-mlo-test.cc.
References ns3::CreateObject(), m_duration, ns3::MicroSeconds(), ns3::Simulator::Now(), and pktSize.
Referenced by MultiLinkMuTxTest::StartTraffic(), MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic(), StartSeqNoUpdateAfterAddBaTimeoutTest::StartTraffic(), MultiLinkMuTxTest::Transmit(), and ReleaseSeqNoAfterCtsTimeoutTest::Transmit().
|
protectedvirtual |
Function to trace packets received by the server application.
nodeId | the ID of the node that received the packet |
p | the packet |
addr | the address |
Definition at line 604 of file wifi-mlo-test.cc.
References m_rxPkts, and NS_LOG_INFO.
Referenced by DoSetup().
|
protected |
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 611 of file wifi-mlo-test.cc.
References ns3::SpectrumWifiPhyHelper::AddChannel(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::WifiPhyHelper::Set(), ns3::WifiPhyHelper::SetPcapCaptureType(), and ns3::WifiPhyHelper::SetPcapDataLinkType().
Referenced by DoSetup().
|
protected |
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 785 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 MultiLinkMuTxTest, MultiLinkSetupTest, MultiLinkTxTest, ReleaseSeqNoAfterCtsTimeoutTest, and StartSeqNoUpdateAfterAddBaTimeoutTest.
Definition at line 318 of file wifi-mlo-test.h.
Referenced by SetSsid().
|
protectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
mac | the MAC transmitting the PSDUs |
phyId | the ID of the PHY transmitting the PSDUs |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Reimplemented in MultiLinkMuTxTest, MultiLinkTxTest, ReleaseSeqNoAfterCtsTimeoutTest, and StartSeqNoUpdateAfterAddBaTimeoutTest.
Definition at line 498 of file wifi-mlo-test.cc.
References CheckCapabilities(), m_txPsdus, ns3::Simulator::Now(), NS_LOG_INFO, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoSetup(), MultiLinkMuTxTest::Transmit(), MultiLinkTxTest::Transmit(), and ReleaseSeqNoAfterCtsTimeoutTest::Transmit().
|
protected |
strings specifying channels for AP
Definition at line 282 of file wifi-mlo-test.h.
Referenced by MultiLinkSetupTest::DoRun(), and DoSetup().
AP wifi MAC.
Definition at line 284 of file wifi-mlo-test.h.
Referenced by CheckAddresses(), MultiLinkSetupTest::CheckAssocRequest(), MultiLinkSetupTest::CheckAssocResponse(), MultiLinkSetupTest::CheckBeacon(), MultiLinkMuTxTest::CheckBlockAck(), MultiLinkTxTest::CheckBlockAck(), MultiLinkSetupTest::CheckDisabledLinks(), MultiLinkSetupTest::CheckMlSetup(), MultiLinkSetupTest::CheckProbeResponse(), MultiLinkSetupTest::CheckQosData(), MultiLinkSetupTest::DoRun(), MultiLinkMuTxTest::DoSetup(), DoSetup(), MultiLinkSetupTest::DoSetup(), MultiLinkTxTest::DoSetup(), MultiLinkMuTxTest::StartTraffic(), MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic(), StartSeqNoUpdateAfterAddBaTimeoutTest::StartTraffic(), MultiLinkMuTxTest::Transmit(), ReleaseSeqNoAfterCtsTimeoutTest::Transmit(), and StartSeqNoUpdateAfterAddBaTimeoutTest::Transmit().
simulation duration
Definition at line 288 of file wifi-mlo-test.h.
Referenced by MultiLinkSetupTest::DoRun(), ReleaseSeqNoAfterCtsTimeoutTest::DoRun(), StartSeqNoUpdateAfterAddBaTimeoutTest::DoRun(), DoSetup(), GetApplication(), MultiLinkMuTxTest::StartTraffic(), and MultiLinkTxTest::StartTraffic().
|
protected |
links on non-AP MLD with fixed PHY band
Definition at line 283 of file wifi-mlo-test.h.
Referenced by DoSetup().
|
protected |
AID of last associated station.
Definition at line 287 of file wifi-mlo-test.h.
Referenced by SetSsid().
|
protected |
number of stations to create
Definition at line 286 of file wifi-mlo-test.h.
Referenced by CheckAddresses(), MultiLinkMuTxTest::CheckBlockAck(), DoSetup(), SetSsid(), MultiLinkMuTxTest::StartTraffic(), and MultiLinkMuTxTest::Transmit().
|
protected |
number of packets received at application layer by each node (index is node ID)
Definition at line 289 of file wifi-mlo-test.h.
Referenced by MultiLinkMuTxTest::DoRun(), MultiLinkSetupTest::DoRun(), MultiLinkTxTest::DoRun(), StartSeqNoUpdateAfterAddBaTimeoutTest::DoRun(), and L7Receive().
|
protected |
strings specifying channels for STA
Definition at line 281 of file wifi-mlo-test.h.
Referenced by MultiLinkSetupTest::DoRun(), DoSetup(), and MultiLinkSetupTest::DoSetup().
|
protected |
STA wifi MACs.
Definition at line 285 of file wifi-mlo-test.h.
Referenced by CheckAddresses(), MultiLinkSetupTest::CheckAssocRequest(), MultiLinkSetupTest::CheckAssocResponse(), MultiLinkMuTxTest::CheckBlockAck(), MultiLinkTxTest::CheckBlockAck(), MultiLinkSetupTest::CheckDisabledLinks(), MultiLinkSetupTest::CheckMlSetup(), MultiLinkSetupTest::CheckQosData(), MultiLinkMuTxTest::DoRun(), MultiLinkSetupTest::DoRun(), MultiLinkTxTest::DoRun(), MultiLinkMuTxTest::DoSetup(), DoSetup(), MultiLinkSetupTest::DoSetup(), MultiLinkTxTest::DoSetup(), ReleaseSeqNoAfterCtsTimeoutTest::DoSetup(), StartSeqNoUpdateAfterAddBaTimeoutTest::DoSetup(), SetSsid(), MultiLinkMuTxTest::StartTraffic(), MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), ReleaseSeqNoAfterCtsTimeoutTest::StartTraffic(), StartSeqNoUpdateAfterAddBaTimeoutTest::StartTraffic(), MultiLinkMuTxTest::Transmit(), and StartSeqNoUpdateAfterAddBaTimeoutTest::Transmit().
|
protected |
transmitted PSDUs
Definition at line 280 of file wifi-mlo-test.h.
Referenced by MultiLinkSetupTest::CheckQosData(), MultiLinkSetupTest::DoRun(), ReleaseSeqNoAfterCtsTimeoutTest::DoRun(), MultiLinkMuTxTest::Transmit(), Transmit(), MultiLinkTxTest::Transmit(), and StartSeqNoUpdateAfterAddBaTimeoutTest::Transmit().