Test UDP packet transmission between MLDs and SLDs. More...
Public Member Functions | |
WifiMloUdpTest (const std::vector< std::string > &apChannels, const std::vector< std::string > &firstStaChannels, const std::vector< std::string > &secondStaChannels, WifiTrafficPattern trafficPattern, WifiAssocType assocType, bool amsduAggr) | |
Constructor. | |
![]() | |
MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, const BaseParams &baseParams) | |
Constructor. | |
~MultiLinkOperationsTestBase () override=default | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
void | CheckArpReplyHwAddresses (const ArpHeader &arp, Mac48Address sender, uint8_t linkId) |
Check source and destination hardware addresses in ARP reply frames. | |
void | CheckArpRequestHwAddresses (const ArpHeader &arp, Mac48Address sender, uint8_t linkId) |
Check source and destination hardware addresses in ARP request frames. | |
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. | |
![]() | |
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. | |
![]() | |
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 Member Functions | |
void | StartTraffic () override |
Start the generation of traffic (needs to be overridden) | |
Private Attributes | |
const std::vector< std::string > | m_2ndStaChannels |
string specifying channels for second STA | |
bool | m_amsduAggr |
whether A-MSDU aggregation is enabled | |
Ipv4InterfaceContainer | m_apInterface |
IP interface for AP MLD. | |
WifiAssocType | m_assocType |
association type | |
std::size_t | m_nArpReply {0} |
counts how many ARP Replies are transmitted | |
std::size_t | m_nArpRequest {0} |
counts how many ARP Requests are transmitted | |
std::size_t | m_nCheckedArpReply {0} |
counts how many ARP Replies are checked | |
std::size_t | m_nCheckedArpRequest {0} |
counts how many ARP Requests are checked | |
const std::size_t | m_nPackets {3} |
number of application packets to generate | |
Ptr< UdpServer > | m_sink |
server app on the receiving node | |
Ipv4InterfaceContainer | m_staInterfaces |
IP interfaces for non-AP MLDs. | |
WifiTrafficPattern | m_trafficPattern |
the pattern of traffic to generate | |
const uint16_t | m_udpPort {50000} |
UDP port for application servers. | |
Additional Inherited Members | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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 |
![]() | |
using | ChannelMap = std::map<FrequencyRange, Ptr<MultiModelSpectrumChannel>> |
PHY band-indexed map of spectrum channels. | |
enum | Direction { DL = 0 , UL } |
Uplink or Downlink direction. More... | |
![]() | |
const std::vector< std::string > | m_apChannels |
strings specifying channels for AP | |
Ptr< ApWifiMac > | m_apMac |
AP wifi MAC. | |
WifiAssocType | m_assocType |
type of the association procedure used by non-AP devices | |
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 UDP packet transmission between MLDs and SLDs.
This test sets up an AP MLD and two non-AP MLDs having a variable number of links (possibly one). The RF channels to set each link to are provided as input parameters. This test aims at veryfing the successful transmission and reception of UDP packets in different traffic scenarios (from the first station to the AP, from the AP to the first station, from one station to another). The number of transmitted ARP Request/Reply frames is verified, as well as the source HW address they carry. Specifically:
The source HW address of the ARP Request sent by the STA is:
The source HW address of the ARP Request sent by the AP is:
The source HW address of the ARP Request sent by STA 1 is:
Definition at line 73 of file wifi-mlo-udp-test-suite.cc.
WifiMloUdpTest::WifiMloUdpTest | ( | const std::vector< std::string > & | apChannels, |
const std::vector< std::string > & | firstStaChannels, | ||
const std::vector< std::string > & | secondStaChannels, | ||
WifiTrafficPattern | trafficPattern, | ||
WifiAssocType | assocType, | ||
bool | amsduAggr ) |
Constructor.
apChannels | string specifying channels for AP |
firstStaChannels | string specifying channels for first STA |
secondStaChannels | string specifying channels for second STA |
trafficPattern | the pattern of traffic to generate |
assocType | the type of association procedure for non-AP devices |
amsduAggr | whether A-MSDU aggregation is enabled |
Definition at line 138 of file wifi-mlo-udp-test-suite.cc.
|
protected |
Check source and destination hardware addresses in ARP reply frames.
arp | the ARP header |
sender | the MAC address of the sender (Address 2 field) |
linkId | the ID of the link on which the ARP frame is transmitted |
Definition at line 450 of file wifi-mlo-udp-test-suite.cc.
References AP_TO_STA, ns3::Mac48Address::ConvertFrom(), ns3::ArpHeader::GetSourceHardwareAddress(), MultiLinkOperationsTestBase::m_apMac, m_assocType, m_nArpReply, m_nCheckedArpReply, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, NS_TEST_EXPECT_MSG_EQ, STA_TO_AP, and ns3::StaticCast().
Referenced by Transmit().
|
protected |
Check source and destination hardware addresses in ARP request frames.
arp | the ARP header |
sender | the MAC address of the sender (Address 2 field) |
linkId | the ID of the link on which the ARP frame is transmitted |
Definition at line 398 of file wifi-mlo-udp-test-suite.cc.
References AP_TO_STA, ns3::Mac48Address::ConvertFrom(), ns3::Mac48Address::GetBroadcast(), ns3::ArpHeader::GetDestinationHardwareAddress(), ns3::ArpHeader::GetSourceHardwareAddress(), MultiLinkOperationsTestBase::m_apMac, m_assocType, m_nArpRequest, m_nCheckedArpRequest, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, NS_ABORT_MSG, NS_TEST_EXPECT_MSG_EQ, STA_TO_AP, STA_TO_STA, 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 481 of file wifi-mlo-udp-test-suite.cc.
References AP_TO_STA, ns3::Simulator::Destroy(), MultiLinkOperationsTestBase::m_apMac, MultiLinkOperationsTestBase::m_duration, m_nArpReply, m_nArpRequest, m_nCheckedArpReply, m_nCheckedArpRequest, m_nPackets, m_sink, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, NS_ABORT_MSG, NS_TEST_ASSERT_MSG_NE, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), STA_TO_AP, STA_TO_STA, and ns3::Simulator::Stop().
|
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 162 of file wifi-mlo-udp-test-suite.cc.
References ns3::Ipv4InterfaceContainer::Add(), AP_TO_STA, ns3::WifiHelper::AssignStreams(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NodeContainer::GetGlobal(), ns3::ApplicationHelper::Install(), m_2ndStaChannels, m_amsduAggr, MultiLinkOperationsTestBase::m_apChannels, m_apInterface, MultiLinkOperationsTestBase::m_apMac, m_assocType, MultiLinkOperationsTestBase::m_duration, MultiLinkOperationsTestBase::m_nStations, m_sink, MultiLinkOperationsTestBase::m_staChannels, m_staInterfaces, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, m_udpPort, ns3::MakeCallback(), ns3::Seconds(), MultiLinkOperationsTestBase::SetChannels(), ns3::Config::SetDefault(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), MultiLinkOperationsTestBase::SetSsid(), STA_TO_AP, STA_TO_STA, Transmit(), ns3::WIFI_SPECTRUM_2_4_GHZ, ns3::WIFI_SPECTRUM_5_GHZ, ns3::WIFI_SPECTRUM_6_GHZ, and ns3::WIFI_STANDARD_80211be.
|
overrideprivatevirtual |
Start the generation of traffic (needs to be overridden)
Reimplemented from MultiLinkOperationsTestBase.
Definition at line 305 of file wifi-mlo-udp-test-suite.cc.
References AP_TO_STA, ns3::Ipv4InterfaceContainer::GetAddress(), ns3::ApplicationHelper::Install(), m_apInterface, MultiLinkOperationsTestBase::m_apMac, MultiLinkOperationsTestBase::m_duration, m_nPackets, m_staInterfaces, MultiLinkOperationsTestBase::m_staMacs, m_trafficPattern, m_udpPort, NS_ABORT_MSG, ns3::Seconds(), ns3::ApplicationHelper::SetAttribute(), STA_TO_AP, STA_TO_STA, and ns3::ApplicationContainer::Start().
|
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 338 of file wifi-mlo-udp-test-suite.cc.
References CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), ns3::LlcSnapHeader::GetType(), ns3::ArpHeader::IsReply(), ns3::ArpHeader::IsRequest(), MultiLinkOperationsTestBase::m_txPsdus, ns3::PeekPointer(), ns3::ArpL3Protocol::PROT_NUMBER, and MultiLinkOperationsTestBase::Transmit().
Referenced by DoSetup().
|
private |
string specifying channels for second STA
Definition at line 123 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup().
|
private |
whether A-MSDU aggregation is enabled
Definition at line 126 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup().
|
private |
IP interface for AP MLD.
Definition at line 129 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().
|
private |
association type
Definition at line 125 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), and DoSetup().
|
private |
counts how many ARP Replies are transmitted
Definition at line 134 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpReplyHwAddresses(), and DoRun().
|
private |
counts how many ARP Requests are transmitted
Definition at line 132 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpRequestHwAddresses(), and DoRun().
|
private |
counts how many ARP Replies are checked
Definition at line 135 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpReplyHwAddresses(), and DoRun().
|
private |
counts how many ARP Requests are checked
Definition at line 133 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpRequestHwAddresses(), and DoRun().
|
private |
number of application packets to generate
Definition at line 127 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoRun(), and StartTraffic().
server app on the receiving node
Definition at line 131 of file wifi-mlo-udp-test-suite.cc.
|
private |
IP interfaces for non-AP MLDs.
Definition at line 128 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().
|
private |
the pattern of traffic to generate
Definition at line 124 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), DoRun(), DoSetup(), and StartTraffic().
|
private |
UDP port for application servers.
Definition at line 130 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().