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