A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
eht-phy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18 */
19
20#ifndef EHT_PHY_H
21#define EHT_PHY_H
22
23#include "ns3/he-phy.h"
24
25/**
26 * \file
27 * \ingroup wifi
28 * Declaration of ns3::EhtPhy class.
29 */
30
31namespace ns3
32{
33
34/**
35 * This defines the BSS membership value for EHT PHY.
36 */
37#define EHT_PHY 121 // FIXME: not defined yet as of 802.11be D1.5
38
39/**
40 * \brief PHY entity for EHT (11be)
41 * \ingroup wifi
42 *
43 * EHT PHY is based on HE PHY.
44 *
45 * Refer to P802.11be/D1.5.
46 */
47class EhtPhy : public HePhy
48{
49 public:
50 /**
51 * Constructor for EHT PHY
52 *
53 * \param buildModeList flag used to add EHT modes to list (disabled
54 * by child classes to only add child classes' modes)
55 */
56 EhtPhy(bool buildModeList = true);
57 /**
58 * Destructor for EHT PHY
59 */
60 ~EhtPhy() override;
61
62 const PpduFormats& GetPpduFormats() const override;
63 Time GetDuration(WifiPpduField field, const WifiTxVector& txVector) const override;
65 const WifiTxVector& txVector,
66 Time ppduDuration) override;
67 WifiMode GetSigBMode(const WifiTxVector& txVector) const override;
68
69 /**
70 * Initialize all EHT modes.
71 */
72 static void InitializeModes();
73
74 /**
75 * Return the EHT MCS corresponding to
76 * the provided index.
77 *
78 * \param index the index of the MCS
79 * \return an EHT MCS
80 */
81 static WifiMode GetEhtMcs(uint8_t index);
82
83 /**
84 * Return MCS 0 from EHT MCS values.
85 *
86 * \return MCS 0 from EHT MCS values
87 */
89 /**
90 * Return MCS 1 from EHT MCS values.
91 *
92 * \return MCS 1 from EHT MCS values
93 */
95 /**
96 * Return MCS 2 from EHT MCS values.
97 *
98 * \return MCS 2 from EHT MCS values
99 */
101 /**
102 * Return MCS 3 from EHT MCS values.
103 *
104 * \return MCS 3 from EHT MCS values
105 */
107 /**
108 * Return MCS 4 from EHT MCS values.
109 *
110 * \return MCS 4 from EHT MCS values
111 */
113 /**
114 * Return MCS 5 from EHT MCS values.
115 *
116 * \return MCS 5 from EHT MCS values
117 */
119 /**
120 * Return MCS 6 from EHT MCS values.
121 *
122 * \return MCS 6 from EHT MCS values
123 */
125 /**
126 * Return MCS 7 from EHT MCS values.
127 *
128 * \return MCS 7 from EHT MCS values
129 */
131 /**
132 * Return MCS 8 from EHT MCS values.
133 *
134 * \return MCS 8 from EHT MCS values
135 */
137 /**
138 * Return MCS 9 from EHT MCS values.
139 *
140 * \return MCS 9 from EHT MCS values
141 */
143 /**
144 * Return MCS 10 from EHT MCS values.
145 *
146 * \return MCS 10 from EHT MCS values
147 */
149 /**
150 * Return MCS 11 from EHT MCS values.
151 *
152 * \return MCS 11 from EHT MCS values
153 */
155 /**
156 * Return MCS 12 from EHT MCS values.
157 *
158 * \return MCS 12 from EHT MCS values
159 */
161 /**
162 * Return MCS 13 from EHT MCS values.
163 *
164 * \return MCS 13 from EHT MCS values
165 */
167
168 /**
169 * Return the coding rate corresponding to
170 * the supplied EHT MCS index. This function is used
171 * as a callback for WifiMode operation.
172 *
173 * \param mcsValue the MCS index
174 * \return the coding rate.
175 */
176 static WifiCodeRate GetCodeRate(uint8_t mcsValue);
177
178 /**
179 * Return the constellation size corresponding
180 * to the supplied EHT MCS index. This function is used
181 * as a callback for WifiMode operation.
182 *
183 * \param mcsValue the MCS index
184 * \return the size of modulation constellation.
185 */
186 static uint16_t GetConstellationSize(uint8_t mcsValue);
187
188 /**
189 * Return the PHY rate corresponding to the supplied EHT MCS
190 * index, channel width, guard interval, and number of
191 * spatial stream. This function calls HtPhy::CalculatePhyRate
192 * and is mainly used as a callback for WifiMode operation.
193 *
194 * \param mcsValue the EHT MCS index
195 * \param channelWidth the considered channel width in MHz
196 * \param guardInterval the considered guard interval duration in nanoseconds
197 * \param nss the considered number of stream
198 *
199 * \return the physical bit rate of this signal in bps.
200 */
201 static uint64_t GetPhyRate(uint8_t mcsValue,
202 uint16_t channelWidth,
203 uint16_t guardInterval,
204 uint8_t nss);
205
206 /**
207 * Return the PHY rate corresponding to
208 * the supplied TXVECTOR for the STA-ID.
209 *
210 * \param txVector the TXVECTOR used for the transmission
211 * \param staId the station ID for MU (unused if SU)
212 * \return the physical bit rate of this signal in bps.
213 */
214 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
215 uint16_t staId = SU_STA_ID);
216
217 /**
218 * Return the data rate corresponding to
219 * the supplied TXVECTOR for the STA-ID.
220 *
221 * \param txVector the TXVECTOR used for the transmission
222 * \param staId the station ID for MU (unused if SU)
223 * \return the data bit rate in bps.
224 */
225 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
226 uint16_t staId = SU_STA_ID);
227
228 /**
229 * Return the data rate corresponding to
230 * the supplied EHT MCS index, channel width,
231 * guard interval, and number of spatial
232 * streams.
233 *
234 * \param mcsValue the EHT MCS index
235 * \param channelWidth the channel width in MHz
236 * \param guardInterval the guard interval duration in nanoseconds
237 * \param nss the number of spatial streams
238 * \return the data bit rate in bps.
239 */
240 static uint64_t GetDataRate(uint8_t mcsValue,
241 uint16_t channelWidth,
242 uint16_t guardInterval,
243 uint8_t nss);
244
245 /**
246 * Calculate the rate in bps of the non-HT Reference Rate corresponding
247 * to the supplied HE MCS index. This function calls CalculateNonHtReferenceRate
248 * and is used as a callback for WifiMode operation.
249 *
250 * \param mcsValue the HE MCS index
251 * \return the rate in bps of the non-HT Reference Rate.
252 */
253 static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
254
255 protected:
256 void BuildModeList() override;
257 WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
260 PhyFieldRxStatus status,
261 WifiPpduField field) override;
263 Time CalculateNonHeDurationForHeTb(const WifiTxVector& txVector) const override;
264 Time CalculateNonHeDurationForHeMu(const WifiTxVector& txVector) const override;
265 uint32_t GetSigBSize(const WifiTxVector& txVector) const override;
266
267 /**
268 * Create and return the EHT MCS corresponding to
269 * the provided index.
270 * This method binds all the callbacks used by WifiMode.
271 *
272 * \param index the index of the MCS
273 * \return an EHT MCS
274 */
275 static WifiMode CreateEhtMcs(uint8_t index);
276
277 /**
278 * Return the rate (in bps) of the non-HT Reference Rate
279 * which corresponds to the supplied code rate and
280 * constellation size.
281 *
282 * \param codeRate the convolutional coding rate
283 * \param constellationSize the size of modulation constellation
284 * \returns the rate in bps.
285 *
286 * To convert an HE MCS to its corresponding non-HT Reference Rate
287 * use the modulation and coding rate of the HT MCS
288 * and lookup in Table 10-10 of IEEE P802.11ax/D6.0.
289 */
290 static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
291
292 static const PpduFormats m_ehtPpduFormats; //!< EHT PPDU formats
293}; // class EhtPhy
294
295} // namespace ns3
296
297#endif /* EHT_PHY_H */
PHY entity for EHT (11be)
Definition: eht-phy.h:48
static WifiMode GetEhtMcs6()
Return MCS 6 from EHT MCS values.
static WifiMode GetEhtMcs5()
Return MCS 5 from EHT MCS values.
static const PpduFormats m_ehtPpduFormats
EHT PPDU formats.
Definition: eht-phy.h:292
static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
Return the rate (in bps) of the non-HT Reference Rate which corresponds to the supplied code rate and...
Definition: eht-phy.cc:396
PhyFieldRxStatus ProcessSig(Ptr< Event > event, PhyFieldRxStatus status, WifiPpduField field) override
Process SIG-A or SIG-B, perform amendment-specific actions, and provide an updated status of the rece...
Definition: eht-phy.cc:204
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition: eht-phy.cc:312
static WifiMode GetEhtMcs3()
Return MCS 3 from EHT MCS values.
static WifiMode GetEhtMcs8()
Return MCS 8 from EHT MCS values.
static WifiMode GetEhtMcs1()
Return MCS 1 from EHT MCS values.
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition: eht-phy.cc:91
static WifiMode GetEhtMcs2()
Return MCS 2 from EHT MCS values.
static WifiMode GetEhtMcs7()
Return MCS 7 from EHT MCS values.
static WifiMode GetEhtMcs0()
Return MCS 0 from EHT MCS values.
static WifiMode GetEhtMcs12()
Return MCS 12 from EHT MCS values.
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied EHT MCS index.
Definition: eht-phy.cc:326
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition: eht-phy.cc:220
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Return the PHY rate corresponding to the supplied TXVECTOR for the STA-ID.
Definition: eht-phy.cc:348
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:243
void BuildModeList() override
Build mode list.
Definition: eht-phy.cc:78
static void InitializeModes()
Initialize all EHT modes.
Definition: eht-phy.cc:234
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:296
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition: eht-phy.cc:171
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Return the data rate corresponding to the supplied TXVECTOR for the STA-ID.
Definition: eht-phy.cc:362
~EhtPhy() override
Destructor for EHT PHY.
Definition: eht-phy.cc:72
uint32_t GetSigBSize(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:136
Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:152
static WifiMode GetEhtMcs11()
Return MCS 11 from EHT MCS values.
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition: eht-phy.cc:177
static WifiMode GetEhtMcs10()
Return MCS 10 from EHT MCS values.
static uint64_t GetNonHtReferenceRate(uint8_t mcsValue)
Calculate the rate in bps of the non-HT Reference Rate corresponding to the supplied HE MCS index.
Definition: eht-phy.cc:388
static WifiMode GetEhtMcs13()
Return MCS 13 from EHT MCS values.
Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const override
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
Definition: eht-phy.cc:118
static uint64_t GetDataRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition: eht-phy.cc:376
Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:161
static uint64_t GetPhyRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition: eht-phy.cc:340
static WifiMode GetEhtMcs9()
Return MCS 9 from EHT MCS values.
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition: eht-phy.cc:105
static WifiMode GetEhtMcs4()
Return MCS 4 from EHT MCS values.
PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event) override
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
Definition: eht-phy.cc:189
PHY entity for HE (11ax)
Definition: he-phy.h:68
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:561
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
represent a single transmission mode
Definition: wifi-mode.h:51
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPpduField
The type of PPDU field (grouped for convenience)
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.
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
Definition: wifi-mode.h:35
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
Status of the reception of the PPDU field.
Definition: phy-entity.h:112