Test UDP packet transmission between MLDs and SLDs. More...
Classes | |
| struct | InputParams |
| Input parameters. More... | |
Public Member Functions | |
| WifiMloUdpTest (const InputParams ¶ms) | |
| Constructor. | |
| Public Member Functions inherited from MultiLinkOperationsTestBase | |
| MultiLinkOperationsTestBase (const std::string &name, uint8_t nStations, const BaseParams &baseParams) | |
| Constructor. | |
| ~MultiLinkOperationsTestBase () override=default | |
| 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 |
| 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 | 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 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 | 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. | |
| 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. | |
| 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 |
| 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< UdpServer > | m_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... | |
| 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. | |
| 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. | |
| uint16_t | m_startAid |
| first AID to allocate to stations | |
| 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 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:
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 79 of file wifi-mlo-udp-test-suite.cc.
| WifiMloUdpTest::WifiMloUdpTest | ( | const InputParams & | params | ) |
Constructor.
| params | the input parameters |
Definition at line 172 of file wifi-mlo-udp-test-suite.cc.
References MultiLinkOperationsTestBase::MultiLinkOperationsTestBase().
|
protected |
Check source and destination hardware addresses in ARP reply frames.
| ARP protocol. | 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 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().
|
protected |
Check source and destination hardware addresses in ARP request frames.
| ARP protocol. | 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 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().
|
protected |
Check target link-layer address in Neighbor Advertisement frames.
| targetLinkLayerAddress | the target link-layer address option |
| sender | the MAC address of the sender (Address 2 field) |
| linkId | the 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().
|
protected |
Check source link-layer address in Neighbor Solicitation frames.
| sourceLinkLayerAddress | the source link-layer address option |
| sender | the MAC address of the sender (Address 2 field) |
| linkId | the 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().
|
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().
|
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 197 of file wifi-mlo-udp-test-suite.cc.
References 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, m_apInterface6, MultiLinkOperationsTestBase::m_apMac, m_assocType, MultiLinkOperationsTestBase::m_duration, m_ipVersion, MultiLinkOperationsTestBase::m_nStations, m_sink, MultiLinkOperationsTestBase::m_staChannels, m_staInterfaces, m_staInterfaces6, MultiLinkOperationsTestBase::m_staMacs, MultiLinkOperationsTestBase::m_startAid, 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 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().
|
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 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().
|
private |
string specifying channels for second STA
Definition at line 150 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup().
|
private |
whether A-MSDU aggregation is enabled
Definition at line 153 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup().
|
private |
IPv4 interface for AP MLD.
Definition at line 157 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().
|
private |
IPv6 interface for AP MLD.
Definition at line 159 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().
|
private |
association type
Definition at line 152 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), CheckNaHwAddress(), CheckNsHwAddress(), and DoSetup().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
private |
number of application packets to generate
Definition at line 155 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoRun(), and StartTraffic().
server app on the receiving node
Definition at line 161 of file wifi-mlo-udp-test-suite.cc.
|
private |
IPv4 interfaces for non-AP MLDs.
Definition at line 156 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().
|
private |
IPv6 interfaces for non-AP MLDs.
Definition at line 158 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().
|
private |
the pattern of traffic to generate
Definition at line 151 of file wifi-mlo-udp-test-suite.cc.
Referenced by CheckArpReplyHwAddresses(), CheckArpRequestHwAddresses(), CheckNaHwAddress(), CheckNsHwAddress(), DoRun(), DoSetup(), and StartTraffic().
|
private |
UDP port for application servers.
Definition at line 160 of file wifi-mlo-udp-test-suite.cc.
Referenced by DoSetup(), and StartTraffic().