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

Test data transmission between two MLDs. More...

#include "wifi-mlo-test.h"

+ Inheritance diagram for MultiLinkTxTest:
+ Collaboration diagram for MultiLinkTxTest:

Public Member Functions

 MultiLinkTxTest (const BaseParams &baseParams, WifiTrafficPattern trafficPattern, WifiBaEnabled baEnabled, WifiUseBarAfterMissedBa useBarAfterMissedBa, uint8_t nMaxInflight)
 Constructor.
 
 ~MultiLinkTxTest () 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 Member Functions

void CheckBlockAck (Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint8_t linkId)
 Check the content of a received BlockAck frame when the max number of links on which an MPDU can be inflight is one.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 
void Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override
 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.
 

Private Types

using RxErrorModelMap = std::unordered_map<Mac48Address, Ptr<ListErrorModel>, WifiAddressHash>
 Receiver address-indexed map of list error models.
 

Private Member Functions

void StartTraffic () override
 Start the generation of traffic (needs to be overridden)
 

Private Attributes

bool m_baEnabled
 whether BA agreement is enabled or disabled
 
std::size_t m_blockAckCount {0}
 transmitted BlockAck counter
 
std::size_t m_blockAckReqCount {0}
 transmitted BlockAckReq counter
 
bool m_dataCorrupted {false}
 whether second data frame has been already corrupted
 
RxErrorModelMap m_errorModels
 error rate models to corrupt packets
 
std::map< uint16_t, std::size_t > m_inflightCount
 seqNo-indexed max number of simultaneous transmissions of a data frame
 
std::size_t m_nMaxInflight
 max number of links on which an MPDU can be inflight
 
std::size_t m_nPackets
 number of application packets to generate
 
Ptr< WifiMacm_sourceMac
 MAC of the node sending application packets.
 
WifiTrafficPattern m_trafficPattern
 the pattern of traffic to generate
 
std::list< uint64_t > m_uidList
 list of UIDs of packets to corrupt
 
bool m_useBarAfterMissedBa
 whether to send BAR after missed BlockAck
 

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
 
 Uplink or Downlink direction. More...

Detailed Description

Test data transmission between two MLDs.

This test sets up an AP MLD and two non-AP MLDs 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). This test aims at veryfing the successful transmission of both unicast QoS data frames (from one station to another, from one station to the AP, from the AP to the station) and broadcast QoS data frames (from the AP or from one station). In the scenarios in which the AP forwards frames (i.e., from one station to another and from one station to broadcast) the client application generates only 4 packets, in order to limit the probability of collisions. In the other scenarios, 8 packets are generated. When BlockAck agreements are enabled, the maximum A-MSDU size is set such that two packets can be aggregated in an A-MSDU. The MPDU with sequence number equal to 1 is corrupted (once, by using a post reception error model) to test its successful re-transmission, unless the traffic scenario is from the AP to broadcast (broadcast frames are not retransmitted) or is a scenario where the AP forwards frame (to limit the probability of collisions).

When BlockAck agreements are enabled, we also corrupt a BlockAck frame, so as to simulate the case of BlockAck timeout. Both the case where a BlockAckReq is sent and the case where data frame are retransmitted are tested. Finally, when BlockAck agreements are enabled, we also enable the concurrent transmission of data frames over two links and check that at least one MPDU is concurrently transmitted over two links.

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

Member Typedef Documentation

◆ RxErrorModelMap

Receiver address-indexed map of list error models.

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

Constructor & Destructor Documentation

◆ MultiLinkTxTest()

MultiLinkTxTest::MultiLinkTxTest ( const BaseParams & baseParams,
WifiTrafficPattern trafficPattern,
WifiBaEnabled baEnabled,
WifiUseBarAfterMissedBa useBarAfterMissedBa,
uint8_t nMaxInflight )

Constructor.

Parameters
baseParamscommon configuration parameters
trafficPatternthe pattern of traffic to generate
baEnabledwhether BA agreement is enabled or disabled
useBarAfterMissedBawhether a BAR or Data frames are sent after missed BlockAck
nMaxInflightthe max number of links on which an MPDU can be simultaneously inflight (unused if Block Ack agreements are not established)

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

◆ ~MultiLinkTxTest()

MultiLinkTxTest::~MultiLinkTxTest ( )
overridedefault

Member Function Documentation

◆ CheckBlockAck()

void MultiLinkTxTest::CheckBlockAck ( Ptr< const WifiPsdu > psdu,
const WifiTxVector & txVector,
uint8_t linkId )
protected

Check the content of a received BlockAck frame when the max number of links on which an MPDU can be inflight is one.

Parameters
psduthe PSDU containing the BlockAck
txVectorthe TXVECTOR used to transmit the BlockAck
linkIdthe ID of the link on which the BlockAck was transmitted

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

References ns3::AC_BE, AP_TO_BCAST, AP_TO_STA, ns3::WifiPhy::CalculateTxDuration(), ns3::CtrlBAckResponseHeader::IsPacketReceived(), MultiLinkOperationsTestBase::m_apMac, m_baEnabled, m_blockAckCount, m_nPackets, m_sourceMac, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, ns3::MicroSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Schedule(), STA_TO_AP, and ns3::StaticCast().

Referenced by Transmit().

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

◆ DoRun()

void MultiLinkTxTest::DoRun ( )
overrideprotectedvirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

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

References AP_TO_BCAST, AP_TO_STA, ns3::Simulator::Destroy(), m_baEnabled, m_blockAckCount, m_blockAckReqCount, m_inflightCount, m_nMaxInflight, m_nPackets, MultiLinkOperationsTestBase::m_rxPkts, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, m_useBarAfterMissedBa, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT_OR_EQ, ns3::Simulator::Run(), STA_TO_AP, STA_TO_BCAST, and STA_TO_STA.

+ Here is the call graph for this function:

◆ DoSetup()

void MultiLinkTxTest::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 MultiLinkOperationsTestBase.

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

References ns3::AC_BE, ns3::CreateObject(), MultiLinkOperationsTestBase::DoSetup(), MultiLinkOperationsTestBase::m_apMac, m_baEnabled, m_errorModels, m_nMaxInflight, MultiLinkOperationsTestBase::m_staMacs, and m_useBarAfterMissedBa.

+ Here is the call graph for this function:

◆ StartTraffic()

void MultiLinkTxTest::StartTraffic ( )
overrideprivatevirtual

◆ Transmit()

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

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 from MultiLinkOperationsTestBase.

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

References AP_TO_BCAST, MultiLinkOperationsTestBase::CheckAddresses(), CheckBlockAck(), MultiLinkOperationsTestBase::DL, m_baEnabled, m_blockAckCount, m_blockAckReqCount, m_dataCorrupted, m_errorModels, m_inflightCount, m_nMaxInflight, m_sourceMac, m_trafficPattern, MultiLinkOperationsTestBase::m_txPsdus, m_uidList, NS_LOG_INFO, STA_TO_BCAST, STA_TO_STA, MultiLinkOperationsTestBase::Transmit(), MultiLinkOperationsTestBase::UL, ns3::WIFI_MAC_CTL_BACKREQ, ns3::WIFI_MAC_CTL_BACKRESP, ns3::WIFI_MAC_MGT_ACTION, and ns3::WIFI_MAC_QOSDATA.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_baEnabled

bool MultiLinkTxTest::m_baEnabled
private

whether BA agreement is enabled or disabled

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

Referenced by CheckBlockAck(), DoRun(), DoSetup(), and Transmit().

◆ m_blockAckCount

std::size_t MultiLinkTxTest::m_blockAckCount {0}
private

transmitted BlockAck counter

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

Referenced by CheckBlockAck(), DoRun(), and Transmit().

◆ m_blockAckReqCount

std::size_t MultiLinkTxTest::m_blockAckReqCount {0}
private

transmitted BlockAckReq counter

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

Referenced by DoRun(), and Transmit().

◆ m_dataCorrupted

bool MultiLinkTxTest::m_dataCorrupted {false}
private

whether second data frame has been already corrupted

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

Referenced by Transmit().

◆ m_errorModels

RxErrorModelMap MultiLinkTxTest::m_errorModels
private

error rate models to corrupt packets

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

Referenced by DoSetup(), and Transmit().

◆ m_inflightCount

std::map<uint16_t, std::size_t> MultiLinkTxTest::m_inflightCount
private

seqNo-indexed max number of simultaneous transmissions of a data frame

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

Referenced by DoRun(), and Transmit().

◆ m_nMaxInflight

std::size_t MultiLinkTxTest::m_nMaxInflight
private

max number of links on which an MPDU can be inflight

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

Referenced by DoRun(), DoSetup(), and Transmit().

◆ m_nPackets

std::size_t MultiLinkTxTest::m_nPackets
private

number of application packets to generate

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

Referenced by CheckBlockAck(), DoRun(), and StartTraffic().

◆ m_sourceMac

Ptr<WifiMac> MultiLinkTxTest::m_sourceMac
private

MAC of the node sending application packets.

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

Referenced by CheckBlockAck(), StartTraffic(), and Transmit().

◆ m_trafficPattern

WifiTrafficPattern MultiLinkTxTest::m_trafficPattern
private

the pattern of traffic to generate

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

Referenced by CheckBlockAck(), DoRun(), StartTraffic(), and Transmit().

◆ m_uidList

std::list<uint64_t> MultiLinkTxTest::m_uidList
private

list of UIDs of packets to corrupt

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

Referenced by Transmit().

◆ m_useBarAfterMissedBa

bool MultiLinkTxTest::m_useBarAfterMissedBa
private

whether to send BAR after missed BlockAck

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

Referenced by DoRun(), and DoSetup().


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