A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
WifiMloUdpTest Class Reference

Test UDP packet transmission between MLDs and SLDs. More...

+ Inheritance diagram for WifiMloUdpTest:
+ Collaboration diagram for WifiMloUdpTest:

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.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (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.
 
- 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.
 
TestCaseGetParent () 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< UdpServerm_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

- 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
 
 Uplink or Downlink direction. More...

Detailed Description

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:

STA to AP

The source HW address of the ARP Request sent by the STA is:

  • the address of the link used to associate, if STA performs legacy association or AP is an SLD
  • the non-AP MLD address (or the unique STA address), otherwise The source HW address of the ARP Reply sent by the AP is the address of the link used by STA to associate, if the STA performed legacy association, or the AP MLD address, otherwise.

AP to STA

The source HW address of the ARP Request sent by the AP is:

  • the unique AP address, if the AP is an SLD
  • the AP MLD address, if the AP is an MLD The source HW address of the ARP Reply sent by the STA is the address of the link used by STA to associate, if the STA performed legacy association, or the non-AP MLD address, otherwise.

STA 1 to STA 2

The source HW address of the ARP Request sent by STA 1 is:

  • the address of the link used to associate, if STA performs legacy association or AP is an SLD
  • the non-AP MLD address (or the unique STA address), otherwise The source HW address of the ARP Reply sent by STA 2 is the address of the link used by STA 2 to associate, if STA 2 performed legacy association, or the non-AP MLD address of STA 2, otherwise.

Definition at line 73 of file wifi-mlo-udp-test-suite.cc.

Constructor & Destructor Documentation

◆ WifiMloUdpTest()

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.

Parameters
apChannelsstring specifying channels for AP
firstStaChannelsstring specifying channels for first STA
secondStaChannelsstring specifying channels for second STA
trafficPatternthe pattern of traffic to generate
assocTypethe type of association procedure for non-AP devices
amsduAggrwhether A-MSDU aggregation is enabled

Definition at line 138 of file wifi-mlo-udp-test-suite.cc.

Member Function Documentation

◆ CheckArpReplyHwAddresses()

void WifiMloUdpTest::CheckArpReplyHwAddresses ( const ArpHeader & arp,
Mac48Address sender,
uint8_t linkId )
protected

Check source and destination hardware addresses in ARP reply frames.

Parameters
arpthe ARP header
senderthe MAC address of the sender (Address 2 field)
linkIdthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckArpRequestHwAddresses()

void WifiMloUdpTest::CheckArpRequestHwAddresses ( const ArpHeader & arp,
Mac48Address sender,
uint8_t linkId )
protected

Check source and destination hardware addresses in ARP request frames.

Parameters
arpthe ARP header
senderthe MAC address of the sender (Address 2 field)
linkIdthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRun()

void WifiMloUdpTest::DoRun ( )
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().

+ Here is the call graph for this function:

◆ DoSetup()

◆ StartTraffic()

void WifiMloUdpTest::StartTraffic ( )
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().

+ Here is the call graph for this function:

◆ Transmit()

void WifiMloUdpTest::Transmit ( Ptr< WifiMac > mac,
uint8_t phyId,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )
overrideprotectedvirtual

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
macthe MAC transmitting the PSDUs
phyIdthe ID of the PHY transmitting the PSDUs
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_2ndStaChannels

const std::vector<std::string> WifiMloUdpTest::m_2ndStaChannels
private

string specifying channels for second STA

Definition at line 123 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoSetup().

◆ m_amsduAggr

bool WifiMloUdpTest::m_amsduAggr
private

whether A-MSDU aggregation is enabled

Definition at line 126 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoSetup().

◆ m_apInterface

Ipv4InterfaceContainer WifiMloUdpTest::m_apInterface
private

IP interface for AP MLD.

Definition at line 129 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoSetup(), and StartTraffic().

◆ m_assocType

WifiAssocType WifiMloUdpTest::m_assocType
private

association type

Definition at line 125 of file wifi-mlo-udp-test-suite.cc.

Referenced by CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), and DoSetup().

◆ m_nArpReply

std::size_t WifiMloUdpTest::m_nArpReply {0}
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().

◆ m_nArpRequest

std::size_t WifiMloUdpTest::m_nArpRequest {0}
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().

◆ m_nCheckedArpReply

std::size_t WifiMloUdpTest::m_nCheckedArpReply {0}
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().

◆ m_nCheckedArpRequest

std::size_t WifiMloUdpTest::m_nCheckedArpRequest {0}
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().

◆ m_nPackets

const std::size_t WifiMloUdpTest::m_nPackets {3}
private

number of application packets to generate

Definition at line 127 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoRun(), and StartTraffic().

◆ m_sink

Ptr<UdpServer> WifiMloUdpTest::m_sink
private

server app on the receiving node

Definition at line 131 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoRun(), and DoSetup().

◆ m_staInterfaces

Ipv4InterfaceContainer WifiMloUdpTest::m_staInterfaces
private

IP interfaces for non-AP MLDs.

Definition at line 128 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoSetup(), and StartTraffic().

◆ m_trafficPattern

WifiTrafficPattern WifiMloUdpTest::m_trafficPattern
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().

◆ m_udpPort

const uint16_t WifiMloUdpTest::m_udpPort {50000}
private

UDP port for application servers.

Definition at line 130 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoSetup(), and StartTraffic().


The documentation for this class was generated from the following file: