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:

Classes

struct  InputParams
 Input parameters. More...

Public Member Functions

 WifiMloUdpTest (const InputParams &params)
 Constructor.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
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 CheckNaHwAddress (Address targetLinkLayerAddress, Mac48Address sender, uint8_t linkId)
 Check target link-layer address in Neighbor Advertisement frames.
void CheckNsHwAddress (Address sourceLinkLayerAddress, Mac48Address sender, uint8_t linkId)
 Check source link-layer address in Neighbor Solicitation 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
 IPv4 interface for AP MLD.
Ipv6InterfaceContainer m_apInterface6
 IPv6 interface for AP MLD.
WifiAssocType m_assocType
 association type
uint8_t m_ipVersion
 IP version to use, either 4 or 6.
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
std::size_t m_nCheckedNa {0}
 counts how many Neighbor Advertisements are checked
std::size_t m_nCheckedNs {0}
 counts how many Neighbor Solicitations are checked
std::size_t m_nNa {0}
 counts how many Neighbor Advertisements are sent
std::size_t m_nNs {0}
 counts how many Neighbor Solicitations are transmitted
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
 IPv4 interfaces for non-AP MLDs.
Ipv6InterfaceContainer m_staInterfaces6
 IPv6 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...
 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 verifying 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 for IPv4 traffic and Neighbor Solicitation/Advertisement frames for IPv6 traffic is verified, as well as the link-layer 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 79 of file wifi-mlo-udp-test-suite.cc.

Constructor & Destructor Documentation

◆ WifiMloUdpTest()

WifiMloUdpTest::WifiMloUdpTest ( const InputParams & params)

Constructor.

Parameters
paramsthe input parameters

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

References MultiLinkOperationsTestBase::MultiLinkOperationsTestBase().

Here is the call graph for this function:

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
ARP protocol.the 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 555 of file wifi-mlo-udp-test-suite.cc.

References AP_TO_STA, ns3::Mac48Address::ConvertFrom(), ns3::ArpHeader::GetSourceHardwareAddress(), ns3::LEGACY, 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
ARP protocol.the 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 503 of file wifi-mlo-udp-test-suite.cc.

References AP_TO_STA, ns3::Mac48Address::ConvertFrom(), ns3::Mac48Address::GetBroadcast(), ns3::ArpHeader::GetDestinationHardwareAddress(), ns3::ArpHeader::GetSourceHardwareAddress(), ns3::LEGACY, 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:

◆ CheckNaHwAddress()

void WifiMloUdpTest::CheckNaHwAddress ( Address targetLinkLayerAddress,
Mac48Address sender,
uint8_t linkId )
protected

Check target link-layer address in Neighbor Advertisement frames.

Parameters
targetLinkLayerAddressthe target link-layer address option
senderthe MAC address of the sender (Address 2 field)
linkIdthe ID of the link on which the Neighbor Advertisement frame is transmitted

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

References AP_TO_STA, ns3::Mac48Address::ConvertFrom(), ns3::LEGACY, MultiLinkOperationsTestBase::m_apMac, m_assocType, m_nCheckedNa, m_nNa, 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:

◆ CheckNsHwAddress()

void WifiMloUdpTest::CheckNsHwAddress ( Address sourceLinkLayerAddress,
Mac48Address sender,
uint8_t linkId )
protected

Check source link-layer address in Neighbor Solicitation frames.

Parameters
sourceLinkLayerAddressthe source link-layer address option
senderthe MAC address of the sender (Address 2 field)
linkIdthe ID of the link on which the Neighbor Solicitation frame is transmitted

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

References AP_TO_STA, ns3::Mac48Address::ConvertFrom(), ns3::LEGACY, MultiLinkOperationsTestBase::m_apMac, m_assocType, m_nCheckedNs, m_nNs, 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 667 of file wifi-mlo-udp-test-suite.cc.

References AP_TO_STA, ns3::Simulator::Destroy(), MultiLinkOperationsTestBase::m_apMac, MultiLinkOperationsTestBase::m_duration, m_ipVersion, m_nArpReply, m_nArpRequest, m_nCheckedArpReply, m_nCheckedArpRequest, m_nCheckedNa, m_nCheckedNs, m_nNa, m_nNs, 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 355 of file wifi-mlo-udp-test-suite.cc.

References AP_TO_STA, ns3::ApplicationHelper::Install(), m_apInterface, m_apInterface6, MultiLinkOperationsTestBase::m_apMac, MultiLinkOperationsTestBase::m_duration, m_ipVersion, m_nPackets, m_staInterfaces, m_staInterfaces6, 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 391 of file wifi-mlo-udp-test-suite.cc.

References CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), CheckNaHwAddress(), CheckNsHwAddress(), ns3::Icmpv6OptionLinkLayerAddress::GetAddress(), ns3::Ipv6Header::GetNextHeader(), ns3::Ipv6Header::GetSource(), ns3::Icmpv6Header::GetType(), ns3::LlcSnapHeader::GetType(), ns3::Icmpv6Header::ICMPV6_ND_NEIGHBOR_ADVERTISEMENT, ns3::Icmpv6Header::ICMPV6_ND_NEIGHBOR_SOLICITATION, ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_SOURCE, ns3::Icmpv6Header::ICMPV6_OPT_LINK_LAYER_TARGET, ns3::Ipv6Header::IPV6_ICMPV6, ns3::Ipv6Address::IsAny(), ns3::ArpHeader::IsReply(), ns3::ArpHeader::IsRequest(), MultiLinkOperationsTestBase::m_txPsdus, NS_TEST_ASSERT_MSG_NE, NS_TEST_EXPECT_MSG_EQ, ns3::PeekPointer(), ns3::ArpL3Protocol::PROT_NUMBER, ns3::Ipv6L3Protocol::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 150 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 153 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoSetup().

◆ m_apInterface

Ipv4InterfaceContainer WifiMloUdpTest::m_apInterface
private

IPv4 interface for AP MLD.

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

Referenced by DoSetup(), and StartTraffic().

◆ m_apInterface6

Ipv6InterfaceContainer WifiMloUdpTest::m_apInterface6
private

IPv6 interface for AP MLD.

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

Referenced by DoSetup(), and StartTraffic().

◆ m_assocType

WifiAssocType WifiMloUdpTest::m_assocType
private

◆ m_ipVersion

uint8_t WifiMloUdpTest::m_ipVersion
private

IP version to use, either 4 or 6.

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

Referenced by DoRun(), DoSetup(), and StartTraffic().

◆ m_nArpReply

std::size_t WifiMloUdpTest::m_nArpReply {0}
private

counts how many ARP Replies are transmitted

Definition at line 164 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 162 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 165 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 163 of file wifi-mlo-udp-test-suite.cc.

Referenced by CheckArpRequestHwAddresses(), and DoRun().

◆ m_nCheckedNa

std::size_t WifiMloUdpTest::m_nCheckedNa {0}
private

counts how many Neighbor Advertisements are checked

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

Referenced by CheckNaHwAddress(), and DoRun().

◆ m_nCheckedNs

std::size_t WifiMloUdpTest::m_nCheckedNs {0}
private

counts how many Neighbor Solicitations are checked

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

Referenced by CheckNsHwAddress(), and DoRun().

◆ m_nNa

std::size_t WifiMloUdpTest::m_nNa {0}
private

counts how many Neighbor Advertisements are sent

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

Referenced by CheckNaHwAddress(), and DoRun().

◆ m_nNs

std::size_t WifiMloUdpTest::m_nNs {0}
private

counts how many Neighbor Solicitations are transmitted

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

Referenced by CheckNsHwAddress(), and DoRun().

◆ m_nPackets

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

number of application packets to generate

Definition at line 155 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 161 of file wifi-mlo-udp-test-suite.cc.

Referenced by DoRun(), and DoSetup().

◆ m_staInterfaces

Ipv4InterfaceContainer WifiMloUdpTest::m_staInterfaces
private

IPv4 interfaces for non-AP MLDs.

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

Referenced by DoSetup(), and StartTraffic().

◆ m_staInterfaces6

Ipv6InterfaceContainer WifiMloUdpTest::m_staInterfaces6
private

IPv6 interfaces for non-AP MLDs.

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

Referenced by DoSetup(), and StartTraffic().

◆ m_trafficPattern

WifiTrafficPattern WifiMloUdpTest::m_trafficPattern
private

◆ m_udpPort

const uint16_t WifiMloUdpTest::m_udpPort {50000}
private

UDP port for application servers.

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

Referenced by DoSetup(), and StartTraffic().


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