A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-mlo-udp-test-suite.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#include "ns3/arp-header.h"
10#include "ns3/arp-l3-protocol.h"
11#include "ns3/config.h"
12#include "ns3/frame-exchange-manager.h"
13#include "ns3/internet-stack-helper.h"
14#include "ns3/ipv4-address-helper.h"
15#include "ns3/llc-snap-header.h"
16#include "ns3/mobility-helper.h"
17#include "ns3/pointer.h"
18#include "ns3/qos-txop.h"
19#include "ns3/rng-seed-manager.h"
20#include "ns3/ssid.h"
21#include "ns3/string.h"
22#include "ns3/test.h"
23#include "ns3/udp-client-server-helper.h"
24#include "ns3/wifi-mac-queue.h"
25#include "ns3/wifi-mac.h"
26#include "ns3/wifi-mlo-test.h"
27#include "ns3/wifi-net-device.h"
28
29#include <array>
30#include <list>
31
32using namespace ns3;
33
34NS_LOG_COMPONENT_DEFINE("WifiMloUdpTest");
35
36/**
37 * @ingroup wifi-test
38 * @ingroup tests
39 *
40 * @brief Test UDP packet transmission between MLDs and SLDs.
41 *
42 * This test sets up an AP MLD and two non-AP MLDs having a variable number of links (possibly one).
43 * The RF channels to set each link to are provided as input parameters. This test aims at veryfing
44 * the successful transmission and reception of UDP packets in different traffic scenarios (from
45 * the first station to the AP, from the AP to the first station, from one station to another).
46 * The number of transmitted ARP Request/Reply frames is verified, as well as the source HW address
47 * they carry. Specifically:
48 *
49 * STA to AP
50 * ---------
51 * The source HW address of the ARP Request sent by the STA is:
52 * - the address of the link used to associate, if STA performs legacy association or AP is an SLD
53 * - the non-AP MLD address (or the unique STA address), otherwise
54 * The source HW address of the ARP Reply sent by the AP is the address of the link used by STA to
55 * associate, if the STA performed legacy association, or the AP MLD address, otherwise.
56 *
57 * AP to STA
58 * ---------
59 * The source HW address of the ARP Request sent by the AP is:
60 * - the unique AP address, if the AP is an SLD
61 * - the AP MLD address, if the AP is an MLD
62 * The source HW address of the ARP Reply sent by the STA is the address of the link used by STA to
63 * associate, if the STA performed legacy association, or the non-AP MLD address, otherwise.
64 *
65 * STA 1 to STA 2
66 * --------------
67 * The source HW address of the ARP Request sent by STA 1 is:
68 * - the address of the link used to associate, if STA performs legacy association or AP is an SLD
69 * - the non-AP MLD address (or the unique STA address), otherwise
70 * The source HW address of the ARP Reply sent by STA 2 is the address of the link used by STA 2 to
71 * associate, if STA 2 performed legacy association, or the non-AP MLD address of STA 2, otherwise.
72 */
74{
75 public:
76 /**
77 * Constructor
78 *
79 * @param apChannels string specifying channels for AP
80 * @param firstStaChannels string specifying channels for first STA
81 * @param secondStaChannels string specifying channels for second STA
82 * @param trafficPattern the pattern of traffic to generate
83 * @param assocType the type of association procedure for non-AP devices
84 * @param amsduAggr whether A-MSDU aggregation is enabled
85 */
86 WifiMloUdpTest(const std::vector<std::string>& apChannels,
87 const std::vector<std::string>& firstStaChannels,
88 const std::vector<std::string>& secondStaChannels,
89 WifiTrafficPattern trafficPattern,
90 WifiAssocType assocType,
91 bool amsduAggr);
92
93 protected:
94 void DoSetup() override;
95 void Transmit(Ptr<WifiMac> mac,
96 uint8_t phyId,
97 WifiConstPsduMap psduMap,
98 WifiTxVector txVector,
99 double txPowerW) override;
100 void DoRun() override;
101
102 /**
103 * Check source and destination hardware addresses in ARP request frames.
104 *
105 * @param arp the ARP header
106 * @param sender the MAC address of the sender (Address 2 field)
107 * @param linkId the ID of the link on which the ARP frame is transmitted
108 */
109 void CheckArpRequestHwAddresses(const ArpHeader& arp, Mac48Address sender, uint8_t linkId);
110
111 /**
112 * Check source and destination hardware addresses in ARP reply frames.
113 *
114 * @param arp the ARP header
115 * @param sender the MAC address of the sender (Address 2 field)
116 * @param linkId the ID of the link on which the ARP frame is transmitted
117 */
118 void CheckArpReplyHwAddresses(const ArpHeader& arp, Mac48Address sender, uint8_t linkId);
119
120 private:
121 void StartTraffic() override;
122
123 const std::vector<std::string> m_2ndStaChannels; ///< string specifying channels for second STA
124 WifiTrafficPattern m_trafficPattern; ///< the pattern of traffic to generate
125 WifiAssocType m_assocType; //!< association type
126 bool m_amsduAggr; ///< whether A-MSDU aggregation is enabled
127 const std::size_t m_nPackets{3}; ///< number of application packets to generate
128 Ipv4InterfaceContainer m_staInterfaces; ///< IP interfaces for non-AP MLDs
129 Ipv4InterfaceContainer m_apInterface; ///< IP interface for AP MLD
130 const uint16_t m_udpPort{50000}; ///< UDP port for application servers
131 Ptr<UdpServer> m_sink; ///< server app on the receiving node
132 std::size_t m_nArpRequest{0}; ///< counts how many ARP Requests are transmitted
133 std::size_t m_nCheckedArpRequest{0}; ///< counts how many ARP Requests are checked
134 std::size_t m_nArpReply{0}; ///< counts how many ARP Replies are transmitted
135 std::size_t m_nCheckedArpReply{0}; ///< counts how many ARP Replies are checked
136};
137
138WifiMloUdpTest::WifiMloUdpTest(const std::vector<std::string>& apChannels,
139 const std::vector<std::string>& firstStaChannels,
140 const std::vector<std::string>& secondStaChannels,
141 WifiTrafficPattern trafficPattern,
142 WifiAssocType assocType,
143 bool amsduAggr)
145 std::string("Check UDP packet transmission between MLDs ") +
146 " (#AP_links: " + std::to_string(apChannels.size()) +
147 ", #STA_1_links: " + std::to_string(firstStaChannels.size()) +
148 ", #STA_2_links: " + std::to_string(secondStaChannels.size()) +
149 ", Traffic pattern: " + std::to_string(static_cast<uint8_t>(trafficPattern)) +
150 ", Assoc type: " + (assocType == WifiAssocType::LEGACY ? "Legacy" : "ML setup") +
151 ", A-MSDU aggregation: " + std::to_string(amsduAggr) + ")",
152 2,
153 BaseParams{firstStaChannels, apChannels, {}}),
154 m_2ndStaChannels(secondStaChannels),
155 m_trafficPattern(trafficPattern),
156 m_assocType(assocType),
157 m_amsduAggr(amsduAggr)
158{
159}
160
161void
163{
164 Config::SetDefault("ns3::WifiMac::BE_MaxAmsduSize", UintegerValue(m_amsduAggr ? 4000 : 0));
165
168 int64_t streamNumber = 30;
169
170 NodeContainer wifiApNode(1);
171 NodeContainer wifiStaNodes(2);
172
173 WifiHelper wifi;
174 // WifiHelper::EnableLogComponents();
175 wifi.SetStandard(WIFI_STANDARD_80211be);
176 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
177 "DataMode",
178 StringValue("EhtMcs0"),
179 "ControlMode",
180 StringValue("HtMcs0"));
181
185
186 SpectrumWifiPhyHelper staPhyHelper1;
187 SpectrumWifiPhyHelper staPhyHelper2;
188 SpectrumWifiPhyHelper apPhyHelper;
189 SetChannels(staPhyHelper1, m_staChannels, channelMap);
190 SetChannels(staPhyHelper2, m_2ndStaChannels, channelMap);
191 SetChannels(apPhyHelper, m_apChannels, channelMap);
192
193 WifiMacHelper mac;
194 mac.SetType("ns3::StaWifiMac", // default SSID
195 "ActiveProbing",
196 BooleanValue(false),
197 "AssocType",
199
200 NetDeviceContainer staDevices = wifi.Install(staPhyHelper1, mac, wifiStaNodes.Get(0));
201
202 mac.SetType("ns3::StaWifiMac", // default SSID
203 "ActiveProbing",
204 BooleanValue(false),
205 "AssocType",
207
208 staDevices.Add(wifi.Install(staPhyHelper2, mac, wifiStaNodes.Get(1)));
209
210 mac.SetType("ns3::ApWifiMac",
211 "Ssid",
212 SsidValue(Ssid("ns-3-ssid")),
213 "BeaconGeneration",
214 BooleanValue(true));
215
216 NetDeviceContainer apDevices = wifi.Install(apPhyHelper, mac, wifiApNode);
217
218 // Uncomment the lines below to write PCAP files
219 // apPhyHelper.EnablePcap("wifi-mlo_AP", apDevices);
220 // staPhyHelper1.EnablePcap("wifi-mlo_STA", staDevices);
221
222 // Assign fixed streams to random variables in use
223 streamNumber += WifiHelper::AssignStreams(apDevices, streamNumber);
224 streamNumber += WifiHelper::AssignStreams(staDevices, streamNumber);
225
226 MobilityHelper mobility;
228
229 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
230 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
231 mobility.SetPositionAllocator(positionAlloc);
232
233 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
234 mobility.Install(wifiApNode);
235 mobility.Install(wifiStaNodes);
236
237 m_apMac = DynamicCast<ApWifiMac>(DynamicCast<WifiNetDevice>(apDevices.Get(0))->GetMac());
238 for (uint8_t i = 0; i < m_nStations; i++)
239 {
240 m_staMacs[i] =
241 DynamicCast<StaWifiMac>(DynamicCast<WifiNetDevice>(staDevices.Get(i))->GetMac());
242 }
243
244 // Trace PSDUs passed to the PHY on all devices
245 for (uint8_t phyId = 0; phyId < m_apMac->GetDevice()->GetNPhys(); phyId++)
246 {
248 "/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phys/" + std::to_string(phyId) +
249 "/PhyTxPsduBegin",
250 MakeCallback(&WifiMloUdpTest::Transmit, this).Bind(m_apMac, phyId));
251 }
252 for (uint8_t i = 0; i < m_nStations; i++)
253 {
254 for (uint8_t phyId = 0; phyId < m_staMacs[i]->GetDevice()->GetNPhys(); phyId++)
255 {
257 "/NodeList/" + std::to_string(i + 1) + "/DeviceList/*/$ns3::WifiNetDevice/Phys/" +
258 std::to_string(phyId) + "/PhyTxPsduBegin",
259 MakeCallback(&WifiMloUdpTest::Transmit, this).Bind(m_staMacs[i], phyId));
260 }
261 }
262
263 // install Internet stack on all nodes
265 auto allNodes = NodeContainer::GetGlobal();
266 stack.Install(allNodes);
267 streamNumber += stack.AssignStreams(allNodes, streamNumber);
268
269 Ipv4AddressHelper address;
270 address.SetBase("10.1.0.0", "255.255.255.0");
271 m_apInterface = address.Assign(NetDeviceContainer(m_apMac->GetDevice()));
272 for (std::size_t i = 0; i < m_nStations; i++)
273 {
274 m_staInterfaces.Add(address.Assign(NetDeviceContainer(m_staMacs[i]->GetDevice())));
275 }
276
277 // install a UDP server on all nodes
278 UdpServerHelper serverHelper(m_udpPort);
279 auto serverApps = serverHelper.Install(allNodes);
280 serverApps.Start(Seconds(0.0));
281 serverApps.Stop(m_duration);
282
283 switch (m_trafficPattern)
284 {
286 m_sink = DynamicCast<UdpServer>(serverApps.Get(0));
287 break;
289 m_sink = DynamicCast<UdpServer>(serverApps.Get(1));
290 break;
292 m_sink = DynamicCast<UdpServer>(serverApps.Get(2));
293 break;
294 default:
295 m_sink = nullptr; // other cases are not supported
296 }
297
298 // schedule association/ML setup for one station at a time
299 m_apMac->TraceConnectWithoutContext("AssociatedSta",
301 m_staMacs[0]->SetSsid(Ssid("ns-3-ssid"));
302}
303
304void
306{
307 Ptr<WifiMac> srcMac;
308 Ipv4Address destAddr;
309
310 switch (m_trafficPattern)
311 {
313 srcMac = m_staMacs[0];
314 destAddr = m_apInterface.GetAddress(0);
315 break;
317 srcMac = m_apMac;
318 destAddr = m_staInterfaces.GetAddress(0);
319 break;
321 srcMac = m_staMacs[0];
322 destAddr = m_staInterfaces.GetAddress(1);
323 break;
324 default:
325 NS_ABORT_MSG("Unsupported scenario " << +static_cast<uint8_t>(m_trafficPattern));
326 }
327
328 UdpClientHelper clientHelper(InetSocketAddress(destAddr, m_udpPort));
329 clientHelper.SetAttribute("MaxPackets", UintegerValue(m_nPackets));
330 clientHelper.SetAttribute("Interval", TimeValue(Time{0}));
331 clientHelper.SetAttribute("PacketSize", UintegerValue(100));
332 auto clientApp = clientHelper.Install(srcMac->GetDevice()->GetNode());
333 clientApp.Start(Seconds(0.0));
334 clientApp.Stop(m_duration);
335}
336
337void
339 uint8_t phyId,
340 WifiConstPsduMap psduMap,
341 WifiTxVector txVector,
342 double txPowerW)
343{
344 MultiLinkOperationsTestBase::Transmit(mac, phyId, psduMap, txVector, txPowerW);
345
346 auto psdu = psduMap.begin()->second;
347 auto linkId = m_txPsdus.back().linkId;
348
349 if (!psdu->GetHeader(0).IsQosData() || !psdu->GetHeader(0).HasData())
350 {
351 // we are interested in ARP Request/Reply frames, which are carried by QoS data frames
352 return;
353 }
354
355 for (const auto& mpdu : *PeekPointer(psdu))
356 {
357 std::list<Ptr<const Packet>> packets;
358
359 if (mpdu->GetHeader().IsQosAmsdu())
360 {
361 for (const auto& msdu : *PeekPointer(mpdu))
362 {
363 packets.push_back(msdu.first);
364 }
365 }
366 else
367 {
368 packets.push_back(mpdu->GetPacket());
369 }
370
371 for (auto pkt : packets)
372 {
373 LlcSnapHeader llc;
374 auto packet = pkt->Copy();
375 packet->RemoveHeader(llc);
376
378 {
379 continue;
380 }
381
382 ArpHeader arp;
383 packet->RemoveHeader(arp);
384
385 if (arp.IsRequest())
386 {
387 CheckArpRequestHwAddresses(arp, psdu->GetAddr2(), linkId);
388 }
389 if (arp.IsReply())
390 {
391 CheckArpReplyHwAddresses(arp, psdu->GetAddr2(), linkId);
392 }
393 }
394 }
395}
396
397void
399 Mac48Address sender,
400 uint8_t linkId)
401{
403
404 // source and destination HW addresses cannot be checked for forwarded frames because
405 // they can be forwarded on different links
406 if (auto srcMac =
409 !srcMac->GetLinkIdByAddress(sender) && sender != srcMac->GetAddress())
410 {
411 // the sender address is not the MLD address nor a link address of the source device
412 return;
413 }
414
415 Mac48Address expectedSrc;
416
417 switch (m_trafficPattern)
418 {
421 // if the ARP Request is sent by a STA, the source HW address is:
422 // - the address of the link used to associate, if the STA performs legacy association or
423 // the AP is an SLD
424 // - the non-AP MLD address (or the unique STA address), otherwise
425 expectedSrc = (m_assocType == WifiAssocType::LEGACY || m_apMac->GetNLinks() == 1)
426 ? m_staMacs[0]->GetFrameExchangeManager(linkId)->GetAddress()
427 : m_staMacs[0]->GetAddress();
428 break;
430 // if the ARP Request is sent by an AP, the source HW address is:
431 // - the unique AP address, if the AP is an SLD
432 // - the AP MLD address, if the AP is an MLD
433 expectedSrc = m_apMac->GetAddress();
434 break;
435 default:
436 NS_ABORT_MSG("Unsupported scenario " << +static_cast<uint8_t>(m_trafficPattern));
437 }
438
440
442 expectedSrc,
443 "Unexpected source HW address");
446 "Unexpected destination HW address");
447}
448
449void
451{
452 ++m_nArpReply;
453
454 // source and destination HW addresses cannot be checked for forwarded frames because
455 // they can be forwarded on different links
456 auto srcMac =
460
461 if (!srcMac->GetLinkIdByAddress(sender) && sender != srcMac->GetAddress())
462 {
463 // the sender address is not the MLD address nor a link address of the source device
464 return;
465 }
466
467 // the source HW address of the ARP Reply is the address of the link on which the ARP Reply is
468 // sent, if the sender performed legacy association, or the MLD address, otherwise
469 Mac48Address expectedSrc = (m_assocType == WifiAssocType::LEGACY || m_apMac->GetNLinks() == 1)
470 ? srcMac->GetFrameExchangeManager(linkId)->GetAddress()
471 : srcMac->GetAddress();
472
474
476 expectedSrc,
477 "Unexpected source HW address");
478}
479
480void
482{
485
486 NS_TEST_ASSERT_MSG_NE(m_sink, nullptr, "Sink is not set");
487 NS_TEST_EXPECT_MSG_EQ(m_sink->GetReceived(),
489 "Unexpected number of received packets");
490
491 std::size_t expectedNOrigArpRequest{0};
492 std::size_t expectedNFwdArpRequest{0};
493
494 switch (m_trafficPattern)
495 {
498 // STA transmits ARP Request on one link, AP retransmits it on all of its links
499 expectedNOrigArpRequest = 1;
500 expectedNFwdArpRequest = m_apMac->GetNLinks();
501 break;
503 // AP transmits ARP Request on all of its links
504 expectedNOrigArpRequest = m_apMac->GetNLinks();
505 expectedNFwdArpRequest = 0;
506 break;
507 default:
508 NS_ABORT_MSG("Unsupported scenario " << +static_cast<uint8_t>(m_trafficPattern));
509 }
510
512 expectedNOrigArpRequest + expectedNFwdArpRequest,
513 "Unexpected number of transmitted ARP Request frames");
515 expectedNOrigArpRequest,
516 "Unexpected number of checked ARP Request frames");
517
518 std::size_t expectedNOrigArpReply{0};
519 std::size_t expectedNFwdArpReply{0};
520
521 switch (m_trafficPattern)
522 {
524 // STA transmits only one ARP Request, AP replies with one (unicast) ARP Reply
525 expectedNOrigArpReply = 1;
526 expectedNFwdArpReply = 0;
527 break;
529 // ARP Request is broadcast, so it is sent by the AP on all of its links; the STA sends
530 // an ARP Reply for each setup link
531 expectedNOrigArpReply =
532 std::min<std::size_t>(m_apMac->GetNLinks(), m_staMacs[0]->GetSetupLinkIds().size());
533 expectedNFwdArpReply = 0;
534 break;
536 // AP forwards ARP Request on all of its links; STA 2 sends as many ARP Replies as the
537 // number of setup links; each such ARP Reply is forwarded by the AP to STA 1
538 expectedNOrigArpReply = expectedNFwdArpReply = m_staMacs[1]->GetSetupLinkIds().size();
539 break;
540 default:
541 NS_ABORT_MSG("Unsupported scenario " << +static_cast<uint8_t>(m_trafficPattern));
542 }
543
545 expectedNOrigArpReply + expectedNFwdArpReply,
546 "Unexpected number of transmitted ARP Reply frames");
548 expectedNOrigArpReply,
549 "Unexpected number of checked ARP Reply frames");
550
552}
553
554/**
555 * @ingroup wifi-test
556 * @ingroup tests
557 *
558 * @brief Multi-Link Operations with UDP traffic Test Suite
559 */
561{
562 public:
564};
565
567 : TestSuite("wifi-mlo-udp", Type::SYSTEM)
568{
569 using ParamsTuple = std::array<std::vector<std::string>, 3>; // AP, STA 1, STA 2 channels
570
571 for (const auto& channels :
572 {// single link AP, non-AP MLD with 3 links, single link non-AP STA
573 ParamsTuple{
574 {{"{7, 80, BAND_6GHZ, 0}"},
575 {"{42, 80, BAND_5GHZ, 2}", "{5, 40, BAND_2_4GHZ, 0}", "{7, 80, BAND_6GHZ, 0}"},
576 {"{7, 80, BAND_6GHZ, 0}"}}},
577 // single link AP, non-AP MLD with 3 links, non-AP MLD with 2 links
578 ParamsTuple{
579 {{"{7, 80, BAND_6GHZ, 0}"},
580 {"{42, 80, BAND_5GHZ, 2}", "{5, 40, BAND_2_4GHZ, 0}", "{7, 80, BAND_6GHZ, 0}"},
581 {"{42, 80, BAND_5GHZ, 2}", "{7, 80, BAND_6GHZ, 0}"}}},
582 // AP MLD with 3 links, single link non-AP STA, non-AP MLD with 2 links
583 ParamsTuple{
584 {{"{42, 80, BAND_5GHZ, 2}", "{5, 40, BAND_2_4GHZ, 0}", "{7, 80, BAND_6GHZ, 0}"},
585 {"{7, 80, BAND_6GHZ, 0}"},
586 {"{42, 80, BAND_5GHZ, 2}", "{5, 40, BAND_2_4GHZ, 0}"}}},
587 // AP MLD with 3 links, non-AP MLD with 3 links, non-AP MLD with 2 links
588 ParamsTuple{
589 {{"{42, 80, BAND_5GHZ, 2}", "{5, 40, BAND_2_4GHZ, 0}", "{7, 80, BAND_6GHZ, 0}"},
590 {"{42, 80, BAND_5GHZ, 2}", "{5, 40, BAND_2_4GHZ, 0}", "{7, 80, BAND_6GHZ, 0}"},
591 {"{5, 40, BAND_2_4GHZ, 0}", "{7, 80, BAND_6GHZ, 0}"}}}})
592 {
593 for (const auto& trafficPattern : {WifiTrafficPattern::STA_TO_AP,
596 {
597 for (const auto amsduAggr : {false, true})
598 {
599 for (const auto assocType : {WifiAssocType::LEGACY, WifiAssocType::ML_SETUP})
600 {
601 AddTestCase(new WifiMloUdpTest(channels[0],
602 channels[1],
603 channels[2],
604 trafficPattern,
605 assocType,
606 amsduAggr),
607 TestCase::Duration::QUICK);
608 }
609 }
610 }
611 }
612}
613
Test UDP packet transmission between MLDs and SLDs.
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.
const uint16_t m_udpPort
UDP port for application servers.
WifiAssocType m_assocType
association type
void CheckArpRequestHwAddresses(const ArpHeader &arp, Mac48Address sender, uint8_t linkId)
Check source and destination hardware addresses in ARP request frames.
std::size_t m_nArpRequest
counts how many ARP Requests are transmitted
WifiTrafficPattern m_trafficPattern
the pattern of traffic to generate
void CheckArpReplyHwAddresses(const ArpHeader &arp, Mac48Address sender, uint8_t linkId)
Check source and destination hardware addresses in ARP reply frames.
std::size_t m_nCheckedArpReply
counts how many ARP Replies are checked
const std::vector< std::string > m_2ndStaChannels
string specifying channels for second STA
Ipv4InterfaceContainer m_staInterfaces
IP interfaces for non-AP MLDs.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
const std::size_t m_nPackets
number of application packets to generate
std::size_t m_nArpReply
counts how many ARP Replies are transmitted
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 DoRun() override
Implementation to actually run this TestCase.
Ptr< UdpServer > m_sink
server app on the receiving node
Ipv4InterfaceContainer m_apInterface
IP interface for AP MLD.
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
bool m_amsduAggr
whether A-MSDU aggregation is enabled
std::size_t m_nCheckedArpRequest
counts how many ARP Requests are checked
Multi-Link Operations with UDP traffic Test Suite.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
ApplicationContainer Install(NodeContainer c)
Install an application on each node of the input container configured with all the attributes set wit...
void SetAttribute(const std::string &name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
The packet header for an ARP packet.
Definition arp-header.h:23
bool IsReply() const
Check if the ARP is a reply.
Definition arp-header.cc:78
bool IsRequest() const
Check if the ARP is a request.
Definition arp-header.cc:71
Address GetDestinationHardwareAddress() const
Returns the destination hardware address.
Definition arp-header.cc:99
Address GetSourceHardwareAddress() const
Returns the source hardware address.
Definition arp-header.cc:92
static const uint16_t PROT_NUMBER
ARP protocol number (0x0806)
AttributeValue implementation for Boolean.
Definition boolean.h:26
Hold variables of type enum.
Definition enum.h:52
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4 addresses are stored in host order in this class.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void Add(const Ipv4InterfaceContainer &other)
Concatenate the entries in the other container with ours.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Header for the LLC/SNAP encapsulation.
uint16_t GetType()
Return the Ethertype.
an EUI-48 address
static Mac48Address ConvertFrom(const Address &address)
static Mac48Address GetBroadcast()
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
static NodeContainer GetGlobal()
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static void Run()
Run the simulation.
Definition simulator.cc:167
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:175
Make it easy to create and manage PHY objects for the spectrum model.
The IEEE 802.11 SSID Information Element.
Definition ssid.h:25
AttributeValue implementation for Ssid.
Definition ssid.h:85
Hold variables of type string.
Definition string.h:45
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
AttributeValue implementation for Time.
Definition nstime.h:1432
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Create a server application which waits for input UDP packets and uses the information carried into t...
Hold an unsigned integer type.
Definition uinteger.h:34
helps to create WifiNetDevice objects
static int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the PHY and MAC aspects ...
create MAC layers for a ns3::WifiNetDevice.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:886
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
Definition config.cc:946
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition abort.h:38
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Definition test.h:241
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
Definition test.h:554
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1345
WifiAssocType
Type of association performed by this device (provided that it is supported by the standard configure...
@ WIFI_STANDARD_80211be
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr FrequencyRange WIFI_SPECTRUM_6_GHZ
Identifier for the frequency range covering the wifi spectrum in the 6 GHz band.
U * PeekPointer(const Ptr< U > &p)
Definition ptr.h:443
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition callback.h:684
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
constexpr FrequencyRange WIFI_SPECTRUM_5_GHZ
Identifier for the frequency range covering the wifi spectrum in the 5 GHz band.
Ptr< T1 > StaticCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:587
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition wifi-ppdu.h:38
constexpr FrequencyRange WIFI_SPECTRUM_2_4_GHZ
Identifier for the frequency range covering the wifi spectrum in the 2.4 GHz band.
STL namespace.
WifiTrafficPattern
Tested traffic patterns.
static WifiMloUdpTestSuite g_wifiMloUdpTestSuite
the test suite