A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-emlsr-test.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 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#ifndef WIFI_EMLSR_TEST_H
10#define WIFI_EMLSR_TEST_H
11
12#include "ns3/ap-wifi-mac.h"
13#include "ns3/error-model.h"
14#include "ns3/header-serialization-test.h"
15#include "ns3/packet-socket-address.h"
16#include "ns3/packet-socket-client.h"
17#include "ns3/sta-wifi-mac.h"
18#include "ns3/test.h"
19#include "ns3/wifi-mac-queue-scheduler.h"
20#include "ns3/wifi-mac.h"
21#include "ns3/wifi-ppdu.h"
22#include "ns3/wifi-psdu.h"
23
24using namespace ns3;
25
26/**
27 * @ingroup wifi-test
28 * @ingroup tests
29 *
30 * @brief Test EML Operating Mode Notification frame serialization and deserialization
31 */
33{
34 public:
35 /**
36 * Constructor
37 */
40
41 private:
42 void DoRun() override;
43};
44
45/**
46 * @ingroup wifi-test
47 * @ingroup tests
48 *
49 * @brief Base class for EMLSR Operations tests
50 *
51 * This base class setups and configures one AP MLD, a variable number of non-AP MLDs with
52 * EMLSR activated and a variable number of non-AP MLD with EMLSR deactivated. Every MLD has
53 * three links, each operating on a distinct PHY band (2.4 GHz, 5 GHz and 6 GHz). Therefore,
54 * it is expected that three links are setup by the non-AP MLD(s). The values for the Padding
55 * Delay, the Transition Delay and the Transition Timeout are provided as argument to the
56 * constructor of this class, along with the IDs of the links on which EMLSR mode must be
57 * enabled for the non-AP MLDs (this information is used to set the EmlsrLinkSet attribute
58 * of the DefaultEmlsrManager installed on the non-AP MLDs).
59 */
61{
62 public:
63 /**
64 * Constructor
65 *
66 * @param name The name of the new TestCase created
67 */
68 EmlsrOperationsTestBase(const std::string& name);
69 ~EmlsrOperationsTestBase() override = default;
70
71 /// Enumeration for traffic directions
72 enum TrafficDirection : uint8_t
73 {
75 UPLINK
76 };
77
78 protected:
79 /**
80 * Callback invoked when a FEM passes PSDUs to the PHY.
81 *
82 * @param mac the MAC transmitting the PSDUs
83 * @param phyId the ID of the PHY transmitting the PSDUs
84 * @param psduMap the PSDU map
85 * @param txVector the TX vector
86 * @param txPowerW the tx power in Watts
87 */
88 virtual void Transmit(Ptr<WifiMac> mac,
89 uint8_t phyId,
90 WifiConstPsduMap psduMap,
91 WifiTxVector txVector,
92 double txPowerW);
93
94 /**
95 * @param dir the traffic direction (downlink/uplink)
96 * @param staId the index (starting at 0) of the non-AP MLD generating/receiving packets
97 * @param count the number of packets to generate
98 * @param pktSize the size of the packets to generate
99 * @return an application generating the given number packets of the given size from/to the
100 * AP MLD to/from the given non-AP MLD
101 */
103 std::size_t staId,
104 std::size_t count,
105 std::size_t pktSize) const;
106
107 /**
108 * Check whether QoS data unicast transmissions addressed to the given destination on the
109 * given link are blocked or unblocked for the given reason on the given device.
110 *
111 * @param mac the MAC of the given device
112 * @param dest the MAC address of the given destination
113 * @param linkId the ID of the given link
114 * @param reason the reason for blocking transmissions to test
115 * @param blocked whether transmissions are blocked for the given reason
116 * @param description text indicating when this check is performed
117 * @param testUnblockedForOtherReasons whether to test if transmissions are unblocked for
118 * all the reasons other than the one provided
119 */
121 Mac48Address dest,
122 uint8_t linkId,
124 bool blocked,
125 std::string description,
126 bool testUnblockedForOtherReasons = true);
127
128 /**
129 * Check whether the MediumSyncDelay timer is running on the given link of the given device.
130 *
131 * @param staMac the MAC of the given device
132 * @param linkId the ID of the given link
133 * @param isRunning whether the MediumSyncDelay timer is running
134 * @param msg message to print in case the check failed
135 */
137 uint8_t linkId,
138 bool isRunning,
139 const std::string& msg);
140
141 /**
142 * Check whether aux PHYs of the given device are in sleep mode/awake.
143 *
144 * @param staMac the MAC of the given device
145 * @param sleep whether aux PHYs should be in sleep mode
146 */
147 void CheckAuxPhysSleepMode(Ptr<StaWifiMac> staMac, bool sleep);
148
149 void DoSetup() override;
150
151 /// Information about transmitted frames
153 {
154 Time startTx; ///< TX start time
155 WifiConstPsduMap psduMap; ///< transmitted PSDU map
156 WifiTxVector txVector; ///< TXVECTOR
157 uint8_t linkId; ///< link ID
158 uint8_t phyId; ///< ID of the transmitting PHY
159 };
160
161 uint8_t m_mainPhyId{0}; //!< ID of the main PHY
162 std::set<uint8_t> m_linksToEnableEmlsrOn; /**< IDs of the links on which EMLSR mode has to
163 be enabled */
164 std::size_t m_nEmlsrStations{1}; ///< number of stations to create that activate EMLSR
165 std::size_t m_nNonEmlsrStations{0}; /**< number of stations to create that do not
166 activate EMLSR */
167 Time m_transitionTimeout{MicroSeconds(128)}; ///< Transition Timeout advertised by the AP MLD
168 std::vector<Time> m_paddingDelay{
169 {MicroSeconds(32)}}; ///< Padding Delay advertised by the non-AP MLD
170 std::vector<Time> m_transitionDelay{
171 {MicroSeconds(16)}}; ///< Transition Delay advertised by the non-AP MLD
172 bool m_establishBaDl{false}; /**< whether BA needs to be established (for TID 0)
173 with the AP as originator */
174 bool m_establishBaUl{false}; /**< whether BA needs to be established (for TID 0)
175 with the AP as recipient */
176 bool m_putAuxPhyToSleep{false}; //!< whether aux PHYs are put to sleep during DL/UL TXOPs
177 std::vector<FrameInfo> m_txPsdus; ///< transmitted PSDUs
178 Ptr<ApWifiMac> m_apMac; ///< AP wifi MAC
179 std::vector<Ptr<StaWifiMac>> m_staMacs; ///< MACs of the non-AP MLDs
180 std::vector<PacketSocketAddress> m_dlSockets; ///< packet socket address for DL traffic
181 std::vector<PacketSocketAddress> m_ulSockets; ///< packet socket address for UL traffic
182 uint16_t m_lastAid{0}; ///< AID of last associated station
183 Time m_duration{0}; ///< simulation duration
184
185 private:
186 /**
187 * Set the SSID on the next station that needs to start the association procedure.
188 * This method is connected to the ApWifiMac's AssociatedSta trace source.
189 * Start generating traffic (if needed) when all stations are associated.
190 *
191 * @param aid the AID assigned to the previous associated STA
192 */
193 void SetSsid(uint16_t aid, Mac48Address /* addr */);
194
195 /**
196 * Start the generation of traffic (needs to be overridden)
197 */
198 virtual void StartTraffic()
199 {
200 }
201};
202
203/**
204 * @ingroup wifi-test
205 * @ingroup tests
206 *
207 * @brief Test the exchange of EML Operating Mode Notification frames.
208 *
209 * This test considers an AP MLD and a non-AP MLD with EMLSR activated. Upon association,
210 * the non-AP MLD sends an EML Operating Mode Notification frame, which is however corrupted
211 * by using a post reception error model (installed on the AP MLD). We keep corrupting the
212 * EML Notification frames transmitted by the non-AP MLD until the frame is dropped due to
213 * exceeded max retry limit. It is checked that:
214 *
215 * - the Association Request contains a Multi-Link Element including an EML Capabilities field
216 * that contains the expected values for Padding Delay and Transition Delay
217 * - the Association Response contains a Multi-Link Element including an EML Capabilities field
218 * that contains the expected value for Transition Timeout
219 * - all EML Notification frames contain the expected values for EMLSR Mode, EMLMR Mode and
220 * Link Bitmap fields and are transmitted on the link used for association
221 * - the correct EMLSR link set is stored by the EMLSR Manager, both when the transition
222 * timeout expires and when an EML Notification response is received from the AP MLD (thus,
223 * the correct EMLSR link set is stored after whichever of the two events occur first)
224 */
226{
227 public:
228 /**
229 * Constructor
230 *
231 * @param linksToEnableEmlsrOn IDs of links on which EMLSR mode should be enabled
232 * @param transitionTimeout the Transition Timeout advertised by the AP MLD
233 */
234 EmlOmnExchangeTest(const std::set<uint8_t>& linksToEnableEmlsrOn, Time transitionTimeout);
235 ~EmlOmnExchangeTest() override = default;
236
237 protected:
238 void DoSetup() override;
239 void DoRun() override;
240 void Transmit(Ptr<WifiMac> mac,
241 uint8_t phyId,
242 WifiConstPsduMap psduMap,
243 WifiTxVector txVector,
244 double txPowerW) override;
245
246 /**
247 * Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU.
248 *
249 * @param mpdu the acknowledged MPDU
250 */
251 void TxOk(Ptr<const WifiMpdu> mpdu);
252 /**
253 * Callback invoked when the non-AP MLD drops the given MPDU for the given reason.
254 *
255 * @param reason the reason why the MPDU was dropped
256 * @param mpdu the dropped MPDU
257 */
259
260 /**
261 * Check the content of the EML Capabilities subfield of the Multi-Link Element included
262 * in the Association Request frame sent by the non-AP MLD.
263 *
264 * @param mpdu the MPDU containing the Association Request frame
265 * @param txVector the TXVECTOR used to transmit the frame
266 * @param linkId the ID of the link on which the frame was transmitted
267 */
269 const WifiTxVector& txVector,
270 uint8_t linkId);
271 /**
272 * Check the content of the EML Capabilities subfield of the Multi-Link Element included
273 * in the Association Response frame sent by the AP MLD to the EMLSR client.
274 *
275 * @param mpdu the MPDU containing the Association Response frame
276 * @param txVector the TXVECTOR used to transmit the frame
277 * @param linkId the ID of the link on which the frame was transmitted
278 */
280 const WifiTxVector& txVector,
281 uint8_t linkId);
282 /**
283 * Check the content of a received EML Operating Mode Notification frame.
284 *
285 * @param psdu the PSDU containing the EML Operating Mode Notification frame
286 * @param txVector the TXVECTOR used to transmit the frame
287 * @param linkId the ID of the link on which the frame was transmitted
288 */
290 const WifiTxVector& txVector,
291 uint8_t linkId);
292 /**
293 * Check that the EMLSR mode has been enabled on the expected EMLSR links.
294 */
295 void CheckEmlsrLinks();
296
297 private:
298 std::size_t m_checkEmlsrLinksCount; /**< counter for the number of times CheckEmlsrLinks
299 is called (should be two: when the transition
300 timeout expires and when the EML Notification
301 response from the AP MLD is received */
302 std::size_t m_emlNotificationDroppedCount; /**< counter for the number of times the EML
303 Notification frame sent by the non-AP MLD
304 has been dropped due to max retry limit */
305 Ptr<ListErrorModel> m_errorModel; ///< error rate model to corrupt packets at AP MLD
306 std::list<uint64_t> m_uidList; ///< list of UIDs of packets to corrupt
307};
308
309/**
310 * @ingroup wifi-test
311 * @ingroup tests
312 *
313 * @brief Test the transmission of DL frames to EMLSR clients.
314 *
315 * This test considers an AP MLD and a configurable number of non-AP MLDs that support EMLSR
316 * and a configurable number of non-AP MLDs that do not support EMLSR. All MLDs have three
317 * setup links, while the set of EMLSR links for the EMLSR clients is configurable.
318 * Block ack agreements (for TID 0, with the AP MLD as originator) are established with all
319 * the non-AP MLDs before that EMLSR clients send the EML Operating Mode Notification frame
320 * to enable the EMLSR mode on their EMLSR links.
321 *
322 * Before enabling EMLSR mode, it is checked that:
323 *
324 * - all EMLSR links (but the link used for ML setup) of the EMLSR clients are considered to
325 * be in power save mode and are blocked by the AP MLD; all the other links have transitioned
326 * to active mode and are not blocked
327 * - no MU-RTS Trigger Frame is sent as Initial control frame
328 * - In case of EMLSR clients having no link that is not an EMLSR link and is different than
329 * the link used for ML setup, the two A-MPDUs used to trigger BA establishment are
330 * transmitted one after another on the link used for ML setup. Otherwise, the two A-MPDUs
331 * are sent concurrently on two distinct links
332 *
333 * After enabling EMLSR mode, it is checked that:
334 *
335 * - all EMLSR links of the EMLSR clients are considered to be in active mode and are not
336 * blocked by the AP MLD
337 * - If all setup links are EMLSR links, the first two frame exchanges are both protected by
338 * MU-RTS TF and occur one after another. Otherwise, one frame exchange occurs on the
339 * non-EMLSR link and is not protected by MU-RTS TF; the other frame exchange occurs on an
340 * EMLSR link and is protected by MU-RTS TF
341 * - the AP MLD blocks transmission on all other EMLSR links when sending an ICF to an EMLSR client
342 * - After completing a frame exchange with an EMLSR client, the AP MLD can start another frame
343 * exchange with that EMLSR client within the same TXOP (after a SIFS) without sending an ICF
344 * - During the transition delay, all EMLSR links are not used for DL transmissions
345 * - The padding added to Initial Control frames is the largest among all the EMLSR clients
346 * solicited by the ICF
347 *
348 * After disabling EMLSR mode, it is checked that:
349 *
350 * - all EMLSR links (but the link used to exchange EML Notification frames) of the EMLSR clients
351 * are considered to be in power save mode and are blocked by the AP MLD
352 * - an MU-RTS Trigger Frame is sent by the AP MLD as ICF for sending the EML Notification
353 * response, unless the link used to exchange EML Notification frames is a non-EMLSR link
354 * - no MU-RTS Trigger Frame is used as ICF for QoS data frames
355 * - In case of EMLSR clients having no link that is not an EMLSR link and is different than
356 * the link used to exchange EML Notification frames, the two A-MPDUs are transmitted one
357 * after another on the link used to exchange EML Notification frames. Otherwise, the two
358 * A-MPDUs are sent concurrently on two distinct links
359 *
360 * Also, if the PutAuxPhyToSleep attribute is set to true, it is checked that aux PHYs are in
361 * sleep mode after receiving an ICF and are resumed from sleep after receiving the CF-End frame.
362 */
364{
365 public:
366 /**
367 * Parameters for the EMLSR DL TXOP test
368 */
369 struct Params
370 {
371 std::size_t nEmlsrStations; //!< number of non-AP MLDs that support EMLSR
372 std::size_t nNonEmlsrStations; //!< number of non-AP MLDs that do not support EMLSR
373 std::set<uint8_t>
374 linksToEnableEmlsrOn; //!< IDs of links on which EMLSR mode should be enabled
375 std::vector<Time> paddingDelay; //!< vector (whose size equals <i>nEmlsrStations</i>) of the
376 //!< padding delay values advertised by non-AP MLDs
377 std::vector<Time>
378 transitionDelay; //!< vector (whose size equals <i>nEmlsrStations</i>) of
379 //!< transition the delay values advertised by non-AP MLDs
380 Time transitionTimeout; //!< the Transition Timeout advertised by the AP MLD
381 bool putAuxPhyToSleep; //!< whether aux PHYs are put to sleep during DL/UL TXOPs
382 };
383
384 /**
385 * Constructor
386 *
387 * @param params parameters for the EMLSR DL TXOP test
388 */
389 EmlsrDlTxopTest(const Params& params);
390 ~EmlsrDlTxopTest() override = default;
391
392 protected:
393 void DoSetup() override;
394 void DoRun() override;
395 void Transmit(Ptr<WifiMac> mac,
396 uint8_t phyId,
397 WifiConstPsduMap psduMap,
398 WifiTxVector txVector,
399 double txPowerW) override;
400
401 /**
402 * Check that the simulation produced the expected results.
403 */
404 void CheckResults();
405
406 /**
407 * Check that the AP MLD considers the correct Power Management mode for the links setup
408 * with the given non-AP MLD. This method is intended to be called shortly after ML setup.
409 *
410 * @param address a link address of the given non-AP MLD
411 */
412 void CheckPmModeAfterAssociation(const Mac48Address& address);
413
414 /**
415 * Check that appropriate actions are taken when the AP MLD transmits an EML Operating Mode
416 * Notification response frame to an EMLSR client on the given link.
417 *
418 * @param mpdu the MPDU carrying the EML Operating Mode Notification frame
419 * @param txVector the TXVECTOR used to send the PPDU
420 * @param linkId the ID of the given link
421 */
423 const WifiTxVector& txVector,
424 uint8_t linkId);
425
426 /**
427 * Check that appropriate actions are taken when an EMLSR client transmits an EML Operating
428 * Mode Notification frame to the AP MLD on the given link.
429 *
430 * @param mpdu the MPDU carrying the EML Operating Mode Notification frame
431 * @param txVector the TXVECTOR used to send the PPDU
432 * @param linkId the ID of the given link
433 */
435 const WifiTxVector& txVector,
436 uint8_t linkId);
437
438 /**
439 * Check that appropriate actions are taken by the AP MLD transmitting an initial
440 * Control frame to an EMLSR client on the given link.
441 *
442 * @param mpdu the MPDU carrying the MU-RTS TF
443 * @param txVector the TXVECTOR used to send the PPDU
444 * @param linkId the ID of the given link
445 */
447 const WifiTxVector& txVector,
448 uint8_t linkId);
449
450 /**
451 * Check that appropriate actions are taken by the AP MLD transmitting a PPDU containing
452 * QoS data frames to EMLSR clients on the given link.
453 *
454 * @param psduMap the PSDU(s) carrying QoS data frames
455 * @param txVector the TXVECTOR used to send the PPDU
456 * @param linkId the ID of the given link
457 */
458 void CheckQosFrames(const WifiConstPsduMap& psduMap,
459 const WifiTxVector& txVector,
460 uint8_t linkId);
461
462 /**
463 * Check that appropriate actions are taken by the AP MLD receiving a PPDU containing
464 * BlockAck frames from EMLSR clients on the given link.
465 *
466 * @param psduMap the PSDU carrying BlockAck frames
467 * @param txVector the TXVECTOR used to send the PPDU
468 * @param phyId the ID of the PHY transmitting the PSDU(s)
469 */
470 void CheckBlockAck(const WifiConstPsduMap& psduMap,
471 const WifiTxVector& txVector,
472 uint8_t phyId);
473
474 private:
475 void StartTraffic() override;
476
477 /**
478 * Enable EMLSR mode on the next EMLSR client
479 */
480 void EnableEmlsrMode();
481
482 std::set<uint8_t> m_emlsrLinks; /**< IDs of the links on which EMLSR mode has to be enabled */
483 Time m_emlsrEnabledTime; //!< when EMLSR mode has been enabled on all EMLSR clients
484 const Time m_fe2to3delay; /**< time interval between 2nd and 3rd frame exchange sequences
485 after the enablement of EMLSR mode */
486 std::size_t m_countQoSframes; //!< counter for QoS frames (transition delay test)
487 std::size_t m_countBlockAck; //!< counter for BlockAck frames (transition delay test)
488 Ptr<ListErrorModel> m_errorModel; ///< error rate model to corrupt BlockAck at AP MLD
489};
490
491/**
492 * @ingroup wifi-test
493 * @ingroup tests
494 *
495 * @brief Test the transmission of UL frames from EMLSR clients.
496 *
497 * This test considers an AP MLD and a non-AP MLD that support EMLSR. The non-AP MLD setups three
498 * links, while the set of EMLSR links is configurable. Block ack agreements (for TID 0) for both
499 * DL and UL directions are established after that the EML Operating Mode Notification frames are
500 * exchanged to enable the EMLSR mode on the EMLSR links. Aux PHYs on the EMLSR client do not
501 * switch link, hence the main PHY will switch link (if needed) when terminating a TXOP.
502 *
503 * It is checked that:
504 *
505 * - Initially, aux PHYs are configured so that they are unable to transmit frames. Before
506 * generating the packets for the first UL data frame, transmissions on the link where the
507 * main PHY is operating and on the non-EMLSR link (if any) are blocked. Thus, the first UL data
508 * frame is held until transmissions on the link where the main PHY is operating are unblocked.
509 * The first UL data frame is sent by the main PHY without RTS protection. When the data frame
510 * exchange terminates, the MediumSyncDelay timer is started on the other EMLSR links and the
511 * CCA ED threshold is set as expected
512 * - If there is a non-EMLSR link, another data frame can be sent concurrently (without protection)
513 * on the non-EMLSR link
514 * - When the first UL data frame is transmitted, we make the aux PHYs on the EMLSR client capable
515 * of transmitting, we block transmissions on the link where the main PHY is operating and
516 * generate new UL packets, which will then be transmitted on a link where an aux PHY is
517 * operating. Thus, the aux PHY transmits an RTS frame and the main PHY will take over and
518 * transmit the second UL data frame. We check that, while the link on which the main PHY was
519 * operating is blocked because another EMLSR link is being used, new backoff values for that
520 * link are generated if and only if the QosTxop::GenerateBackoffIfTxopWithoutTx attribute is
521 * true; otherwise, a new backoff value is generated when the link is unblocked.
522 * - When the exchange of the second UL data frame terminates, we make the aux PHY unable to
523 * transmit, block transmissions on the non-EMLSR link (if any) and generate some more UL
524 * packets, which will then be transmitted by the main PHY. However, a MediumSyncDelay timer
525 * is now running on the link where the main PHY is operating, hence transmissions are protected
526 * by an RTS frame. We install a post reception error model on the AP MLD so that all RTS frames
527 * sent by the EMLSR client are not received by the AP MLD. We check that the EMLSR client makes
528 * at most the configured max number of transmission attempts and that another UL data frame is
529 * sent once the MediumSyncDelay timer is expired. We also check that the TX width of the RTS
530 * frames and the UL data frame equal the channel width used by the main PHY.
531 * - We check that no issue arises in case an aux PHY sends an RTS frame but the CTS response is
532 * not transmitted successfully. Specifically, we check that the main PHY is completing the
533 * channel switch when the (unsuccessful) reception of the CTS ends and that a new RTS/CTS
534 * exchange is carried out to protect the transmission of the last data frame.
535 * - While the main PHY is operating on the same link as an aux PHY (which does not switch
536 * channel), the aux PHY is put in sleep mode as soon as the main PHY starts operating on the
537 * link, stays in sleep mode until the TXOP ends and is resumed from sleep mode right after the
538 * end of the DL/UL TXOP.
539 * - When an aux PHY that is not TX capable gains a TXOP, it checks whether the main PHY can switch
540 * to the auxiliary link a start an UL TXOP. If the main PHY is switching, the aux PHY waits
541 * until the channel switch is completed and checks again; if the remaining backoff time on the
542 * preferred link is greater than the channel switch delay, the main PHY is requested to switch to
543 * the auxiliary link of the aux PHY. When the channel switch is completed, if the medium is
544 * idle on the auxiliary link and the backoff is zero, the main PHY starts an UL TXOP after a
545 * PIFS period; otherwise, the main PHY starts an UL TXOP when the backoff timer counts down to
546 * zero. The QoS data frame sent by the main PHY is not protected by RTS and the bandwidth it
547 * occupies is not affected by possible limitations on the aux PHY TX bandwidth capabilities.
548 *
549 * Also, if the PutAuxPhyToSleep attribute is set to true, it is checked that aux PHYs are in
550 * sleep mode a SIFS after receiving the ICF and are still in sleep mode right before receiving
551 * a Block Ack frame, and they are resumed from sleep after receiving the Block Ack frame.
552 */
554{
555 public:
556 /**
557 * Parameters for the EMLSR UL TXOP test
558 */
559 struct Params
560 {
561 std::set<uint8_t>
562 linksToEnableEmlsrOn; //!< IDs of links on which EMLSR mode should be enabled
563 MHz_u channelWidth; //!< width of the channels used by MLDs
564 MHz_u auxPhyChannelWidth; //!< max width supported by aux PHYs
565 Time mediumSyncDuration; //!< duration of the MediumSyncDelay timer
566 uint8_t msdMaxNTxops; //!< Max number of TXOPs that an EMLSR client is allowed
567 //!< to attempt to initiate while the MediumSyncDelay
568 //!< timer is running (zero indicates no limit)
569 bool genBackoffAndUseAuxPhyCca; //!< this variable controls two boolean values that are
570 //!< either both set to true or both set to false;
571 //!< the first value controls whether the backoff should be
572 //!< invoked when the AC gains the right to start a TXOP
573 //!< but it does not transmit any frame, the second value
574 //!< controls whether CCA info from aux PHY is used when
575 //!< aux PHY is not TX capable
576 uint8_t nSlotsLeftAlert; //!< value to set the ChannelAccessManager NSlotsLeft
577 //!< attribute to
578 bool putAuxPhyToSleep; //!< whether aux PHYs are put to sleep during DL/UL TXOPs
579 };
580
581 /**
582 * Constructor
583 *
584 * @param params parameters for the EMLSR UL TXOP test
585 */
586 EmlsrUlTxopTest(const Params& params);
587 ~EmlsrUlTxopTest() override = default;
588
589 protected:
590 void DoSetup() override;
591 void DoRun() override;
592 void Transmit(Ptr<WifiMac> mac,
593 uint8_t phyId,
594 WifiConstPsduMap psduMap,
595 WifiTxVector txVector,
596 double txPowerW) override;
597
598 /**
599 * Check that the simulation produced the expected results.
600 */
601 void CheckResults();
602
603 /**
604 * Check that appropriate actions are taken by the EMLSR client when transmitting an RTS
605 * frame on the given link.
606 *
607 * @param mpdu the MPDU carrying the RTS frame
608 * @param txVector the TXVECTOR used to send the PPDU
609 * @param linkId the ID of the given link
610 */
611 void CheckRtsFrames(Ptr<const WifiMpdu> mpdu, const WifiTxVector& txVector, uint8_t linkId);
612
613 /**
614 * Check that appropriate actions are taken by the EMLSR client when receiving a CTS
615 * frame on the given link.
616 *
617 * @param mpdu the MPDU carrying the CTS frame
618 * @param txVector the TXVECTOR used to send the PPDU
619 * @param linkId the ID of the given link
620 */
621 void CheckCtsFrames(Ptr<const WifiMpdu> mpdu, const WifiTxVector& txVector, uint8_t linkId);
622
623 /**
624 * Check that appropriate actions are taken when an MLD transmits a PPDU containing
625 * QoS data frames on the given link.
626 *
627 * @param psduMap the PSDU(s) carrying QoS data frames
628 * @param txVector the TXVECTOR used to send the PPDU
629 * @param linkId the ID of the given link
630 */
631 void CheckQosFrames(const WifiConstPsduMap& psduMap,
632 const WifiTxVector& txVector,
633 uint8_t linkId);
634
635 /**
636 * Check that appropriate actions are taken when an MLD transmits a PPDU containing
637 * BlockAck frames on the given link.
638 *
639 * @param psduMap the PSDU carrying BlockAck frames
640 * @param txVector the TXVECTOR used to send the PPDU
641 * @param linkId the ID of the given link
642 */
643 void CheckBlockAck(const WifiConstPsduMap& psduMap,
644 const WifiTxVector& txVector,
645 uint8_t linkId);
646
647 private:
648 void StartTraffic() override;
649
650 /**
651 * Callback invoked when a new backoff value is generated by the EMLSR client.
652 *
653 * @param backoff the generated backoff value
654 * @param linkId the ID of the link for which the backoff value has been generated
655 */
656 void BackoffGenerated(uint32_t backoff, uint8_t linkId);
657
658 std::set<uint8_t> m_emlsrLinks; /**< IDs of the links on which EMLSR mode has to be enabled */
659 MHz_u m_channelWidth; //!< width of the channels used by MLDs
660 MHz_u m_auxPhyChannelWidth; //!< max width supported by aux PHYs
661 Time m_mediumSyncDuration; //!< duration of the MediumSyncDelay timer
662 uint8_t m_msdMaxNTxops; //!< Max number of TXOPs that an EMLSR client is allowed
663 //!< to attempt to initiate while the MediumSyncDelay
664 //!< timer is running (zero indicates no limit)
665 std::optional<uint8_t> m_nonEmlsrLink; //!< ID of the non-EMLSR link (if any)
666 Time m_emlsrEnabledTime; //!< when EMLSR mode has been enabled on all EMLSR clients
667 Time m_firstUlPktsGenTime; //!< generation time of the first two UL packets
668 const Time m_unblockMainPhyLinkDelay; //!< delay between the time the first two UL packets are
669 //!< generated and the time transmissions are unblocked
670 //!< on the link where the main PHY is operating on
671 Time m_lastMsdExpiryTime; //!< expiry time of the last MediumSyncDelay timer
672 bool m_checkBackoffStarted; //!< whether we are checking the generated backoff values
673 std::optional<Time> m_backoffEndTime; //!< expected backoff end time on main PHY link
674 Ptr<ListErrorModel> m_errorModel; ///< error rate model to corrupt packets
675 std::size_t m_countQoSframes; //!< counter for QoS frames
676 std::size_t m_countBlockAck; //!< counter for BlockAck frames
677 std::size_t m_countRtsframes; //!< counter for RTS frames
678 bool m_genBackoffIfTxopWithoutTx; //!< whether the backoff should be invoked when the AC
679 //!< gains the right to start a TXOP but it does not
680 //!< transmit any frame
681 bool m_useAuxPhyCca; //!< whether CCA info from aux PHY is used when
682 //!< aux PHY is not TX capable
683 uint8_t m_nSlotsLeftAlert; //!< value for ChannelAccessManager NSlotsLeft attribute
684 std::optional<bool> m_corruptCts; //!< whether the transmitted CTS must be corrupted
685 Time m_5thQosFrameTxTime; //!< start transmission time of the 5th QoS data frame
686};
687
688/**
689 * @ingroup wifi-test
690 * @ingroup tests
691 *
692 * @brief Check UL OFDMA operations with EMLSR clients.
693 *
694 * This test considers an AP MLD and an EMLSR client and a non-AP MLD that setup three links with
695 * the AP MLD. Once block ack agreements (for TID 0) are established for the UL direction, the
696 * AP MLD starts requesting channel access (on all the links) through the Multi-User scheduler.
697 * Given that links are idle, AP MLD accesses the channel on all the links and concurrently sends
698 * Trigger Frames. When the transmission of the first Trigger Frame is over, a client application
699 * on the EMLSR client generates two packets addressed to the AP MLD.
700 *
701 * It is checked that:
702 * - when sending BSRP TF is disabled, the first Trigger Frame sent is an MU-RTS; otherwise, it is
703 * a BSRP Trigger Frame. In both cases, such Trigger Frame acts as an ICF for the EMLSR client
704 * - the other Trigger Frames sent concurrently with the ICF only solicit the non-EMLSR client
705 * (AP MLD has blocked transmissions to the EMLSR client upon preparing the first Trigger Frame)
706 * - the buffer status reported in QoS Null frames is as expected
707 * - the EMLSR client sends a QoS Data frame in a TB PPDU
708 */
710{
711 public:
712 /**
713 * Constructor
714 *
715 * @param enableBsrp whether MU scheduler sends BSRP TFs
716 */
717 EmlsrUlOfdmaTest(bool enableBsrp);
718
719 protected:
720 void DoSetup() override;
721 void DoRun() override;
722 void Transmit(Ptr<WifiMac> mac,
723 uint8_t phyId,
724 WifiConstPsduMap psduMap,
725 WifiTxVector txVector,
726 double txPowerW) override;
727
728 /**
729 * Check that the simulation produced the expected results.
730 */
731 void CheckResults();
732
733 private:
734 void StartTraffic() override;
735
736 bool m_enableBsrp; //!< whether MU scheduler sends BSRP TFs
737 std::size_t m_txPsdusPos; //!< position in the vector of TX PSDUs of the first ICF
738 Time m_startAccessReq; //!< start time of the first AP MLD access request via MU scheduler
739};
740
741/**
742 * @ingroup wifi-test
743 * @ingroup tests
744 *
745 * @brief Test the switching of PHYs on EMLSR clients.
746 *
747 * An AP MLD and an EMLSR client setup 3 links, on which EMLSR mode is enabled. The AP MLD
748 * transmits 4 QoS data frames (one after another, each protected by ICF):
749 *
750 * - the first one on the link used for ML setup, hence no PHY switch occurs
751 * - the second one on another link, thus causing the main PHY to switch link
752 * - the third one on the remaining link, thus causing the main PHY to switch link again
753 * - the fourth one on the link used for ML setup
754 *
755 * Afterwards, the EMLSR client transmits 2 QoS data frames; the first one on the link used for
756 * ML setup (hence, no RTS is sent), the second one on another link.
757 */
759{
760 public:
761 /**
762 * Parameters for the EMLSR link switching test
763 */
764 struct Params
765 {
766 bool
767 switchAuxPhy; //!< whether AUX PHY should switch channel to operate on the link on which
768 //!< the Main PHY was operating before moving to the link of the Aux PHY
769 bool resetCamStateAndInterruptSwitch; //!< this variable controls two boolean values that
770 //!< are either both set to true or both set to false;
771 //!< the first value controls whether to reset the
772 //!< state of the ChannelAccessManager associated
773 //!< with the link on which the main PHY has just
774 //!< switched to, the second value controls whether
775 //!< a main PHY channel switch can be interrupted
776 MHz_u auxPhyMaxChWidth; //!< max channel width (MHz) supported by aux PHYs
777 };
778
779 /**
780 * Constructor
781 *
782 * @param params parameters for the EMLSR link switching test
783 */
784 EmlsrLinkSwitchTest(const Params& params);
785
786 ~EmlsrLinkSwitchTest() override = default;
787
788 protected:
789 void DoSetup() override;
790 void DoRun() override;
791 void Transmit(Ptr<WifiMac> mac,
792 uint8_t phyId,
793 WifiConstPsduMap psduMap,
794 WifiTxVector txVector,
795 double txPowerW) override;
796
797 /**
798 * Check that the simulation produced the expected results.
799 */
800 void CheckResults();
801
802 /**
803 * Check that the Main PHY (and possibly the Aux PHY) correctly switches channel when the
804 * reception of an ICF ends.
805 *
806 * @param psduMap the PSDU carrying the MU-RTS TF
807 * @param txVector the TXVECTOR used to send the PPDU
808 * @param linkId the ID of the given link
809 */
810 void CheckInitialControlFrame(const WifiConstPsduMap& psduMap,
811 const WifiTxVector& txVector,
812 uint8_t linkId);
813
814 /**
815 * Check that appropriate actions are taken by the AP MLD transmitting a PPDU containing
816 * QoS data frames to the EMLSR client on the given link.
817 *
818 * @param psduMap the PSDU(s) carrying QoS data frames
819 * @param txVector the TXVECTOR used to send the PPDU
820 * @param linkId the ID of the given link
821 */
822 void CheckQosFrames(const WifiConstPsduMap& psduMap,
823 const WifiTxVector& txVector,
824 uint8_t linkId);
825
826 /**
827 * Check that appropriate actions are taken by the EMLSR client transmitting a PPDU containing
828 * an RTS frame to the AP MLD on the given link.
829 *
830 * @param psduMap the PSDU carrying RTS frame
831 * @param txVector the TXVECTOR used to send the PPDU
832 * @param linkId the ID of the given link
833 */
834 void CheckRtsFrame(const WifiConstPsduMap& psduMap,
835 const WifiTxVector& txVector,
836 uint8_t linkId);
837
838 private:
839 bool m_switchAuxPhy; /**< whether AUX PHY should switch channel to operate on the link on which
840 the Main PHY was operating before moving to the link of Aux PHY */
841 bool
842 m_resetCamStateAndInterruptSwitch; /**< whether to reset the state of the
843 ChannelAccessManager associated with the link on which the main PHY
844 has just switched to and whether main PHY switch can be interrupted */
845 MHz_u m_auxPhyMaxChWidth; //!< max channel width (MHz) supported by aux PHYs
846 std::size_t m_countQoSframes; //!< counter for QoS data frames
847 std::size_t m_countIcfFrames; //!< counter for ICF frames
848 std::size_t m_countRtsFrames; //!< counter for RTS frames
849 std::size_t m_txPsdusPos; //!< position in the vector of TX PSDUs of the first ICF
850 Ptr<ListErrorModel> m_errorModel; ///< error rate model to corrupt packets at AP MLD
851};
852
853/**
854 * @ingroup wifi-test
855 * @ingroup tests
856 *
857 * @brief wifi EMLSR Test Suite
858 */
860{
861 public:
863};
864
865/**
866 * @ingroup wifi-test
867 * @ingroup tests
868 *
869 * @brief Test CCA busy notifications on EMLSR clients.
870 *
871 * SwitchAuxPhy is set to true, so that the aux PHY starts switching when the main PHY switch is
872 * completed.
873 *
874 * - Main PHY switches to a link on which an aux PHY is operating. Right after the start of the
875 * channel switch, the AP transmits a frame to another device on the aux PHY link. Verify that,
876 * once the main PHY is operating on the new link, the channel access manager on that link is
877 * notified of CCA busy until the end of the transmission
878 * - When the main PHY switch is completed, the aux PHY switches to a link on which no PHY is
879 * operating. Before the aux PHY starts switching, the AP starts transmitting a frame to another
880 * device on the link on which no PHY is operating. Verify that, once the aux PHY is operating
881 * on the new link, the channel access manager on that link is notified of CCA busy until the
882 * end of the transmission
883 */
885{
886 public:
887 /**
888 * Constructor
889 *
890 * @param auxPhyMaxChWidth max channel width (MHz) supported by aux PHYs
891 */
892 EmlsrCcaBusyTest(uint16_t auxPhyMaxChWidth);
893
894 ~EmlsrCcaBusyTest() override = default;
895
896 protected:
897 void DoSetup() override;
898 void DoRun() override;
899
900 private:
901 void StartTraffic() override;
902
903 /**
904 * Make the other MLD transmit a packet to the AP on the given link.
905 *
906 * @param linkId the ID of the given link
907 */
908 void TransmitPacketToAp(uint8_t linkId);
909
910 /**
911 * Perform checks after that the preamble of the first PPDU has been received.
912 */
913 void CheckPoint1();
914
915 /**
916 * Perform checks after that the main PHY completed the link switch.
917 */
918 void CheckPoint2();
919
920 /**
921 * Perform checks after that the aux PHY completed the link switch.
922 */
923 void CheckPoint3();
924
925 uint16_t m_auxPhyMaxChWidth; //!< max channel width (MHz) supported by aux PHYs
926 Time m_channelSwitchDelay; //!< the PHY channel switch delay
927 uint8_t m_currMainPhyLinkId; //!< the ID of the link the main PHY switches from
928 uint8_t m_nextMainPhyLinkId; //!< the ID of the link the main PHY switches to
929};
930
931#endif /* WIFI_EMLSR_TEST_H */
Test the exchange of EML Operating Mode Notification frames.
void CheckEmlCapabilitiesInAssocResp(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check the content of the EML Capabilities subfield of the Multi-Link Element included in the Associat...
void TxOk(Ptr< const WifiMpdu > mpdu)
Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU.
std::list< uint64_t > m_uidList
list of UIDs of packets to corrupt
std::size_t m_checkEmlsrLinksCount
counter for the number of times CheckEmlsrLinks is called (should be two: when the transition timeout...
Ptr< ListErrorModel > m_errorModel
error rate model to corrupt packets at AP MLD
void DoSetup() override
Implementation to do any local setup required for this TestCase.
EmlOmnExchangeTest(const std::set< uint8_t > &linksToEnableEmlsrOn, Time transitionTimeout)
Constructor.
std::size_t m_emlNotificationDroppedCount
counter for the number of times the EML Notification frame sent by the non-AP MLD has been dropped du...
void CheckEmlsrLinks()
Check that the EMLSR mode has been enabled on the expected EMLSR links.
void CheckEmlCapabilitiesInAssocReq(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check the content of the EML Capabilities subfield of the Multi-Link Element included in the Associat...
~EmlOmnExchangeTest() override=default
void TxDropped(WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
Callback invoked when the non-AP MLD drops the given MPDU for the given reason.
void CheckEmlNotification(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint8_t linkId)
Check the content of a received EML Operating Mode Notification frame.
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.
Test EML Operating Mode Notification frame serialization and deserialization.
void DoRun() override
Implementation to actually run this TestCase.
~EmlOperatingModeNotificationTest() override=default
Test CCA busy notifications on EMLSR clients.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint8_t m_nextMainPhyLinkId
the ID of the link the main PHY switches to
uint8_t m_currMainPhyLinkId
the ID of the link the main PHY switches from
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
EmlsrCcaBusyTest(uint16_t auxPhyMaxChWidth)
Constructor.
~EmlsrCcaBusyTest() override=default
void TransmitPacketToAp(uint8_t linkId)
Make the other MLD transmit a packet to the AP on the given link.
uint16_t m_auxPhyMaxChWidth
max channel width (MHz) supported by aux PHYs
void DoRun() override
Implementation to actually run this TestCase.
Time m_channelSwitchDelay
the PHY channel switch delay
void CheckPoint1()
Perform checks after that the preamble of the first PPDU has been received.
void CheckPoint3()
Perform checks after that the aux PHY completed the link switch.
void CheckPoint2()
Perform checks after that the main PHY completed the link switch.
Test the transmission of DL frames to EMLSR clients.
void CheckInitialControlFrame(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken by the AP MLD transmitting an initial Control frame to an EM...
const Time m_fe2to3delay
time interval between 2nd and 3rd frame exchange sequences after the enablement of EMLSR mode
void CheckResults()
Check that the simulation produced the expected results.
void CheckPmModeAfterAssociation(const Mac48Address &address)
Check that the AP MLD considers the correct Power Management mode for the links setup with the given ...
EmlsrDlTxopTest(const Params &params)
Constructor.
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
Ptr< ListErrorModel > m_errorModel
error rate model to corrupt BlockAck at AP MLD
void CheckStaEmlNotificationFrame(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken when an EMLSR client transmits an EML Operating Mode Notific...
std::size_t m_countQoSframes
counter for QoS frames (transition delay test)
void CheckApEmlNotificationFrame(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken when the AP MLD transmits an EML Operating Mode Notification...
~EmlsrDlTxopTest() override=default
Time m_emlsrEnabledTime
when EMLSR mode has been enabled on all EMLSR clients
std::set< uint8_t > m_emlsrLinks
IDs of the links on which EMLSR mode has to be enabled.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void CheckQosFrames(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken by the AP MLD transmitting a PPDU containing QoS data frames...
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 EnableEmlsrMode()
Enable EMLSR mode on the next EMLSR client.
void CheckBlockAck(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t phyId)
Check that appropriate actions are taken by the AP MLD receiving a PPDU containing BlockAck frames fr...
void DoRun() override
Implementation to actually run this TestCase.
std::size_t m_countBlockAck
counter for BlockAck frames (transition delay test)
Base class for EMLSR Operations tests.
std::size_t m_nNonEmlsrStations
number of stations to create that do not activate EMLSR
void SetSsid(uint16_t aid, Mac48Address)
Set the SSID on the next station that needs to start the association procedure.
bool m_establishBaDl
whether BA needs to be established (for TID 0) with the AP as originator
void CheckBlockedLink(Ptr< WifiMac > mac, Mac48Address dest, uint8_t linkId, WifiQueueBlockedReason reason, bool blocked, std::string description, bool testUnblockedForOtherReasons=true)
Check whether QoS data unicast transmissions addressed to the given destination on the given link are...
std::size_t m_nEmlsrStations
number of stations to create that activate EMLSR
std::vector< PacketSocketAddress > m_dlSockets
packet socket address for DL traffic
std::vector< Time > m_paddingDelay
Padding Delay advertised by the non-AP MLD.
std::set< uint8_t > m_linksToEnableEmlsrOn
IDs of the links on which EMLSR mode has to be enabled.
Ptr< ApWifiMac > m_apMac
AP wifi MAC.
~EmlsrOperationsTestBase() override=default
bool m_putAuxPhyToSleep
whether aux PHYs are put to sleep during DL/UL TXOPs
TrafficDirection
Enumeration for traffic directions.
void CheckMsdTimerRunning(Ptr< StaWifiMac > staMac, uint8_t linkId, bool isRunning, const std::string &msg)
Check whether the MediumSyncDelay timer is running on the given link of the given device.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint8_t m_mainPhyId
ID of the main PHY.
Time m_duration
simulation duration
std::vector< FrameInfo > m_txPsdus
transmitted PSDUs
Ptr< PacketSocketClient > GetApplication(TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const
virtual void Transmit(Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when a FEM passes PSDUs to the PHY.
bool m_establishBaUl
whether BA needs to be established (for TID 0) with the AP as recipient
uint16_t m_lastAid
AID of last associated station.
std::vector< Time > m_transitionDelay
Transition Delay advertised by the non-AP MLD.
Time m_transitionTimeout
Transition Timeout advertised by the AP MLD.
std::vector< PacketSocketAddress > m_ulSockets
packet socket address for UL traffic
void CheckAuxPhysSleepMode(Ptr< StaWifiMac > staMac, bool sleep)
Check whether aux PHYs of the given device are in sleep mode/awake.
std::vector< Ptr< StaWifiMac > > m_staMacs
MACs of the non-AP MLDs.
virtual void StartTraffic()
Start the generation of traffic (needs to be overridden)
EmlsrOperationsTestBase(const std::string &name)
Constructor.
Check UL OFDMA operations with EMLSR clients.
Time m_startAccessReq
start time of the first AP MLD access request via MU scheduler
void DoRun() override
Implementation to actually run this TestCase.
void CheckResults()
Check that the simulation produced the expected results.
EmlsrUlOfdmaTest(bool enableBsrp)
Constructor.
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
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 DoSetup() override
Implementation to do any local setup required for this TestCase.
bool m_enableBsrp
whether MU scheduler sends BSRP TFs
std::size_t m_txPsdusPos
position in the vector of TX PSDUs of the first ICF
Test the transmission of UL frames from EMLSR clients.
std::size_t m_countQoSframes
counter for QoS frames
Time m_emlsrEnabledTime
when EMLSR mode has been enabled on all EMLSR clients
const Time m_unblockMainPhyLinkDelay
delay between the time the first two UL packets are generated and the time transmissions are unblocke...
Ptr< ListErrorModel > m_errorModel
error rate model to corrupt packets
bool m_useAuxPhyCca
whether CCA info from aux PHY is used when aux PHY is not TX capable
Time m_5thQosFrameTxTime
start transmission time of the 5th QoS data frame
MHz_u m_auxPhyChannelWidth
max width supported by aux PHYs
void BackoffGenerated(uint32_t backoff, uint8_t linkId)
Callback invoked when a new backoff value is generated by the EMLSR client.
std::optional< uint8_t > m_nonEmlsrLink
ID of the non-EMLSR link (if any)
Time m_lastMsdExpiryTime
expiry time of the last MediumSyncDelay timer
void DoSetup() override
Implementation to do any local setup required for this TestCase.
std::size_t m_countRtsframes
counter for RTS frames
void CheckCtsFrames(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken by the EMLSR client when receiving a CTS frame on the given ...
void DoRun() override
Implementation to actually run this TestCase.
Time m_firstUlPktsGenTime
generation time of the first two UL packets
std::optional< bool > m_corruptCts
whether the transmitted CTS must be corrupted
~EmlsrUlTxopTest() override=default
void CheckBlockAck(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken when an MLD transmits a PPDU containing BlockAck frames on t...
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
std::optional< Time > m_backoffEndTime
expected backoff end time on main PHY link
MHz_u m_channelWidth
width of the channels used by MLDs
std::set< uint8_t > m_emlsrLinks
IDs of the links on which EMLSR mode has to be enabled.
Time m_mediumSyncDuration
duration of the MediumSyncDelay timer
void CheckRtsFrames(Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken by the EMLSR client when transmitting an RTS frame on the gi...
void CheckQosFrames(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, uint8_t linkId)
Check that appropriate actions are taken when an MLD transmits a PPDU containing QoS data frames on t...
bool m_genBackoffIfTxopWithoutTx
whether the backoff should be invoked when the AC gains the right to start a TXOP but it does not tra...
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.
uint8_t m_nSlotsLeftAlert
value for ChannelAccessManager NSlotsLeft attribute
bool m_checkBackoffStarted
whether we are checking the generated backoff values
std::size_t m_countBlockAck
counter for BlockAck frames
void CheckResults()
Check that the simulation produced the expected results.
uint8_t m_msdMaxNTxops
Max number of TXOPs that an EMLSR client is allowed to attempt to initiate while the MediumSyncDelay ...
EmlsrUlTxopTest(const Params &params)
Constructor.
wifi EMLSR Test Suite
Subclass of TestCase class adding the ability to test the serialization and deserialization of a Head...
an EUI-48 address
Smart pointer class similar to boost::intrusive_ptr.
encapsulates test code
Definition test.h:1050
A suite of tests to run.
Definition test.h:1267
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1368
WifiMacDropReason
The reason why an MPDU was dropped.
Definition wifi-mac.h:70
WifiQueueBlockedReason
Enumeration of the reasons to block container queues.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Parameters for the EMLSR DL TXOP test.
std::vector< Time > paddingDelay
vector (whose size equals nEmlsrStations) of the padding delay values advertised by non-AP MLDs
std::size_t nNonEmlsrStations
number of non-AP MLDs that do not support EMLSR
std::set< uint8_t > linksToEnableEmlsrOn
IDs of links on which EMLSR mode should be enabled.
Time transitionTimeout
the Transition Timeout advertised by the AP MLD
bool putAuxPhyToSleep
whether aux PHYs are put to sleep during DL/UL TXOPs
std::vector< Time > transitionDelay
vector (whose size equals nEmlsrStations) of transition the delay values advertised by non-AP MLDs
std::size_t nEmlsrStations
number of non-AP MLDs that support EMLSR
Information about transmitted frames.
WifiConstPsduMap psduMap
transmitted PSDU map
uint8_t phyId
ID of the transmitting PHY.
Parameters for the EMLSR UL TXOP test.
MHz_u auxPhyChannelWidth
max width supported by aux PHYs
uint8_t msdMaxNTxops
Max number of TXOPs that an EMLSR client is allowed to attempt to initiate while the MediumSyncDelay ...
bool putAuxPhyToSleep
whether aux PHYs are put to sleep during DL/UL TXOPs
uint8_t nSlotsLeftAlert
value to set the ChannelAccessManager NSlotsLeft attribute to
Time mediumSyncDuration
duration of the MediumSyncDelay timer
std::set< uint8_t > linksToEnableEmlsrOn
IDs of links on which EMLSR mode should be enabled.
bool genBackoffAndUseAuxPhyCca
this variable controls two boolean values that are either both set to true or both set to false; the ...
MHz_u channelWidth
width of the channels used by MLDs
std::string dir
uint32_t pktSize
packet size used for the simulation (in bytes)