A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-probe-exchange-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sharan Naribole <sharan.naribole@gmail.com>
7 */
8
9#include "ns3/ap-wifi-mac.h"
10#include "ns3/common-info-probe-req-mle.h"
11#include "ns3/config.h"
12#include "ns3/ctrl-headers.h"
13#include "ns3/eht-configuration.h"
14#include "ns3/error-model.h"
15#include "ns3/frame-exchange-manager.h"
16#include "ns3/log.h"
17#include "ns3/mac48-address.h"
18#include "ns3/mgt-headers.h"
19#include "ns3/mobility-helper.h"
20#include "ns3/multi-link-element.h"
21#include "ns3/multi-model-spectrum-channel.h"
22#include "ns3/node-container.h"
23#include "ns3/object-factory.h"
24#include "ns3/rng-seed-manager.h"
25#include "ns3/simulator.h"
26#include "ns3/spectrum-helper.h"
27#include "ns3/spectrum-wifi-helper.h"
28#include "ns3/sta-wifi-mac.h"
29#include "ns3/string.h"
30#include "ns3/test.h"
31#include "ns3/tuple.h"
32#include "ns3/wifi-mac-header.h"
33#include "ns3/wifi-mac-helper.h"
34#include "ns3/wifi-mac-queue.h"
35#include "ns3/wifi-mode.h"
36#include "ns3/wifi-net-device.h"
37#include "ns3/wifi-phy-common.h"
38#include "ns3/wifi-psdu.h"
39#include "ns3/wifi-tx-vector.h"
40#include "ns3/wifi-utils.h"
41
42#include <algorithm>
43#include <iterator>
44#include <optional>
45#include <vector>
46
47using namespace ns3;
48
49NS_LOG_COMPONENT_DEFINE("WifiProbeExchangeTestSuite");
50
51// clang-format off
54const auto DEFAULT_DATA_MODE = "EhtMcs3";
55const auto DEFAULT_CONTROL_MODE = "OfdmRate24Mbps";
56const auto DEFAULT_SSID = Ssid("probe-exch-test");
57const auto DEFAULT_RNG_SEED = 3;
58const auto DEFAULT_RNG_RUN = 7;
59const auto DEFAULT_STREAM_INDEX = 100;
60const uint64_t DEFAULT_STREAM_INCREMENT = 1e4; // some large number
61const auto DEFAULT_WIFI_STANDARD = WifiStandard::WIFI_STANDARD_80211be;
65const uint8_t DEFAULT_PRB_EXCH_LINK_ID = 0;
66const uint8_t DEFAULT_AP_MLD_ID = 0;
67using LinkIds = std::vector<uint8_t>; ///< Link identifiers
68
69// clang-format on
70
71/// Parameters and expected results for a test case
73{
74 std::string name{}; ///< Test case name
75 std::vector<std::string> apChs{}; ///< AP MLD channels
76 std::vector<std::string> clientChs{}; ///< Non-AP MLD channels
77 bool isMultiLinkReq{DEFAULT_MULTI_LINK_PROBE_REQ}; ///< Send Multi-link Prpbe Req
78 uint8_t reqTxLinkId{DEFAULT_PRB_EXCH_LINK_ID}; ///< Probe Request Tx Link ID
79 LinkIds reqLinkIds{}; ///< Link IDs included in Multi-link Probe Request if any
80 bool addr1Bcast{DEFAULT_PROBE_REQ_ADDR1_BCAST}; ///< Flag for Probe Request ADDR1 broadcast
81 bool addr3Bcast{DEFAULT_PROBE_REQ_ADDR3_BCAST}; ///< Flag for Probe Request ADDR3 broadcast
82 uint8_t respTxLinkId{DEFAULT_PRB_EXCH_LINK_ID}; ///< Probe Response Tx Link ID
83 LinkIds respLinkIds{}; ///< Expected link IDs included in Multi-link Probe Response if any
84};
85
86/**
87 * @ingroup wifi-test
88 * @ingroup tests
89 * @brief Probe Request-Probe Response exchange
90 *
91 * Test suite including Probe Request and multi-link Probe Request for various cases of
92 * Probe Request frame contents and link of transmission.
93 */
94class ProbeExchTest : public TestCase
95{
96 public:
97 /// information on transmitted PSDU
98 struct TxPsdu
99 {
101 WifiTxVector txVec; ///< TXVECTOR
102 uint8_t linkId; ///< Tx link ID
103 };
104
105 /**
106 * Constructor.
107 *
108 * @param testVec the test vector
109 * @param testCase the test case name
110 */
111 ProbeExchTest(ProbeExchTestVector testVec, std::string testCase);
112
113 /// PHY band-indexed map of spectrum channels
114 using ChannelMap = std::map<FrequencyRange, Ptr<MultiModelSpectrumChannel>>;
115
116 private:
117 /**
118 * Setup WifiNetDevices.
119 */
120 void SetupDevices();
121
122 /**
123 * Setup PSDU Tx trace.
124 *
125 * @param dev the wifi netdevice
126 * @param nodeId the node ID
127 */
128 void SetupTxTrace(Ptr<WifiNetDevice> dev, std::size_t nodeId);
129
130 /**
131 * Send Probe Request based on test vector input.
132 */
133 void SendProbeReq();
134
135 /**
136 * Setup the PHY Helper based on input channel settings.
137 *
138 * @param helper the spectrum wifi PHY helper
139 * @param channels the list of channels
140 * @param channelMap the channel map to configure
141 */
143 const std::vector<std::string>& channels,
144 const ChannelMap& channelMap);
145
146 /**
147 * Traced callback when FEM passes PSDUs to the PHY.
148 *
149 * @param linkId the link ID
150 * @param context the context
151 * @param psduMap the transmitted PSDU map
152 * @param txVector the TXVECTOR used for transmission
153 * @param txPowerW the TX power in watts
154 */
155 void CollectTxTrace(uint8_t linkId,
156 std::string context,
157 WifiConstPsduMap psduMap,
158 WifiTxVector txVector,
159 double txPowerW);
160
161 /**
162 * Check Probe Request contents.
163 *
164 * @param txPsdu information about transmitted PSDU
165 */
166 void ValidateProbeReq(const TxPsdu& txPsdu);
167
168 /**
169 * Check Probe Response contents.
170 *
171 * @param txPsdu information about transmitted PSDU
172 */
173 void ValidateProbeResp(const TxPsdu& txPsdu);
174
175 /**
176 * Check expected outcome of test case run.
177 */
178 void ValidateTest();
179
180 void DoSetup() override;
181 void DoTeardown() override;
182 void DoRun() override;
183
184 /**
185 * Get Link MAC address for input device on specified link.
186 *
187 * @param dev the input device
188 * @param linkId the ID of the specified link
189 * @return the Link MAC address for input device on specified link
190 */
192
193 Ptr<WifiNetDevice> m_apDev{nullptr}; ///< AP MLD WifiNetDevice
194 Ptr<WifiNetDevice> m_clientDev{nullptr}; ///< Non-AP MLD WifiNetDevice
196 std::vector<TxPsdu> m_mgtPsdus{}; ///< Tx PSDUs
197};
198
200 : TestCase(testCase),
201 m_testVec(testVec)
202{
203}
204
205void
207{
208 NodeContainer apNode(1);
209 NodeContainer clientNode(1);
210
211 WifiHelper wifi;
212 wifi.SetStandard(DEFAULT_WIFI_STANDARD);
213 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
214 "DataMode",
216 "ControlMode",
218
222
223 SpectrumWifiPhyHelper apPhyHelper;
224 SetChannels(apPhyHelper, m_testVec.apChs, channelMap);
225 SpectrumWifiPhyHelper clientPhyHelper;
226 SetChannels(clientPhyHelper, m_testVec.clientChs, channelMap);
227
228 WifiMacHelper mac;
229 mac.SetType("ns3::ApWifiMac",
230 "Ssid",
232 "BeaconGeneration",
233 BooleanValue(false));
234 NetDeviceContainer apDevices = wifi.Install(apPhyHelper, mac, apNode);
235 m_apDev = DynamicCast<WifiNetDevice>(apDevices.Get(0));
237
238 mac.SetType("ns3::StaWifiMac",
239 "Ssid",
241 "ActiveProbing",
242 BooleanValue(false));
243 auto clientDevices = wifi.Install(clientPhyHelper, mac, clientNode);
244 m_clientDev = DynamicCast<WifiNetDevice>(clientDevices.Get(0));
246
247 // Assign fixed streams to random variables in use
248 auto streamNumber = DEFAULT_STREAM_INDEX;
249 auto streamsUsed = WifiHelper::AssignStreams(apDevices, streamNumber);
250 NS_ASSERT_MSG(static_cast<uint64_t>(streamsUsed) < DEFAULT_STREAM_INCREMENT,
251 "Too many streams used (" << streamsUsed << "), increase the stream increment");
252 streamNumber += DEFAULT_STREAM_INCREMENT;
253 streamsUsed = WifiHelper::AssignStreams(clientDevices, streamNumber);
254 NS_ASSERT_MSG(static_cast<uint64_t>(streamsUsed) < DEFAULT_STREAM_INCREMENT,
255 "Too many streams used (" << streamsUsed << "), increase the stream increment");
256
257 MobilityHelper mobility;
259
260 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
261 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
262 mobility.SetPositionAllocator(positionAlloc);
263
264 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
265 mobility.Install(apNode);
266 mobility.Install(clientNode);
267}
268
269void
271 const std::vector<std::string>& channels,
272 const ChannelMap& channelMap)
273{
274 helper = SpectrumWifiPhyHelper(channels.size());
276
277 for (std::size_t idx = 0; idx != channels.size(); ++idx)
278 {
279 helper.Set(idx, "ChannelSettings", StringValue(channels[idx]));
280 }
281
282 for (const auto& [band, channel] : channelMap)
283 {
284 helper.AddChannel(channel, band);
285 }
286}
287
290{
291 auto mac = dev->GetMac();
292 NS_ASSERT(linkId < mac->GetNLinks());
293 return mac->GetFrameExchangeManager(linkId)->GetAddress();
294}
295
296void
298{
299 for (uint8_t idx = 0; idx < dev->GetNPhys(); ++idx)
300 {
301 Config::Connect("/NodeList/" + std::to_string(nodeId) +
302 "/DeviceList/*/$ns3::WifiNetDevice/Phys/" + std::to_string(idx) +
303 "/PhyTxPsduBegin",
305 }
306}
307
308void
310 std::string context,
311 WifiConstPsduMap psduMap,
312 WifiTxVector txVector,
313 double txPowerW)
314{
315 auto psdu = psduMap.begin()->second;
316 if (psdu->GetHeader(0).IsMgt())
317 {
318 m_mgtPsdus.push_back({psdu, txVector, linkId});
319 }
320}
321
322void
324{
325 auto clientMac = DynamicCast<StaWifiMac>(m_clientDev->GetMac());
326 NS_ASSERT(clientMac);
327
328 const auto& reqTxLinkId = m_testVec.reqTxLinkId;
329 MgtProbeRequestHeader probeReq;
331 {
332 probeReq = clientMac->GetMultiLinkProbeRequest(reqTxLinkId,
335 }
336 else
337 {
338 probeReq = clientMac->GetProbeRequest(reqTxLinkId);
339 }
340
341 auto apLinkAddr = GetLinkMacAddr(m_apDev, m_testVec.respTxLinkId);
342 auto bcastAddr = Mac48Address::GetBroadcast();
343 auto addr1 = m_testVec.addr1Bcast ? bcastAddr : apLinkAddr;
344 auto addr3 = m_testVec.addr3Bcast ? bcastAddr : apLinkAddr;
345 clientMac->EnqueueProbeRequest(probeReq, reqTxLinkId, addr1, addr3);
346}
347
348void
357
358void
360{
361 auto psdu = txPsdu.psdu;
362 auto macHdr = psdu->GetHeader(0);
363 NS_TEST_ASSERT_MSG_EQ(macHdr.IsProbeReq(), true, "Probe Request expected, actual =" << macHdr);
366 "Probe Request transmission link mismatch");
367
368 auto packet = psdu->GetPayload(0);
369 MgtProbeRequestHeader probeReq;
370 packet->PeekHeader(probeReq);
371 auto mle = probeReq.Get<MultiLinkElement>();
372 NS_TEST_ASSERT_MSG_EQ(mle.has_value(),
374 "Multi-link Element expectation mismatch");
375
376 if (!mle.has_value())
377 { // Further checks on Multi-link Element contents
378 return;
379 }
380
381 auto nProfiles = mle->GetNPerStaProfileSubelements();
382 auto expectedNProfiles = m_testVec.reqLinkIds.size();
383 NS_TEST_ASSERT_MSG_EQ(nProfiles, expectedNProfiles, "Number of Per-STA Profiles mismatch");
384
385 for (std::size_t i = 0; i < nProfiles; ++i)
386 {
387 auto actualLinkId = mle->GetPerStaProfile(i).GetLinkId();
388 NS_TEST_ASSERT_MSG_EQ(+actualLinkId,
390 "Per-STA Profile Link ID mismatch");
391 }
392}
393
394void
396{
397 auto psdu = txPsdu.psdu;
398 auto macHdr = psdu->GetHeader(0);
399 NS_TEST_ASSERT_MSG_EQ(macHdr.IsProbeResp(),
400 true,
401 "Probe Response expected, actual =" << macHdr);
404 "Probe Response transmission link mismatch");
405
406 auto packet = psdu->GetPayload(0);
407 MgtProbeResponseHeader probeResp;
408 packet->PeekHeader(probeResp);
409 auto mle = probeResp.Get<MultiLinkElement>();
410 auto isMleExpected = m_testVec.apChs.size() > 1;
411 NS_TEST_ASSERT_MSG_EQ(mle.has_value(),
412 isMleExpected,
413 "Multi-link Element expectation mismatch");
414
415 if (!mle.has_value())
416 { // Further checks on Multi-link Element contents
417 return;
418 }
419
420 auto nProfiles = mle->GetNPerStaProfileSubelements();
421 auto expectedNProfiles = m_testVec.respLinkIds.size();
422 NS_TEST_ASSERT_MSG_EQ(nProfiles, expectedNProfiles, "Number of Per-STA Profiles mismatch");
423
424 LinkIds respLinkIds{};
425 for (std::size_t i = 0; i < nProfiles; ++i)
426 {
427 auto actualLinkId = mle->GetPerStaProfile(i).GetLinkId();
428 NS_TEST_ASSERT_MSG_EQ(+actualLinkId,
430 "Per-STA Profile Link ID mismatch");
431 }
432}
433
434void
436{
437 NS_TEST_ASSERT_MSG_GT_OR_EQ(m_mgtPsdus.size(), 2, "Expected Probe Request and Response");
438
439 // Test first Management PSDU is Probe Request
441
442 // Test second Management PSDU is Probe Response
444}
445
446void
455
456void
458{
459 m_apDev->Dispose();
460 m_apDev = nullptr;
461 m_clientDev->Dispose();
462 m_clientDev = nullptr;
463 m_mgtPsdus.clear();
464}
465
466/**
467 * @ingroup wifi-test
468 * @ingroup tests
469 *
470 * @brief wifi probe exchange Test Suite
471 */
473{
474 public:
476};
477
479 : TestSuite("wifi-probe-exchange", Type::UNIT)
480{
481 using ChCfgVec = std::vector<std::string>;
482 ChCfgVec ap1Link{"{1, 0, BAND_6GHZ, 0}"};
483 ChCfgVec ap1LinkAlt{"{36, 0, BAND_5GHZ, 0}"};
484 ChCfgVec ap1LinkAlt2{"{2, 0, BAND_2_4GHZ, 0}"};
485 ChCfgVec ap2Links{"{36, 0, BAND_5GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"};
486 ChCfgVec ap2LinksAlt{"{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"};
487 ChCfgVec ap3Links{"{2, 0, BAND_2_4GHZ, 0}", "{36, 0, BAND_5GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"};
488 ChCfgVec clientChCfg{"{2, 0, BAND_2_4GHZ, 0}", "{36, 0, BAND_5GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"};
489 std::vector<ProbeExchTestVector> vecs{
490 {.name = "Single link AP, non-AP MLD sends Probe Request on link 2",
491 .apChs = ap1Link,
492 .clientChs = clientChCfg,
493 .isMultiLinkReq = false,
494 .reqTxLinkId = 2,
495 .reqLinkIds = {},
496 .addr1Bcast = false,
497 .addr3Bcast = true,
498 .respTxLinkId = 0,
499 .respLinkIds = {}},
500 {.name = "Single link AP, non-AP MLD sends Probe Request on link 1",
501 .apChs = ap1LinkAlt,
502 .clientChs = clientChCfg,
503 .isMultiLinkReq = false,
504 .reqTxLinkId = 1,
505 .reqLinkIds = {},
506 .addr1Bcast = false,
507 .addr3Bcast = true,
508 .respTxLinkId = 0,
509 .respLinkIds = {}},
510 {.name = "Single link AP, non-AP MLD sends Probe Request on link 0",
511 .apChs = ap1LinkAlt2,
512 .clientChs = clientChCfg,
513 .isMultiLinkReq = false,
514 .reqTxLinkId = 0,
515 .reqLinkIds = {},
516 .addr1Bcast = false,
517 .addr3Bcast = true,
518 .respTxLinkId = 0,
519 .respLinkIds = {}},
520 {.name = "Non-AP MLD sends Multi-Link Probe Request on link 0 requesting a different link",
521 .apChs = ap3Links,
522 .clientChs = clientChCfg,
523 .isMultiLinkReq = true,
524 .reqTxLinkId = 0,
525 .reqLinkIds = {2},
526 .addr1Bcast = false,
527 .addr3Bcast = true,
528 .respTxLinkId = 0,
529 .respLinkIds = {2}},
530 {.name = "Non-AP MLD sends Multi-Link Probe Request with broadcast Addr1 and Addr3",
531 .apChs = ap3Links,
532 .clientChs = clientChCfg,
533 .isMultiLinkReq = true,
534 .reqTxLinkId = 1,
535 .reqLinkIds = {0, 1, 2},
536 .addr1Bcast = true,
537 .addr3Bcast = true,
538 .respTxLinkId = 1,
539 .respLinkIds = {}},
540 {.name = "Non-AP MLD sends Multi-Link Probe Request on link 2 requesting the same link",
541 .apChs = ap3Links,
542 .clientChs = clientChCfg,
543 .isMultiLinkReq = true,
544 .reqTxLinkId = 2,
545 .reqLinkIds = {2},
546 .addr1Bcast = false,
547 .addr3Bcast = true,
548 .respTxLinkId = 2,
549 .respLinkIds = {}},
550 {.name = "Non-AP MLD sends Probe Request to AP MLD",
551 .apChs = ap3Links,
552 .clientChs = clientChCfg,
553 .isMultiLinkReq = false,
554 .reqTxLinkId = 1,
555 .reqLinkIds = {},
556 .addr1Bcast = false,
557 .addr3Bcast = true,
558 .respTxLinkId = 1,
559 .respLinkIds = {}},
560 {.name = "Non-AP MLD sends Multi-Link Probe Request to AP MLD with 3 links requesting all "
561 "links",
562 .apChs = ap3Links,
563 .clientChs = clientChCfg,
564 .isMultiLinkReq = true,
565 .reqTxLinkId = 0,
566 .reqLinkIds = {0, 1, 2},
567 .addr1Bcast = false,
568 .addr3Bcast = true,
569 .respTxLinkId = 0,
570 .respLinkIds = {1, 2}},
571 {.name = "Non-AP MLD sends Multi-Link Probe Request on link 1 to AP MLD with 2 links "
572 "requesting all links",
573 .apChs = ap2Links,
574 .clientChs = clientChCfg,
575 .isMultiLinkReq = true,
576 .reqTxLinkId = 1,
577 .reqLinkIds = {0, 1},
578 .addr1Bcast = false,
579 .addr3Bcast = true,
580 .respTxLinkId = 0,
581 .respLinkIds = {1}},
582 {.name = "Non-AP MLD sends Multi-Link Probe Request on link 0 to AP MLD with 2 links "
583 "requesting all links",
584 .apChs = ap2LinksAlt,
585 .clientChs = clientChCfg,
586 .isMultiLinkReq = true,
587 .reqTxLinkId = 0,
588 .reqLinkIds = {0, 1},
589 .addr1Bcast = false,
590 .addr3Bcast = true,
591 .respTxLinkId = 0,
592 .respLinkIds = {1}},
593 {.name = "Non-AP MLD sends Multi-Link Probe Request with no Per-STA-Profile",
594 .apChs = ap3Links,
595 .clientChs = clientChCfg,
596 .isMultiLinkReq = true,
597 .reqTxLinkId = 0,
598 .reqLinkIds = {},
599 .addr1Bcast = false,
600 .addr3Bcast = true,
601 .respTxLinkId = 0,
602 .respLinkIds = {1, 2}},
603 {.name = "Non-AP MLD sends Multi-Link Probe Request with broadcast Addr1",
604 .apChs = ap3Links,
605 .clientChs = clientChCfg,
606 .isMultiLinkReq = true,
607 .reqTxLinkId = 1,
608 .reqLinkIds = {1, 2},
609 .addr1Bcast = true,
610 .addr3Bcast = false,
611 .respTxLinkId = 1,
612 .respLinkIds = {2}},
613 {.name = "Duplicate requested Link IDs",
614 .apChs = ap3Links,
615 .clientChs = clientChCfg,
616 .isMultiLinkReq = true,
617 .reqTxLinkId = 0,
618 .reqLinkIds = {0, 1, 1, 2, 2},
619 .addr1Bcast = false,
620 .addr3Bcast = false,
621 .respTxLinkId = 0,
622 .respLinkIds = {1, 2}},
623 };
624
625 for (const auto& testVec : vecs)
626 {
627 AddTestCase(new ProbeExchTest(testVec, testVec.name), TestCase::Duration::QUICK);
628 }
629}
630
Probe Request-Probe Response exchange.
void DoRun() override
Implementation to actually run this TestCase.
ProbeExchTestVector m_testVec
Test vector.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::vector< TxPsdu > m_mgtPsdus
Tx PSDUs.
void SetChannels(SpectrumWifiPhyHelper &helper, const std::vector< std::string > &channels, const ChannelMap &channelMap)
Setup the PHY Helper based on input channel settings.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void ValidateTest()
Check expected outcome of test case run.
void ValidateProbeReq(const TxPsdu &txPsdu)
Check Probe Request contents.
void CollectTxTrace(uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Traced callback when FEM passes PSDUs to the PHY.
void SetupDevices()
Setup WifiNetDevices.
void SendProbeReq()
Send Probe Request based on test vector input.
Mac48Address GetLinkMacAddr(Ptr< WifiNetDevice > dev, uint8_t linkId)
Get Link MAC address for input device on specified link.
std::map< FrequencyRange, Ptr< MultiModelSpectrumChannel > > ChannelMap
PHY band-indexed map of spectrum channels.
void SetupTxTrace(Ptr< WifiNetDevice > dev, std::size_t nodeId)
Setup PSDU Tx trace.
void ValidateProbeResp(const TxPsdu &txPsdu)
Check Probe Response contents.
ProbeExchTest(ProbeExchTestVector testVec, std::string testCase)
Constructor.
Ptr< WifiNetDevice > m_apDev
AP MLD WifiNetDevice.
Ptr< WifiNetDevice > m_clientDev
Non-AP MLD WifiNetDevice.
wifi probe exchange Test Suite
AttributeValue implementation for Boolean.
Definition boolean.h:26
an EUI-48 address
static Mac48Address GetBroadcast()
Implement the header for management frames of type probe request.
Implement the header for management frames of type probe response.
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.
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 EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:560
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.
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
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
encapsulates test code
Definition test.h:1050
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
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.
void SetPcapDataLinkType(SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
void Set(std::string name, const AttributeValue &v)
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
const WifiMacHeader & GetHeader(std::size_t i) const
Get the header of the i-th MPDU.
Definition wifi-psdu.cc:278
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
void Connect(std::string path, const CallbackBase &cb)
Definition config.cc:967
#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_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition test.h:134
#define NS_TEST_ASSERT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not.
Definition test.h:905
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1356
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.
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.
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.
information on transmitted PSDU
Ptr< const WifiPsdu > psdu
WifiPsdu.
Parameters and expected results for a test case.
LinkIds respLinkIds
Expected link IDs included in Multi-link Probe Response if any.
bool addr3Bcast
Flag for Probe Request ADDR3 broadcast.
bool addr1Bcast
Flag for Probe Request ADDR1 broadcast.
std::vector< std::string > clientChs
Non-AP MLD channels.
std::vector< std::string > apChs
AP MLD channels.
bool isMultiLinkReq
Send Multi-link Prpbe Req.
std::string name
Test case name.
LinkIds reqLinkIds
Link IDs included in Multi-link Probe Request if any.
uint8_t reqTxLinkId
Probe Request Tx Link ID.
uint8_t respTxLinkId
Probe Response Tx Link ID.
std::vector< uint8_t > LinkIds
Link identifiers.
const auto DEFAULT_SSID
const auto DEFAULT_STREAM_INDEX
const auto DEFAULT_PROBE_REQ_TX_TIME
const auto DEFAULT_RNG_RUN
const auto DEFAULT_MULTI_LINK_PROBE_REQ
const uint8_t DEFAULT_AP_MLD_ID
const auto DEFAULT_PROBE_REQ_ADDR3_BCAST
static ProbeExchTestSuite g_probeExchTestSuite
const auto DEFAULT_DATA_MODE
const auto DEFAULT_PROBE_REQ_ADDR1_BCAST
const auto DEFAULT_RNG_SEED
const auto DEFAULT_CONTROL_MODE
const auto DEFAULT_WIFI_STANDARD
const auto DEFAULT_SIM_STOP_TIME
const uint64_t DEFAULT_STREAM_INCREMENT
const uint8_t DEFAULT_PRB_EXCH_LINK_ID