A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-static-infra-bss-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025
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/assert.h"
11#include "ns3/boolean.h"
12#include "ns3/frame-exchange-manager.h"
13#include "ns3/log.h"
14#include "ns3/mac48-address.h"
15#include "ns3/multi-model-spectrum-channel.h"
16#include "ns3/node-container.h"
17#include "ns3/rng-seed-manager.h"
18#include "ns3/rr-multi-user-scheduler.h"
19#include "ns3/simulator.h"
20#include "ns3/spectrum-wifi-helper.h"
21#include "ns3/sta-wifi-mac.h"
22#include "ns3/string.h"
23#include "ns3/test.h"
24#include "ns3/wifi-mac-header.h"
25#include "ns3/wifi-mac-helper.h"
26#include "ns3/wifi-mac.h"
27#include "ns3/wifi-net-device.h"
28#include "ns3/wifi-ns3-constants.h"
29#include "ns3/wifi-static-setup-helper.h"
30#include "ns3/wifi-utils.h"
31
32#include <algorithm>
33#include <optional>
34#include <unordered_map>
35
36/// @ingroup wifi-test
37/// @ingroup tests
38/// @brief WifiStaticSetupHelper test suite
39/// Test suite intended to test static management exchanges between
40/// AP device and client device for single link and multi
41/// link operations.
42/// The test prepares AP WifiNetDevice and client WifiNetDevice
43/// based on test vector input and performs static exchanges for
44/// association, Block ACK agreement, UL MU disable etc.
45/// using WifiStaticSetupHelper. The test verifies if state machines
46/// at ApWifiMac and StaWifiMac has been updated correctly.
47
48using namespace ns3;
49NS_LOG_COMPONENT_DEFINE("WifiStaticInfraBssTestSuite");
50
51/// @brief Constants used in test suite
53{
54const auto DEFAULT_RNG_SEED = 3; ///< default RNG seed
55const auto DEFAULT_RNG_RUN = 7; ///< default RNG run
56const auto DEFAULT_STREAM_INDEX = 100; ///< default stream index
57const auto DEFAULT_SIM_STOP_TIME = NanoSeconds(1); ///< default simulation stop time
58const auto DEFAULT_BEACON_GEN = false; ///< default beacon generation value
59const auto DEFAULT_DATA_MODE = "HeMcs3"; ///< default data mode
60const auto DEFAULT_CONTROL_MODE = "OfdmRate24Mbps"; ///< default control mode
61const auto DEFAULT_WIFI_STANDARD = WifiStandard::WIFI_STANDARD_80211be; ///< default Wi-Fi standard
62const auto DEFAULT_SSID = Ssid("wifi-static-setup"); ///< default SSID
63const tid_t DEFAULT_TEST_TID = 0; ///< default TID
64const uint16_t DEFAULT_BA_BUFFER_SIZE = 64; ///< default MPDU buffer size
65const uint8_t DEFAULT_WIFI_UL_MU_NUM_RU = 4; ///< default number of RUs in UL MU PPDUs
66} // namespace WifiStaticInfraBssTestConstants
67
69
70/// @brief channel map typedef
71using ChannelMap = std::unordered_map<WifiPhyBand, Ptr<MultiModelSpectrumChannel>>;
72
73/// @brief test case information
75{
76 std::string name; ///< Test case name
77 StringVector apChs{}; ///< Channel setting for AP device
78 StringVector clientChs{}; ///< Channel settings for client device
79 std::vector<WifiPowerManagementMode> pmModes; ///< if non-empty, PM mode for each STA affiliated
80 ///< with the client in increasing order of client
81 ///< link ID (as assigned before association); if
82 ///< empty, no PowerSave manager is installed
83 uint16_t apBufferSize{consts::DEFAULT_BA_BUFFER_SIZE}; ///< Originator Buffer Size
84 uint16_t clientBufferSize{consts::DEFAULT_BA_BUFFER_SIZE}; ///< Recipient Buffer Size
85 std::optional<Ipv4Address> apMulticastIp{std::nullopt}; ///< AP multicast IP
86 bool ulMuDataDisable{DEFAULT_WIFI_UL_MU_DATA_DISABLE}; ///< UL MU Data Disable
87};
88
89/**
90 * Test static setup of an infrastructure BSS.
91 */
93{
94 public:
95 /**
96 * Constructor.
97 *
98 * @param testVec the test vector
99 */
101
102 private:
103 /// Construct WifiNetDevice
104 /// @param isAp true if AP, false otherwise
105 /// @param channelMap created spectrum channels
106 /// @return constructed WifiNetDevice
107 Ptr<WifiNetDevice> GetWifiNetDevice(bool isAp, const ChannelMap& channelMap);
108
109 /// Construct PHY helper based on input operating channels
110 /// @param settings vector of strings specifying the operating channels to configure
111 /// @param channelMap created spectrum channels
112 /// @return PHY helper
114 const ChannelMap& channelMap) const;
115
116 /// @return the WifiHelper
118 /// @return the AP MAC helper
120 /// @return the Client MAC helper
122 void ValidateAssoc(); ///< Validate Association
123
124 /// Validate Multi-user scheduler setup
125 /// @param apMac AP MAC
126 /// @param clientMac Non-AP MAC
128
129 /// Validate association state machine at AP and client
130 /// for input link
131 /// @param clientLinkId client local Link ID
132 /// @param apMac AP MAC
133 /// @param clientMac Client MAC
134 void ValidateAssocForLink(linkId_t clientLinkId,
135 Ptr<ApWifiMac> apMac,
136 Ptr<StaWifiMac> clientMac);
137
138 /// Validate the configured PM mode for the STA(s) affiliated with the client device
139 /// @param apMac AP MAC
140 /// @param clientMac Client MAC
141 void ValidatePmMode(Ptr<ApWifiMac> apMac, Ptr<StaWifiMac> clientMac);
142
143 /// Validate Block ACK Agreement at AP and client
144 /// @param apMac AP MAC
145 /// @param clientMac Client MAC
146 void ValidateBaAgr(Ptr<ApWifiMac> apMac, Ptr<StaWifiMac> clientMac);
147
148 void DoRun() override;
149 void DoSetup() override;
150
152 Ptr<WifiNetDevice> m_apDev{nullptr}; ///< AP WiFi device
153 Ptr<WifiNetDevice> m_clientDev{nullptr}; ///< client WiFi device
154 std::optional<Mac48Address> m_apGcrGroupAddr; ///< GCR group address
155 std::map<linkId_t, linkId_t> m_linkIdMap; ///< non-AP MLD link ID to AP MLD link ID mapping
156};
157
159 : TestCase(testVec.name),
160 m_testVec(testVec)
161{
162}
163
166{
167 WifiHelper wifiHelper;
169 wifiHelper.SetRemoteStationManager("ns3::ConstantRateWifiManager",
170 "DataMode",
172 "ControlMode",
174 return wifiHelper;
175}
176
179 const ChannelMap& channelMap) const
180{
181 NS_ASSERT(!settings.empty());
182 SpectrumWifiPhyHelper helper(settings.size());
183
184 linkId_t linkId = 0;
185 for (const auto& str : settings)
186 {
187 helper.Set(linkId, "ChannelSettings", StringValue(str));
188
189 auto channelConfig = WifiChannelConfig::FromString(str);
190 auto phyBand = channelConfig.front().band;
191 auto freqRange = GetFrequencyRange(phyBand);
192 helper.AddPhyToFreqRangeMapping(linkId, freqRange);
193 helper.AddChannel(channelMap.at(phyBand), freqRange);
194
195 ++linkId;
196 }
197 return helper;
198}
199
202{
203 WifiMacHelper macHelper;
204 auto ssid = Ssid(consts::DEFAULT_SSID);
205
206 macHelper.SetType("ns3::ApWifiMac",
207 "Ssid",
208 SsidValue(ssid),
209 "BeaconGeneration",
211 "MpduBufferSize",
212 UintegerValue(m_testVec.apBufferSize));
213 macHelper.SetMultiUserScheduler("ns3::RrMultiUserScheduler",
214 "NStations",
216 return macHelper;
217}
218
221{
222 WifiMacHelper macHelper;
224 macHelper.SetType("ns3::StaWifiMac",
225 "Ssid",
226 SsidValue(ssid),
227 "MpduBufferSize",
228 UintegerValue(m_testVec.clientBufferSize));
229 // install and configure a PowerSave manager if PM modes are provided
230 if (!m_testVec.pmModes.empty())
231 {
232 std::string s;
233 for (std::size_t id = 0; const auto pmMode : m_testVec.pmModes)
234 {
235 s += std::to_string(id++) + (pmMode == WIFI_PM_POWERSAVE ? " true, " : " false, ");
236 }
237 s.pop_back();
238 s.pop_back();
239 macHelper.SetPowerSaveManager("ns3::DefaultPowerSaveManager",
240 "PowerSaveMode",
241 StringValue(s));
242 }
243 return macHelper;
244}
245
248{
249 NodeContainer node(1);
250 auto wifiHelper = GetWifiHelper();
251 auto settings = isAp ? m_testVec.apChs : m_testVec.clientChs;
252 auto phyHelper = GetPhyHelper(settings, channelMap);
253 auto macHelper = isAp ? GetApMacHelper() : GetClientMacHelper();
254 auto netDev = wifiHelper.Install(phyHelper, macHelper, node);
256 return DynamicCast<WifiNetDevice>(netDev.Get(0));
257}
258
259void
261{
264
268
270 (m_testVec.pmModes.empty() || (m_testVec.pmModes.size() == m_testVec.clientChs.size())),
271 true,
272 "PM modes (" << m_testVec.pmModes.size() << ") and link (" << m_testVec.clientChs.size()
273 << ") mismatch");
274
275 m_apDev = GetWifiNetDevice(true, channelMap); // AP
277 m_clientDev = GetWifiNetDevice(false, channelMap); // Client
279
281
283 if (auto multicastIp = m_testVec.apMulticastIp)
284 {
285 NS_ASSERT_MSG(multicastIp->IsMulticast(),
286 "Assigned IP " << multicastIp.value() << " is not multicast");
287 m_apGcrGroupAddr = Mac48Address::ConvertFrom(m_apDev->GetMulticast(multicastIp.value()));
288 }
294}
295
296void
298 Ptr<ApWifiMac> apMac,
299 Ptr<StaWifiMac> clientMac)
300{
301 const auto isMldAssoc = (apMac->GetNLinks() > 1) && (clientMac->GetNLinks() > 1);
302 const auto apLinkId = clientLinkId;
303 const auto clientFem = clientMac->GetFrameExchangeManager(clientLinkId);
304 const auto apFem = apMac->GetFrameExchangeManager(apLinkId);
305 const auto staAddr = clientFem->GetAddress();
306 const auto apAddr = apFem->GetAddress();
307 const auto staRemoteMgr = clientMac->GetWifiRemoteStationManager(clientLinkId);
308 const auto apRemoteMgr = apMac->GetWifiRemoteStationManager(apLinkId);
309
310 NS_TEST_ASSERT_MSG_EQ(clientFem->GetBssid(),
311 apAddr,
312 "Unexpected BSSID for STA link ID " << +clientLinkId);
313 NS_TEST_ASSERT_MSG_EQ(apRemoteMgr->IsAssociated(staAddr),
314 true,
315 "Expecting STA " << staAddr << " to be associated on AP link "
316 << +apLinkId);
317
318 const auto aid = apMac->GetAssociationId(staAddr, apLinkId);
319 NS_TEST_ASSERT_MSG_EQ(apMac->GetStaList(apLinkId).contains(aid),
320 true,
321 "STA " << staAddr << " not found in list of associated STAs");
322
323 if (!isMldAssoc)
324 {
325 return;
326 }
327
328 NS_TEST_ASSERT_MSG_EQ((staRemoteMgr->GetMldAddress(apAddr) == apMac->GetAddress()),
329 true,
330 "Incorrect MLD address stored by STA on link ID " << +clientLinkId);
331 NS_TEST_ASSERT_MSG_EQ((staRemoteMgr->GetAffiliatedStaAddress(apMac->GetAddress()) == apAddr),
332 true,
333 "Incorrect affiliated address stored by STA on link ID "
334 << +clientLinkId);
335
336 NS_TEST_ASSERT_MSG_EQ((apRemoteMgr->GetMldAddress(staAddr) == clientMac->GetAddress()),
337 true,
338 "Incorrect MLD address stored by AP on link ID " << +apLinkId);
340 (apRemoteMgr->GetAffiliatedStaAddress(clientMac->GetAddress()) == staAddr),
341 true,
342 "Incorrect affiliated address stored by AP on link ID " << +apLinkId);
343}
344
345void
347{
348 const auto& clientLinkIds = clientMac->GetLinkIds();
349 // if PM modes are not provided (hence, no PowerSave manager is installed), we expect all
350 // STAs affiliated with the client to be in active mode
351 auto pmModes = !m_testVec.pmModes.empty()
352 ? m_testVec.pmModes
353 : std::vector<WifiPowerManagementMode>(clientLinkIds.size(), WIFI_PM_ACTIVE);
354
355 NS_TEST_ASSERT_MSG_EQ(pmModes.size(), clientLinkIds.size(), "Number of PM modes mismatch");
356 for (std::size_t id = 0; const auto pmMode : pmModes)
357 {
359 true,
360 "Non-AP MLD did not have link " << id << " before association");
361 const auto linkId = m_linkIdMap.at(id);
363 clientMac->GetPmMode(linkId),
364 pmMode,
365 "Unexpected PM mode for STA affiliated with the non-AP MLD and operating on link "
366 << +linkId << "(non-AP MLD side)");
367
369 apMac->GetWifiRemoteStationManager(linkId)->IsInPsMode(clientMac->GetAddress()),
370 (pmMode == WIFI_PM_POWERSAVE),
371 "Unexpected PM mode for STA affiliated with the non-AP MLD and operating on link "
372 << +linkId << "(AP MLD side)");
373
374 NS_TEST_EXPECT_MSG_EQ(apMac->GetNStationsInPsMode(linkId),
375 (pmMode == WIFI_PM_POWERSAVE ? 1 : 0),
376 "AP is tracking an unexpected number of STAs in PS mode on link "
377 << +linkId);
378 ++id;
379 }
380}
381
382void
384{
385 auto muScheduler = apMac->GetObject<RrMultiUserScheduler>();
386 NS_ASSERT(muScheduler);
387 auto clientList = muScheduler->GetUlMuStas();
388 std::size_t expectedSize = m_testVec.ulMuDataDisable ? 0 : 1;
389 if (expectedSize == 0)
390 {
391 return;
392 }
393 auto clientAddr = clientList.front().address;
394 auto expectedAddr = clientMac->GetAddress();
395 NS_TEST_ASSERT_MSG_EQ(clientAddr, expectedAddr, "Client MAC address mismatch");
396}
397
398void
400{
401 auto isMldAssoc = (apMac->GetNLinks() > 1) && (clientMac->GetNLinks() > 1);
402 auto setupLinks = clientMac->GetSetupLinkIds();
403 auto linkId = *(setupLinks.begin());
404 auto apAddr =
405 isMldAssoc ? apMac->GetAddress() : clientMac->GetFrameExchangeManager(linkId)->GetBssid();
406 auto clientAddr = isMldAssoc ? clientMac->GetAddress()
407 : clientMac->GetFrameExchangeManager(linkId)->GetAddress();
408
409 auto expectedBufferSize = std::min(m_testVec.apBufferSize, m_testVec.clientBufferSize);
410
411 // AP Block ACK Manager
412 auto baApOrig = apMac->GetBaAgreementEstablishedAsOriginator(clientAddr,
415 NS_TEST_ASSERT_MSG_EQ(baApOrig.has_value(),
416 true,
417 "BA Agreement not established at AP as originator");
418 NS_TEST_ASSERT_MSG_EQ(baApOrig->get().GetBufferSize(),
419 expectedBufferSize,
420 "BA Agreement buffer size mismatch");
421 auto baApRecip =
422 apMac->GetBaAgreementEstablishedAsRecipient(clientAddr, consts::DEFAULT_TEST_TID);
423 NS_TEST_ASSERT_MSG_EQ(baApRecip.has_value(),
424 true,
425 "BA Agreement not established at AP as recipient");
426 NS_TEST_ASSERT_MSG_EQ(baApRecip->get().GetBufferSize(),
427 expectedBufferSize,
428 "BA Agreement buffer size mismatch");
429
430 // Non-AP Block ACK Manager
431 auto baClientOrig =
432 clientMac->GetBaAgreementEstablishedAsOriginator(apAddr, consts::DEFAULT_TEST_TID);
433 NS_TEST_ASSERT_MSG_EQ(baClientOrig.has_value(),
434 true,
435 "BA Agreement not established at client as originator");
436 NS_TEST_ASSERT_MSG_EQ(baClientOrig->get().GetBufferSize(),
437 expectedBufferSize,
438 "BA Agreement buffer size mismatch");
439 auto baClientRecip = clientMac->GetBaAgreementEstablishedAsRecipient(apAddr,
442 NS_TEST_ASSERT_MSG_EQ(baClientRecip.has_value(),
443 true,
444 "BA Agreement not established at client as recipient");
445 NS_TEST_ASSERT_MSG_EQ(baClientOrig->get().GetBufferSize(),
446 expectedBufferSize,
447 "BA Agreement buffer size mismatch");
448}
449
450void
452{
453 auto apMac = DynamicCast<ApWifiMac>(m_apDev->GetMac());
454 NS_ASSERT(apMac);
455 auto clientMac = DynamicCast<StaWifiMac>(m_clientDev->GetMac());
456 NS_ASSERT(clientMac);
457
458 NS_TEST_ASSERT_MSG_EQ(clientMac->IsAssociated(), true, "Expected the STA to be associated");
459 const auto nClientLinks = m_testVec.clientChs.size();
460 auto clientLinkIds = clientMac->GetLinkIds();
461 NS_TEST_EXPECT_MSG_EQ(clientLinkIds.size(), nClientLinks, "Client number of links mismatch");
462 for (auto linkId : clientLinkIds)
463 {
464 ValidateAssocForLink(linkId, apMac, clientMac);
465 }
466
467 ValidatePmMode(apMac, clientMac);
468 ValidateBaAgr(apMac, clientMac);
469 ValidateMuScheduler(apMac, clientMac);
470}
471
472void
480
481/**
482 * @ingroup wifi-test
483 * @ingroup tests
484 *
485 * @brief WifiStaticSetupHelper test suite
486 */
488{
489 public:
491};
492
494 : TestSuite("wifi-static-infra-bss-test", Type::UNIT)
495{
496 for (const std::vector<WifiStaticInfraBssTestVector> inputs{
497 {"AP-1-link-Client-1-link",
498 {"{36, 0, BAND_5GHZ, 0}"},
499 {"{36, 0, BAND_5GHZ, 0}"},
500 {},
503 std::nullopt,
505 {"AP-1-link-Client-1-link-multicast",
506 {"{36, 0, BAND_5GHZ, 0}"},
507 {"{36, 0, BAND_5GHZ, 0}"},
511 "239.192.1.1",
513 {"AP-2-link-Client-1-link",
514 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}"},
515 {"{36, 0, BAND_5GHZ, 0}"},
516 {},
519 std::nullopt,
521 {"AP-2-link-Client-1-link-Diff-Order",
522 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}"},
523 {"{2, 0, BAND_2_4GHZ, 0}"},
527 std::nullopt,
529 {"AP-3-link-Client-2-link",
530 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
531 {"{36, 0, BAND_5GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
532 {},
535 std::nullopt,
537 {"AP-3-link-Client-2-link-Diff-Order",
538 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
539 {"{2, 0, BAND_2_4GHZ, 0}", "{36, 0, BAND_5GHZ, 0}"},
543 std::nullopt,
545 {"AP-3-link-Client-3-link",
546 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
547 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
551 std::nullopt,
553 {"AP-80MHz-Client-20MHz",
554 {"{42, 80, BAND_5GHZ, 0}"},
555 {"{36, 20, BAND_5GHZ, 0}"},
559 std::nullopt,
561 {"Single-linkBuffer-Size-Test",
562 {"{36, 0, BAND_5GHZ, 0}"},
563 {"{36, 0, BAND_5GHZ, 0}"},
564 {},
565 64,
566 256,
567 std::nullopt,
569 {"Single-linkBuffer-Size-Test-Alt",
570 {"{36, 0, BAND_5GHZ, 0}"},
571 {"{36, 0, BAND_5GHZ, 0}"},
572 {},
573 1024,
574 256,
575 std::nullopt,
577 {"Multi-link-Buffer-Size-Test",
578 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
579 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
581 256,
582 64,
583 std::nullopt,
585 {"Multi-link-Buffer-Size-Test-Alt",
586 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
587 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
589 1024,
590 1024,
591 std::nullopt,
593 {"Single-link-UL-MU-Disable",
594 {"{36, 0, BAND_5GHZ, 0}"},
595 {"{36, 0, BAND_5GHZ, 0}"},
596 {},
599 std::nullopt,
600 true},
601 {"2-link-UL-MU-Disable",
602 {"{36, 0, BAND_5GHZ, 0}", "{2, 0, BAND_2_4GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
603 {"{36, 0, BAND_5GHZ, 0}", "{1, 0, BAND_6GHZ, 0}"},
604 {},
607 std::nullopt,
608 true}};
609
610 const auto& input : inputs)
611 {
613 }
614}
615
Test static setup of an infrastructure BSS.
SpectrumWifiPhyHelper GetPhyHelper(const StringVector &settings, const ChannelMap &channelMap) const
Construct PHY helper based on input operating channels.
void ValidateAssocForLink(linkId_t clientLinkId, Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
Validate association state machine at AP and client for input link.
WifiMacHelper GetClientMacHelper() const
Ptr< WifiNetDevice > m_apDev
AP WiFi device.
void ValidatePmMode(Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
Validate the configured PM mode for the STA(s) affiliated with the client device.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::map< linkId_t, linkId_t > m_linkIdMap
non-AP MLD link ID to AP MLD link ID mapping
std::optional< Mac48Address > m_apGcrGroupAddr
GCR group address.
Ptr< WifiNetDevice > GetWifiNetDevice(bool isAp, const ChannelMap &channelMap)
Construct WifiNetDevice.
WifiStaticInfraBssTestVector m_testVec
Test vector.
void ValidateMuScheduler(Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
Validate Multi-user scheduler setup.
void ValidateBaAgr(Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
Validate Block ACK Agreement at AP and client.
WifiStaticInfraBssTest(const WifiStaticInfraBssTestVector &testVec)
Constructor.
Ptr< WifiNetDevice > m_clientDev
client WiFi device
void ValidateAssoc()
Validate Association.
void DoRun() override
Implementation to actually run this TestCase.
WifiStaticSetupHelper test suite.
AttributeValue implementation for Boolean.
Definition boolean.h:26
static Mac48Address ConvertFrom(const Address &address)
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
RrMultiUserScheduler is a simple OFDMA scheduler that indicates to perform a DL OFDMA transmission if...
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:125
static void Run()
Run the simulation.
Definition simulator.cc:161
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:169
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)
void AddPhyToFreqRangeMapping(uint8_t linkId, const FrequencyRange &freqRange)
Add a given spectrum PHY interface to the PHY instance corresponding of a given link.
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:296
@ QUICK
Fast test.
Definition test.h:1057
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
Type
Type of test.
Definition test.h:1271
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Definition test.cc:494
Hold an unsigned integer type.
Definition uinteger.h:34
helps to create WifiNetDevice objects
void SetRemoteStationManager(std::string type, Args &&... args)
Helper function used to set the station manager.
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 ...
virtual void SetStandard(WifiStandard standard)
create MAC layers for a ns3::WifiNetDevice.
void SetPowerSaveManager(std::string type, Args &&... args)
Helper function used to set the Power Save Manager.
void SetMultiUserScheduler(std::string type, Args &&... args)
Helper function used to set the Multi User Scheduler that can be aggregated to an HE AP's MAC.
void SetType(std::string type, Args &&... args)
void Set(std::string name, const AttributeValue &v)
static void SetStaticAssociation(Ptr< WifiNetDevice > bssDev, const NetDeviceContainer &clientDevs)
Bypass static capabilities exchange for input devices.
static std::map< linkId_t, linkId_t > GetLinkIdMap(Ptr< WifiNetDevice > apDev, Ptr< WifiNetDevice > clientDev)
Construct non-AP MLD link ID to AP MLD link ID mapping based on PHY channel settings.
static void SetStaticBlockAck(Ptr< WifiNetDevice > apDev, const NetDeviceContainer &clientDevs, const std::set< tid_t > &tids, std::optional< Mac48Address > gcrGroupAddr=std::nullopt)
Bypass ADDBA Request-Response exchange sequence between AP and STAs for given TIDs.
#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
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:627
#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:133
#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:240
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1324
@ WIFI_STANDARD_80211be
@ WIFI_PM_POWERSAVE
@ WIFI_PM_ACTIVE
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
const auto DEFAULT_DATA_MODE
default data mode
const uint16_t DEFAULT_BA_BUFFER_SIZE
default MPDU buffer size
const auto DEFAULT_RNG_SEED
default RNG seed
const auto DEFAULT_STREAM_INDEX
default stream index
const auto DEFAULT_SIM_STOP_TIME
default simulation stop time
const uint8_t DEFAULT_WIFI_UL_MU_NUM_RU
default number of RUs in UL MU PPDUs
const auto DEFAULT_CONTROL_MODE
default control mode
const auto DEFAULT_WIFI_STANDARD
default Wi-Fi standard
const auto DEFAULT_BEACON_GEN
default beacon generation value
Every class exported by the ns3 library is enclosed in the ns3 namespace.
FrequencyRange GetFrequencyRange(WifiPhyBand band)
Get the frequency range corresponding to the given PHY band.
static constexpr bool DEFAULT_WIFI_UL_MU_DATA_DISABLE
UL MU Data Disable flag at non-AP STA.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:605
uint8_t tid_t
IEEE 802.11-2020 9.2.4.5.2 TID subfield.
Definition wifi-utils.h:71
uint8_t linkId_t
IEEE 802.11be D7.0 Figure 9-207e—Link ID Info field format.
Definition wifi-utils.h:74
std::vector< std::string > StringVector
Return type of SplitString.
Definition string.h:26
StringVector apChs
Channel setting for AP device.
std::optional< Ipv4Address > apMulticastIp
AP multicast IP.
StringVector clientChs
Channel settings for client device.
uint16_t apBufferSize
Originator Buffer Size.
std::vector< WifiPowerManagementMode > pmModes
if non-empty, PM mode for each STA affiliated with the client in increasing order of client link ID (...
uint16_t clientBufferSize
Recipient Buffer Size.
static WifiChannelConfig FromString(const std::string &settings, WifiStandard standard=WIFI_STANDARD_UNSPECIFIED)
Get the wifi channel config from a WifiPhy::ChannelSettings string.
Definition wifi-types.cc:24
static WifiStaticInfraBssTestSuite g_wifiStaticInfraBssTestSuite
std::unordered_map< WifiPhyBand, Ptr< MultiModelSpectrumChannel > > ChannelMap
channel map typedef