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 Time CalculateNonHeDurationForHeTb(const WifiTxVector& txVector) const override;
58 Time CalculateNonHeDurationForHeMu(const WifiTxVector& txVector) const override;
59
60 /**
61 * Initialize all EHT modes.
62 */
63 static void InitializeModes();
64
65 /**
66 * Return the EHT MCS corresponding to
67 * the provided index.
68 *
69 * @param index the index of the MCS
70 * @return an EHT MCS
71 */
72 static WifiMode GetEhtMcs(uint8_t index);
73
74 /**
75 * Return MCS 0 from EHT MCS values.
76 *
77 * @return MCS 0 from EHT MCS values
78 */
80 /**
81 * Return MCS 1 from EHT MCS values.
82 *
83 * @return MCS 1 from EHT MCS values
84 */
86 /**
87 * Return MCS 2 from EHT MCS values.
88 *
89 * @return MCS 2 from EHT MCS values
90 */
92 /**
93 * Return MCS 3 from EHT MCS values.
94 *
95 * @return MCS 3 from EHT MCS values
96 */
98 /**
99 * Return MCS 4 from EHT MCS values.
100 *
101 * @return MCS 4 from EHT MCS values
102 */
104 /**
105 * Return MCS 5 from EHT MCS values.
106 *
107 * @return MCS 5 from EHT MCS values
108 */
110 /**
111 * Return MCS 6 from EHT MCS values.
112 *
113 * @return MCS 6 from EHT MCS values
114 */
116 /**
117 * Return MCS 7 from EHT MCS values.
118 *
119 * @return MCS 7 from EHT MCS values
120 */
122 /**
123 * Return MCS 8 from EHT MCS values.
124 *
125 * @return MCS 8 from EHT MCS values
126 */
128 /**
129 * Return MCS 9 from EHT MCS values.
130 *
131 * @return MCS 9 from EHT MCS values
132 */
134 /**
135 * Return MCS 10 from EHT MCS values.
136 *
137 * @return MCS 10 from EHT MCS values
138 */
140 /**
141 * Return MCS 11 from EHT MCS values.
142 *
143 * @return MCS 11 from EHT MCS values
144 */
146 /**
147 * Return MCS 12 from EHT MCS values.
148 *
149 * @return MCS 12 from EHT MCS values
150 */
152 /**
153 * Return MCS 13 from EHT MCS values.
154 *
155 * @return MCS 13 from EHT MCS values
156 */
158
159 /**
160 * Return the coding rate corresponding to
161 * the supplied EHT MCS index. This function is used
162 * as a callback for WifiMode operation.
163 *
164 * @param mcsValue the MCS index
165 * @return the coding rate.
166 */
167 static WifiCodeRate GetCodeRate(uint8_t mcsValue);
168
169 /**
170 * Return the constellation size corresponding
171 * to the supplied EHT MCS index. This function is used
172 * as a callback for WifiMode operation.
173 *
174 * @param mcsValue the MCS index
175 * @return the size of modulation constellation.
176 */
177 static uint16_t GetConstellationSize(uint8_t mcsValue);
178
179 /**
180 * Return the PHY rate corresponding to the supplied EHT MCS
181 * index, channel width, guard interval, and number of
182 * spatial stream. This function calls HtPhy::CalculatePhyRate
183 * and is mainly used as a callback for WifiMode operation.
184 *
185 * @param mcsValue the EHT MCS index
186 * @param channelWidth the considered channel width
187 * @param guardInterval the considered guard interval duration
188 * @param nss the considered number of stream
189 *
190 * @return the physical bit rate of this signal in bps.
191 */
192 static uint64_t GetPhyRate(uint8_t mcsValue,
193 MHz_u channelWidth,
194 Time guardInterval,
195 uint8_t nss);
196
197 /**
198 * Return the PHY rate corresponding to
199 * the supplied TXVECTOR for the STA-ID.
200 *
201 * @param txVector the TXVECTOR used for the transmission
202 * @param staId the station ID for MU (unused if SU)
203 * @return the physical bit rate of this signal in bps.
204 */
205 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
206 uint16_t staId = SU_STA_ID);
207
208 /**
209 * Return the data rate corresponding to
210 * the supplied TXVECTOR for the STA-ID.
211 *
212 * @param txVector the TXVECTOR used for the transmission
213 * @param staId the station ID for MU (unused if SU)
214 * @return the data bit rate in bps.
215 */
216 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
217 uint16_t staId = SU_STA_ID);
218
219 /**
220 * Return the data rate corresponding to
221 * the supplied EHT MCS index, channel width,
222 * guard interval, and number of spatial
223 * streams.
224 *
225 * @param mcsValue the EHT MCS index
226 * @param channelWidth the channel width
227 * @param guardInterval the guard interval duration
228 * @param nss the number of spatial streams
229 * @return the data bit rate in bps.
230 */
231 static uint64_t GetDataRate(uint8_t mcsValue,
232 MHz_u channelWidth,
233 Time guardInterval,
234 uint8_t nss);
235
236 /**
237 * Calculate the rate in bps of the non-HT Reference Rate corresponding
238 * to the supplied HE MCS index. This function calls CalculateNonHtReferenceRate
239 * and is used as a callback for WifiMode operation.
240 *
241 * @param mcsValue the HE MCS index
242 * @return the rate in bps of the non-HT Reference Rate.
243 */
244 static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
245
246 protected:
247 void BuildModeList() override;
248 WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
251 PhyFieldRxStatus status,
252 WifiPpduField field) override;
254 uint32_t GetSigBSize(const WifiTxVector& txVector) const override;
256 WifiChannelListType channelType) const override;
257 const std::map<MHz_u, WifiChannelListType>& GetCcaSecondaryChannels() const override;
259 std::vector<Time> GetPer20MHzDurations(const Ptr<const WifiPpdu> ppdu) override;
260
261 /**
262 * Create and return the EHT MCS corresponding to
263 * the provided index.
264 * This method binds all the callbacks used by WifiMode.
265 *
266 * @param index the index of the MCS
267 * @return an EHT MCS
268 */
269 static WifiMode CreateEhtMcs(uint8_t index);
270
271 /**
272 * Return the rate (in bps) of the non-HT Reference Rate
273 * which corresponds to the supplied code rate and
274 * constellation size.
275 *
276 * @param codeRate the convolutional coding rate
277 * @param constellationSize the size of modulation constellation
278 * @returns the rate in bps.
279 *
280 * To convert an HE MCS to its corresponding non-HT Reference Rate
281 * use the modulation and coding rate of the HT MCS
282 * and lookup in Table 10-10 of IEEE P802.11ax/D6.0.
283 */
284 static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
285
286 /**
287 * Compute the CCA threshold for Per 20MHz check.
288 * This threshold is used for CCA check when signal is not occupying P20 or for Per 20MHz CCA
289 * check.
290 *
291 * @param ppdu the incoming PPDU or nullptr for any signal
292 * @return the CCA threshold for Per 20MHz check
293 */
295
296 static const PpduFormats m_ehtPpduFormats; //!< EHT PPDU formats
297};
298
299} // namespace ns3
300
301#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:296
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:398
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:205
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:313
static WifiMode GetEhtMcs3()
Return MCS 3 from EHT MCS values.
std::vector< Time > GetPer20MHzDurations(const Ptr< const WifiPpdu > ppdu) override
Compute the per-20 MHz CCA durations vector that indicates for how long each 20 MHz subchannel (corre...
Definition eht-phy.cc:492
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:92
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.
dBm_u GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const override
Return the CCA threshold for a given channel type.
Definition eht-phy.cc:451
static WifiMode GetEhtMcs12()
Return MCS 12 from EHT MCS values.
PhyEntity::CcaIndication GetCcaIndicationOnSecondary(const Ptr< const WifiPpdu > ppdu) override
Get CCA end time and its corresponding channel list type when a new signal not occupying the primary ...
Definition eht-phy.cc:467
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied EHT MCS index.
Definition eht-phy.cc:327
WifiPhyRxfailureReason GetFailureReason(WifiPpduField field) const override
Get the failure reason corresponding to the unsuccessful processing of a given PPDU field.
Definition eht-phy.cc:221
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:349
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:244
void BuildModeList() override
Build mode list.
Definition eht-phy.cc:79
const std::map< MHz_u, WifiChannelListType > & GetCcaSecondaryChannels() const override
Get the secondary channel widths and their corresponding channel list types that are supported by the...
Definition eht-phy.cc:461
static void InitializeModes()
Initialize all EHT modes.
Definition eht-phy.cc:235
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:377
static WifiMode CreateEhtMcs(uint8_t index)
Create and return the EHT MCS corresponding to the provided index.
Definition eht-phy.cc:297
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition eht-phy.cc:172
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:363
~EhtPhy() override
Destructor for EHT PHY.
Definition eht-phy.cc:73
uint32_t GetSigBSize(const WifiTxVector &txVector) const override
Definition eht-phy.cc:137
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:341
dBm_u Per20MHzCcaThreshold(const Ptr< const WifiPpdu > ppdu) const
Compute the CCA threshold for Per 20MHz check.
Definition eht-phy.cc:421
Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const override
Definition eht-phy.cc:153
static WifiMode GetEhtMcs11()
Return MCS 11 from EHT MCS values.
EhtPhy(bool buildModeList=true)
Constructor for EHT PHY.
Definition eht-phy.cc:60
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition eht-phy.cc:178
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:390
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:119
Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const override
Definition eht-phy.cc:162
static WifiMode GetEhtMcs9()
Return MCS 9 from EHT MCS values.
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition eht-phy.cc:106
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:190
PHY entity for HE (11ax)
Definition he-phy.h:58
std::optional< std::pair< Time, WifiChannelListType > > CcaIndication
CCA end time and its corresponding channel list type (can be std::nullopt if IDLE)
Definition phy-entity.h:926
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition phy-entity.h:531
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.
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
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.
Definition wifi-ppdu.h:38
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