Test data transmission between two MLDs. More...
#include "wifi-mlo-test.h"
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 MultiLinkOperationsTestBase | |
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 |
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. | |
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 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. | |
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. | |
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. | |
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. | |
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. | |
TestCase * | GetParent () 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< WifiMac > | m_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 |
Protected Types inherited from MultiLinkOperationsTestBase | |
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 Attributes inherited from MultiLinkOperationsTestBase | |
const std::vector< std::string > | m_apChannels |
strings specifying channels for AP | |
Ptr< ApWifiMac > | m_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< FrameInfo > | m_txPsdus |
transmitted PSDUs | |
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.
|
private |
Receiver address-indexed map of list error models.
Definition at line 565 of file wifi-mlo-test.h.
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 1719 of file wifi-mlo-test.cc.
|
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 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().
|
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.
|
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.
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 2033 of file wifi-mlo-test.cc.
References AP_TO_BCAST, AP_TO_STA, MultiLinkOperationsTestBase::GetApplication(), ns3::Mac48Address::GetBroadcast(), 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, STA_TO_STA, and ns3::Simulator::Stop().
|
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 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.
|
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().
|
private |
transmitted BlockAck counter
Definition at line 575 of file wifi-mlo-test.h.
Referenced by CheckBlockAck(), DoRun(), and Transmit().
|
private |
transmitted BlockAckReq counter
Definition at line 576 of file wifi-mlo-test.h.
Referenced by DoRun(), and Transmit().
|
private |
whether second data frame has been already corrupted
Definition at line 569 of file wifi-mlo-test.h.
Referenced by Transmit().
|
private |
error rate models to corrupt packets
Definition at line 567 of file wifi-mlo-test.h.
Referenced by DoSetup(), and Transmit().
|
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().
|
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().
|
private |
number of application packets to generate
Definition at line 574 of file wifi-mlo-test.h.
Referenced by CheckBlockAck(), DoRun(), and StartTraffic().
MAC of the node sending application packets.
Definition at line 579 of file wifi-mlo-test.h.
Referenced by CheckBlockAck(), StartTraffic(), and Transmit().
|
private |
the pattern of traffic to generate
Definition at line 570 of file wifi-mlo-test.h.
Referenced by CheckBlockAck(), DoRun(), StartTraffic(), and Transmit().
|
private |
list of UIDs of packets to corrupt
Definition at line 568 of file wifi-mlo-test.h.
Referenced by Transmit().
|
private |
whether to send BAR after missed BlockAck
Definition at line 572 of file wifi-mlo-test.h.