A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
MultiLinkOperationsTestBase Class Reference

Base class for Multi-Link Operations tests. More...

#include "wifi-mlo-test.h"

+ Inheritance diagram for MultiLinkOperationsTestBase:
+ Collaboration diagram for MultiLinkOperationsTestBase:

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
 
TestCaseoperator= (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< PacketSocketClientGetApplication (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.
 
TestCaseGetParent () 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< ApWifiMacm_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< FrameInfom_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
 

Detailed Description

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.

Member Typedef Documentation

◆ ChannelMap

PHY band-indexed map of spectrum channels.

Definition at line 250 of file wifi-mlo-test.h.

Member Enumeration Documentation

◆ Direction

Uplink or Downlink direction.

Enumerator
DL 
UL 

Definition at line 255 of file wifi-mlo-test.h.

Constructor & Destructor Documentation

◆ MultiLinkOperationsTestBase()

MultiLinkOperationsTestBase::MultiLinkOperationsTestBase ( const std::string & name,
uint8_t nStations,
const BaseParams & baseParams )

Constructor.

Parameters
nameThe name of the new TestCase created
nStationsthe number of stations to create
baseParamscommon configuration parameters

Definition at line 410 of file wifi-mlo-test.cc.

◆ ~MultiLinkOperationsTestBase()

MultiLinkOperationsTestBase::~MultiLinkOperationsTestBase ( )
overridedefault

Member Function Documentation

◆ CheckAddresses()

void MultiLinkOperationsTestBase::CheckAddresses ( Ptr< const WifiPsdu > psdu,
std::optional< Direction > direction = std::nullopt )
protected

Check that the Address 1 and Address 2 fields of the given PSDU contain device MAC addresses.

Parameters
psduthe given PSDU
directionindicates 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().

+ Here is the caller graph for this function:

◆ CheckCapabilities()

void MultiLinkOperationsTestBase::CheckCapabilities ( Ptr< WifiMpdu > mpdu,
Ptr< WifiMac > mac,
uint8_t phyId )
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.

Parameters
mpduthe given management frame
macthe MAC transmitting the management frame
phyIdthe 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().

+ Here is the caller graph for this function:

◆ DoSetup()

void MultiLinkOperationsTestBase::DoSetup ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetApplication()

Ptr< PacketSocketClient > MultiLinkOperationsTestBase::GetApplication ( const PacketSocketAddress & sockAddr,
std::size_t count,
std::size_t pktSize,
Time delay = Seconds(0),
uint8_t priority = 0 ) const
protected
Parameters
sockAddrthe packet socket address identifying local outgoing interface and remote address
countthe number of packets to generate
pktSizethe size of the packets to generate
delaythe delay with which traffic generation starts
priorityuser priority for generated packets
Returns
an application generating the given number packets of the given size destined to the given packet socket address

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ L7Receive()

void MultiLinkOperationsTestBase::L7Receive ( uint8_t nodeId,
Ptr< const Packet > p,
const Address & addr )
protectedvirtual

Function to trace packets received by the server application.

Parameters
nodeIdthe ID of the node that received the packet
pthe packet
addrthe address

Definition at line 604 of file wifi-mlo-test.cc.

References m_rxPkts, and NS_LOG_INFO.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ SetChannels()

void MultiLinkOperationsTestBase::SetChannels ( SpectrumWifiPhyHelper & helper,
const std::vector< std::string > & channels,
const ChannelMap & channelMap )
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.

Parameters
helperthe given PHY helper
channelsthe strings specifying the operating channels to configure
channelMapthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetSsid()

void MultiLinkOperationsTestBase::SetSsid ( uint16_t aid,
Mac48Address  )
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.

Parameters
aidthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartTraffic()

virtual void MultiLinkOperationsTestBase::StartTraffic ( )
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().

+ Here is the caller graph for this function:

◆ Transmit()

void MultiLinkOperationsTestBase::Transmit ( Ptr< WifiMac > mac,
uint8_t phyId,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )
protectedvirtual

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
macthe MAC transmitting the PSDUs
phyIdthe ID of the PHY transmitting the PSDUs
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_apChannels

const std::vector<std::string> MultiLinkOperationsTestBase::m_apChannels
protected

strings specifying channels for AP

Definition at line 282 of file wifi-mlo-test.h.

Referenced by MultiLinkSetupTest::DoRun(), and DoSetup().

◆ m_apMac

◆ m_duration

◆ m_fixedPhyBands

const std::vector<uint8_t> MultiLinkOperationsTestBase::m_fixedPhyBands
protected

links on non-AP MLD with fixed PHY band

Definition at line 283 of file wifi-mlo-test.h.

Referenced by DoSetup().

◆ m_lastAid

uint16_t MultiLinkOperationsTestBase::m_lastAid
protected

AID of last associated station.

Definition at line 287 of file wifi-mlo-test.h.

Referenced by SetSsid().

◆ m_nStations

uint8_t MultiLinkOperationsTestBase::m_nStations
protected

◆ m_rxPkts

std::vector<std::size_t> MultiLinkOperationsTestBase::m_rxPkts
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().

◆ m_staChannels

const std::vector<std::string> MultiLinkOperationsTestBase::m_staChannels
protected

strings specifying channels for STA

Definition at line 281 of file wifi-mlo-test.h.

Referenced by MultiLinkSetupTest::DoRun(), DoSetup(), and MultiLinkSetupTest::DoSetup().

◆ m_staMacs

◆ m_txPsdus


The documentation for this class was generated from the following files: