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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#ifndef EHT_PHY_H
10#define EHT_PHY_H
11
12#include "ns3/he-phy.h"
13
14/**
15 * \file
16 * \ingroup wifi
17 * Declaration of ns3::EhtPhy class.
18 */
19
20namespace ns3
21{
22
23/**
24 * This defines the BSS membership value for EHT PHY.
25 */
26#define EHT_PHY 121 // FIXME: not defined yet as of 802.11be D1.5
27
28/**
29 * \brief PHY entity for EHT (11be)
30 * \ingroup wifi
31 *
32 * EHT PHY is based on HE PHY.
33 *
34 * Refer to P802.11be/D1.5.
35 */
36class EhtPhy : public HePhy
37{
38 public:
39 /**
40 * Constructor for EHT PHY
41 *
42 * \param buildModeList flag used to add EHT modes to list (disabled
43 * by child classes to only add child classes' modes)
44 */
45 EhtPhy(bool buildModeList = true);
46 /**
47 * Destructor for EHT PHY
48 */
49 ~EhtPhy() override;
50
51 const PpduFormats& GetPpduFormats() const override;
52 Time GetDuration(WifiPpduField field, const WifiTxVector& txVector) const override;
54 const WifiTxVector& txVector,
55 Time ppduDuration) override;
56 WifiMode GetSigBMode(const WifiTxVector& txVector) const override;
57
58 /**
59 * Initialize all EHT modes.
60 */
61 static void InitializeModes();
62
63 /**
64 * Return the EHT MCS corresponding to
65 * the provided index.
66 *
67 * \param index the index of the MCS
68 * \return an EHT MCS
69 */
70 static WifiMode GetEhtMcs(uint8_t index);
71
72 /**
73 * Return MCS 0 from EHT MCS values.
74 *
75 * \return MCS 0 from EHT MCS values
76 */
78 /**
79 * Return MCS 1 from EHT MCS values.
80 *
81 * \return MCS 1 from EHT MCS values
82 */
84 /**
85 * Return MCS 2 from EHT MCS values.
86 *
87 * \return MCS 2 from EHT MCS values
88 */
90 /**
91 * Return MCS 3 from EHT MCS values.
92 *
93 * \return MCS 3 from EHT MCS values
94 */
96 /**
97 * Return MCS 4 from EHT MCS values.
98 *
99 * \return MCS 4 from EHT MCS values
100 */
102 /**
103 * Return MCS 5 from EHT MCS values.
104 *
105 * \return MCS 5 from EHT MCS values
106 */
108 /**
109 * Return MCS 6 from EHT MCS values.
110 *
111 * \return MCS 6 from EHT MCS values
112 */
114 /**
115 * Return MCS 7 from EHT MCS values.
116 *
117 * \return MCS 7 from EHT MCS values
118 */
120 /**
121 * Return MCS 8 from EHT MCS values.
122 *
123 * \return MCS 8 from EHT MCS values
124 */
126 /**
127 * Return MCS 9 from EHT MCS values.
128 *
129 * \return MCS 9 from EHT MCS values
130 */
132 /**
133 * Return MCS 10 from EHT MCS values.
134 *
135 * \return MCS 10 from EHT MCS values
136 */
138 /**
139 * Return MCS 11 from EHT MCS values.
140 *
141 * \return MCS 11 from EHT MCS values
142 */
144 /**
145 * Return MCS 12 from EHT MCS values.
146 *
147 * \return MCS 12 from EHT MCS values
148 */
150 /**
151 * Return MCS 13 from EHT MCS values.
152 *
153 * \return MCS 13 from EHT MCS values
154 */
156
157 /**
158 * Return the coding rate corresponding to
159 * the supplied EHT MCS index. This function is used
160 * as a callback for WifiMode operation.
161 *
162 * \param mcsValue the MCS index
163 * \return the coding rate.
164 */
165 static WifiCodeRate GetCodeRate(uint8_t mcsValue);
166
167 /**
168 * Return the constellation size corresponding
169 * to the supplied EHT MCS index. This function is used
170 * as a callback for WifiMode operation.
171 *
172 * \param mcsValue the MCS index
173 * \return the size of modulation constellation.
174 */
175 static uint16_t GetConstellationSize(uint8_t mcsValue);
176
177 /**
178 * Return the PHY rate corresponding to the supplied EHT MCS
179 * index, channel width, guard interval, and number of
180 * spatial stream. This function calls HtPhy::CalculatePhyRate
181 * and is mainly used as a callback for WifiMode operation.
182 *
183 * \param mcsValue the EHT MCS index
184 * \param channelWidth the considered channel width
185 * \param guardInterval the considered guard interval duration
186 * \param nss the considered number of stream
187 *
188 * \return the physical bit rate of this signal in bps.
189 */
190 static uint64_t GetPhyRate(uint8_t mcsValue,
191 MHz_u channelWidth,
192 Time guardInterval,
193 uint8_t nss);
194
195 /**
196 * Return the PHY rate corresponding to
197 * the supplied TXVECTOR for the STA-ID.
198 *
199 * \param txVector the TXVECTOR used for the transmission
200 * \param staId the station ID for MU (unused if SU)
201 * \return the physical bit rate of this signal in bps.
202 */
203 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
204 uint16_t staId = SU_STA_ID);
205
206 /**
207 * Return the data 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 data bit rate in bps.
213 */
214 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
215 uint16_t staId = SU_STA_ID);
216
217 /**
218 * Return the data rate corresponding to
219 * the supplied EHT MCS index, channel width,
220 * guard interval, and number of spatial
221 * streams.
222 *
223 * \param mcsValue the EHT MCS index
224 * \param channelWidth the channel width
225 * \param guardInterval the guard interval duration
226 * \param nss the number of spatial streams
227 * \return the data bit rate in bps.
228 */
229 static uint64_t GetDataRate(uint8_t mcsValue,
230 MHz_u channelWidth,
231 Time guardInterval,
232 uint8_t nss);
233
234 /**
235 * Calculate the rate in bps of the non-HT Reference Rate corresponding
236 * to the supplied HE MCS index. This function calls CalculateNonHtReferenceRate
237 * and is used as a callback for WifiMode operation.
238 *
239 * \param mcsValue the HE MCS index
240 * \return the rate in bps of the non-HT Reference Rate.
241 */
242 static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
243
244 protected:
245 void BuildModeList() override;
246 WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
249 PhyFieldRxStatus status,
250 WifiPpduField field) override;
252 Time CalculateNonHeDurationForHeTb(const WifiTxVector& txVector) const override;
253 Time CalculateNonHeDurationForHeMu(const WifiTxVector& txVector) const override;
254 uint32_t GetSigBSize(const WifiTxVector& txVector) const override;
255
256 /**
257 * Create and return the EHT MCS corresponding to
258 * the provided index.
259 * This method binds all the callbacks used by WifiMode.
260 *
261 * \param index the index of the MCS
262 * \return an EHT MCS
263 */
264 static WifiMode CreateEhtMcs(uint8_t index);
265
266 /**
267 * Return the rate (in bps) of the non-HT Reference Rate
268 * which corresponds to the supplied code rate and
269 * constellation size.
270 *
271 * \param codeRate the convolutional coding rate
272 * \param constellationSize the size of modulation constellation
273 * \returns the rate in bps.
274 *
275 * To convert an HE MCS to its corresponding non-HT Reference Rate
276 * use the modulation and coding rate of the HT MCS
277 * and lookup in Table 10-10 of IEEE P802.11ax/D6.0.
278 */
279 static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
280
281 static const PpduFormats m_ehtPpduFormats; //!< EHT PPDU formats
282}; // class EhtPhy
283
284} // namespace ns3
285
286#endif /* EHT_PHY_H */
PHY entity for EHT (11be)
Definition eht-phy.h:37
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:281
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:386
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:193
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:301
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:80
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:315
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition eht-phy.cc:209
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:337
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:232
void BuildModeList() override
Build mode list.
Definition eht-phy.cc:67
static void InitializeModes()
Initialize all EHT modes.
Definition eht-phy.cc:223
static uint64_t GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition eht-phy.cc:365
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:285
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition eht-phy.cc:160
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:351
~EhtPhy() override
Destructor for EHT PHY.
Definition eht-phy.cc:61
uint32_t GetSigBSize(const WifiTxVector &txVector) const override
Definition eht-phy.cc:125
static uint64_t GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied EHT MCS index, channel width, guard interval,...
Definition eht-phy.cc:329
Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const override
Definition eht-phy.cc:141
static WifiMode GetEhtMcs11()
Return MCS 11 from EHT MCS values.
EhtPhy(bool buildModeList=true)
Constructor for EHT PHY.
Definition eht-phy.cc:48
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition eht-phy.cc:166
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:378
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:107
Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const override
Definition eht-phy.cc:150
static WifiMode GetEhtMcs9()
Return MCS 9 from EHT MCS values.
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition eht-phy.cc:94
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:178
PHY entity for HE (11ax)
Definition he-phy.h:58
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition phy-entity.h:529
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
represent a single transmission mode
Definition wifi-mode.h:40
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:24
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:80