A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-emlsr-enabling-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_ENABLING_TEST_H
10#define WIFI_EMLSR_ENABLING_TEST_H
11
13
14#include <list>
15
16/**
17 * @ingroup wifi-test
18 * @ingroup tests
19 *
20 * @brief Test EML Operating Mode Notification frame serialization and deserialization
21 */
23{
24 public:
25 /**
26 * Constructor
27 */
30
31 private:
32 void DoRun() override;
33};
34
35/**
36 * @ingroup wifi-test
37 * @ingroup tests
38 *
39 * @brief Test the exchange of EML Operating Mode Notification frames.
40 *
41 * This test considers an AP MLD and a non-AP MLD with EMLSR activated. Upon association,
42 * the non-AP MLD sends an EML Operating Mode Notification frame, which is however corrupted
43 * by using a post reception error model (installed on the AP MLD). We keep corrupting the
44 * EML Notification frames transmitted by the non-AP MLD until the frame is dropped due to
45 * exceeded max retry limit. It is checked that:
46 *
47 * - the Association Request contains a Multi-Link Element including an EML Capabilities field
48 * that contains the expected values for Padding Delay and Transition Delay
49 * - the Association Response contains a Multi-Link Element including an EML Capabilities field
50 * that contains the expected value for Transition Timeout
51 * - all EML Notification frames contain the expected values for EMLSR Mode, EMLMR Mode and
52 * Link Bitmap fields and are transmitted on the link used for association
53 * - the correct EMLSR link set is stored by the EMLSR Manager, both when the transition
54 * timeout expires and when an EML Notification response is received from the AP MLD (thus,
55 * the correct EMLSR link set is stored after whichever of the two events occur first)
56 */
58{
59 public:
60 /**
61 * Constructor
62 *
63 * @param linksToEnableEmlsrOn IDs of links on which EMLSR mode should be enabled
64 * @param transitionTimeout the Transition Timeout advertised by the AP MLD
65 */
66 EmlOmnExchangeTest(const std::set<uint8_t>& linksToEnableEmlsrOn, Time transitionTimeout);
67 ~EmlOmnExchangeTest() override = default;
68
69 protected:
70 void DoSetup() override;
71 void DoRun() override;
72 void Transmit(Ptr<WifiMac> mac,
73 uint8_t phyId,
74 WifiConstPsduMap psduMap,
75 WifiTxVector txVector,
76 double txPowerW) override;
77
78 /**
79 * Callback invoked when the non-AP MLD receives the acknowledgment for a transmitted MPDU.
80 *
81 * @param mpdu the acknowledged MPDU
82 */
83 void TxOk(Ptr<const WifiMpdu> mpdu);
84 /**
85 * Callback invoked when the non-AP MLD drops the given MPDU for the given reason.
86 *
87 * @param reason the reason why the MPDU was dropped
88 * @param mpdu the dropped MPDU
89 */
91
92 /**
93 * Check the content of the EML Capabilities subfield of the Multi-Link Element included
94 * in the Association Request frame sent by the non-AP MLD.
95 *
96 * @param mpdu the MPDU containing the Association Request frame
97 * @param txVector the TXVECTOR used to transmit the frame
98 * @param linkId the ID of the link on which the frame was transmitted
99 */
101 const WifiTxVector& txVector,
102 uint8_t linkId);
103 /**
104 * Check the content of the EML Capabilities subfield of the Multi-Link Element included
105 * in the Association Response frame sent by the AP MLD to the EMLSR client.
106 *
107 * @param mpdu the MPDU containing the Association Response frame
108 * @param txVector the TXVECTOR used to transmit the frame
109 * @param linkId the ID of the link on which the frame was transmitted
110 */
112 const WifiTxVector& txVector,
113 uint8_t linkId);
114 /**
115 * Check the content of a received EML Operating Mode Notification frame.
116 *
117 * @param psdu the PSDU containing the EML Operating Mode Notification frame
118 * @param txVector the TXVECTOR used to transmit the frame
119 * @param linkId the ID of the link on which the frame was transmitted
120 */
122 const WifiTxVector& txVector,
123 uint8_t linkId);
124 /**
125 * Check that the EMLSR mode has been enabled on the expected EMLSR links.
126 */
127 void CheckEmlsrLinks();
128
129 private:
130 std::size_t m_checkEmlsrLinksCount; /**< counter for the number of times CheckEmlsrLinks
131 is called (should be two: when the transition
132 timeout expires and when the EML Notification
133 response from the AP MLD is received */
134 std::size_t m_emlNotificationDroppedCount; /**< counter for the number of times the EML
135 Notification frame sent by the non-AP MLD
136 has been dropped due to max retry limit */
137 Ptr<ListErrorModel> m_errorModel; ///< error rate model to corrupt packets at AP MLD
138 std::list<uint64_t> m_uidList; ///< list of UIDs of packets to corrupt
139};
140
141/**
142 * @ingroup wifi-test
143 * @ingroup tests
144 *
145 * @brief wifi EMLSR suite to test the procedure for enabling EMLSR mode
146 */
148{
149 public:
151};
152
153#endif /* WIFI_EMLSR_ENABLING_TEST_H */
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.
void DoRun() override
Implementation to actually run this TestCase.
~EmlOperatingModeNotificationTest() override=default
EmlsrOperationsTestBase(const std::string &name)
Constructor.
HeaderSerializationTestCase(std::string name)
Constructor.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Definition test.cc:490
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...
WifiMacDropReason
The reason why an MPDU was dropped.
Definition wifi-mac.h:71
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition wifi-ppdu.h:38