A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-phy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Orange Labs
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Rediet <getachew.redieteab@orange.com>
7 * Sébastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy and
8 * spectrum-wifi-phy)
9 */
10
11#ifndef HE_PHY_H
12#define HE_PHY_H
13
14#include "he-ppdu.h"
15
16#include "ns3/callback.h"
17#include "ns3/vht-phy.h"
18#include "ns3/wifi-phy-band.h"
19#include "ns3/wifi-types.h"
20
21#include <optional>
22
23/**
24 * @file
25 * @ingroup wifi
26 * Declaration of ns3::HePhy class
27 * and ns3::HeSigAParameters struct.
28 */
29
30namespace ns3
31{
32
33class ObssPdAlgorithm;
34
35/**
36 * This defines the BSS membership value for HE PHY.
37 */
38#define HE_PHY 122
39
40/**
41 * Parameters for received HE-SIG-A for OBSS_PD based SR
42 */
44{
45 dBm_u rssi; ///< RSSI
46 uint8_t bssColor; ///< BSS color
47};
48
49/**
50 * @brief PHY entity for HE (11ax)
51 * @ingroup wifi
52 *
53 * HE PHY is based on VHT PHY.
54 *
55 * Refer to P802.11ax/D4.0, clause 27.
56 */
57class HePhy : public VhtPhy
58{
59 public:
60 /**
61 * Callback upon end of HE-SIG-A
62 *
63 * arg1: Parameters of HE-SIG-A
64 */
66
67 /**
68 * Constructor for HE PHY
69 *
70 * @param buildModeList flag used to add HE modes to list (disabled
71 * by child classes to only add child classes' modes)
72 */
73 HePhy(bool buildModeList = true);
74 /**
75 * Destructor for HE PHY
76 */
77 ~HePhy() override;
78
79 WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
80 WifiMode GetSigAMode() const override;
81 WifiMode GetSigBMode(const WifiTxVector& txVector) const override;
82 const PpduFormats& GetPpduFormats() const override;
83 Time GetLSigDuration(WifiPreamble preamble) const override;
85 uint8_t nDataLtf,
86 uint8_t nExtensionLtf = 0) const override;
87 Time GetSigADuration(WifiPreamble preamble) const override;
88 Time GetSigBDuration(const WifiTxVector& txVector) const override;
90 const WifiTxVector& txVector,
91 Time ppduDuration) override;
95 Time rxDuration) override;
96 void CancelAllEvents() override;
97 uint16_t GetStaId(const Ptr<const WifiPpdu> ppdu) const override;
98 MHz_u GetMeasurementChannelWidth(const Ptr<const WifiPpdu> ppdu) const override;
99 void StartTx(Ptr<const WifiPpdu> ppdu) override;
101 const WifiTxVector& txVector,
102 WifiPhyBand band) const override;
103 void SwitchMaybeToCcaBusy(const Ptr<const WifiPpdu> ppdu) override;
105 WifiChannelListType channelType) const override;
106 void NotifyCcaBusy(const Ptr<const WifiPpdu> ppdu,
107 Time duration,
108 WifiChannelListType channelType) override;
109 bool CanStartRx(Ptr<const WifiPpdu> ppdu) const override;
111
112 /**
113 * @return the BSS color of this PHY.
114 */
115 uint8_t GetBssColor() const;
116
117 /**
118 * Compute the L-SIG length value corresponding to the given HE TB PPDU duration.
119 * If the latter is not a feasible duration (considering the selected guard interval),
120 * a proper duration is computed and returned along with the L-SIG length value.
121 *
122 * @param ppduDuration the duration of the HE TB PPDU
123 * @param txVector the TXVECTOR used for the transmission of this HE TB PPDU
124 * @param band the frequency band being used
125 *
126 * @return the L-SIG length value and the adjusted HE TB PPDU duration.
127 */
128 static std::pair<uint16_t, Time> ConvertHeTbPpduDurationToLSigLength(
129 Time ppduDuration,
130 const WifiTxVector& txVector,
131 WifiPhyBand band);
132 /**
133 * @param length the L-SIG length value
134 * @param txVector the TXVECTOR used for the transmission of this HE TB PPDU
135 * @param band the frequency band being used
136 *
137 * @return the duration of the HE TB PPDU corresponding to that L-SIG length value.
138 */
139 static Time ConvertLSigLengthToHeTbPpduDuration(uint16_t length,
140 const WifiTxVector& txVector,
141 WifiPhyBand band);
142 /**
143 * @param txVector the transmission parameters used for the HE TB PPDU
144 *
145 * @return the duration of the non-HE portion of the HE TB PPDU.
146 */
147 virtual Time CalculateNonHeDurationForHeTb(const WifiTxVector& txVector) const;
148
149 /**
150 * @param txVector the transmission parameters used for the HE MU PPDU
151 *
152 * @return the duration of the non-HE portion of the HE MU PPDU.
153 */
154 virtual Time CalculateNonHeDurationForHeMu(const WifiTxVector& txVector) const;
155
156 /**
157 * Get the band in the TX spectrum associated with the RU used by the PSDU
158 * transmitted to/by a given STA in a DL MU PPDU/HE TB PPDU
159 *
160 * @param txVector the TXVECTOR used for the transmission
161 * @param staId the STA-ID of the station
162 *
163 * @return the RU band in the TX spectrum
164 */
165 WifiSpectrumBandInfo GetRuBandForTx(const WifiTxVector& txVector, uint16_t staId) const;
166 /**
167 * Get the band in the RX spectrum associated with the RU used by the PSDU
168 * transmitted to/by a given STA in a DL MU PPDU/HE TB PPDU
169 *
170 * @param txVector the TXVECTOR used for the transmission
171 * @param staId the STA-ID of the station
172 *
173 * @return the RU band in the RX spectrum
174 */
175 WifiSpectrumBandInfo GetRuBandForRx(const WifiTxVector& txVector, uint16_t staId) const;
176 /**
177 * Get the width of the non-OFDMA portion of an HE TB PPDU
178 *
179 * @param ru the RU in which the HE TB PPDU is sent
180 * @return the width of the non-OFDMA portion of an HE TB PPDU
181 */
183
184 /**
185 * @return the UID of the HE TB PPDU being received
186 */
187 uint64_t GetCurrentHeTbPpduUid() const;
188
189 /**
190 * Set the TRIGVECTOR and the associated expiration time. A TRIGVECTOR shall expire
191 * when the TX timer associated with the transmission of the Trigger Frame expires.
192 *
193 * @param trigVector the TRIGVECTOR
194 * @param validity the amount of time (from now) until expiration of the TRIGVECTOR
195 */
196 void SetTrigVector(const WifiTxVector& trigVector, Time validity);
197
198 /**
199 * Get the center frequency per segment of the non-HE portion of the current PPDU for the given
200 * STA-ID. Note this method is only to be used for UL MU.
201 *
202 * @param ppdu the PPDU
203 * @param staId the STA-ID of the station taking part of the UL MU
204 * @return the center frequency corresponding to the non-HE portion of the HE TB PPDU
205 */
206 std::vector<MHz_u> GetCenterFrequenciesForNonHePart(const Ptr<const WifiPpdu> ppdu,
207 uint16_t staId) const;
208
209 /**
210 * Sets the OBSS-PD algorithm.
211 *
212 * @param algorithm the OBSS-PD algorithm
213 */
214 void SetObssPdAlgorithm(const Ptr<ObssPdAlgorithm> algorithm);
215
216 /**
217 * Gets the OBSS-PD algorithm.
218 *
219 * @return the OBSS-PD algorithm
220 */
222
223 /**
224 * Set a callback for a end of HE-SIG-A.
225 *
226 * @param callback the EndOfHeSigACallback to set
227 */
229
230 /**
231 * Fire a EndOfHeSigA callback (if connected) once HE-SIG-A field has been received.
232 * This method is scheduled immediately after end of HE-SIG-A, once
233 * field processing is finished.
234 *
235 * @param params the HE-SIG-A parameters
236 */
238
239 /**
240 * Initialize all HE modes.
241 */
242 static void InitializeModes();
243 /**
244 * Return the HE MCS corresponding to
245 * the provided index.
246 *
247 * @param index the index of the MCS
248 * @return an HE MCS
249 */
250 static WifiMode GetHeMcs(uint8_t index);
251
252 /**
253 * Return MCS 0 from HE MCS values.
254 *
255 * @return MCS 0 from HE MCS values
256 */
258 /**
259 * Return MCS 1 from HE MCS values.
260 *
261 * @return MCS 1 from HE MCS values
262 */
264 /**
265 * Return MCS 2 from HE MCS values.
266 *
267 * @return MCS 2 from HE MCS values
268 */
270 /**
271 * Return MCS 3 from HE MCS values.
272 *
273 * @return MCS 3 from HE MCS values
274 */
276 /**
277 * Return MCS 4 from HE MCS values.
278 *
279 * @return MCS 4 from HE MCS values
280 */
282 /**
283 * Return MCS 5 from HE MCS values.
284 *
285 * @return MCS 5 from HE MCS values
286 */
288 /**
289 * Return MCS 6 from HE MCS values.
290 *
291 * @return MCS 6 from HE MCS values
292 */
294 /**
295 * Return MCS 7 from HE MCS values.
296 *
297 * @return MCS 7 from HE MCS values
298 */
300 /**
301 * Return MCS 8 from HE MCS values.
302 *
303 * @return MCS 8 from HE MCS values
304 */
306 /**
307 * Return MCS 9 from HE MCS values.
308 *
309 * @return MCS 9 from HE MCS values
310 */
312 /**
313 * Return MCS 10 from HE MCS values.
314 *
315 * @return MCS 10 from HE MCS values
316 */
318 /**
319 * Return MCS 11 from HE MCS values.
320 *
321 * @return MCS 11 from HE MCS values
322 */
324
325 /**
326 * Return the coding rate corresponding to
327 * the supplied HE MCS index. This function is used
328 * as a callback for WifiMode operation.
329 *
330 * @param mcsValue the MCS index
331 * @return the coding rate.
332 */
333 static WifiCodeRate GetCodeRate(uint8_t mcsValue);
334 /**
335 * Return the constellation size corresponding
336 * to the supplied HE MCS index. This function is used
337 * as a callback for WifiMode operation.
338 *
339 * @param mcsValue the MCS index
340 * @return the size of modulation constellation.
341 */
342 static uint16_t GetConstellationSize(uint8_t mcsValue);
343 /**
344 * Return the PHY rate corresponding to the supplied HE MCS
345 * index, channel width, guard interval, and number of
346 * spatial stream. This function calls HtPhy::CalculatePhyRate
347 * and is mainly used as a callback for WifiMode operation.
348 *
349 * @param mcsValue the HE MCS index
350 * @param channelWidth the considered channel width
351 * @param guardInterval the considered guard interval duration
352 * @param nss the considered number of stream
353 *
354 * @return the physical bit rate of this signal in bps.
355 */
356 static uint64_t GetPhyRate(uint8_t mcsValue,
357 MHz_u channelWidth,
358 Time guardInterval,
359 uint8_t nss);
360 /**
361 * Return the PHY rate corresponding to
362 * the supplied TXVECTOR for the STA-ID.
363 *
364 * @param txVector the TXVECTOR used for the transmission
365 * @param staId the station ID for MU (unused if SU)
366 * @return the physical bit rate of this signal in bps.
367 */
368 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
369 uint16_t staId = SU_STA_ID);
370 /**
371 * Return the data rate corresponding to
372 * the supplied TXVECTOR for the STA-ID.
373 *
374 * @param txVector the TXVECTOR used for the transmission
375 * @param staId the station ID for MU (unused if SU)
376 * @return the data bit rate in bps.
377 */
378 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
379 uint16_t staId = SU_STA_ID);
380 /**
381 * Return the data rate corresponding to
382 * the supplied HE MCS index, channel width,
383 * guard interval, and number of spatial
384 * streams.
385 *
386 * @param mcsValue the MCS index
387 * @param channelWidth the channel width
388 * @param guardInterval the guard interval duration
389 * @param nss the number of spatial streams
390 * @return the data bit rate in bps.
391 */
392 static uint64_t GetDataRate(uint8_t mcsValue,
393 MHz_u channelWidth,
394 Time guardInterval,
395 uint8_t nss);
396 /**
397 * Calculate the rate in bps of the non-HT Reference Rate corresponding
398 * to the supplied HE MCS index. This function calls CalculateNonHtReferenceRate
399 * and is used as a callback for WifiMode operation.
400 *
401 * @param mcsValue the HE MCS index
402 * @return the rate in bps of the non-HT Reference Rate.
403 */
404 static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
405 /**
406 * Check whether the combination in TXVECTOR is allowed.
407 * This function is used as a callback for WifiMode operation.
408 *
409 * @param txVector the TXVECTOR
410 * @returns true if this combination is allowed, false otherwise.
411 */
412 static bool IsAllowed(const WifiTxVector& txVector);
413
414 /**
415 * Create and return the HE MCS corresponding to
416 * the provided index.
417 * This method binds all the callbacks used by WifiMode.
418 *
419 * @param index the index of the MCS
420 * @return an HE MCS
421 */
422 static WifiMode CreateHeMcs(uint8_t index);
423
424 /**
425 * @param guardInterval the guard interval duration
426 * @return the symbol duration
427 */
428 static Time GetSymbolDuration(Time guardInterval);
429
430 /// structure containing the information about the RU subcarriers to be able to converted to the
431 /// indices used by the Spectrum model
433 {
434 MHz_u bandWidth; ///< width of the band used for the OFDMA transmission. Must be a multiple
435 ///< of 20 MHz
436 MHz_u guardBandwidth; ///< width of the guard band
437 const std::vector<MHz_u>& centerFrequencies; ///< center frequency of each segment
438 MHz_u totalWidth; ///< width of the operating channel
439 Hz_u subcarrierSpacing; ///< subcarrier spacing
440 WifiModulationClass mc; ///< modulation class used for the transmission
441 SubcarrierRange subcarrierRange; ///< subcarrier range of the RU
442 uint8_t bandIndex{0}; ///< index (starting at 0) of the band within the operating channel
443 };
444
445 /**
446 * This is a helper function to convert RU subcarriers, which are relative to the center
447 * frequency subcarrier, to the indices used by the Spectrum model. The size of the returned
448 * vector corresponds to the number of segments covered by the RU.
449 *
450 * @param info the information about the RU subcarrier to convert
451 * @return the indices used by the Spectrum model for the provided RU subcarrier
452 */
453 static std::vector<WifiSpectrumBandIndices> ConvertRuSubcarriers(const RuSubcarriersInfo& info);
454
455 protected:
456 PhyFieldRxStatus ProcessSig(Ptr<Event> event,
457 PhyFieldRxStatus status,
458 WifiPpduField field) override;
460 bool IsConfigSupported(Ptr<const WifiPpdu> ppdu) const override;
461 Time DoStartReceivePayload(Ptr<Event> event) override;
462 std::pair<MHz_u, WifiSpectrumBandInfo> GetChannelWidthAndBand(const WifiTxVector& txVector,
463 uint16_t staId) const override;
465 RxSignalInfo rxSignalInfo,
466 const WifiTxVector& txVector,
467 uint16_t staId,
468 const std::vector<bool>& statusPerMpdu) override;
470 double snr,
471 const WifiTxVector& txVector) override;
472 void DoEndReceivePayload(Ptr<const WifiPpdu> ppdu) override;
473 void DoResetReceive(Ptr<Event> event) override;
475 uint64_t ObtainNextUid(const WifiTxVector& txVector) override;
476 Time GetMaxDelayPpduSameUid(const WifiTxVector& txVector) override;
478 Ptr<const WifiPpdu> ppdu) const override;
479 uint32_t GetMaxPsduSize() const override;
481 const WifiTxVector& txVector) const override;
484 RxPowerWattPerChannelBand& rxPower) override;
485
486 /**
487 * Process SIG-A, perform amendment-specific actions, and
488 * provide an updated status of the reception.
489 *
490 * @param event the event holding incoming PPDU's information
491 * @param status the status of the reception of the correctly received SIG-A after the
492 * configuration support check
493 * @return the updated status of the reception of the SIG-A
494 */
495 virtual PhyFieldRxStatus ProcessSigA(Ptr<Event> event, PhyFieldRxStatus status);
496
497 /**
498 * Process SIG-B, perform amendment-specific actions, and
499 * provide an updated status of the reception.
500 *
501 * @param event the event holding incoming PPDU's information
502 * @param status the status of the reception of the correctly received SIG-A after the
503 * configuration support check
504 * @return the updated status of the reception of the SIG-B
505 */
506 virtual PhyFieldRxStatus ProcessSigB(Ptr<Event> event, PhyFieldRxStatus status);
507
508 /**
509 * @param txVector the transmission parameters
510 * @return the number of bits of the HE-SIG-B
511 */
512 virtual uint32_t GetSigBSize(const WifiTxVector& txVector) const;
513
514 /**
515 * Start receiving the PSDU (i.e. the first symbol of the PSDU has arrived) of an MU
516 * transmission. This function is called upon the RX event corresponding to the HE portion of
517 * the MU PPDU.
518 *
519 * @param event the event holding incoming HE portion of the PPDU's information
520 */
522
523 /**
524 * Return the rate (in bps) of the non-HT Reference Rate
525 * which corresponds to the supplied code rate and
526 * constellation size.
527 *
528 * @param codeRate the convolutional coding rate
529 * @param constellationSize the size of modulation constellation
530 * @returns the rate in bps.
531 *
532 * To convert an HE MCS to its corresponding non-HT Reference Rate
533 * use the modulation and coding rate of the HT MCS
534 * and lookup in Table 10-10 of IEEE P802.11ax/D6.0.
535 */
536 static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
537
538 /**
539 * @param channelWidth the channel width
540 * @return the number of usable subcarriers for data
541 */
542 static uint16_t GetUsableSubcarriers(MHz_u channelWidth);
543
544 /**
545 * Compute the per-20 MHz CCA durations vector that indicates
546 * for how long each 20 MHz subchannel (corresponding to the
547 * index of the element in the vector) is busy and where a zero duration
548 * indicates that the subchannel is idle. The vector is non-empty if the
549 * operational channel width is larger than 20 MHz.
550 *
551 * @param ppdu the incoming PPDU or nullptr for any signal
552 * @return the per-20 MHz CCA durations vector
553 */
554 virtual std::vector<Time> GetPer20MHzDurations(const Ptr<const WifiPpdu> ppdu);
555
556 uint64_t m_previouslyTxPpduUid; //!< UID of the previously sent PPDU, used by AP to recognize
557 //!< response HE TB PPDUs
558 uint64_t m_currentMuPpduUid; //!< UID of the HE MU or HE TB PPDU being received
559
560 std::map<uint16_t /* STA-ID */, EventId>
561 m_beginMuPayloadRxEvents; //!< the beginning of the MU payload reception events (indexed by
562 //!< STA-ID)
563
564 EndOfHeSigACallback m_endOfHeSigACallback; //!< end of HE-SIG-A callback
565 std::optional<WifiTxVector> m_trigVector; //!< the TRIGVECTOR
566 std::optional<Time> m_trigVectorExpirationTime; //!< expiration time of the TRIGVECTOR
567 std::optional<WifiTxVector> m_currentTxVector; //!< If the STA is an AP STA, this holds the
568 //!< TXVECTOR of the PPDU that has been sent
569
570 private:
571 void BuildModeList() override;
572 uint8_t GetNumberBccEncoders(const WifiTxVector& txVector) const override;
573 Time GetSymbolDuration(const WifiTxVector& txVector) const override;
574
575 /**
576 * This is a helper function to create the TX PSD of the non-HE and HE portions.
577 *
578 * @param txPower power to spread across the bands
579 * @param ppdu the PPDU that will be transmitted
580 * @param flag flag indicating whether the PSD is for non-HE portion or HE portion
581 * @return Pointer to SpectrumValue
582 */
585 HePpdu::TxPsdFlag flag) const;
586
587 /**
588 * Start the transmission of the HE portion of the MU PPDU.
589 *
590 * @param ppdu the PPDU
591 * @param txPower the total TX power
592 * @param txPowerSpectrum the TX PSD
593 * @param hePortionDuration the duration of the HE portion
594 */
596 dBm_u txPower,
597 Ptr<SpectrumValue> txPowerSpectrum,
598 Time hePortionDuration);
599
600 /**
601 * Notify PHY state helper to switch to CCA busy state,
602 *
603 * @param duration the duration of the CCA state
604 * @param channelType the channel type for which the CCA busy state is reported.
605 * @param per20MHzDurations the per-20 MHz CCA durations vector
606 */
607 void NotifyCcaBusy(Time duration,
608 WifiChannelListType channelType,
609 const std::vector<Time>& per20MHzDurations);
610
611 /**
612 * Given a PPDU duration value, the TXVECTOR used to transmit the PPDU and
613 * the PHY band, compute a valid PPDU duration considering the number and
614 * duration of symbols, the preamble duration and the guard interval.
615 *
616 * @param ppduDuration the given PPDU duration
617 * @param txVector the given TXVECTOR
618 * @param band the PHY band
619 * @return a valid PPDU duration
620 */
621 static Time GetValidPpduDuration(Time ppduDuration,
622 const WifiTxVector& txVector,
623 WifiPhyBand band);
624
625 static const PpduFormats m_hePpduFormats; //!< HE PPDU formats
626
627 std::size_t m_rxHeTbPpdus; //!< Number of successfully received HE TB PPDUS
629 std::vector<Time> m_lastPer20MHzDurations; //!< Hold the last per-20 MHz CCA durations vector
630};
631
632} // namespace ns3
633
634#endif /* HE_PHY_H */
Callback template class.
Definition callback.h:422
An identifier for simulation events.
Definition event-id.h:45
PHY entity for HE (11ax)
Definition he-phy.h:58
std::optional< WifiTxVector > m_trigVector
the TRIGVECTOR
Definition he-phy.h:565
Time GetLSigDuration(WifiPreamble preamble) const override
Definition he-phy.cc:177
virtual Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const
Definition he-phy.cc:296
static uint64_t GetDataRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied HE MCS index, channel width, guard interval,...
Definition he-phy.cc:1683
static Time ConvertLSigLengthToHeTbPpduDuration(uint16_t length, const WifiTxVector &txVector, WifiPhyBand band)
Definition he-phy.cc:282
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
static uint64_t GetPhyRate(uint8_t mcsValue, MHz_u channelWidth, Time guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied HE MCS index, channel width, guard interval,...
Definition he-phy.cc:1647
uint64_t GetCurrentHeTbPpduUid() const
Definition he-phy.cc:1065
Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW) override
Get the event corresponding to the incoming PPDU.
Definition he-phy.cc:452
void CancelAllEvents() override
Cancel and clear all running events.
Definition he-phy.cc:407
void SetObssPdAlgorithm(const Ptr< ObssPdAlgorithm > algorithm)
Sets the OBSS-PD algorithm.
Definition he-phy.cc:696
static void InitializeModes()
Initialize all HE modes.
Definition he-phy.cc:1546
static WifiMode GetHeMcs9()
Return MCS 9 from HE MCS values.
void DoAbortCurrentReception(WifiPhyRxfailureReason reason) override
Perform amendment-specific actions before aborting the current reception.
Definition he-phy.cc:419
WifiSpectrumBandInfo GetRuBandForRx(const WifiTxVector &txVector, uint16_t staId) const
Get the band in the RX spectrum associated with the RU used by the PSDU transmitted to/by a given STA...
Definition he-phy.cc:1016
void StartReceiveMuPayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition he-phy.cc:926
static WifiMode GetHeMcs11()
Return MCS 11 from HE MCS values.
virtual PhyFieldRxStatus ProcessSigB(Ptr< Event > event, PhyFieldRxStatus status)
Process SIG-B, perform amendment-specific actions, and provide an updated status of the reception.
Definition he-phy.cc:723
virtual Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const
Definition he-phy.cc:305
std::optional< WifiTxVector > m_currentTxVector
If the STA is an AP STA, this holds the TXVECTOR of the PPDU that has been sent.
Definition he-phy.h:567
Time GetSigBDuration(const WifiTxVector &txVector) const override
Definition he-phy.cc:230
static WifiMode CreateHeMcs(uint8_t index)
Create and return the HE MCS corresponding to the provided index.
Definition he-phy.cc:1604
virtual uint32_t GetSigBSize(const WifiTxVector &txVector) const
Definition he-phy.cc:212
static WifiMode GetHeMcs(uint8_t index)
Return the HE MCS corresponding to the provided index.
Definition he-phy.cc:1555
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
void BuildModeList() override
Build mode list.
Definition he-phy.cc:96
WifiConstPsduMap GetWifiConstPsduMap(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector) const override
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
Definition he-phy.cc:1764
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 he-phy.cc:1735
void StartTxHePortion(Ptr< const WifiPpdu > ppdu, dBm_u txPower, Ptr< SpectrumValue > txPowerSpectrum, Time hePortionDuration)
Start the transmission of the HE portion of the MU PPDU.
Definition he-phy.cc:1499
MHz_u GetNonOfdmaWidth(WifiRu::RuSpec ru) const
Get the width of the non-OFDMA portion of an HE TB PPDU.
Definition he-phy.cc:1052
bool CanStartRx(Ptr< const WifiPpdu > ppdu) const override
Determine whether the PHY shall issue a PHY-RXSTART.indication primitive in response to a given PPDU.
Definition he-phy.cc:1784
void SetEndOfHeSigACallback(EndOfHeSigACallback callback)
Set a callback for a end of HE-SIG-A.
Definition he-phy.cc:708
uint64_t m_previouslyTxPpduUid
UID of the previously sent PPDU, used by AP to recognize response HE TB PPDUs.
Definition he-phy.h:556
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied HE MCS index.
Definition he-phy.cc:1620
static WifiMode GetHeMcs6()
Return MCS 6 from HE MCS values.
void StartTx(Ptr< const WifiPpdu > ppdu) override
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actio...
Definition he-phy.cc:1447
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 he-phy.cc:585
EndOfHeSigACallback m_endOfHeSigACallback
end of HE-SIG-A callback
Definition he-phy.h:564
static WifiMode GetHeMcs4()
Return MCS 4 from HE MCS values.
Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const override
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
Definition he-phy.cc:540
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition he-phy.cc:109
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition he-phy.cc:171
uint64_t ObtainNextUid(const WifiTxVector &txVector) override
Obtain the next UID for the PPDU to transmit.
Definition he-phy.cc:1268
Time CalculateTxDuration(const WifiConstPsduMap &psduMap, const WifiTxVector &txVector, WifiPhyBand band) const override
Definition he-phy.cc:1512
static WifiMode GetHeMcs10()
Return MCS 10 from HE MCS values.
Callback< void, HeSigAParameters > EndOfHeSigACallback
Callback upon end of HE-SIG-A.
Definition he-phy.h:65
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 he-phy.cc:1655
Ptr< ObssPdAlgorithm > m_obssPdAlgorithm
OBSS-PD algorithm.
Definition he-phy.h:628
dBm_u GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const override
Return the CCA threshold for a given channel type.
Definition he-phy.cc:1089
std::pair< MHz_u, WifiSpectrumBandInfo > GetChannelWidthAndBand(const WifiTxVector &txVector, uint16_t staId) const override
Get the channel width and band to use (will be overloaded by child classes).
Definition he-phy.cc:967
MHz_u GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const override
Return the channel width used to measure the RSSI.
Definition he-phy.cc:1071
Ptr< ObssPdAlgorithm > GetObssPdAlgorithm() const
Gets the OBSS-PD algorithm.
Definition he-phy.cc:702
uint8_t GetBssColor() const
Definition he-phy.cc:552
static Time GetValidPpduDuration(Time ppduDuration, const WifiTxVector &txVector, WifiPhyBand band)
Given a PPDU duration value, the TXVECTOR used to transmit the PPDU and the PHY band,...
Definition he-phy.cc:250
uint8_t GetNumberBccEncoders(const WifiTxVector &txVector) const override
Definition he-phy.cc:315
Time GetMaxDelayPpduSameUid(const WifiTxVector &txVector) override
Obtain the maximum time between two PPDUs with the same UID to consider they are identical and their ...
Definition he-phy.cc:1288
void HandleRxPpduWithSameContent(Ptr< Event > event, Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPower) override
Handle reception of a PPDU that carries the same content of another PPDU.
Definition he-phy.cc:518
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
Definition he-phy.cc:1758
std::size_t m_rxHeTbPpdus
Number of successfully received HE TB PPDUS.
Definition he-phy.h:627
~HePhy() override
Destructor for HE PHY.
Definition he-phy.cc:90
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition he-phy.cc:345
void NotifyEndOfHeSigA(HeSigAParameters params)
Fire a EndOfHeSigA callback (if connected) once HE-SIG-A field has been received.
Definition he-phy.cc:714
Ptr< SpectrumValue > GetTxPowerSpectralDensity(Watt_u txPower, Ptr< const WifiPpdu > ppdu) const override
Definition he-phy.cc:1307
static WifiMode GetHeMcs7()
Return MCS 7 from HE MCS values.
void RxPayloadSucceeded(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, uint16_t staId, const std::vector< bool > &statusPerMpdu) override
Perform amendment-specific actions when the payload is successfully received.
Definition he-phy.cc:854
uint64_t m_currentMuPpduUid
UID of the HE MU or HE TB PPDU being received.
Definition he-phy.h:558
static WifiMode GetHeMcs3()
Return MCS 3 from HE MCS values.
uint32_t GetMaxPsduSize() const override
Get the maximum PSDU size in bytes.
Definition he-phy.cc:1778
static const PpduFormats m_hePpduFormats
HE PPDU formats.
Definition he-phy.h:625
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 he-phy.cc:1669
std::map< uint16_t, EventId > m_beginMuPayloadRxEvents
the beginning of the MU payload reception events (indexed by STA-ID)
Definition he-phy.h:561
virtual std::vector< Time > GetPer20MHzDurations(const Ptr< const WifiPpdu > ppdu)
Compute the per-20 MHz CCA durations vector that indicates for how long each 20 MHz subchannel (corre...
Definition he-phy.cc:1167
void RxPayloadFailed(Ptr< const WifiPsdu > psdu, double snr, const WifiTxVector &txVector) override
Perform amendment-specific actions when the payload is unsuccessfuly received.
Definition he-phy.cc:872
Ptr< const WifiPpdu > GetRxPpduFromTxPpdu(Ptr< const WifiPpdu > ppdu) override
The WifiPpdu from the TX PHY is received by each RX PHY attached to the same channel.
Definition he-phy.cc:1803
HePhy(bool buildModeList=true)
Constructor for HE PHY.
Definition he-phy.cc:70
bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const override
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
Definition he-phy.cc:745
uint16_t GetStaId(const Ptr< const WifiPpdu > ppdu) const override
Return the STA ID that has been assigned to the station this PHY belongs to.
Definition he-phy.cc:567
static Time GetSymbolDuration(Time guardInterval)
Definition he-phy.cc:1721
void SetTrigVector(const WifiTxVector &trigVector, Time validity)
Set the TRIGVECTOR and the associated expiration time.
Definition he-phy.cc:330
static WifiMode GetHeMcs1()
Return MCS 1 from HE MCS values.
static std::pair< uint16_t, Time > ConvertHeTbPpduDurationToLSigLength(Time ppduDuration, const WifiTxVector &txVector, WifiPhyBand band)
Compute the L-SIG length value corresponding to the given HE TB PPDU duration.
Definition he-phy.cc:263
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 he-phy.cc:1727
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition he-phy.cc:138
void SwitchMaybeToCcaBusy(const Ptr< const WifiPpdu > ppdu) override
Check if PHY state should move to CCA busy state based on current state of interference tracker.
Definition he-phy.cc:1119
Time DoStartReceivePayload(Ptr< Event > event) override
Start receiving the PSDU (i.e.
Definition he-phy.cc:784
void StartReceivePreamble(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration) override
Start receiving the PHY preamble of a PPDU (i.e.
Definition he-phy.cc:357
virtual PhyFieldRxStatus ProcessSigA(Ptr< Event > event, PhyFieldRxStatus status)
Process SIG-A, perform amendment-specific actions, and provide an updated status of the reception.
Definition he-phy.cc:602
std::optional< Time > m_trigVectorExpirationTime
expiration time of the TRIGVECTOR
Definition he-phy.h:566
void DoEndReceivePayload(Ptr< const WifiPpdu > ppdu) override
Perform amendment-specific actions at the end of the reception of the payload.
Definition he-phy.cc:882
static WifiMode GetHeMcs5()
Return MCS 5 from HE MCS values.
void DoResetReceive(Ptr< Event > event) override
Perform amendment-specific actions before resetting PHY at the end of the PPDU under reception after ...
Definition he-phy.cc:437
static WifiMode GetHeMcs2()
Return MCS 2 from HE MCS values.
WifiMode GetSigAMode() const override
Definition he-phy.cc:132
std::vector< MHz_u > GetCenterFrequenciesForNonHePart(const Ptr< const WifiPpdu > ppdu, uint16_t staId) const
Get the center frequency per segment of the non-HE portion of the current PPDU for the given STA-ID.
Definition he-phy.cc:1416
Time GetSigADuration(WifiPreamble preamble) const override
Definition he-phy.cc:204
Time GetTrainingDuration(const WifiTxVector &txVector, uint8_t nDataLtf, uint8_t nExtensionLtf=0) const override
Definition he-phy.cc:183
static std::vector< WifiSpectrumBandIndices > ConvertRuSubcarriers(const RuSubcarriersInfo &info)
This is a helper function to convert RU subcarriers, which are relative to the center frequency subca...
Definition he-phy.cc:1829
std::vector< Time > m_lastPer20MHzDurations
Hold the last per-20 MHz CCA durations vector.
Definition he-phy.h:629
void NotifyCcaBusy(const Ptr< const WifiPpdu > ppdu, Time duration, WifiChannelListType channelType) override
Notify PHY state helper to switch to CCA busy state,.
Definition he-phy.cc:1148
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied HE MCS index.
Definition he-phy.cc:1634
WifiSpectrumBandInfo GetRuBandForTx(const WifiTxVector &txVector, uint16_t staId) const
Get the band in the TX spectrum associated with the RU used by the PSDU transmitted to/by a given STA...
Definition he-phy.cc:981
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
Definition he-ppdu.h:104
static uint16_t GetUsableSubcarriers()
Definition ofdm-phy.cc:623
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
PHY entity for VHT (11ac)
Definition vht-phy.h:38
represent a single transmission mode
Definition wifi-mode.h:38
std::variant< HeRu::RuSpec, EhtRu::RuSpec > RuSpec
variant of the RU specification
Definition wifi-ru.h:27
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.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPhyBand
Identifies the PHY band.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
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)
Declaration of ns3::HePpdu class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition wifi-types.h:154
double MHz_u
MHz weak type.
Definition wifi-units.h:31
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
Definition phy-entity.h:45
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)
double Watt_u
Watt weak type.
Definition wifi-units.h:25
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
structure containing the information about the RU subcarriers to be able to converted to the indices ...
Definition he-phy.h:433
MHz_u bandWidth
width of the band used for the OFDMA transmission.
Definition he-phy.h:434
Hz_u subcarrierSpacing
subcarrier spacing
Definition he-phy.h:439
MHz_u totalWidth
width of the operating channel
Definition he-phy.h:438
const std::vector< MHz_u > & centerFrequencies
center frequency of each segment
Definition he-phy.h:437
uint8_t bandIndex
index (starting at 0) of the band within the operating channel
Definition he-phy.h:442
MHz_u guardBandwidth
width of the guard band
Definition he-phy.h:436
WifiModulationClass mc
modulation class used for the transmission
Definition he-phy.h:440
SubcarrierRange subcarrierRange
subcarrier range of the RU
Definition he-phy.h:441
Parameters for received HE-SIG-A for OBSS_PD based SR.
Definition he-phy.h:44
uint8_t bssColor
BSS color.
Definition he-phy.h:46
dBm_u rssi
RSSI.
Definition he-phy.h:45
RxSignalInfo structure containing info on the received signal.
Definition wifi-types.h:79
WifiSpectrumBandInfo structure containing info about a spectrum band.