A Discrete-Event Network Simulator
API
MultiLinkTxTest Class Reference

Test data transmission between two MLDs. More...

+ 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. More...
 
 ~MultiLinkTxTest () override=default
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
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. More...
 
void DoRun () override
 Implementation to actually run this TestCase. More...
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase. More...
 
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. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

Private Types

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

Private Member Functions

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

Private Attributes

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

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

Member Typedef Documentation

◆ RxErrorModelMap

Receiver address-indexed map of list error models.

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

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

References STA_TO_BCAST, STA_TO_STA, and YES.

◆ ~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 2013 of file wifi-mlo-test.cc.

References ns3::AC_BE, AP_TO_BCAST, AP_TO_STA, ns3::WifiPsdu::begin(), ns3::WifiMac::GetLinkIdByAddress(), ns3::WifiMac::GetTxopQueue(), 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, and STA_TO_AP.

Referenced by Transmit().

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

◆ DoRun()

void MultiLinkTxTest::DoRun ( )
overrideprotectedvirtual

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

References ns3::AC_BE, MultiLinkOperationsTestBase::DoSetup(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetNLinks(), ns3::WifiMac::GetWifiPhy(), MultiLinkOperationsTestBase::m_apMac, m_baEnabled, m_errorModels, m_nMaxInflight, MultiLinkOperationsTestBase::m_staMacs, m_useBarAfterMissedBa, third::mac, and ns3::WifiPhy::SetPostReceptionErrorModel().

+ Here is the call graph for this function:

◆ StartTraffic()

◆ Transmit()

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

Member Data Documentation

◆ m_baEnabled

bool MultiLinkTxTest::m_baEnabled
private

whether BA agreement is enabled or disabled

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

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

◆ m_blockAckCount

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

transmitted BlockAck counter

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

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

◆ m_blockAckReqCount

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

transmitted BlockAckReq counter

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

Referenced by DoRun(), and Transmit().

◆ m_dataCorrupted

bool MultiLinkTxTest::m_dataCorrupted {false}
private

whether second data frame has been already corrupted

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

Referenced by Transmit().

◆ m_errorModels

RxErrorModelMap MultiLinkTxTest::m_errorModels
private

error rate models to corrupt packets

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

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

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

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

◆ m_nPackets

std::size_t MultiLinkTxTest::m_nPackets
private

number of application packets to generate

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

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

◆ m_sourceMac

Ptr<WifiMac> MultiLinkTxTest::m_sourceMac
private

MAC of the node sending application packets.

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

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

◆ m_trafficPattern

WifiTrafficPattern MultiLinkTxTest::m_trafficPattern
private

the pattern of traffic to generate

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

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

Referenced by Transmit().

◆ m_useBarAfterMissedBa

bool MultiLinkTxTest::m_useBarAfterMissedBa
private

whether to send BAR after missed BlockAck

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

Referenced by DoRun(), and DoSetup().


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