Test data transmission between two MLDs. More...
Public Member Functions | |
MultiLinkTxTest (WifiTrafficPattern trafficPattern, WifiBaEnabled baEnabled, WifiUseBarAfterMissedBa useBarAfterMissedBa, uint8_t nMaxInflight, const std::vector< std::string > &staChannels, const std::vector< std::string > &apChannels, const std::vector< uint8_t > &fixedPhyBands={}) | |
Constructor. | |
~MultiLinkTxTest () override=default | |
Public Member Functions inherited from MultiLinkOperationsTestBase | |
MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, std::vector< std::string > staChannels, std::vector< std::string > apChannels, std::vector< uint8_t > fixedPhyBands={}) | |
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 | L7Receive (uint8_t nodeId, Ptr< const Packet > p, const Address &addr) |
Function to trace packets received by the server application. | |
void | Transmit (uint8_t linkId, std::string context, 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 | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
virtual void | Transmit (uint8_t linkId, std::string context, 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, TestDuration 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 | |
std::array< std::size_t, 3 > | m_rxPkts {} |
number of packets received at application layer by each node (AP, STA 0, STA 1) | |
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 | 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. | |
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. | |
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 | |
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 1147 of file wifi-mlo-test.cc.
|
private |
Receiver address-indexed map of list error models.
Definition at line 1202 of file wifi-mlo-test.cc.
MultiLinkTxTest::MultiLinkTxTest | ( | WifiTrafficPattern | trafficPattern, |
WifiBaEnabled | baEnabled, | ||
WifiUseBarAfterMissedBa | useBarAfterMissedBa, | ||
uint8_t | nMaxInflight, | ||
const std::vector< std::string > & | staChannels, | ||
const std::vector< std::string > & | apChannels, | ||
const std::vector< uint8_t > & | fixedPhyBands = {} |
||
) |
Constructor.
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) |
staChannels | the strings specifying the operating channels for the STA |
apChannels | the strings specifying the operating channels for the AP |
fixedPhyBands | list of IDs of STA links that cannot switch PHY band |
Definition at line 1221 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 1369 of file wifi-mlo-test.cc.
References ns3::AC_BE, ns3::WifiPhy::CalculateTxDuration(), 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 ns3::Simulator::Schedule().
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 1630 of file wifi-mlo-test.cc.
References ns3::Simulator::Destroy(), m_baEnabled, m_blockAckCount, m_blockAckReqCount, m_inflightCount, m_nMaxInflight, m_nPackets, m_rxPkts, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, m_useBarAfterMissedBa, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT_OR_EQ, and ns3::Simulator::Run().
|
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 1510 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, and ns3::WifiPhy::SetPostReceptionErrorModel().
|
protected |
Function to trace packets received by the server application.
nodeId | the ID of the node that received the packet |
p | the packet |
addr | the address |
Definition at line 1503 of file wifi-mlo-test.cc.
References m_rxPkts, and NS_LOG_INFO.
Referenced by StartTraffic().
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 1546 of file wifi-mlo-test.cc.
References ns3::Node::AddApplication(), ns3::NodeList::Begin(), ns3::Config::ConnectWithoutContext(), ns3::NodeList::End(), ns3::WifiNetDevice::GetAddress(), ns3::Mac48Address::GetBroadcast(), ns3::WifiMac::GetDevice(), ns3::WifiNetDevice::GetIfIndex(), ns3::NodeList::GetNNodes(), ns3::WifiNetDevice::GetNode(), ns3::PacketSocketHelper::Install(), L7Receive(), MultiLinkOperationsTestBase::m_apMac, m_nPackets, m_sourceMac, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), and ns3::Simulator::Stop().
|
overrideprotectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
linkId | the ID of the link transmitting the PSDUs |
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 1255 of file wifi-mlo-test.cc.
References MultiLinkOperationsTestBase::CheckAddresses(), CheckBlockAck(), MultiLinkOperationsTestBase::DL, ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetLinkIdByAddress(), m_baEnabled, m_blockAckCount, m_blockAckReqCount, m_dataCorrupted, m_errorModels, m_inflightCount, m_nMaxInflight, m_sourceMac, m_trafficPattern, m_uidList, NS_LOG_INFO, 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 1208 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), DoSetup(), and Transmit().
|
private |
transmitted BlockAck counter
Definition at line 1212 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), and Transmit().
|
private |
transmitted BlockAckReq counter
Definition at line 1213 of file wifi-mlo-test.cc.
Referenced by DoRun(), and Transmit().
|
private |
whether second data frame has been already corrupted
Definition at line 1206 of file wifi-mlo-test.cc.
Referenced by Transmit().
|
private |
error rate models to corrupt packets
Definition at line 1204 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 1216 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 1210 of file wifi-mlo-test.cc.
Referenced by DoRun(), DoSetup(), and Transmit().
|
private |
number of application packets to generate
Definition at line 1211 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), and StartTraffic().
|
private |
number of packets received at application layer by each node (AP, STA 0, STA 1)
Definition at line 1214 of file wifi-mlo-test.cc.
Referenced by DoRun(), and L7Receive().
MAC of the node sending application packets.
Definition at line 1218 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), StartTraffic(), and Transmit().
|
private |
the pattern of traffic to generate
Definition at line 1207 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), StartTraffic(), and Transmit().
|
private |
list of UIDs of packets to corrupt
Definition at line 1205 of file wifi-mlo-test.cc.
Referenced by Transmit().
|
private |
whether to send BAR after missed BlockAck
Definition at line 1209 of file wifi-mlo-test.cc.