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

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

+ 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 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.
 
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

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 class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto 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 317 of file wifi-mlo-test.cc.

Member Typedef Documentation

◆ ChannelMap

PHY band-indexed map of spectrum channels.

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

Member Enumeration Documentation

◆ Direction

Uplink or Downlink direction.

Enumerator
DL 
UL 

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

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

+ Here is the call graph for this function:
+ 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, MultiLinkMuTxTest, and ReleaseSeqNoAfterCtsTimeoutTest.

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

References ns3::NodeList::Begin(), ns3::Config::ConnectWithoutContext(), ns3::NodeList::End(), ns3::WifiMac::GetDevice(), 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(), 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().

+ 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 745 of file wifi-mlo-test.cc.

References m_duration, ns3::MicroSeconds(), ns3::Simulator::Now(), and pktSize.

Referenced by MultiLinkSetupTest::StartTraffic(), MultiLinkTxTest::StartTraffic(), MultiLinkMuTxTest::StartTraffic(), ReleaseSeqNoAfterCtsTimeoutTest::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 584 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 
)
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.

Parameters
helperthe given PHY helper
channelsthe strings specifying the operating channels to configure
channelMapthe created spectrum channels

Definition at line 591 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().

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

◆ SetSsid()

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

Parameters
aidthe AID assigned to the previous associated STA

Definition at line 764 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 MultiLinkSetupTest, MultiLinkTxTest, MultiLinkMuTxTest, and ReleaseSeqNoAfterCtsTimeoutTest.

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

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 MultiLinkTxTest, MultiLinkMuTxTest, and ReleaseSeqNoAfterCtsTimeoutTest.

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

References m_txPsdus, ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, and ns3::PeekPointer().

Referenced by DoSetup(), MultiLinkTxTest::Transmit(), MultiLinkMuTxTest::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 420 of file wifi-mlo-test.cc.

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

◆ m_apMac

◆ m_duration

Time MultiLinkOperationsTestBase::m_duration {Seconds(1)}
protected

◆ m_fixedPhyBands

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

links on non-AP MLD with fixed PHY band

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

Referenced by DoSetup().

◆ m_lastAid

uint16_t MultiLinkOperationsTestBase::m_lastAid
protected

AID of last associated station.

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

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 427 of file wifi-mlo-test.cc.

Referenced by MultiLinkSetupTest::DoRun(), MultiLinkTxTest::DoRun(), MultiLinkMuTxTest::DoRun(), and L7Receive().

◆ m_staChannels

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

strings specifying channels for STA

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

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

◆ m_staMacs

◆ m_txPsdus

std::vector<FrameInfo> MultiLinkOperationsTestBase::m_txPsdus
protected

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