Test data transmission between two MLDs. More...
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 MultiLinkOperationsTestBase | |
MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, const BaseParams &baseParams) | |
Constructor. More... | |
~MultiLinkOperationsTestBase () override=default | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (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 MultiLinkOperationsTestBase | |
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. More... | |
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. 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... | |
TestCase * | GetParent () 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< WifiMac > | m_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... | |
Protected Types inherited from MultiLinkOperationsTestBase | |
using | ChannelMap = std::map< FrequencyRange, Ptr< MultiModelSpectrumChannel > > |
PHY band-indexed map of spectrum channels. More... | |
enum | Direction { DL = 0 , UL } |
Uplink or Downlink direction. More... | |
Protected Attributes inherited from MultiLinkOperationsTestBase | |
const std::vector< std::string > | m_apChannels |
strings specifying channels for AP More... | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. More... | |
Time | m_duration {Seconds(1)} |
simulation duration More... | |
const std::vector< uint8_t > | m_fixedPhyBands |
links on non-AP MLD with fixed PHY band More... | |
uint16_t | m_lastAid |
AID of last associated station. More... | |
uint8_t | m_nStations |
number of stations to create More... | |
std::vector< std::size_t > | m_rxPkts |
number of packets received at application layer by each node (index is node ID) More... | |
const std::vector< std::string > | m_staChannels |
strings specifying channels for STA More... | |
std::vector< Ptr< StaWifiMac > > | m_staMacs |
STA wifi MACs. More... | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs More... | |
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.
|
private |
Receiver address-indexed map of list error models.
Definition at line 1851 of file wifi-mlo-test.cc.
MultiLinkTxTest::MultiLinkTxTest | ( | const BaseParams & | baseParams, |
WifiTrafficPattern | trafficPattern, | ||
WifiBaEnabled | baEnabled, | ||
WifiUseBarAfterMissedBa | useBarAfterMissedBa, | ||
uint8_t | nMaxInflight | ||
) |
Constructor.
baseParams | common configuration parameters |
trafficPattern | the pattern of traffic to generate |
baEnabled | whether BA agreement is enabled or disabled |
useBarAfterMissedBa | whether a BAR or Data frames are sent after missed BlockAck |
nMaxInflight | the 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.
|
overridedefault |
|
protected |
Check the content of a received BlockAck frame when the max number of links on which an MPDU can be inflight is one.
psdu | the PSDU containing the BlockAck |
txVector | the TXVECTOR used to transmit the BlockAck |
linkId | the 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().
|
overrideprotectedvirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 2231 of file wifi-mlo-test.cc.
References AP_TO_BCAST, AP_TO_STA, m_baEnabled, m_blockAckCount, m_blockAckReqCount, m_inflightCount, m_nMaxInflight, m_nPackets, MultiLinkOperationsTestBase::m_rxPkts, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, m_useBarAfterMissedBa, max, min, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT_OR_EQ, STA_TO_AP, STA_TO_BCAST, and STA_TO_STA.
|
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().
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 2182 of file wifi-mlo-test.cc.
References ns3::Node::AddApplication(), AP_TO_BCAST, AP_TO_STA, ns3::WifiNetDevice::GetAddress(), MultiLinkOperationsTestBase::GetApplication(), ns3::WifiMac::GetDevice(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiNetDevice::GetNode(), MultiLinkOperationsTestBase::m_apMac, MultiLinkOperationsTestBase::m_duration, m_nPackets, m_sourceMac, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, ns3::MilliSeconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), STA_TO_AP, STA_TO_BCAST, and STA_TO_STA.
|
overrideprotectedvirtual |
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 from MultiLinkOperationsTestBase.
Definition at line 1898 of file wifi-mlo-test.cc.
References AP_TO_BCAST, MultiLinkOperationsTestBase::CheckAddresses(), CheckBlockAck(), MultiLinkOperationsTestBase::DL, ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetLinkIdByAddress(), ns3::WifiMac::GetLinkIds(), m_baEnabled, m_blockAckCount, m_blockAckReqCount, m_dataCorrupted, m_errorModels, m_inflightCount, m_nMaxInflight, m_sourceMac, m_trafficPattern, MultiLinkOperationsTestBase::m_txPsdus, m_uidList, third::mac, max, 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.
|
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().
|
private |
transmitted BlockAck counter
Definition at line 1861 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), and Transmit().
|
private |
transmitted BlockAckReq counter
Definition at line 1862 of file wifi-mlo-test.cc.
Referenced by DoRun(), and Transmit().
|
private |
whether second data frame has been already corrupted
Definition at line 1855 of file wifi-mlo-test.cc.
Referenced by Transmit().
|
private |
error rate models to corrupt packets
Definition at line 1853 of file wifi-mlo-test.cc.
Referenced by DoSetup(), and Transmit().
|
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().
|
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().
|
private |
number of application packets to generate
Definition at line 1860 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), and StartTraffic().
MAC of the node sending application packets.
Definition at line 1865 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), StartTraffic(), and Transmit().
|
private |
the pattern of traffic to generate
Definition at line 1856 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), StartTraffic(), and Transmit().
|
private |
list of UIDs of packets to corrupt
Definition at line 1854 of file wifi-mlo-test.cc.
Referenced by Transmit().
|
private |
whether to send BAR after missed BlockAck
Definition at line 1858 of file wifi-mlo-test.cc.