Test data transmission between MLDs using OFDMA MU transmissions. More...
Public Member Functions | |
MultiLinkMuTxTest (WifiMuTrafficPattern muTrafficPattern, WifiUseBarAfterMissedBa useBarAfterMissedBa, uint8_t nMaxInflight, const std::vector< std::string > &staChannels, const std::vector< std::string > &apChannels, const std::vector< uint8_t > &fixedPhyBands={}) | |
Constructor. | |
~MultiLinkMuTxTest () 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 | AddrSeqNoPair = std::pair< Mac48Address, uint16_t > |
A pair of a MAC address (the address of the receiver for DL frames and the address of the sender for UL frames) and a sequence number identifying a transmitted QoS data frame. | |
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 | |
std::size_t | m_blockAckCount {0} |
transmitted BlockAck counter | |
std::optional< Mac48Address > | m_dataCorruptedSta |
MAC address of the station that received MPDU with SeqNo=2 corrupted. | |
RxErrorModelMap | m_errorModels |
error rate models to corrupt packets | |
std::map< AddrSeqNoPair, std::size_t > | m_inflightCount |
max number of simultaneous transmissions of each data frame | |
WifiMuTrafficPattern | m_muTrafficPattern |
the pattern of traffic to generate | |
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) | |
std::vector< PacketSocketAddress > | m_sockets |
packet socket addresses for STAs | |
Ptr< WifiMac > | m_sourceMac |
MAC of the node sending application packets. | |
std::list< uint64_t > | m_uidList |
list of UIDs of packets to corrupt | |
bool | m_useBarAfterMissedBa |
whether to send BAR after missed BlockAck | |
bool | m_waitFirstTf {true} |
whether we are waiting for the first Basic Trigger Frame | |
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 MLDs using OFDMA MU transmissions.
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 DL MU and UL MU frames. In the DL MU scenarios, the client applications installed on the AP generate 8 packets addressed to each of the stations (plus 3 packets to trigger the establishment of BlockAck agreements). In the UL MU scenario, client applications installed on the stations generate 4 packets each (plus 3 packets to trigger the establishment of BlockAck agreements).
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 3 is corrupted (by using a post reception error model) once and for a single station, to test its successful re-transmission.
Also, we 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 1768 of file wifi-mlo-test.cc.
|
private |
A pair of a MAC address (the address of the receiver for DL frames and the address of the sender for UL frames) and a sequence number identifying a transmitted QoS data frame.
Definition at line 1825 of file wifi-mlo-test.cc.
|
private |
Receiver address-indexed map of list error models.
Definition at line 1821 of file wifi-mlo-test.cc.
MultiLinkMuTxTest::MultiLinkMuTxTest | ( | WifiMuTrafficPattern | muTrafficPattern, |
WifiUseBarAfterMissedBa | useBarAfterMissedBa, | ||
uint8_t | nMaxInflight, | ||
const std::vector< std::string > & | staChannels, | ||
const std::vector< std::string > & | apChannels, | ||
const std::vector< uint8_t > & | fixedPhyBands = {} |
||
) |
Constructor.
muTrafficPattern | the pattern of traffic to generate |
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 1846 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 2005 of file wifi-mlo-test.cc.
References ns3::AC_BE, ns3::WifiPhy::CalculateTxDuration(), ns3::CtrlBAckResponseHeader::FindPerAidTidInfoWithAid(), ns3::WifiMac::GetLinkIdByAddress(), ns3::ApWifiMac::GetTxopQueue(), ns3::CtrlBAckResponseHeader::IsMultiSta(), ns3::CtrlBAckResponseHeader::IsPacketReceived(), MultiLinkOperationsTestBase::m_apMac, m_blockAckCount, m_dataCorruptedSta, m_muTrafficPattern, m_nPackets, MultiLinkOperationsTestBase::m_nStations, MultiLinkOperationsTestBase::m_staMacs, ns3::MicroSeconds(), NS_ABORT_MSG, 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 2356 of file wifi-mlo-test.cc.
References ns3::Simulator::Destroy(), m_inflightCount, m_muTrafficPattern, m_nMaxInflight, m_nPackets, m_rxPkts, MultiLinkOperationsTestBase::m_staMacs, 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 2177 of file wifi-mlo-test.cc.
References ns3::AC_BE, ns3::AC_VI, ns3::Object::AggregateObject(), ns3::WifiAcknowledgment::DL_MU_AGGREGATE_TF, ns3::WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE, ns3::WifiAcknowledgment::DL_MU_TF_MU_BAR, MultiLinkOperationsTestBase::DoSetup(), ns3::WifiMac::GetFrameExchangeManager(), ns3::WifiMac::GetNLinks(), ns3::WifiMac::GetWifiPhy(), MultiLinkOperationsTestBase::m_apMac, m_errorModels, m_muTrafficPattern, m_nMaxInflight, MultiLinkOperationsTestBase::m_staMacs, m_useBarAfterMissedBa, ns3::Config::SetDefault(), 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 2170 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 2242 of file wifi-mlo-test.cc.
References ns3::Node::AddApplication(), ns3::NodeList::Begin(), ns3::NodeList::End(), ns3::WifiNetDevice::GetAddress(), ns3::WifiMac::GetDevice(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiNetDevice::GetNode(), ns3::Object::GetObject(), ns3::PacketSocketHelper::Install(), L7Receive(), MultiLinkOperationsTestBase::m_apMac, m_muTrafficPattern, m_nPackets, MultiLinkOperationsTestBase::m_nStations, m_sockets, MultiLinkOperationsTestBase::m_staMacs, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), NS_TEST_ASSERT_MSG_NE, ns3::Simulator::Schedule(), 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 1872 of file wifi-mlo-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), MultiLinkOperationsTestBase::CheckAddresses(), CheckBlockAck(), ns3::WifiTxVector::GetHeMuUserInfoMap(), ns3::WifiMac::GetMldAddress(), ns3::WifiPhy::GetPhyBand(), ns3::WifiMac::GetWifiPhy(), ns3::CtrlTriggerHeader::IsBasic(), ns3::WifiTxVector::IsUlMu(), MultiLinkOperationsTestBase::m_apMac, m_blockAckCount, m_dataCorruptedSta, m_errorModels, m_inflightCount, m_muTrafficPattern, m_nMaxInflight, m_nPackets, MultiLinkOperationsTestBase::m_nStations, m_sockets, MultiLinkOperationsTestBase::m_staMacs, m_uidList, m_waitFirstTf, ns3::MicroSeconds(), NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, ns3::Seconds(), MultiLinkOperationsTestBase::Transmit(), ns3::WIFI_MAC_CTL_BACKRESP, ns3::WIFI_MAC_CTL_TRIGGER, and ns3::WIFI_MAC_QOSDATA.
|
private |
transmitted BlockAck counter
Definition at line 1837 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), and Transmit().
|
private |
MAC address of the station that received MPDU with SeqNo=2 corrupted.
Definition at line 1829 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), and Transmit().
|
private |
error rate models to corrupt packets
Definition at line 1827 of file wifi-mlo-test.cc.
Referenced by DoSetup(), and Transmit().
|
private |
max number of simultaneous transmissions of each data frame
Definition at line 1841 of file wifi-mlo-test.cc.
Referenced by DoRun(), and Transmit().
|
private |
the pattern of traffic to generate
Definition at line 1832 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), DoSetup(), StartTraffic(), and Transmit().
|
private |
max number of links on which an MPDU can be inflight
Definition at line 1834 of file wifi-mlo-test.cc.
Referenced by DoRun(), DoSetup(), and Transmit().
|
private |
number of application packets to generate
Definition at line 1836 of file wifi-mlo-test.cc.
Referenced by CheckBlockAck(), DoRun(), StartTraffic(), and Transmit().
|
private |
number of packets received at application layer by each node (AP, STA 0, STA 1)
Definition at line 1839 of file wifi-mlo-test.cc.
Referenced by DoRun(), and L7Receive().
|
private |
packet socket addresses for STAs
Definition at line 1835 of file wifi-mlo-test.cc.
Referenced by StartTraffic(), and Transmit().
MAC of the node sending application packets.
Definition at line 1843 of file wifi-mlo-test.cc.
|
private |
list of UIDs of packets to corrupt
Definition at line 1828 of file wifi-mlo-test.cc.
Referenced by Transmit().
|
private |
whether to send BAR after missed BlockAck
Definition at line 1833 of file wifi-mlo-test.cc.
Referenced by DoSetup().
|
private |
whether we are waiting for the first Basic Trigger Frame
Definition at line 1831 of file wifi-mlo-test.cc.
Referenced by Transmit().