A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
common-info-basic-mle.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 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 COMMON_INFO_BASIC_MLE_H
10#define COMMON_INFO_BASIC_MLE_H
11
12#include "ns3/buffer.h"
13#include "ns3/mac48-address.h"
14#include "ns3/nstime.h"
15
16#include <cstdint>
17#include <optional>
18
19namespace ns3
20{
21
22/**
23 * Common Info field of the Basic Multi-Link element.
24 * See Sec. 9.4.2.312.2.2 of 802.11be D1.5
25 */
27{
28 /**
29 * Medium Synchronization Delay Information subfield
30 */
32 {
33 uint8_t mediumSyncDuration; //!< Medium Synchronization Duration
34 uint8_t mediumSyncOfdmEdThreshold : 4; //!< Medium Synchronization OFDM ED Threshold
35 uint8_t mediumSyncMaxNTxops : 4; //!< Medium Synchronization MAximum Number of TXOPs
36 };
37
38 /**
39 * EML Capabilities subfield
40 */
42 {
43 uint8_t emlsrSupport : 1; //!< EMLSR Support
44 uint8_t emlsrPaddingDelay : 3; //!< EMLSR Padding Delay
45 uint8_t emlsrTransitionDelay : 3; //!< EMLSR Transition Delay
46 uint8_t emlmrSupport : 1; //!< EMLMR Support
47 uint8_t emlmrDelay : 3; //!< EMLMR Delay
48 uint8_t transitionTimeout : 4; //!< Transition Timeout
49 };
50
51 /**
52 * MLD Capabilities subfield
53 */
55 {
56 uint8_t maxNSimultaneousLinks : 4; //!< Max number of simultaneous links
57 uint8_t srsSupport : 1; //!< SRS Support
58 uint8_t tidToLinkMappingSupport : 2; //!< TID-To-Link Mapping Negotiation Supported
59 uint8_t freqSepForStrApMld : 5; //!< Frequency Separation For STR/AP MLD Type Indication
60 uint8_t aarSupport : 1; //!< AAR Support
61 };
62
63 /**
64 * Extended MLD Capabilities and Operations subfield
65 */
67 {
68 uint8_t opParamUpdateSupp : 1; ///< Operation Parameter Update Support
69 uint8_t recommMaxSimulLinks : 4; ///< Recommended Max Simultaneous Links
70 uint8_t nstrStatusUpdateSupp : 1; ///< NSTR Status Update Support
71 };
72
73 /**
74 * Subfields
75 */
76 Mac48Address m_mldMacAddress; //!< MLD MAC Address
77 std::optional<uint8_t> m_linkIdInfo; //!< Link ID Info
78 std::optional<uint8_t> m_bssParamsChangeCount; //!< BSS Parameters Change Count
79 std::optional<MediumSyncDelayInfo>
80 m_mediumSyncDelayInfo; //!< Medium Synchronization Delay Information
81 std::optional<EmlCapabilities> m_emlCapabilities; //!< EML Capabilities
82 std::optional<MldCapabilities> m_mldCapabilities; //!< MLD Capabilities
83 std::optional<uint8_t> m_apMldId; ///< AP MLD ID
84 std::optional<ExtMldCapabilities> m_extMldCapabilities; ///< Extended MLD Capabilities
85
86 /**
87 * Get the Presence Bitmap subfield of the Common Info field
88 *
89 * @return the Presence Bitmap subfield of the Common Info field
90 */
91 uint16_t GetPresenceBitmap() const;
92
93 /**
94 * Get the size of the serialized Common Info field
95 *
96 * @return the size of the serialized Common Info field
97 */
98 uint8_t GetSize() const;
99
100 /**
101 * Serialize the Common Info field
102 *
103 * @param start iterator pointing to where the Common Info field should be written to
104 */
105 void Serialize(Buffer::Iterator& start) const;
106
107 /**
108 * Deserialize the Common Info field
109 *
110 * @param start iterator pointing to where the Common Info field should be read from
111 * @param presence the value of the Presence Bitmap field indicating which subfields
112 * are present in the Common Info field
113 * @return the number of bytes read
114 */
115 uint8_t Deserialize(Buffer::Iterator start, uint16_t presence);
116
117 /**
118 * @param delay the EMLSR Padding delay
119 * @return the encoded value for the EMLSR Padding Delay subfield
120 */
121 static uint8_t EncodeEmlsrPaddingDelay(Time delay);
122
123 /**
124 * @param value the value for the EMLSR Padding Delay subfield
125 * @return the corresponding EMLSR Padding delay
126 */
127 static Time DecodeEmlsrPaddingDelay(uint8_t value);
128
129 /**
130 * @param delay the EMLSR Transition delay
131 * @return the encoded value for the EMLSR Transition Delay subfield
132 */
133 static uint8_t EncodeEmlsrTransitionDelay(Time delay);
134
135 /**
136 * @param value the value for the EMLSR Transition Delay subfield
137 * @return the corresponding EMLSR Transition delay
138 */
139 static Time DecodeEmlsrTransitionDelay(uint8_t value);
140
141 /**
142 * Set the Medium Synchronization Duration subfield of the Medium Synchronization
143 * Delay Information in the Common Info field.
144 *
145 * @param delay the timer duration (must be a multiple of 32 microseconds)
146 */
147 void SetMediumSyncDelayTimer(Time delay);
148
149 /**
150 * Set the Medium Synchronization OFDM ED Threshold subfield of the Medium Synchronization
151 * Delay Information in the Common Info field.
152 *
153 * @param threshold the threshold in dBm (ranges from -72 to -62 dBm)
154 */
155 void SetMediumSyncOfdmEdThreshold(int8_t threshold);
156
157 /**
158 * Set the Medium Synchronization Maximum Number of TXOPs subfield of the Medium Synchronization
159 * Delay Information in the Common Info field. A value of zero indicates no limit on the
160 * maximum number of TXOPs.
161 *
162 * @param nTxops the maximum number of TXOPs a non-AP STA is allowed to attempt to
163 * initiate while the MediumSyncDelay timer is running at a non-AP STA
164 */
165 void SetMediumSyncMaxNTxops(uint8_t nTxops);
166
167 /**
168 * Get the Medium Synchronization Duration subfield of the Medium Synchronization Delay
169 * Information in the Common Info field. Make sure that the Medium Synchronization Delay
170 * Information subfield is present.
171 *
172 * @return the timer duration
173 */
175
176 /**
177 * Get the Medium Synchronization OFDM ED Threshold in dBm. Make sure that the Medium
178 * Synchronization Delay Information subfield is present.
179 *
180 * @return the threshold in dBm
181 */
183
184 /**
185 * Get the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate
186 * while the MediumSyncDelay timer is running at a non-AP STA. If no value is returned,
187 * no limit is imposed on the number of TXOPs. Make sure that the Medium Synchronization
188 * Delay Information subfield is present.
189 *
190 * @return the number of TXOPs
191 */
192 std::optional<uint8_t> GetMediumSyncMaxNTxops() const;
193};
194
195} // namespace ns3
196
197#endif /* COMMON_INFO_BASIC_MLE_H */
iterator in a Buffer instance
Definition buffer.h:89
an EUI-48 address
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t emlsrTransitionDelay
EMLSR Transition Delay.
Extended MLD Capabilities and Operations subfield.
uint8_t opParamUpdateSupp
Operation Parameter Update Support.
uint8_t recommMaxSimulLinks
Recommended Max Simultaneous Links.
uint8_t nstrStatusUpdateSupp
NSTR Status Update Support.
Medium Synchronization Delay Information subfield.
uint8_t mediumSyncOfdmEdThreshold
Medium Synchronization OFDM ED Threshold.
uint8_t mediumSyncDuration
Medium Synchronization Duration.
uint8_t mediumSyncMaxNTxops
Medium Synchronization MAximum Number of TXOPs.
uint8_t freqSepForStrApMld
Frequency Separation For STR/AP MLD Type Indication.
uint8_t maxNSimultaneousLinks
Max number of simultaneous links.
uint8_t tidToLinkMappingSupport
TID-To-Link Mapping Negotiation Supported.
Common Info field of the Basic Multi-Link element.
uint16_t GetPresenceBitmap() const
Get the Presence Bitmap subfield of the Common Info field.
uint8_t GetSize() const
Get the size of the serialized Common Info field.
static uint8_t EncodeEmlsrTransitionDelay(Time delay)
static Time DecodeEmlsrTransitionDelay(uint8_t value)
std::optional< EmlCapabilities > m_emlCapabilities
EML Capabilities.
std::optional< ExtMldCapabilities > m_extMldCapabilities
Extended MLD Capabilities.
uint8_t Deserialize(Buffer::Iterator start, uint16_t presence)
Deserialize the Common Info field.
std::optional< uint8_t > GetMediumSyncMaxNTxops() const
Get the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while the MediumSyncDe...
int8_t GetMediumSyncOfdmEdThreshold() const
Get the Medium Synchronization OFDM ED Threshold in dBm.
std::optional< MldCapabilities > m_mldCapabilities
MLD Capabilities.
void SetMediumSyncOfdmEdThreshold(int8_t threshold)
Set the Medium Synchronization OFDM ED Threshold subfield of the Medium Synchronization Delay Informa...
static Time DecodeEmlsrPaddingDelay(uint8_t value)
void Serialize(Buffer::Iterator &start) const
Serialize the Common Info field.
std::optional< MediumSyncDelayInfo > m_mediumSyncDelayInfo
Medium Synchronization Delay Information.
void SetMediumSyncDelayTimer(Time delay)
Set the Medium Synchronization Duration subfield of the Medium Synchronization Delay Information in t...
Time GetMediumSyncDelayTimer() const
Get the Medium Synchronization Duration subfield of the Medium Synchronization Delay Information in t...
Mac48Address m_mldMacAddress
Subfields.
std::optional< uint8_t > m_bssParamsChangeCount
BSS Parameters Change Count.
void SetMediumSyncMaxNTxops(uint8_t nTxops)
Set the Medium Synchronization Maximum Number of TXOPs subfield of the Medium Synchronization Delay I...
std::optional< uint8_t > m_linkIdInfo
Link ID Info.
static uint8_t EncodeEmlsrPaddingDelay(Time delay)
std::optional< uint8_t > m_apMldId
AP MLD ID.