A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-protection-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Davide Magrin <davide@magr.in>
7 */
8
9#include "ns3/ap-wifi-mac.h"
10#include "ns3/boolean.h"
11#include "ns3/config.h"
12#include "ns3/ctrl-headers.h"
13#include "ns3/enum.h"
14#include "ns3/log.h"
15#include "ns3/mobility-helper.h"
16#include "ns3/multi-model-spectrum-channel.h"
17#include "ns3/node-container.h"
18#include "ns3/node-list.h"
19#include "ns3/packet-socket-client.h"
20#include "ns3/packet-socket-helper.h"
21#include "ns3/packet-socket-server.h"
22#include "ns3/packet.h"
23#include "ns3/qos-txop.h"
24#include "ns3/rng-seed-manager.h"
25#include "ns3/simulator.h"
26#include "ns3/spectrum-wifi-helper.h"
27#include "ns3/ssid.h"
28#include "ns3/sta-wifi-mac.h"
29#include "ns3/string.h"
30#include "ns3/test.h"
31#include "ns3/wifi-acknowledgment.h"
32#include "ns3/wifi-mac-helper.h"
33#include "ns3/wifi-net-device.h"
34#include "ns3/wifi-phy.h"
35#include "ns3/wifi-psdu.h"
36#include "ns3/wifi-static-setup-helper.h"
37
38#include <list>
39#include <set>
40#include <sstream>
41
42using namespace ns3;
43
44NS_LOG_COMPONENT_DEFINE("WifiProtectionTest");
45
46/**
47 * @ingroup wifi-test
48 * @ingroup tests
49 *
50 * @brief Test that a DL MU PPDU mixing protected and unprotected receivers gets an MU-RTS.
51 *
52 * With a non-zero TXOP limit, stations that responded to the AP earlier in a TXOP are
53 * recorded as protected for the remainder of that TXOP, so a DL MU PPDU prepared for a
54 * non-initial frame exchange of the TXOP can mix protected and unprotected receivers.
55 * The MU-RTS decision is a property of the PPDU's receiver set (send an MU-RTS if any
56 * receiver is unprotected), not of the single MPDU being aggregated.
57 *
58 * An AP transmits two DL MU PPDUs to three stations within the same TXOP. Packets for
59 * the first DL MU PPDU (to STA 1 and STA 2) are generated at the beginning of the
60 * simulation; packets for the second DL MU PPDU (to STA 2 and STA 3) are generated as
61 * soon as the first DL MU PPDU is transmitted. The first MU-RTS/CTS exchange protects
62 * STA 1 and STA 2 only, hence the second DL MU PPDU mixes a protected receiver (STA 2)
63 * with an unprotected one (STA 3) and must be preceded by another MU-RTS.
64 *
65 * The expected frame exchange sequence is (all frames within one TXOP, hence
66 * SIFS-separated; the second MU-RTS is required because STA 3 is not protected yet;
67 * the CF-End truncates the TXOP once all queues are empty):
68 *
69 * @verbatim
70 *
71 * packets to STA 1, STA 2 packets to STA 2, STA 3
72 * queued at the AP queued at this point
73 * │ │
74 * ▼ ▼
75 * ┌──────┐ ┌──────────┐ ┌──────┐
76 * [AP] │MU-RTS│ │DL MU PPDU│ │MU-BAR│
77 * ───────┴──────┴─┬───┬─┴──────────┴──┴──────┴─┬──┬ ─ ─ ─
78 * STA 1 │CTS│ │BA│
79 * └───┘ └──┘
80 * STA 2 │CTS│ │BA│
81 * └───┘ └──┘
82 *
83 * (the TXOP continues: the second MU-RTS follows a SIFS after the BlockAcks)
84 *
85 * ┌──────┐ ┌──────────┐ ┌──────┐ ┌──────┐
86 * [AP] │MU-RTS│ │DL MU PPDU│ │MU-BAR│ │CF-End│
87 * ───────┴──────┴─┬───┬─┴──────────┴──┴──────┴─┬──┬─┴──────┴────
88 * STA 2 │CTS│ │BA│
89 * └───┘ └──┘
90 * STA 3 │CTS│ │BA│
91 * └───┘ └──┘
92 *
93 * @endverbatim
94 *
95 * Association and Block Ack agreement establishment are performed through the static
96 * setup helper and UL OFDMA is disabled on the multi-user scheduler, so that the frames
97 * above are the only ones transmitted. The test checks the type of every transmitted
98 * frame against this sequence, that both MU-RTS frames solicit both receivers of the
99 * respective PPDU, and that all expected frames have been transmitted by the end of the
100 * simulation.
101 */
103{
104 public:
106
107 /**
108 * Callback invoked when a PHY passes a PSDU map to transmit.
109 *
110 * @param psduMap the PSDU map
111 * @param txVector the TX vector
112 * @param txPower the TX power
113 */
114 void Transmit(WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower);
115
116 private:
117 /// Expected start time of a frame relative to the previous frame in the sequence
118 enum class ExpectedStart : uint8_t
119 {
120 ANY, ///< no expectation (first frame of the sequence)
121 AFTER_SIFS, ///< a SIFS after the end of the previous frame
122 SAME_TIME ///< at the same time as the previous frame (simultaneous responses)
123 };
124
125 /// Actions and checks to perform upon the transmission of each frame
126 struct Events
127 {
128 /**
129 * Constructor.
130 *
131 * @param type the frame MAC header type
132 * @param s the expected start time of the frame
133 * @param f function to perform actions and checks
134 */
137 std::function<void(const WifiConstPsduMap&, const WifiTxVector&)>&& f = {})
138 : hdrType(type),
139 start(s),
140 func(f)
141 {
142 }
143
144 WifiMacType hdrType; ///< MAC header type of the frame
145 ExpectedStart start; ///< expected start time of the frame
146 std::function<void(const WifiConstPsduMap&, const WifiTxVector&)>
147 func; ///< actions and checks to perform
148 };
149
150 void DoSetup() override;
151 void DoRun() override;
152
153 /**
154 * @param staId the index of the station the generated packets are destined to
155 * @return an application generating one packet destined to the given station
156 */
157 Ptr<PacketSocketClient> GetApplication(std::size_t staId) const;
158
159 /// Insert elements in the list of expected events (transmitted frames)
160 void InsertEvents();
161
162 /**
163 * Check that the given PSDU is an MU-RTS soliciting exactly the given stations.
164 *
165 * @param psdu the PSDU carrying the Trigger Frame
166 * @param staIds the indices of the solicited stations
167 */
168 void CheckMuRts(Ptr<const WifiPsdu> psdu, const std::set<std::size_t>& staIds);
169
170 /**
171 * Check that the given PSDU map is a DL MU PPDU addressed to exactly the given
172 * stations.
173 *
174 * @param psduMap the PSDU map
175 * @param staIds the indices of the receiver stations
176 */
177 void CheckDlMuPpdu(const WifiConstPsduMap& psduMap, const std::set<std::size_t>& staIds);
178
179 /// number of contending stations
180 static constexpr std::size_t N_STAS = 3;
181
182 Ptr<ApWifiMac> m_apMac; ///< AP wifi MAC
183 std::vector<Ptr<StaWifiMac>> m_staMacs; ///< station wifi MACs
184 std::vector<PacketSocketAddress> m_dlSockets; ///< packet socket addresses for DL traffic
185 std::list<Events> m_events; ///< list of events for the test run
186 Time m_prevTxStart; ///< start time of the previous frame
187 Time m_prevTxEnd; ///< end time of the previous frame
188 const Time m_duration{MilliSeconds(50)}; ///< simulation duration
189 const Time m_txopLimit{MicroSeconds(4800)}; ///< TXOP limit for the AC of the DL traffic
190};
191
193 : TestCase("Check that a DL MU PPDU mixing protected and unprotected receivers gets an MU-RTS")
194{
195}
196
199{
200 auto client = CreateObject<PacketSocketClient>();
201 client->SetAttribute("PacketSize", UintegerValue(500));
202 client->SetAttribute("MaxPackets", UintegerValue(1));
203 client->SetAttribute("Interval", TimeValue(MicroSeconds(0)));
204 client->SetRemote(m_dlSockets.at(staId));
205 client->SetStartTime(Time{0}); // now
206 client->SetStopTime(m_duration - Simulator::Now());
207
208 return client;
209}
210
211void
213{
216
217 Config::SetDefault("ns3::WifiDefaultProtectionManager::EnableMuRts", BooleanValue(true));
218 Config::SetDefault("ns3::WifiDefaultAckManager::DlMuAckSequenceType",
220
221 NodeContainer apNode(1);
222 NodeContainer staNodes(N_STAS);
223
226 phy.SetChannel(channel);
227 phy.Set("ChannelSettings", StringValue("{36, 20, BAND_5GHZ, 0}"));
228
229 WifiHelper wifi;
230 wifi.SetStandard(WIFI_STANDARD_80211ax);
231 wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager",
232 "DataMode",
233 StringValue("HeMcs5"),
234 "ControlMode",
235 StringValue("OfdmRate6Mbps"));
236
237 WifiMacHelper mac;
238 Ssid ssid("mu-rts-test");
239 mac.SetType("ns3::StaWifiMac", "Ssid", SsidValue(ssid));
240 auto staDevices = wifi.Install(phy, mac, staNodes);
241
242 mac.SetType("ns3::ApWifiMac", "Ssid", SsidValue(ssid), "BeaconGeneration", BooleanValue(false));
243 mac.SetMultiUserScheduler("ns3::RrMultiUserScheduler", "EnableUlOfdma", BooleanValue(false));
244 auto apDevices = wifi.Install(phy, mac, apNode);
245 auto apDev = DynamicCast<WifiNetDevice>(apDevices.Get(0));
246
247 WifiHelper::AssignStreams(NetDeviceContainer(apDevices, staDevices), 100);
248
249 MobilityHelper mobility;
250 auto positionAlloc = CreateObject<ListPositionAllocator>();
251 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
252 for (std::size_t i = 0; i < N_STAS; ++i)
253 {
254 positionAlloc->Add(Vector(1.0, i * 1.0, 0.0));
255 }
256 mobility.SetPositionAllocator(positionAlloc);
257 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
258 mobility.Install(apNode);
259 mobility.Install(staNodes);
260
261 m_apMac = DynamicCast<ApWifiMac>(apDev->GetMac());
262 for (std::size_t i = 0; i < N_STAS; ++i)
263 {
264 m_staMacs.push_back(
265 DynamicCast<StaWifiMac>(DynamicCast<WifiNetDevice>(staDevices.Get(i))->GetMac()));
266 }
267
268 // skip association and Block Ack agreement establishment
270 WifiStaticSetupHelper::SetStaticBlockAck(apDev, staDevices, {0});
271
272 // a non-zero TXOP limit, so that both DL MU PPDUs are transmitted within one TXOP
273 m_apMac->GetQosTxop(AC_BE)->SetTxopLimit(m_txopLimit);
274
275 // trace PSDUs passed to the PHY on all devices
276 for (auto devIt = NodeList::Begin(); devIt != NodeList::End(); ++devIt)
277 {
278 auto dev = DynamicCast<WifiNetDevice>((*devIt)->GetDevice(0));
279 dev->GetPhy(0)->TraceConnectWithoutContext(
280 "PhyTxPsduBegin",
282 }
283
284 PacketSocketHelper packetSocket;
285 packetSocket.Install(apNode);
286 packetSocket.Install(staNodes);
287
288 // install a packet socket server on each station
289 for (std::size_t i = 0; i < N_STAS; ++i)
290 {
291 PacketSocketAddress srvAddr;
292 auto staDev = DynamicCast<WifiNetDevice>(staNodes.Get(i)->GetDevice(0));
293 srvAddr.SetSingleDevice(staDev->GetIfIndex());
294 srvAddr.SetProtocol(1);
295
296 auto server = CreateObject<PacketSocketServer>();
297 server->SetLocal(srvAddr);
298 staNodes.Get(i)->AddApplication(server);
299 server->SetStartTime(Time{0});
300 server->SetStopTime(m_duration);
301
302 m_dlSockets.emplace_back();
303 m_dlSockets.back().SetSingleDevice(apDev->GetIfIndex());
304 m_dlSockets.back().SetPhysicalAddress(staDev->GetAddress());
305 m_dlSockets.back().SetProtocol(1);
306 }
307}
308
309void
311 const std::set<std::size_t>& staIds)
312{
313 CtrlTriggerHeader trigger;
314 psdu->GetPayload(0)->PeekHeader(trigger);
316 true,
317 "Expected an MU-RTS Trigger Frame at time "
318 << Simulator::Now().As(Time::US));
319
320 std::set<uint16_t> expectedAids;
321 for (const auto staId : staIds)
322 {
323 expectedAids.insert(m_staMacs.at(staId)->GetAssociationId());
324 }
325 std::set<uint16_t> solicitedAids;
326 for (const auto& userInfo : trigger)
327 {
328 solicitedAids.insert(userInfo.GetAid12());
329 }
330 NS_TEST_EXPECT_MSG_EQ((solicitedAids == expectedAids),
331 true,
332 "The MU-RTS must solicit all receivers of the DL MU PPDU");
333}
334
335void
337 const std::set<std::size_t>& staIds)
338{
339 std::set<Mac48Address> expectedReceivers;
340 for (const auto staId : staIds)
341 {
342 expectedReceivers.insert(m_staMacs.at(staId)->GetAddress());
343 }
344 std::set<Mac48Address> receivers;
345 for (const auto& [aid, psdu] : psduMap)
346 {
347 receivers.insert(psdu->GetAddr1());
348 }
349 NS_TEST_EXPECT_MSG_EQ((receivers == expectedReceivers),
350 true,
351 "Unexpected receiver set for the DL MU PPDU transmitted at time "
352 << Simulator::Now().As(Time::US));
353}
354
355void
357{
358 // first frame exchange: MU-RTS protecting the DL MU PPDU to STA 1 and STA 2
359 m_events.emplace_back(WIFI_MAC_CTL_TRIGGER,
361 [this](const WifiConstPsduMap& psduMap, const WifiTxVector& txVector) {
362 CheckMuRts(psduMap.cbegin()->second, {0, 1});
363 });
366 m_events.emplace_back(WIFI_MAC_QOSDATA,
368 [this](const WifiConstPsduMap& psduMap, const WifiTxVector& txVector) {
369 CheckDlMuPpdu(psduMap, {0, 1});
370 // generate the packets for the second DL MU PPDU, addressed to a
371 // station that responded to the MU-RTS above (STA 2) and to one that
372 // did not (STA 3)
373 for (const auto staId : {std::size_t{1}, std::size_t{2}})
374 {
375 m_apMac->GetDevice()->GetNode()->AddApplication(
376 GetApplication(staId));
377 }
378 });
379 m_events.emplace_back(WIFI_MAC_CTL_TRIGGER,
381 [this](const WifiConstPsduMap& psduMap, const WifiTxVector& txVector) {
382 CtrlTriggerHeader trigger;
383 psduMap.cbegin()->second->GetPayload(0)->PeekHeader(trigger);
385 true,
386 "Expected an MU-BAR Trigger Frame at time "
387 << Simulator::Now().As(Time::US));
388 });
391
392 // second frame exchange, within the same TXOP: the DL MU PPDU to STA 2 and STA 3
393 // includes an unprotected receiver (STA 3), hence another MU-RTS is required
394 m_events.emplace_back(WIFI_MAC_CTL_TRIGGER,
396 [this](const WifiConstPsduMap& psduMap, const WifiTxVector& txVector) {
397 CheckMuRts(psduMap.cbegin()->second, {1, 2});
398 });
401 m_events.emplace_back(WIFI_MAC_QOSDATA,
403 [this](const WifiConstPsduMap& psduMap, const WifiTxVector& txVector) {
404 CheckDlMuPpdu(psduMap, {1, 2});
405 });
406 m_events.emplace_back(WIFI_MAC_CTL_TRIGGER,
408 [this](const WifiConstPsduMap& psduMap, const WifiTxVector& txVector) {
409 CtrlTriggerHeader trigger;
410 psduMap.cbegin()->second->GetPayload(0)->PeekHeader(trigger);
412 true,
413 "Expected an MU-BAR Trigger Frame at time "
414 << Simulator::Now().As(Time::US));
415 });
418
419 // all queues are empty at this point, hence the AP truncates the TXOP
421}
422
423void
425 WifiTxVector txVector,
426 Watt_u txPower)
427{
428 for (const auto& [aid, psdu] : psduMap)
429 {
430 std::stringstream ss;
431 ss << " #MPDUs " << psdu->GetNMpdus();
432 for (auto it = psdu->begin(); it != psdu->end(); ++it)
433 {
434 ss << "\n" << **it;
435 }
436 NS_LOG_INFO(ss.str());
437 }
438 NS_LOG_INFO("TXVECTOR = " << txVector << "\n");
439
440 const auto psdu = psduMap.cbegin()->second;
441 const auto& hdr = psdu->GetHeader(0);
442
444 false,
445 "Unexpected frame of type " << hdr.GetTypeString()
446 << " transmitted at time "
447 << Simulator::Now().As(Time::US));
448 if (m_events.empty())
449 {
450 return;
451 }
452
453 // check that the expected frame is being transmitted
454 const auto expectedType = std::string(WifiMacHeader(m_events.front().hdrType).GetTypeString());
455 NS_TEST_ASSERT_MSG_EQ(expectedType,
456 hdr.GetTypeString(),
457 "Unexpected MAC header type for frame transmitted at time "
458 << Simulator::Now().As(Time::US));
459
460 // check the start time of the frame with respect to the previous frame
461 switch (m_events.front().start)
462 {
465 m_prevTxEnd + m_apMac->GetWifiPhy(0)->GetSifs(),
466 "Frame of type " << hdr.GetTypeString()
467 << " expected a SIFS after the previous frame");
468 break;
472 "Frame of type "
473 << hdr.GetTypeString()
474 << " expected at the same time as the previous frame");
475 break;
477 break;
478 }
479
480 // perform actions and checks, if any (only on a frame of the expected type, as the
481 // checks parse the frame contents accordingly)
482 if (expectedType == hdr.GetTypeString() && m_events.front().func)
483 {
484 m_events.front().func(psduMap, txVector);
485 }
486
490 WifiPhy::CalculateTxDuration(psduMap, txVector, m_apMac->GetWifiPhy(0)->GetPhyBand());
491
492 m_events.pop_front();
493}
494
495void
497{
498 InsertEvents();
499
500 // generate the packets for the first DL MU PPDU, addressed to STA 1 and STA 2
501 for (const auto staId : {std::size_t{0}, std::size_t{1}})
502 {
503 m_apMac->GetDevice()->GetNode()->AddApplication(GetApplication(staId));
504 }
505
508
509 NS_TEST_EXPECT_MSG_EQ(m_events.empty(), true, "Not all events took place");
510
512}
513
514/**
515 * @ingroup wifi-test
516 * @ingroup tests
517 *
518 * @brief wifi protection Test Suite
519 */
521{
522 public:
524};
525
531
Test that a DL MU PPDU mixing protected and unprotected receivers gets an MU-RTS.
static constexpr std::size_t N_STAS
number of contending stations
const Time m_duration
simulation duration
std::vector< Ptr< StaWifiMac > > m_staMacs
station wifi MACs
std::vector< PacketSocketAddress > m_dlSockets
packet socket addresses for DL traffic
void InsertEvents()
Insert elements in the list of expected events (transmitted frames).
void DoRun() override
Implementation to actually run this TestCase.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::list< Events > m_events
list of events for the test run
Ptr< PacketSocketClient > GetApplication(std::size_t staId) const
void CheckMuRts(Ptr< const WifiPsdu > psdu, const std::set< std::size_t > &staIds)
Check that the given PSDU is an MU-RTS soliciting exactly the given stations.
Time m_prevTxStart
start time of the previous frame
const Time m_txopLimit
TXOP limit for the AC of the DL traffic.
void CheckDlMuPpdu(const WifiConstPsduMap &psduMap, const std::set< std::size_t > &staIds)
Check that the given PSDU map is a DL MU PPDU addressed to exactly the given stations.
Ptr< ApWifiMac > m_apMac
AP wifi MAC.
Time m_prevTxEnd
end time of the previous frame
void Transmit(WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower)
Callback invoked when a PHY passes a PSDU map to transmit.
ExpectedStart
Expected start time of a frame relative to the previous frame in the sequence.
@ SAME_TIME
at the same time as the previous frame (simultaneous responses)
@ ANY
no expectation (first frame of the sequence)
@ AFTER_SIFS
a SIFS after the end of the previous frame
wifi protection Test Suite
Headers for Trigger frames.
bool IsMuRts() const
Check if this is a MU-RTS Trigger frame.
bool IsMuBar() const
Check if this is a MU-BAR Trigger frame.
Hold variables of type enum.
Definition enum.h:52
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.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Definition node.cc:153
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition node.cc:138
static Iterator Begin()
Definition node-list.cc:226
static Iterator End()
Definition node-list.cc:233
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
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.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:125
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:191
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.
The IEEE 802.11 SSID Information Element.
Definition ssid.h:27
AttributeValue implementation for Ssid.
Definition ssid.h:98
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
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
@ US
microsecond
Definition nstime.h:108
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 ...
Implements the IEEE 802.11 MAC header.
virtual const char * GetTypeString() const
Return a string corresponds to the header type.
create MAC layers for a ns3::WifiNetDevice.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition wifi-phy.cc:1574
static void SetStaticAssociation(Ptr< WifiNetDevice > bssDev, const NetDeviceContainer &clientDevs)
Bypass static capabilities exchange for input devices.
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.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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:690
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:886
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:201
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:274
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 MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1347
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1330
@ WIFI_STANDARD_80211ax
@ AC_BE
Best Effort.
Definition qos-utils.h:66
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:643
WifiMacType
Combination of valid MAC header type/subtype.
@ WIFI_MAC_CTL_TRIGGER
@ WIFI_MAC_CTL_CTS
@ WIFI_MAC_CTL_BACKRESP
@ WIFI_MAC_CTL_END
@ WIFI_MAC_QOSDATA
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition wifi-ppdu.h:39
double Watt_u
Watt weak type.
Definition wifi-units.h:25
ExpectedStart start
expected start time of the frame
Events(WifiMacType type, ExpectedStart s, std::function< void(const WifiConstPsduMap &, const WifiTxVector &)> &&f={})
Constructor.
WifiMacType hdrType
MAC header type of the frame.
std::function< void(const WifiConstPsduMap &, const WifiTxVector &)> func
actions and checks to perform
static WifiProtectionTestSuite g_wifiProtectionTestSuite
the test suite