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 * 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 * Authors: Rediet <getachew.redieteab@orange.com>
18 * Sébastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy and
19 * spectrum-wifi-phy)
20 */
21
22#ifndef HE_PHY_H
23#define HE_PHY_H
24
25#include "he-ppdu.h"
26
27#include "ns3/callback.h"
28#include "ns3/vht-phy.h"
29#include "ns3/wifi-phy-band.h"
30
31#include <optional>
32
33/**
34 * \file
35 * \ingroup wifi
36 * Declaration of ns3::HePhy class
37 * and ns3::HeSigAParameters struct.
38 */
39
40namespace ns3
41{
42
43class ObssPdAlgorithm;
44
45/**
46 * This defines the BSS membership value for HE PHY.
47 */
48#define HE_PHY 122
49
50/**
51 * Parameters for received HE-SIG-A for OBSS_PD based SR
52 */
54{
55 double rssiW; ///< RSSI in W
56 uint8_t bssColor; ///< BSS color
57};
58
59/**
60 * \brief PHY entity for HE (11ax)
61 * \ingroup wifi
62 *
63 * HE PHY is based on VHT PHY.
64 *
65 * Refer to P802.11ax/D4.0, clause 27.
66 */
67class HePhy : public VhtPhy
68{
69 public:
70 /**
71 * Callback upon end of HE-SIG-A
72 *
73 * arg1: Parameters of HE-SIG-A
74 */
76
77 /**
78 * Constructor for HE PHY
79 *
80 * \param buildModeList flag used to add HE modes to list (disabled
81 * by child classes to only add child classes' modes)
82 */
83 HePhy(bool buildModeList = true);
84 /**
85 * Destructor for HE PHY
86 */
87 ~HePhy() override;
88
89 WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const override;
90 WifiMode GetSigAMode() const override;
91 WifiMode GetSigBMode(const WifiTxVector& txVector) const override;
92 const PpduFormats& GetPpduFormats() const override;
93 Time GetLSigDuration(WifiPreamble preamble) const override;
95 uint8_t nDataLtf,
96 uint8_t nExtensionLtf = 0) const override;
97 Time GetSigADuration(WifiPreamble preamble) const override;
98 Time GetSigBDuration(const WifiTxVector& txVector) const override;
100 const WifiTxVector& txVector,
101 Time ppduDuration) override;
104 RxPowerWattPerChannelBand& rxPowersW,
105 Time rxDuration) override;
106 void CancelAllEvents() override;
107 uint16_t GetStaId(const Ptr<const WifiPpdu> ppdu) const override;
108 uint16_t GetMeasurementChannelWidth(const Ptr<const WifiPpdu> ppdu) const override;
109 void StartTx(Ptr<const WifiPpdu> ppdu) override;
111 const WifiTxVector& txVector,
112 WifiPhyBand band) const override;
113 void SwitchMaybeToCcaBusy(const Ptr<const WifiPpdu> ppdu) override;
114 double GetCcaThreshold(const Ptr<const WifiPpdu> ppdu,
115 WifiChannelListType channelType) const override;
116 void NotifyCcaBusy(const Ptr<const WifiPpdu> ppdu,
117 Time duration,
118 WifiChannelListType channelType) override;
119 bool CanStartRx(Ptr<const WifiPpdu> ppdu) const override;
121
122 /**
123 * \return the BSS color of this PHY.
124 */
125 uint8_t GetBssColor() const;
126
127 /**
128 * Compute the L-SIG length value corresponding to the given HE TB PPDU duration.
129 * If the latter is not a feasible duration (considering the selected guard interval),
130 * a proper duration is computed and returned along with the L-SIG length value.
131 *
132 * \param ppduDuration the duration of the HE TB PPDU
133 * \param txVector the TXVECTOR used for the transmission of this HE TB PPDU
134 * \param band the frequency band being used
135 *
136 * \return the L-SIG length value and the adjusted HE TB PPDU duration.
137 */
138 static std::pair<uint16_t, Time> ConvertHeTbPpduDurationToLSigLength(
139 Time ppduDuration,
140 const WifiTxVector& txVector,
141 WifiPhyBand band);
142 /**
143 * \param length the L-SIG length value
144 * \param txVector the TXVECTOR used for the transmission of this HE TB PPDU
145 * \param band the frequency band being used
146 *
147 * \return the duration of the HE TB PPDU corresponding to that L-SIG length value.
148 */
149 static Time ConvertLSigLengthToHeTbPpduDuration(uint16_t length,
150 const WifiTxVector& txVector,
151 WifiPhyBand band);
152 /**
153 * \param txVector the transmission parameters used for the HE TB PPDU
154 *
155 * \return the duration of the non-HE portion of the HE TB PPDU.
156 */
157 virtual Time CalculateNonHeDurationForHeTb(const WifiTxVector& txVector) const;
158
159 /**
160 * \param txVector the transmission parameters used for the HE MU PPDU
161 *
162 * \return the duration of the non-HE portion of the HE MU PPDU.
163 */
164 virtual Time CalculateNonHeDurationForHeMu(const WifiTxVector& txVector) const;
165
166 /**
167 * Get the band in the TX 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 TX spectrum
174 */
175 WifiSpectrumBandInfo GetRuBandForTx(const WifiTxVector& txVector, uint16_t staId) const;
176 /**
177 * Get the band in the RX spectrum associated with the RU used by the PSDU
178 * transmitted to/by a given STA in a DL MU PPDU/HE TB PPDU
179 *
180 * \param txVector the TXVECTOR used for the transmission
181 * \param staId the STA-ID of the station
182 *
183 * \return the RU band in the RX spectrum
184 */
185 WifiSpectrumBandInfo GetRuBandForRx(const WifiTxVector& txVector, uint16_t staId) const;
186 /**
187 * Get the band used to transmit the non-OFDMA part of an HE TB PPDU.
188 *
189 * \param txVector the TXVECTOR used for the transmission
190 * \param staId the STA-ID of the station taking part of the UL MU
191 *
192 * \return the spectrum band used to transmit the non-OFDMA part of an HE TB PPDU
193 */
194 WifiSpectrumBandInfo GetNonOfdmaBand(const WifiTxVector& txVector, uint16_t staId) const;
195 /**
196 * Get the width in MHz of the non-OFDMA portion of an HE TB PPDU
197 *
198 * \param ru the RU in which the HE TB PPDU is sent
199 * \return the width in MHz of the non-OFDMA portion of an HE TB PPDU
200 */
201 uint16_t GetNonOfdmaWidth(HeRu::RuSpec ru) const;
202
203 /**
204 * \return the UID of the HE TB PPDU being received
205 */
206 uint64_t GetCurrentHeTbPpduUid() const;
207
208 /**
209 * Set the TRIGVECTOR and the associated expiration time. A TRIGVECTOR shall expire
210 * when the TX timer associated with the transmission of the Trigger Frame expires.
211 *
212 * \param trigVector the TRIGVECTOR
213 * \param validity the amount of time (from now) until expiration of the TRIGVECTOR
214 */
215 void SetTrigVector(const WifiTxVector& trigVector, Time validity);
216
217 /**
218 * Get the center frequency of the non-HE portion of the current TxVector for the
219 * given STA-ID.
220 * Note this method is only to be used for UL MU.
221 *
222 * \param txVector the TXVECTOR that has the RU allocation
223 * \param staId the STA-ID of the station taking part of the UL MU
224 * \return the center frequency in MHz corresponding to the non-HE portion of the HE TB PPDU
225 */
226 uint16_t GetCenterFrequencyForNonHePart(const WifiTxVector& txVector, uint16_t staId) const;
227
228 /**
229 * Sets the OBSS-PD algorithm.
230 *
231 * \param algorithm the OBSS-PD algorithm
232 */
233 void SetObssPdAlgorithm(const Ptr<ObssPdAlgorithm> algorithm);
234
235 /**
236 * Gets the OBSS-PD algorithm.
237 *
238 * \return the OBSS-PD algorithm
239 */
241
242 /**
243 * Set a callback for a end of HE-SIG-A.
244 *
245 * \param callback the EndOfHeSigACallback to set
246 */
248
249 /**
250 * Fire a EndOfHeSigA callback (if connected) once HE-SIG-A field has been received.
251 * This method is scheduled immediately after end of HE-SIG-A, once
252 * field processing is finished.
253 *
254 * \param params the HE-SIG-A parameters
255 */
257
258 /**
259 * Initialize all HE modes.
260 */
261 static void InitializeModes();
262 /**
263 * Return the HE MCS corresponding to
264 * the provided index.
265 *
266 * \param index the index of the MCS
267 * \return an HE MCS
268 */
269 static WifiMode GetHeMcs(uint8_t index);
270
271 /**
272 * Return MCS 0 from HE MCS values.
273 *
274 * \return MCS 0 from HE MCS values
275 */
277 /**
278 * Return MCS 1 from HE MCS values.
279 *
280 * \return MCS 1 from HE MCS values
281 */
283 /**
284 * Return MCS 2 from HE MCS values.
285 *
286 * \return MCS 2 from HE MCS values
287 */
289 /**
290 * Return MCS 3 from HE MCS values.
291 *
292 * \return MCS 3 from HE MCS values
293 */
295 /**
296 * Return MCS 4 from HE MCS values.
297 *
298 * \return MCS 4 from HE MCS values
299 */
301 /**
302 * Return MCS 5 from HE MCS values.
303 *
304 * \return MCS 5 from HE MCS values
305 */
307 /**
308 * Return MCS 6 from HE MCS values.
309 *
310 * \return MCS 6 from HE MCS values
311 */
313 /**
314 * Return MCS 7 from HE MCS values.
315 *
316 * \return MCS 7 from HE MCS values
317 */
319 /**
320 * Return MCS 8 from HE MCS values.
321 *
322 * \return MCS 8 from HE MCS values
323 */
325 /**
326 * Return MCS 9 from HE MCS values.
327 *
328 * \return MCS 9 from HE MCS values
329 */
331 /**
332 * Return MCS 10 from HE MCS values.
333 *
334 * \return MCS 10 from HE MCS values
335 */
337 /**
338 * Return MCS 11 from HE MCS values.
339 *
340 * \return MCS 11 from HE MCS values
341 */
343
344 /**
345 * Return the coding rate corresponding to
346 * the supplied HE MCS index. This function is used
347 * as a callback for WifiMode operation.
348 *
349 * \param mcsValue the MCS index
350 * \return the coding rate.
351 */
352 static WifiCodeRate GetCodeRate(uint8_t mcsValue);
353 /**
354 * Return the constellation size corresponding
355 * to the supplied HE MCS index. This function is used
356 * as a callback for WifiMode operation.
357 *
358 * \param mcsValue the MCS index
359 * \return the size of modulation constellation.
360 */
361 static uint16_t GetConstellationSize(uint8_t mcsValue);
362 /**
363 * Return the PHY rate corresponding to the supplied HE MCS
364 * index, channel width, guard interval, and number of
365 * spatial stream. This function calls HtPhy::CalculatePhyRate
366 * and is mainly used as a callback for WifiMode operation.
367 *
368 * \param mcsValue the HE MCS index
369 * \param channelWidth the considered channel width in MHz
370 * \param guardInterval the considered guard interval duration in nanoseconds
371 * \param nss the considered number of stream
372 *
373 * \return the physical bit rate of this signal in bps.
374 */
375 static uint64_t GetPhyRate(uint8_t mcsValue,
376 uint16_t channelWidth,
377 uint16_t guardInterval,
378 uint8_t nss);
379 /**
380 * Return the PHY rate corresponding to
381 * the supplied TXVECTOR for the STA-ID.
382 *
383 * \param txVector the TXVECTOR used for the transmission
384 * \param staId the station ID for MU (unused if SU)
385 * \return the physical bit rate of this signal in bps.
386 */
387 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector,
388 uint16_t staId = SU_STA_ID);
389 /**
390 * Return the data rate corresponding to
391 * the supplied TXVECTOR for the STA-ID.
392 *
393 * \param txVector the TXVECTOR used for the transmission
394 * \param staId the station ID for MU (unused if SU)
395 * \return the data bit rate in bps.
396 */
397 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector,
398 uint16_t staId = SU_STA_ID);
399 /**
400 * Return the data rate corresponding to
401 * the supplied HE MCS index, channel width,
402 * guard interval, and number of spatial
403 * streams.
404 *
405 * \param mcsValue the MCS index
406 * \param channelWidth the channel width in MHz
407 * \param guardInterval the guard interval duration in nanoseconds
408 * \param nss the number of spatial streams
409 * \return the data bit rate in bps.
410 */
411 static uint64_t GetDataRate(uint8_t mcsValue,
412 uint16_t channelWidth,
413 uint16_t guardInterval,
414 uint8_t nss);
415 /**
416 * Calculate the rate in bps of the non-HT Reference Rate corresponding
417 * to the supplied HE MCS index. This function calls CalculateNonHtReferenceRate
418 * and is used as a callback for WifiMode operation.
419 *
420 * \param mcsValue the HE MCS index
421 * \return the rate in bps of the non-HT Reference Rate.
422 */
423 static uint64_t GetNonHtReferenceRate(uint8_t mcsValue);
424 /**
425 * Check whether the combination in TXVECTOR is allowed.
426 * This function is used as a callback for WifiMode operation.
427 *
428 * \param txVector the TXVECTOR
429 * \returns true if this combination is allowed, false otherwise.
430 */
431 static bool IsAllowed(const WifiTxVector& txVector);
432
433 /**
434 * Create and return the HE MCS corresponding to
435 * the provided index.
436 * This method binds all the callbacks used by WifiMode.
437 *
438 * \param index the index of the MCS
439 * \return an HE MCS
440 */
441 static WifiMode CreateHeMcs(uint8_t index);
442
443 /**
444 * \param bandWidth the width (MHz) of the band used for the OFDMA transmission. Must be
445 * a multiple of 20 MHz
446 * \param guardBandwidth width of the guard band (MHz)
447 * \param subcarrierSpacing the subcarrier spacing (MHz)
448 * \param subcarrierRange the subcarrier range of the HE RU
449 * \param bandIndex the index (starting at 0) of the band within the operating channel
450 * \return the converted subcarriers
451 *
452 * This is a helper function to convert HE RU subcarriers, which are relative to the center
453 * frequency subcarrier, to the indexes used by the Spectrum model.
454 */
455 static WifiSpectrumBandIndices ConvertHeRuSubcarriers(uint16_t bandWidth,
456 uint16_t guardBandwidth,
457 uint32_t subcarrierSpacing,
458 HeRu::SubcarrierRange subcarrierRange,
459 uint8_t bandIndex = 0);
460
461 protected:
463 PhyFieldRxStatus status,
464 WifiPpduField field) override;
466 bool IsConfigSupported(Ptr<const WifiPpdu> ppdu) const override;
467 Time DoStartReceivePayload(Ptr<Event> event) override;
468 std::pair<uint16_t, WifiSpectrumBandInfo> GetChannelWidthAndBand(const WifiTxVector& txVector,
469 uint16_t staId) const override;
471 RxSignalInfo rxSignalInfo,
472 const WifiTxVector& txVector,
473 uint16_t staId,
474 const std::vector<bool>& statusPerMpdu) override;
476 double snr,
477 const WifiTxVector& txVector) override;
478 void DoEndReceivePayload(Ptr<const WifiPpdu> ppdu) override;
479 void DoResetReceive(Ptr<Event> event) override;
481 uint64_t ObtainNextUid(const WifiTxVector& txVector) override;
482 Time GetMaxDelayPpduSameUid(const WifiTxVector& txVector) override;
484 Ptr<const WifiPpdu> ppdu) const override;
485 uint32_t GetMaxPsduSize() const override;
487 const WifiTxVector& txVector) const override;
490 RxPowerWattPerChannelBand& rxPower) override;
491
492 /**
493 * Process SIG-A, perform amendment-specific actions, and
494 * provide an updated status of the reception.
495 *
496 * \param event the event holding incoming PPDU's information
497 * \param status the status of the reception of the correctly received SIG-A after the
498 * configuration support check
499 * \return the updated status of the reception of the SIG-A
500 */
502
503 /**
504 * Process SIG-B, perform amendment-specific actions, and
505 * provide an updated status of the reception.
506 *
507 * \param event the event holding incoming PPDU's information
508 * \param status the status of the reception of the correctly received SIG-A after the
509 * configuration support check
510 * \return the updated status of the reception of the SIG-B
511 */
513
514 /**
515 * \param txVector the transmission parameters
516 * \return the number of bits of the HE-SIG-B
517 */
518 virtual uint32_t GetSigBSize(const WifiTxVector& txVector) const;
519
520 /**
521 * Start receiving the PSDU (i.e. the first symbol of the PSDU has arrived) of an MU
522 * transmission. This function is called upon the RX event corresponding to the HE portion of
523 * the MU PPDU.
524 *
525 * \param event the event holding incoming HE portion of the PPDU's information
526 */
528
529 /**
530 * Return the rate (in bps) of the non-HT Reference Rate
531 * which corresponds to the supplied code rate and
532 * constellation size.
533 *
534 * \param codeRate the convolutional coding rate
535 * \param constellationSize the size of modulation constellation
536 * \returns the rate in bps.
537 *
538 * To convert an HE MCS to its corresponding non-HT Reference Rate
539 * use the modulation and coding rate of the HT MCS
540 * and lookup in Table 10-10 of IEEE P802.11ax/D6.0.
541 */
542 static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize);
543
544 /**
545 * \param channelWidth the channel width in MHz
546 * \return the number of usable subcarriers for data
547 */
548 static uint16_t GetUsableSubcarriers(uint16_t channelWidth);
549
550 /**
551 * \param guardInterval the guard interval duration
552 * \return the symbol duration
553 */
554 static Time GetSymbolDuration(Time guardInterval);
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 txPowerW power in W 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 txPowerDbm the total TX power in dBm
592 * \param txPowerSpectrum the TX PSD
593 * \param hePortionDuration the duration of the HE portion
594 */
596 double txPowerDbm,
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 * Compute the per-20 MHz CCA durations vector that indicates
613 * for how long each 20 MHz subchannel (corresponding to the
614 * index of the element in the vector) is busy and where a zero duration
615 * indicates that the subchannel is idle. The vector is non-empty if the
616 * operational channel width is larger than 20 MHz.
617 *
618 * \param ppdu the incoming PPDU or nullptr for any signal
619 * \return the per-20 MHz CCA durations vector
620 */
621 std::vector<Time> GetPer20MHzDurations(const Ptr<const WifiPpdu> ppdu);
622
623 /**
624 * Given a PPDU duration value, the TXVECTOR used to transmit the PPDU and
625 * the PHY band, compute a valid PPDU duration considering the number and
626 * duration of symbols, the preamble duration and the guard interval.
627 *
628 * \param ppduDuration the given PPDU duration
629 * \param txVector the given TXVECTOR
630 * \param band the PHY band
631 * \return a valid PPDU duration
632 */
633 static Time GetValidPpduDuration(Time ppduDuration,
634 const WifiTxVector& txVector,
635 WifiPhyBand band);
636
637 static const PpduFormats m_hePpduFormats; //!< HE PPDU formats
638
639 std::size_t m_rxHeTbPpdus; //!< Number of successfully received HE TB PPDUS
641 std::vector<Time> m_lastPer20MHzDurations; //!< Hold the last per-20 MHz CCA durations vector
642}; // class HePhy
643
644} // namespace ns3
645
646#endif /* HE_PHY_H */
Callback template class.
Definition: callback.h:438
An identifier for simulation events.
Definition: event-id.h:55
PHY entity for HE (11ax)
Definition: he-phy.h:68
std::optional< WifiTxVector > m_trigVector
the TRIGVECTOR
Definition: he-phy.h:565
Time GetLSigDuration(WifiPreamble preamble) const override
Definition: he-phy.cc:188
virtual Time CalculateNonHeDurationForHeTb(const WifiTxVector &txVector) const
Definition: he-phy.cc:305
static Time ConvertLSigLengthToHeTbPpduDuration(uint16_t length, const WifiTxVector &txVector, WifiPhyBand band)
Definition: he-phy.cc:291
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
uint16_t GetCenterFrequencyForNonHePart(const WifiTxVector &txVector, uint16_t staId) const
Get the center frequency of the non-HE portion of the current TxVector for the given STA-ID.
Definition: he-phy.cc:1414
uint64_t GetCurrentHeTbPpduUid() const
Definition: he-phy.cc:1074
Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW) override
Get the event corresponding to the incoming PPDU.
Definition: he-phy.cc:460
void CancelAllEvents() override
Cancel and clear all running events.
Definition: he-phy.cc:415
void SetObssPdAlgorithm(const Ptr< ObssPdAlgorithm > algorithm)
Sets the OBSS-PD algorithm.
Definition: he-phy.cc:703
static void InitializeModes()
Initialize all HE modes.
Definition: he-phy.cc:1540
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:427
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:1010
Time CalculateTxDuration(WifiConstPsduMap psduMap, const WifiTxVector &txVector, WifiPhyBand band) const override
Definition: he-phy.cc:1506
void StartReceiveMuPayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: he-phy.cc:933
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:730
virtual Time CalculateNonHeDurationForHeMu(const WifiTxVector &txVector) const
Definition: he-phy.cc:314
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:239
static WifiMode CreateHeMcs(uint8_t index)
Create and return the HE MCS corresponding to the provided index.
Definition: he-phy.cc:1598
virtual uint32_t GetSigBSize(const WifiTxVector &txVector) const
Definition: he-phy.cc:223
static WifiMode GetHeMcs(uint8_t index)
Return the HE MCS corresponding to the provided index.
Definition: he-phy.cc:1549
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
void BuildModeList() override
Build mode list.
Definition: he-phy.cc:107
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:1755
uint16_t GetNonOfdmaWidth(HeRu::RuSpec ru) const
Get the width in MHz of the non-OFDMA portion of an HE TB PPDU.
Definition: he-phy.cc:1062
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:1726
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:1775
void StartTxHePortion(Ptr< const WifiPpdu > ppdu, double txPowerDbm, Ptr< SpectrumValue > txPowerSpectrum, Time hePortionDuration)
Start the transmission of the HE portion of the MU PPDU.
Definition: he-phy.cc:1493
void SetEndOfHeSigACallback(EndOfHeSigACallback callback)
Set a callback for a end of HE-SIG-A.
Definition: he-phy.cc:715
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:1614
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:1442
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:593
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:548
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:120
const PpduFormats & GetPpduFormats() const override
Return the PPDU formats of the PHY.
Definition: he-phy.cc:182
uint64_t ObtainNextUid(const WifiTxVector &txVector) override
Obtain the next UID for the PPDU to transmit.
Definition: he-phy.cc:1274
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:75
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:1649
Ptr< ObssPdAlgorithm > m_obssPdAlgorithm
OBSS-PD algorithm.
Definition: he-phy.h:640
Ptr< ObssPdAlgorithm > GetObssPdAlgorithm() const
Gets the OBSS-PD algorithm.
Definition: he-phy.cc:709
uint8_t GetBssColor() const
Definition: he-phy.cc:560
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:259
static WifiSpectrumBandIndices ConvertHeRuSubcarriers(uint16_t bandWidth, uint16_t guardBandwidth, uint32_t subcarrierSpacing, HeRu::SubcarrierRange subcarrierRange, uint8_t bandIndex=0)
Definition: he-phy.cc:1820
uint8_t GetNumberBccEncoders(const WifiTxVector &txVector) const override
Definition: he-phy.cc:324
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:1294
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:526
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
Definition: he-phy.cc:1749
std::size_t m_rxHeTbPpdus
Number of successfully received HE TB PPDUS.
Definition: he-phy.h:639
~HePhy() override
Destructor for HE PHY.
Definition: he-phy.cc:101
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition: he-phy.cc:353
void NotifyEndOfHeSigA(HeSigAParameters params)
Fire a EndOfHeSigA callback (if connected) once HE-SIG-A field has been received.
Definition: he-phy.cc:721
static uint64_t GetDataRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied HE MCS index, channel width, guard interval,...
Definition: he-phy.cc:1677
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:861
static uint64_t GetPhyRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied HE MCS index, channel width, guard interval,...
Definition: he-phy.cc:1641
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:1769
static const PpduFormats m_hePpduFormats
HE PPDU formats.
Definition: he-phy.h:637
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:1663
std::map< uint16_t, EventId > m_beginMuPayloadRxEvents
the beginning of the MU payload reception events (indexed by STA-ID)
Definition: he-phy.h:561
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:1176
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:879
double GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const override
Return the CCA threshold in dBm for a given channel type.
Definition: he-phy.cc:1098
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:1794
bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const override
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
Definition: he-phy.cc:752
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:575
static Time GetSymbolDuration(Time guardInterval)
Definition: he-phy.cc:1712
std::pair< uint16_t, 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:974
void SetTrigVector(const WifiTxVector &trigVector, Time validity)
Set the TRIGVECTOR and the associated expiration time.
Definition: he-phy.cc:338
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:272
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:1718
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
Definition: he-phy.cc:149
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:1128
Time DoStartReceivePayload(Ptr< Event > event) override
Start receiving the PSDU (i.e.
Definition: he-phy.cc:791
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:365
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:610
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:889
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:445
static WifiMode GetHeMcs2()
Return MCS 2 from HE MCS values.
WifiMode GetSigAMode() const override
Definition: he-phy.cc:143
Time GetSigADuration(WifiPreamble preamble) const override
Definition: he-phy.cc:215
WifiSpectrumBandInfo GetNonOfdmaBand(const WifiTxVector &txVector, uint16_t staId) const
Get the band used to transmit the non-OFDMA part of an HE TB PPDU.
Definition: he-phy.cc:1033
Time GetTrainingDuration(const WifiTxVector &txVector, uint8_t nDataLtf, uint8_t nExtensionLtf=0) const override
Definition: he-phy.cc:194
std::vector< Time > m_lastPer20MHzDurations
Hold the last per-20 MHz CCA durations vector.
Definition: he-phy.h:641
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:1157
Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const override
Definition: he-phy.cc:1313
uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const override
Return the channel width used to measure the RSSI.
Definition: he-phy.cc:1080
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied HE MCS index.
Definition: he-phy.cc:1628
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:988
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
Definition: he-ppdu.h:115
RU Specification.
Definition: he-ru.h:66
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition: he-ru.h:52
static uint16_t GetUsableSubcarriers()
Definition: ofdm-phy.cc:634
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
PHY entity for VHT (11ac)
Definition: vht-phy.h:49
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.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
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::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
std::pair< uint32_t, uint32_t > WifiSpectrumBandIndices
typedef for a pair of start and stop sub-band indices
std::map< WifiSpectrumBandInfo, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Definition: phy-entity.h:77
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...
Parameters for received HE-SIG-A for OBSS_PD based SR.
Definition: he-phy.h:54
uint8_t bssColor
BSS color.
Definition: he-phy.h:56
double rssiW
RSSI in W.
Definition: he-phy.h:55
Status of the reception of the PPDU field.
Definition: phy-entity.h:112
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:69
WifiSpectrumBandInfo structure containing info about a spectrum band.