A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
phy-entity.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) Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (for logic ported from
20 * wifi-phy)
21 */
22
23#ifndef PHY_ENTITY_H
24#define PHY_ENTITY_H
25
26#include "wifi-mpdu-type.h"
27#include "wifi-phy-band.h"
28#include "wifi-ppdu.h"
29#include "wifi-tx-vector.h"
30
31#include "ns3/event-id.h"
32#include "ns3/nstime.h"
33#include "ns3/simple-ref-count.h"
34
35#include <list>
36#include <map>
37#include <optional>
38#include <tuple>
39#include <utility>
40
41/**
42 * \file
43 * \ingroup wifi
44 * Declaration of:
45 * - ns3::PhyEntity class
46 * - ns3::SignalNoiseDbm, ns3::MpduInfo, and ns3::RxSignalInfo structs
47 * - ns3::RxPowerWattPerChannelBand typedef
48 */
49
50namespace ns3
51{
52
53/// SignalNoiseDbm structure
55{
56 double signal; ///< signal strength in dBm
57 double noise; ///< noise power in dBm
58};
59
60/// MpduInfo structure
62{
63 MpduType type; ///< type of MPDU
64 uint32_t mpduRefNumber; ///< MPDU ref number
65};
66
67/// RxSignalInfo structure containing info on the received signal
69{
70 double snr; ///< SNR in linear scale
71 double rssi; ///< RSSI in dBm
72};
73
74/**
75 * A map of the received power (Watts) for each band
76 */
77using RxPowerWattPerChannelBand = std::map<WifiSpectrumBandInfo, double>;
78
79class WifiPsdu;
80class WifiPhy;
82class Event;
84class WifiPsdu;
85class WifiPpdu;
86
87/**
88 * \brief Abstract class for PHY entities
89 * \ingroup wifi
90 *
91 * This class enables to have a unique set of APIs
92 * to be used by each PHY entity, corresponding to
93 * the different amendments of the IEEE 802.11 standard.
94 */
95class PhyEntity : public SimpleRefCount<PhyEntity>
96{
97 public:
98 /**
99 * Action to perform in case of RX failure.
100 */
102 {
103 DROP = 0, //!< drop PPDU and set CCA_BUSY
104 ABORT, //!< abort reception of PPDU
105 IGNORE //!< ignore the reception
106 };
107
108 /**
109 * Status of the reception of the PPDU field.
110 */
112 {
113 bool isSuccess{true}; //!< outcome (\c true if success) of the reception
116 DROP}; //!< action to perform in case of failure \see PhyRxFailureAction
117
118 /**
119 * Constructor setting outcome of reception.
120 *
121 * \param s \c true if success
122 */
124 : isSuccess(s)
125 {
126 }
127
128 /**
129 * Constructor.
130 *
131 * \param s \c true if success
132 * \param r reason of failure
133 * \param a action to perform in case of failure
134 */
136 : isSuccess(s),
137 reason(r),
139 {
140 }
141 };
142
143 /**
144 * A struct for both SNR and PER
145 */
146 struct SnrPer
147 {
148 double snr{0.0}; ///< SNR in linear scale
149 double per{1.0}; ///< PER
150
151 /**
152 * Default constructor.
153 */
155 {
156 }
157
158 /**
159 * Constructor for SnrPer.
160 *
161 * \param s the SNR in linear scale
162 * \param p the PER
163 */
164 SnrPer(double s, double p)
165 : snr(s),
166 per(p)
167 {
168 }
169 };
170
171 /**
172 * Destructor for PHY entity
173 */
174 virtual ~PhyEntity();
175
176 /**
177 * Set the WifiPhy owning this PHY entity.
178 *
179 * \param wifiPhy the WifiPhy owning this PHY entity
180 */
181 void SetOwner(Ptr<WifiPhy> wifiPhy);
182
183 /**
184 * Check if the WifiMode is supported.
185 *
186 * \param mode the WifiMode to check
187 * \return true if the WifiMode is supported,
188 * false otherwise
189 */
190 virtual bool IsModeSupported(WifiMode mode) const;
191 /**
192 * \return the number of WifiModes supported by this entity
193 */
194 virtual uint8_t GetNumModes() const;
195
196 /**
197 * Get the WifiMode corresponding to the given MCS index.
198 *
199 * \param index the index of the MCS
200 * \return the WifiMode corresponding to the MCS index
201 *
202 * This method should be used only for HtPhy and child classes.
203 */
204 virtual WifiMode GetMcs(uint8_t index) const;
205 /**
206 * Check if the WifiMode corresponding to the given MCS index is supported.
207 *
208 * \param index the index of the MCS
209 * \return true if the WifiMode corresponding to the MCS index is supported,
210 * false otherwise
211 *
212 * Will return false for non-MCS modes.
213 */
214 virtual bool IsMcsSupported(uint8_t index) const;
215 /**
216 * Check if the WifiModes handled by this PHY are MCSs.
217 *
218 * \return true if the handled WifiModes are MCSs,
219 * false if they are non-MCS modes
220 */
221 virtual bool HandlesMcsModes() const;
222
223 /**
224 * Get the WifiMode for the SIG field specified by the PPDU field.
225 *
226 * \param field the PPDU field
227 * \param txVector the transmission parameters
228 *
229 * \return the WifiMode used for the SIG field
230 */
231 virtual WifiMode GetSigMode(WifiPpduField field, const WifiTxVector& txVector) const;
232
233 /**
234 * \brief Return a const iterator to the first WifiMode
235 *
236 * \return a const iterator to the first WifiMode.
237 */
238 std::list<WifiMode>::const_iterator begin() const;
239 /**
240 * \brief Return a const iterator to past-the-last WifiMode
241 *
242 * \return a const iterator to past-the-last WifiMode.
243 */
244 std::list<WifiMode>::const_iterator end() const;
245
246 /**
247 * Return the field following the provided one.
248 *
249 * \param currentField the considered PPDU field
250 * \param preamble the preamble indicating the PPDU format
251 * \return the PPDU field following the reference one
252 */
253 WifiPpduField GetNextField(WifiPpduField currentField, WifiPreamble preamble) const;
254
255 /**
256 * Get the duration of the PPDU field (or group of fields)
257 * used by this entity for the given transmission parameters.
258 *
259 * \param field the PPDU field (or group of fields)
260 * \param txVector the transmission parameters
261 *
262 * \return the duration of the PPDU field
263 */
264 virtual Time GetDuration(WifiPpduField field, const WifiTxVector& txVector) const;
265 /**
266 * \param txVector the transmission parameters
267 *
268 * \return the total duration of the PHY preamble and PHY header.
269 */
271
272 /**
273 * \param size the number of bytes in the packet to send
274 * \param txVector the TXVECTOR used for the transmission of this packet
275 * \param band the frequency band
276 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType.
277 * \param incFlag this flag is used to indicate that the variables need to be update or not
278 * This function is called a couple of times for the same packet so variables should not be
279 * increased each time.
280 * \param totalAmpduSize the total size of the previously transmitted MPDUs for the concerned
281 * A-MPDU. If incFlag is set, this parameter will be updated.
282 * \param totalAmpduNumSymbols the number of symbols previously transmitted for the MPDUs in the
283 * concerned A-MPDU, used for the computation of the number of symbols needed for the last MPDU.
284 * If incFlag is set, this parameter will be updated.
285 * \param staId the STA-ID of the PSDU (only used for MU PPDUs)
286 *
287 * \return the duration of the PSDU
288 */
290 const WifiTxVector& txVector,
291 WifiPhyBand band,
292 MpduType mpdutype,
293 bool incFlag,
294 uint32_t& totalAmpduSize,
295 double& totalAmpduNumSymbols,
296 uint16_t staId) const = 0;
297
298 /**
299 * Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
300 * The STA-ID value is properly determined based on whether the given PSDU has
301 * to be transmitted as a DL or UL frame.
302 *
303 * \param psdu the given PSDU
304 * \param txVector the TXVECTOR to use to send the PSDU
305 * \return a WifiConstPsduMap built from the given PSDU and the given TXVECTOR
306 */
308 const WifiTxVector& txVector) const;
309
310 /**
311 * Get the maximum PSDU size in bytes.
312 *
313 * \return the maximum PSDU size in bytes
314 */
315 virtual uint32_t GetMaxPsduSize() const = 0;
316
317 /**
318 * A pair containing information on the PHY header chunk, namely
319 * the start and stop times of the chunk and the WifiMode used.
320 */
321 typedef std::pair<std::pair<Time /* start */, Time /* stop */>, WifiMode> PhyHeaderChunkInfo;
322 /**
323 * A map of PhyHeaderChunkInfo elements per PPDU field.
324 * \see PhyHeaderChunkInfo
325 */
326 typedef std::map<WifiPpduField, PhyHeaderChunkInfo> PhyHeaderSections;
327 /**
328 * Return a map of PHY header chunk information per PPDU field.
329 * This map will contain the PPDU fields that are actually present based
330 * on the \p txVector information.
331 *
332 * \param txVector the transmission parameters
333 * \param ppduStart the time at which the PPDU started
334 * \return the list of preamble sections
335 *
336 * \see PhyHeaderSections
337 */
338 PhyHeaderSections GetPhyHeaderSections(const WifiTxVector& txVector, Time ppduStart) const;
339
340 /**
341 * Build amendment-specific PPDU.
342 *
343 * \param psdus the PHY payloads (PSDUs)
344 * \param txVector the TXVECTOR that was used for the PPDU
345 * \param ppduDuration the transmission duration of the PPDU
346 *
347 * \return the amendment-specific WifiPpdu
348 */
349 virtual Ptr<WifiPpdu> BuildPpdu(const WifiConstPsduMap& psdus,
350 const WifiTxVector& txVector,
351 Time ppduDuration);
352
353 /**
354 * Get the duration of the PPDU up to (but excluding) the given field.
355 *
356 * \param field the considered PPDU field
357 * \param txVector the transmission parameters
358 * \return the duration from the beginning of the PPDU up to the field
359 */
360 Time GetDurationUpToField(WifiPpduField field, const WifiTxVector& txVector) const;
361 /**
362 * Get the remaining duration of the PPDU after the end of the given field.
363 *
364 * \param field the considered PPDU field
365 * \param ppdu the received PPDU
366 * \return the remaining duration of the PPDU after the end of to the field
367 */
369
370 /**
371 * Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
372 *
373 * \param ppdu the PPDU to extract the PSDU from
374 * \return the PSDU addressed to that PHY
375 */
377
378 /**
379 * Start receiving the PHY preamble of a PPDU (i.e. the first bit of the preamble has arrived).
380 *
381 * This method triggers the start of the preamble detection period (\see
382 * StartPreambleDetectionPeriod) if the PHY can process the PPDU.
383 *
384 * \param ppdu the arriving PPDU
385 * \param rxPowersW the receive power in W per band
386 * \param rxDuration the duration of the PPDU
387 */
389 RxPowerWattPerChannelBand& rxPowersW,
390 Time rxDuration);
391 /**
392 * Start receiving a given field.
393 *
394 * This method will call the DoStartReceiveField.
395 * EndReceiveField is also scheduled after the duration of the field
396 * (except for the special case of preambles \see DoStartReceivePreamble).
397 * The PHY is kept in CCA busy during the reception of the field (except for
398 * data field which should be in RX).
399 *
400 * \param field the starting PPDU field
401 * \param event the event holding incoming PPDU's information
402 */
403 void StartReceiveField(WifiPpduField field, Ptr<Event> event);
404 /**
405 * End receiving a given field.
406 *
407 * This method will call the DoEndReceiveField to obtain the outcome of the reception.
408 * In case of success, reception of the next field is triggered.
409 * In case of failure, the indications in the returned \see PhyFieldRxStatus
410 * are performed.
411 *
412 * \param field the ending PPDU field
413 * \param event the event holding incoming PPDU's information
414 */
415 void EndReceiveField(WifiPpduField field, Ptr<Event> event);
416
417 /**
418 * The last symbol of the PPDU has arrived.
419 *
420 * \param event the event holding incoming PPDU's information
421 */
422 void EndReceivePayload(Ptr<Event> event);
423
424 /**
425 * Reset PHY at the end of the PPDU under reception after it has failed the PHY header.
426 *
427 * \param event the event holding incoming PPDU's information
428 */
429 void ResetReceive(Ptr<Event> event);
430
431 /**
432 * Cancel and clear all running events.
433 */
434 virtual void CancelAllEvents();
435 /**
436 * \return \c true if there is no end preamble detection event running, \c false otherwise
437 */
438 bool NoEndPreambleDetectionEvents() const;
439 /**
440 * Cancel all end preamble detection events.
441 */
443
444 /**
445 * Return the STA ID that has been assigned to the station this PHY belongs to.
446 * This is typically called for MU PPDUs, in order to pick the correct PSDU.
447 *
448 * \param ppdu the PPDU for which the STA ID is requested
449 * \return the STA ID
450 */
451 virtual uint16_t GetStaId(const Ptr<const WifiPpdu> ppdu) const;
452
453 /**
454 * Determine whether the PHY shall issue a PHY-RXSTART.indication primitive in response to a
455 * given PPDU.
456 *
457 * \param ppdu the PPDU
458 * \return true if the PHY shall issue a PHY-RXSTART.indication primitive in response to a PPDU,
459 * false otherwise
460 */
461 virtual bool CanStartRx(Ptr<const WifiPpdu> ppdu) const;
462
463 /**
464 * Check if PHY state should move to CCA busy state based on current
465 * state of interference tracker.
466 *
467 * \param ppdu the incoming PPDU or nullptr for any signal
468 */
469 virtual void SwitchMaybeToCcaBusy(const Ptr<const WifiPpdu> ppdu);
470 /**
471 * Notify PHY state helper to switch to CCA busy state,
472 *
473 * \param ppdu the incoming PPDU or nullptr for any signal
474 * \param duration the duration of the CCA state
475 * \param channelType the channel type for which the CCA busy state is reported.
476 */
477 virtual void NotifyCcaBusy(const Ptr<const WifiPpdu> ppdu,
478 Time duration,
479 WifiChannelListType channelType);
480 /**
481 * This function is called by SpectrumWifiPhy to send
482 * the PPDU while performing amendment-specific actions.
483 * \see SpectrumWifiPhy::StartTx
484 *
485 * \param ppdu the PPDU to send
486 */
487 virtual void StartTx(Ptr<const WifiPpdu> ppdu);
488
489 /**
490 * This function prepares most of the WifiSpectrumSignalParameters
491 * parameters and invokes SpectrumWifiPhy's Transmit method.
492 * \see SpectrumWifiPhy::Transmit
493 *
494 * \param txDuration the duration of the transmission
495 * \param ppdu the PPDU to send
496 * \param txPowerDbm the total TX power in dBm
497 * \param txPowerSpectrum the TX PSD
498 * \param type the type of transmission (for logging)
499 */
500 void Transmit(Time txDuration,
502 double txPowerDbm,
503 Ptr<SpectrumValue> txPowerSpectrum,
504 const std::string& type);
505
506 /**
507 * \param psduMap the PSDU(s) to transmit indexed by STA-ID
508 * \param txVector the TXVECTOR used for the transmission of the PPDU
509 * \param band the frequency band being used
510 *
511 * \return the total amount of time this PHY will stay busy for the transmission of the PPDU
512 */
514 const WifiTxVector& txVector,
515 WifiPhyBand band) const;
516 /**
517 * Return the CCA threshold in dBm for a given channel type.
518 * If the channel type is not provided, the default CCA threshold is returned.
519 *
520 * \param ppdu the PPDU that is being received
521 * \param channelType the channel type
522 * \return the CCA threshold in dBm
523 */
524 virtual double GetCcaThreshold(const Ptr<const WifiPpdu> ppdu,
525 WifiChannelListType channelType) const;
526
527 /**
528 * The WifiPpdu from the TX PHY is received by each RX PHY attached to the same channel.
529 * By default and for performance reasons, all RX PHYs will work on the same WifiPpdu instance
530 * from TX instead of a copy of it. Child classes can change that behavior and do a copy and/or
531 * change the content of the parameters stored in WifiPpdu.
532 *
533 * \param ppdu the WifiPpdu transmitted by the TX PHY
534 * \return the WifiPpdu to be used by the RX PHY
535 */
537
538 /**
539 * Obtain the next UID for the PPDU to transmit.
540 * Note that the global UID counter could be incremented.
541 *
542 * \param txVector the transmission parameters
543 * \return the UID to use for the PPDU to transmit
544 */
545 virtual uint64_t ObtainNextUid(const WifiTxVector& txVector);
546
547 /**
548 * Obtain the maximum time between two PPDUs with the same UID to consider they are identical
549 * and their power can be added construtively.
550 *
551 * \param txVector the TXVECTOR used for the transmission of the PPDUs
552 * \return the maximum time between two PPDUs with the same UID to decode them
553 */
554 virtual Time GetMaxDelayPpduSameUid(const WifiTxVector& txVector);
555
556 protected:
557 /**
558 * A map of PPDU field elements per preamble type.
559 * This corresponds to the different PPDU formats introduced by each amendment.
560 */
561 typedef std::map<WifiPreamble, std::vector<WifiPpduField>> PpduFormats;
562
563 /**
564 * A pair to hold modulation information: code rate and constellation size.
565 */
566 typedef std::pair<WifiCodeRate, uint16_t> CodeRateConstellationSizePair;
567
568 /**
569 * A modulation lookup table using unique name of modulation as key.
570 */
571 typedef std::map<std::string, CodeRateConstellationSizePair> ModulationLookupTable;
572
573 /**
574 * Return the PPDU formats of the PHY.
575 *
576 * \return the PPDU formats of the PHY
577 */
578 virtual const PpduFormats& GetPpduFormats() const = 0;
579
580 /**
581 * Start receiving a given field, perform amendment-specific actions, and
582 * signify if it is supported.
583 *
584 * \param field the starting PPDU field
585 * \param event the event holding incoming PPDU's information
586 * \return \c true if the field is supported, \c false otherwise
587 */
588 virtual bool DoStartReceiveField(WifiPpduField field, Ptr<Event> event);
589 /**
590 * End receiving a given field, perform amendment-specific actions, and
591 * provide the status of the reception.
592 *
593 * \param field the ending PPDU field
594 * \param event the event holding incoming PPDU's information
595 * \return status of the reception of the PPDU field
596 */
598
599 /**
600 * Get the event corresponding to the incoming PPDU.
601 *
602 * We store all incoming preamble events, perform amendment-specific actions,
603 * and a decision is made at the end of the preamble detection window.
604 *
605 * \param ppdu the incoming PPDU
606 * \param rxPowersW the receive power in W per band
607 * \return the event holding the incoming PPDU's information
608 */
610 /**
611 * End receiving the preamble, perform amendment-specific actions, and
612 * provide the status of the reception.
613 *
614 * \param event the event holding incoming PPDU's information
615 * \return status of the reception of the preamble
616 */
618 /**
619 * Start the preamble detection period.
620 *
621 * \param event the event holding incoming PPDU's information
622 */
624 /**
625 * End the preamble detection period.
626 *
627 * The PHY will focus on the strongest PPDU and drop others.
628 * In addition, in case of successful detection, the end of the
629 * preamble reception is triggered (\see DoEndReceivePreamble).
630 *
631 * \param event the event holding incoming PPDU's information
632 */
634
635 /**
636 * Start receiving the PSDU (i.e. the first symbol of the PSDU has arrived).
637 *
638 * \param event the event holding incoming PPDU's information
639 */
641
642 /**
643 * Start receiving the PSDU (i.e. the first symbol of the PSDU has arrived)
644 * and perform amendment-specific actions.
645 *
646 * \param event the event holding incoming PPDU's information
647 * \return the payload duration
648 */
650
651 /**
652 * Perform amendment-specific actions before resetting PHY at
653 * the end of the PPDU under reception after it has failed the PHY header.
654 *
655 * \param event the event holding incoming PPDU's information
656 */
657 virtual void DoResetReceive(Ptr<Event> event);
658
659 /**
660 * Perform amendment-specific actions before aborting the
661 * current reception.
662 *
663 * \param reason the reason the reception is aborted
664 */
666
667 /**
668 * Checks if the signaled configuration (excluding bandwidth)
669 * is supported by the PHY.
670 *
671 * \param ppdu the received PPDU
672 * \return \c true if supported, \c false otherwise
673 */
674 virtual bool IsConfigSupported(Ptr<const WifiPpdu> ppdu) const;
675
676 /**
677 * Drop the PPDU and the corresponding preamble detection event, but keep CCA busy
678 * state after the completion of the currently processed event.
679 *
680 * \param ppdu the incoming PPDU
681 * \param reason the reason the PPDU is dropped
682 * \param endRx the end of the incoming PPDU's reception
683 */
685
686 /**
687 * Erase the event corresponding to the PPDU from the list of preamble events,
688 * but consider it as noise after the completion of the current event.
689 *
690 * \param ppdu the incoming PPDU
691 * \param rxDuration the duration of the PPDU
692 */
693 void ErasePreambleEvent(Ptr<const WifiPpdu> ppdu, Time rxDuration);
694
695 /**
696 * Get the reception status for the provided MPDU and notify.
697 *
698 * \param psdu the arriving MPDU formatted as a PSDU
699 * \param event the event holding incoming PPDU's information
700 * \param staId the station ID of the PSDU (only used for MU)
701 * \param relativeMpduStart the relative start time of the MPDU within the A-MPDU.
702 * 0 for normal MPDUs
703 * \param mpduDuration the duration of the MPDU
704 *
705 * \return information on MPDU reception: status, signal power (dBm), and noise power (in dBm)
706 */
707 std::pair<bool, SignalNoiseDbm> GetReceptionStatus(Ptr<const WifiPsdu> psdu,
708 Ptr<Event> event,
709 uint16_t staId,
710 Time relativeMpduStart,
711 Time mpduDuration);
712 /**
713 * The last symbol of an MPDU in an A-MPDU has arrived.
714 *
715 * \param event the event holding incoming PPDU's information
716 * \param psdu the arriving MPDU formatted as a PSDU containing a normal MPDU
717 * \param mpduIndex the index of the MPDU within the A-MPDU
718 * \param relativeStart the relative start time of the MPDU within the A-MPDU.
719 * \param mpduDuration the duration of the MPDU
720 */
721 void EndOfMpdu(Ptr<Event> event,
723 size_t mpduIndex,
724 Time relativeStart,
725 Time mpduDuration);
726
727 /**
728 * Schedule end of MPDUs events.
729 *
730 * \param event the event holding incoming PPDU's information
731 */
732 void ScheduleEndOfMpdus(Ptr<Event> event);
733
734 /**
735 * Perform amendment-specific actions when the payload is successfully received.
736 *
737 * \param psdu the successfully received PSDU
738 * \param rxSignalInfo the info on the received signal (\see RxSignalInfo)
739 * \param txVector TXVECTOR of the PSDU
740 * \param staId the station ID of the PSDU (only used for MU)
741 * \param statusPerMpdu reception status per MPDU
742 */
743 virtual void RxPayloadSucceeded(Ptr<const WifiPsdu> psdu,
744 RxSignalInfo rxSignalInfo,
745 const WifiTxVector& txVector,
746 uint16_t staId,
747 const std::vector<bool>& statusPerMpdu);
748 /**
749 * Perform amendment-specific actions when the payload is unsuccessfuly received.
750 *
751 * \param psdu the PSDU that we failed to received
752 * \param snr the SNR of the received PSDU in linear scale
753 * \param txVector TXVECTOR of the PSDU
754 */
755 virtual void RxPayloadFailed(Ptr<const WifiPsdu> psdu,
756 double snr,
757 const WifiTxVector& txVector);
758
759 /**
760 * Perform amendment-specific actions at the end of the reception of
761 * the payload.
762 *
763 * \param ppdu the incoming PPDU
764 */
765 virtual void DoEndReceivePayload(Ptr<const WifiPpdu> ppdu);
766
767 /**
768 * Get the channel width and band to use (will be overloaded by child classes).
769 *
770 * \param txVector the transmission parameters
771 * \param staId the station ID of the PSDU
772 * \return a pair of channel width (MHz) and band
773 */
774 virtual std::pair<uint16_t, WifiSpectrumBandInfo> GetChannelWidthAndBand(
775 const WifiTxVector& txVector,
776 uint16_t staId) const;
777
778 /**
779 * Abort the current reception.
780 *
781 * \param reason the reason the reception is aborted
782 */
784
785 /**
786 * Obtain a random value from the WifiPhy's generator.
787 * Wrapper used by child classes.
788 *
789 * \return a uniform random value
790 */
791 double GetRandomValue() const;
792 /**
793 * Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
794 * Wrapper used by child classes.
795 *
796 * \param field the PPDU field
797 * \param event the event holding incoming PPDU's information
798 * \return the SNR and PER
799 */
801 /**
802 * Obtain the received power (W) for a given band.
803 * Wrapper used by child classes.
804 *
805 * \param event the event holding incoming PPDU's information
806 * \return the received power (W) for the event over a given band
807 */
808 double GetRxPowerWForPpdu(Ptr<Event> event) const;
809 /**
810 * Get the pointer to the current event (stored in WifiPhy).
811 * Wrapper used by child classes.
812 *
813 * \return the pointer to the current event
814 */
816 /**
817 * Get the map of current preamble events (stored in WifiPhy).
818 * Wrapper used by child classes.
819 *
820 * \return the reference to the map of current preamble events
821 */
822 const std::map<std::pair<uint64_t, WifiPreamble>, Ptr<Event>>& GetCurrentPreambleEvents() const;
823 /**
824 * Add an entry to the map of current preamble events (stored in WifiPhy).
825 * Wrapper used by child classes.
826 *
827 * \param event the event holding incoming PPDU's information
828 */
829 void AddPreambleEvent(Ptr<Event> event);
830
831 /**
832 * Create an event using WifiPhy's InterferenceHelper class.
833 * Wrapper used by child classes.
834 *
835 * \param ppdu the PPDU
836 * \param duration the PPDU duration
837 * \param rxPower received power per band (W)
838 * \param isStartHePortionRxing flag whether the event corresponds to the start of the OFDMA
839 * payload reception (only used for UL-OFDMA) \return the created event
840 */
842 Time duration,
844 bool isStartHePortionRxing = false);
845 /**
846 * Handle reception of a PPDU that carries the same content of another PPDU.
847 * This is typically called upon reception of preambles of HE MU PPDUs or reception
848 * of non-HT duplicate control frames that carries the exact same content sent from different
849 * STAs. If the delay between the PPDU and the first PPDU carrying the same content is small
850 * enough, PPDU can be decoded and its power is added constructively, and the TXVECTOR is
851 * updated accordingly. Otherwise, a new interference event is created and PPDU is dropped by
852 * the PHY.
853 *
854 * \param event the event of the ongoing reception
855 * \param ppdu the newly received PPDU (UL MU or non-HT duplicate)
856 * \param rxPower the received power (W) per band of the newly received PPDU
857 */
858 virtual void HandleRxPpduWithSameContent(Ptr<Event> event,
861
862 /**
863 * Notify WifiPhy's InterferenceHelper of the end of the reception,
864 * clear maps and end of MPDU event, and eventually reset WifiPhy.
865 *
866 * \param reset whether to reset WifiPhy
867 */
868 void NotifyInterferenceRxEndAndClear(bool reset);
869
870 /**
871 * \param txPowerW power in W to spread across the bands
872 * \param ppdu the PPDU that will be transmitted
873 * \return Pointer to SpectrumValue
874 *
875 * This is a helper function to create the right TX PSD corresponding
876 * to the amendment of this PHY.
877 */
879 Ptr<const WifiPpdu> ppdu) const = 0;
880
881 /**
882 * Get the center frequency of the channel corresponding the current TxVector rather than
883 * that of the supported channel width.
884 * Consider that this "primary channel" is on the lower part for the time being.
885 *
886 * \param txVector the TXVECTOR that has the channel width that is to be used
887 * \return the center frequency in MHz corresponding to the channel width to be used
888 */
889 uint16_t GetCenterFrequencyForChannelWidth(const WifiTxVector& txVector) const;
890
891 /**
892 * Fire the trace indicating that the PHY is starting to receive the payload of a PPDU.
893 *
894 * \param txVector the TXVECTOR used to transmit the PPDU
895 * \param payloadDuration the TX duration of the PPDU payload
896 */
897 void NotifyPayloadBegin(const WifiTxVector& txVector, const Time& payloadDuration);
898
899 /**
900 * If the operating channel width is a multiple of 20 MHz, return the info
901 * corresponding to the primary channel of the given
902 * bandwidth (which must be a multiple of 20 MHz and not exceed the operating
903 * channel width). Otherwise, this call is equivalent to GetBand with
904 * <i>bandIndex</i> equal to zero.
905 *
906 * \param bandWidth the width of the band to be returned (MHz)
907 *
908 * \return the info corresponding to the band
909 */
910 WifiSpectrumBandInfo GetPrimaryBand(uint16_t bandWidth) const;
911 /**
912 * If the channel bonding is used, return the info corresponding to
913 * the secondary channel of the given bandwidth (which must be a multiple of 20 MHz
914 * and not exceed the operating channel width).
915 *
916 * \param bandWidth the width of the band to be returned (MHz)
917 *
918 * \return the info corresponding to the band
919 */
920 WifiSpectrumBandInfo GetSecondaryBand(uint16_t bandWidth) const;
921
922 /**
923 * Return the channel width used to measure the RSSI.
924 *
925 * \param ppdu the PPDU that is being received
926 * \return the channel width (in MHz) used for RSSI measurement
927 */
928 virtual uint16_t GetMeasurementChannelWidth(const Ptr<const WifiPpdu> ppdu) const = 0;
929
930 /**
931 * Return the channel width used in the reception spectrum model.
932 *
933 * \param txVector the TXVECTOR of the PPDU that is being received
934 * \return the channel width (in MHz) used for RxSpectrumModel
935 */
936 virtual uint16_t GetRxChannelWidth(const WifiTxVector& txVector) const;
937
938 /**
939 * Return the delay until CCA busy is ended for a given sensitivity threshold (in dBm) and a
940 * given band.
941 *
942 * \param thresholdDbm the CCA sensitivity threshold in dBm
943 * \param band identify the requested band
944 * \return the delay until CCA busy is ended
945 */
946 Time GetDelayUntilCcaEnd(double thresholdDbm, const WifiSpectrumBandInfo& band);
947
948 /**
949 * \param currentChannelWidth channel width of the current transmission (MHz)
950 * \return the width of the guard band (MHz)
951 *
952 * Wrapper method used by child classes for PSD generation.
953 * Note that this method is necessary for testing UL OFDMA.
954 */
955 uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const;
956 /**
957 * \return a tuple containing the minimum rejection (in dBr) for the inner band,
958 * the minimum rejection (in dBr) for the outer band, and
959 * the maximum rejection (in dBr) for the outer band
960 * for the transmit spectrum mask.
961 *
962 * Wrapper method used by child classes for PSD generation.
963 */
964 std::tuple<double, double, double> GetTxMaskRejectionParams() const;
965
967 std::optional<std::pair<Time, WifiChannelListType>>; //!< CCA end time and its corresponding
968 //!< channel list type (can be
969 //!< std::nullopt if IDLE)
970
971 /**
972 * Get CCA end time and its corresponding channel list type when a new signal has been received
973 * by the PHY.
974 *
975 * \param ppdu the incoming PPDU or nullptr for any signal
976 * \return CCA end time and its corresponding channel list type when a new signal has been
977 * received by the PHY, or std::nullopt if all channel list types are IDLE.
978 */
980
981 Ptr<WifiPhy> m_wifiPhy; //!< Pointer to the owning WifiPhy
982 Ptr<WifiPhyStateHelper> m_state; //!< Pointer to WifiPhyStateHelper of the WifiPhy (to make it
983 //!< reachable for child classes)
984
985 std::list<WifiMode> m_modeList; //!< the list of supported modes
986
987 std::vector<EventId> m_endPreambleDetectionEvents; //!< the end of preamble detection events
988 std::vector<EventId> m_endOfMpduEvents; //!< the end of MPDU events (only used for A-MPDUs)
989
990 std::vector<EventId>
991 m_endRxPayloadEvents; //!< the end of receive events (only one unless UL MU reception)
992
993 /**
994 * A pair of a UID and STA_ID
995 */
996 typedef std::pair<uint64_t /* UID */, uint16_t /* STA-ID */> UidStaIdPair;
997
998 std::map<UidStaIdPair, std::vector<bool>>
999 m_statusPerMpduMap; //!< Map of the current reception status per MPDU that is filled in as
1000 //!< long as MPDUs are being processed by the PHY in case of an A-MPDU
1001 std::map<UidStaIdPair, SignalNoiseDbm>
1002 m_signalNoiseMap; //!< Map of the latest signal power and noise power in dBm (noise power
1003 //!< includes the noise figure)
1004
1005 static uint64_t m_globalPpduUid; //!< Global counter of the PPDU UID
1006}; // class PhyEntity
1007
1008/**
1009 * \brief Stream insertion operator.
1010 *
1011 * \param os the stream
1012 * \param action the action to perform in case of failure
1013 * \returns a reference to the stream
1014 */
1015std::ostream& operator<<(std::ostream& os, const PhyEntity::PhyRxFailureAction& action);
1016/**
1017 * \brief Stream insertion operator.
1018 *
1019 * \param os the stream
1020 * \param status the status of the reception of a PPDU field
1021 * \returns a reference to the stream
1022 */
1023std::ostream& operator<<(std::ostream& os, const PhyEntity::PhyFieldRxStatus& status);
1024
1025} // namespace ns3
1026
1027#endif /* PHY_ENTITY_H */
handles interference calculations
handles interference calculations
Abstract class for PHY entities.
Definition: phy-entity.h:96
void NotifyPayloadBegin(const WifiTxVector &txVector, const Time &payloadDuration)
Fire the trace indicating that the PHY is starting to receive the payload of a PPDU.
Definition: phy-entity.cc:1311
virtual void HandleRxPpduWithSameContent(Ptr< Event > event, Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPower)
Handle reception of a PPDU that carries the same content of another PPDU.
Definition: phy-entity.cc:885
void DropPreambleEvent(Ptr< const WifiPpdu > ppdu, WifiPhyRxfailureReason reason, Time endRx)
Drop the PPDU and the corresponding preamble detection event, but keep CCA busy state after the compl...
Definition: phy-entity.cc:518
std::list< WifiMode >::const_iterator end() const
Return a const iterator to past-the-last WifiMode.
Definition: phy-entity.cc:147
virtual void RxPayloadSucceeded(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, uint16_t staId, const std::vector< bool > &statusPerMpdu)
Perform amendment-specific actions when the payload is successfully received.
Definition: phy-entity.cc:756
virtual PhyFieldRxStatus DoEndReceivePreamble(Ptr< Event > event)
End receiving the preamble, perform amendment-specific actions, and provide the status of the recepti...
Definition: phy-entity.cc:934
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper of the WifiPhy (to make it reachable for child classes)
Definition: phy-entity.h:982
virtual void RxPayloadFailed(Ptr< const WifiPsdu > psdu, double snr, const WifiTxVector &txVector)
Perform amendment-specific actions when the payload is unsuccessfuly received.
Definition: phy-entity.cc:767
void EndPreambleDetectionPeriod(Ptr< Event > event)
End the preamble detection period.
Definition: phy-entity.cc:959
virtual void NotifyCcaBusy(const Ptr< const WifiPpdu > ppdu, Time duration, WifiChannelListType channelType)
Notify PHY state helper to switch to CCA busy state,.
Definition: phy-entity.cc:1279
virtual Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration)
Build amendment-specific PPDU.
Definition: phy-entity.cc:244
virtual Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
Definition: phy-entity.cc:193
std::tuple< double, double, double > GetTxMaskRejectionParams() const
Definition: phy-entity.cc:1357
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
Definition: phy-entity.cc:1289
virtual Time DoStartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: phy-entity.cc:573
Time GetDelayUntilCcaEnd(double thresholdDbm, const WifiSpectrumBandInfo &band)
Return the delay until CCA busy is ended for a given sensitivity threshold (in dBm) and a given band.
Definition: phy-entity.cc:1235
virtual void StartReceivePreamble(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: phy-entity.cc:400
virtual Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype, bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols, uint16_t staId) const =0
bool NoEndPreambleDetectionEvents() const
Definition: phy-entity.cc:1125
virtual bool HandlesMcsModes() const
Check if the WifiModes handled by this PHY are MCSs.
Definition: phy-entity.cc:135
std::pair< WifiCodeRate, uint16_t > CodeRateConstellationSizePair
A pair to hold modulation information: code rate and constellation size.
Definition: phy-entity.h:566
const std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > & GetCurrentPreambleEvents() const
Get the map of current preamble events (stored in WifiPhy).
Definition: phy-entity.cc:837
std::map< UidStaIdPair, SignalNoiseDbm > m_signalNoiseMap
Map of the latest signal power and noise power in dBm (noise power includes the noise figure)
Definition: phy-entity.h:1002
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
Definition: phy-entity.h:981
void Transmit(Time txDuration, Ptr< const WifiPpdu > ppdu, double txPowerDbm, Ptr< SpectrumValue > txPowerSpectrum, const std::string &type)
This function prepares most of the WifiSpectrumSignalParameters parameters and invokes SpectrumWifiPh...
Definition: phy-entity.cc:1327
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
Definition: phy-entity.h:571
virtual Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const =0
WifiSpectrumBandInfo GetSecondaryBand(uint16_t bandWidth) const
If the channel bonding is used, return the info corresponding to the secondary channel of the given b...
Definition: phy-entity.cc:1214
std::pair< std::pair< Time, Time >, WifiMode > PhyHeaderChunkInfo
A pair containing information on the PHY header chunk, namely the start and stop times of the chunk a...
Definition: phy-entity.h:321
std::vector< EventId > m_endOfMpduEvents
the end of MPDU events (only used for A-MPDUs)
Definition: phy-entity.h:988
virtual uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const =0
Return the channel width used to measure the RSSI.
virtual ~PhyEntity()
Destructor for PHY entity.
Definition: phy-entity.cc:84
virtual double GetCcaThreshold(const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType) const
Return the CCA threshold in dBm for a given channel type.
Definition: phy-entity.cc:1228
virtual const PpduFormats & GetPpduFormats() const =0
Return the PPDU formats of the PHY.
virtual uint8_t GetNumModes() const
Definition: phy-entity.cc:113
virtual bool DoStartReceiveField(WifiPpduField field, Ptr< Event > event)
Start receiving a given field, perform amendment-specific actions, and signify if it is supported.
Definition: phy-entity.cc:369
void SetOwner(Ptr< WifiPhy > wifiPhy)
Set the WifiPhy owning this PHY entity.
Definition: phy-entity.cc:92
std::list< WifiMode >::const_iterator begin() const
Return a const iterator to the first WifiMode.
Definition: phy-entity.cc:141
virtual void CancelAllEvents()
Cancel and clear all running events.
Definition: phy-entity.cc:1108
virtual uint32_t GetMaxPsduSize() const =0
Get the maximum PSDU size in bytes.
virtual void DoAbortCurrentReception(WifiPhyRxfailureReason reason)
Perform amendment-specific actions before aborting the current reception.
Definition: phy-entity.cc:1150
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Abort the current reception.
Definition: phy-entity.cc:1142
void EndReceivePayload(Ptr< Event > event)
The last symbol of the PPDU has arrived.
Definition: phy-entity.cc:694
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:561
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
Definition: phy-entity.h:1005
PhyHeaderSections GetPhyHeaderSections(const WifiTxVector &txVector, Time ppduStart) const
Return a map of PHY header chunk information per PPDU field.
Definition: phy-entity.cc:226
virtual bool IsMcsSupported(uint8_t index) const
Check if the WifiMode corresponding to the given MCS index is supported.
Definition: phy-entity.cc:127
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: phy-entity.cc:563
std::vector< EventId > m_endRxPayloadEvents
the end of receive events (only one unless UL MU reception)
Definition: phy-entity.h:991
virtual void DoResetReceive(Ptr< Event > event)
Perform amendment-specific actions before resetting PHY at the end of the PPDU under reception after ...
Definition: phy-entity.cc:1178
void EndReceiveField(WifiPpduField field, Ptr< Event > event)
End receiving a given field.
Definition: phy-entity.cc:309
virtual Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW)
Get the event corresponding to the incoming PPDU.
Definition: phy-entity.cc:851
virtual WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const
Get the WifiMode for the SIG field specified by the PPDU field.
Definition: phy-entity.cc:153
WifiPpduField GetNextField(WifiPpduField currentField, WifiPreamble preamble) const
Return the field following the provided one.
Definition: phy-entity.cc:162
void CancelRunningEndPreambleDetectionEvents()
Cancel all end preamble detection events.
Definition: phy-entity.cc:1131
std::map< WifiPpduField, PhyHeaderChunkInfo > PhyHeaderSections
A map of PhyHeaderChunkInfo elements per PPDU field.
Definition: phy-entity.h:326
double GetRxPowerWForPpdu(Ptr< Event > event) const
Obtain the received power (W) for a given band.
Definition: phy-entity.cc:1191
virtual void SwitchMaybeToCcaBusy(const Ptr< const WifiPpdu > ppdu)
Check if PHY state should move to CCA busy state based on current state of interference tracker.
Definition: phy-entity.cc:1241
Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector) const
Definition: phy-entity.cc:203
void NotifyInterferenceRxEndAndClear(bool reset)
Notify WifiPhy's InterferenceHelper of the end of the reception, clear maps and end of MPDU event,...
Definition: phy-entity.cc:917
void StartPreambleDetectionPeriod(Ptr< Event > event)
Start the preamble detection period.
Definition: phy-entity.cc:944
Time GetDurationUpToField(WifiPpduField field, const WifiTxVector &txVector) const
Get the duration of the PPDU up to (but excluding) the given field.
Definition: phy-entity.cc:255
std::map< UidStaIdPair, std::vector< bool > > m_statusPerMpduMap
Map of the current reception status per MPDU that is filled in as long as MPDUs are being processed b...
Definition: phy-entity.h:999
virtual bool CanStartRx(Ptr< const WifiPpdu > ppdu) const
Determine whether the PHY shall issue a PHY-RXSTART.indication primitive in response to a given PPDU.
Definition: phy-entity.cc:1373
virtual void StartTx(Ptr< const WifiPpdu > ppdu)
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actio...
Definition: phy-entity.cc:1317
virtual uint16_t GetRxChannelWidth(const WifiTxVector &txVector) const
Return the channel width used in the reception spectrum model.
Definition: phy-entity.cc:1222
Time GetRemainingDurationAfterField(Ptr< const WifiPpdu > ppdu, WifiPpduField field) const
Get the remaining duration of the PPDU after the end of the given field.
Definition: phy-entity.cc:361
virtual uint16_t GetStaId(const Ptr< const WifiPpdu > ppdu) const
Return the STA ID that has been assigned to the station this PHY belongs to.
Definition: phy-entity.cc:557
virtual Time CalculateTxDuration(WifiConstPsduMap psduMap, const WifiTxVector &txVector, WifiPhyBand band) const
Definition: phy-entity.cc:1363
void StartReceiveField(WifiPpduField field, Ptr< Event > event)
Start receiving a given field.
Definition: phy-entity.cc:282
uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const
Definition: phy-entity.cc:1351
virtual bool IsModeSupported(WifiMode mode) const
Check if the WifiMode is supported.
Definition: phy-entity.cc:100
void ResetReceive(Ptr< Event > event)
Reset PHY at the end of the PPDU under reception after it has failed the PHY header.
Definition: phy-entity.cc:1164
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:969
virtual CcaIndication GetCcaIndication(const Ptr< const WifiPpdu > ppdu)
Get CCA end time and its corresponding channel list type when a new signal has been received by the P...
Definition: phy-entity.cc:1264
std::list< WifiMode > m_modeList
the list of supported modes
Definition: phy-entity.h:985
virtual Time GetMaxDelayPpduSameUid(const WifiTxVector &txVector)
Obtain the maximum time between two PPDUs with the same UID to consider they are identical and their ...
Definition: phy-entity.cc:1296
std::pair< uint64_t, uint16_t > UidStaIdPair
A pair of a UID and STA_ID.
Definition: phy-entity.h:996
Ptr< const Event > GetCurrentEvent() const
Get the pointer to the current event (stored in WifiPhy).
Definition: phy-entity.cc:1197
double GetRandomValue() const
Obtain a random value from the WifiPhy's generator.
Definition: phy-entity.cc:1185
std::vector< EventId > m_endPreambleDetectionEvents
the end of preamble detection events
Definition: phy-entity.h:987
virtual Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
Definition: phy-entity.cc:220
SnrPer GetPhyHeaderSnrPer(WifiPpduField field, Ptr< Event > event) const
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
Definition: phy-entity.cc:271
void ErasePreambleEvent(Ptr< const WifiPpdu > ppdu, Time rxDuration)
Erase the event corresponding to the PPDU from the list of preamble events, but consider it as noise ...
Definition: phy-entity.cc:536
virtual Ptr< const WifiPpdu > GetRxPpduFromTxPpdu(Ptr< const WifiPpdu > ppdu)
The WifiPpdu from the TX PHY is received by each RX PHY attached to the same channel.
Definition: phy-entity.cc:1394
virtual WifiMode GetMcs(uint8_t index) const
Get the WifiMode corresponding to the given MCS index.
Definition: phy-entity.cc:119
void AddPreambleEvent(Ptr< Event > event)
Add an entry to the map of current preamble events (stored in WifiPhy).
Definition: phy-entity.cc:843
virtual void DoEndReceivePayload(Ptr< const WifiPpdu > ppdu)
Perform amendment-specific actions at the end of the reception of the payload.
Definition: phy-entity.cc:774
uint16_t GetCenterFrequencyForChannelWidth(const WifiTxVector &txVector) const
Get the center frequency of the channel corresponding the current TxVector rather than that of the su...
Definition: phy-entity.cc:1302
virtual WifiConstPsduMap GetWifiConstPsduMap(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector) const
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
Definition: phy-entity.cc:214
virtual std::pair< uint16_t, WifiSpectrumBandInfo > GetChannelWidthAndBand(const WifiTxVector &txVector, uint16_t staId) const
Get the channel width and band to use (will be overloaded by child classes).
Definition: phy-entity.cc:830
virtual bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
Definition: phy-entity.cc:1095
Ptr< Event > CreateInterferenceEvent(Ptr< const WifiPpdu > ppdu, Time duration, RxPowerWattPerChannelBand &rxPower, bool isStartHePortionRxing=false)
Create an event using WifiPhy's InterferenceHelper class.
Definition: phy-entity.cc:872
PhyRxFailureAction
Action to perform in case of RX failure.
Definition: phy-entity.h:102
@ DROP
drop PPDU and set CCA_BUSY
Definition: phy-entity.h:103
@ IGNORE
ignore the reception
Definition: phy-entity.h:105
@ ABORT
abort reception of PPDU
Definition: phy-entity.h:104
std::pair< bool, SignalNoiseDbm > GetReceptionStatus(Ptr< const WifiPsdu > psdu, Ptr< Event > event, uint16_t staId, Time relativeMpduStart, Time mpduDuration)
Get the reception status for the provided MPDU and notify.
Definition: phy-entity.cc:786
WifiSpectrumBandInfo GetPrimaryBand(uint16_t bandWidth) const
If the operating channel width is a multiple of 20 MHz, return the info corresponding to the primary ...
Definition: phy-entity.cc:1203
void EndOfMpdu(Ptr< Event > event, Ptr< const WifiPsdu > psdu, size_t mpduIndex, Time relativeStart, Time mpduDuration)
The last symbol of an MPDU in an A-MPDU has arrived.
Definition: phy-entity.cc:657
virtual PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event)
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
Definition: phy-entity.cc:388
void ScheduleEndOfMpdus(Ptr< Event > event)
Schedule end of MPDUs events.
Definition: phy-entity.cc:595
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
A template-based reference counting class.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
represent a single transmission mode
Definition: wifi-mode.h:51
802.11 PHY layer model
Definition: wifi-phy.h:65
This objects implements the PHY state machine of the Wifi device.
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:57
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition: wifi-psdu.h:43
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)
MpduType
The type of an MPDU.
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::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
std::map< WifiSpectrumBandInfo, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Definition: phy-entity.h:77
MpduInfo structure.
Definition: phy-entity.h:62
MpduType type
type of MPDU
Definition: phy-entity.h:63
uint32_t mpduRefNumber
MPDU ref number.
Definition: phy-entity.h:64
Status of the reception of the PPDU field.
Definition: phy-entity.h:112
WifiPhyRxfailureReason reason
failure reason
Definition: phy-entity.h:114
PhyRxFailureAction actionIfFailure
action to perform in case of failure
Definition: phy-entity.h:115
PhyFieldRxStatus(bool s, WifiPhyRxfailureReason r, PhyRxFailureAction a)
Constructor.
Definition: phy-entity.h:135
PhyFieldRxStatus(bool s)
Constructor setting outcome of reception.
Definition: phy-entity.h:123
bool isSuccess
outcome (true if success) of the reception
Definition: phy-entity.h:113
A struct for both SNR and PER.
Definition: phy-entity.h:147
SnrPer(double s, double p)
Constructor for SnrPer.
Definition: phy-entity.h:164
double snr
SNR in linear scale.
Definition: phy-entity.h:148
SnrPer()
Default constructor.
Definition: phy-entity.h:154
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:69
double rssi
RSSI in dBm.
Definition: phy-entity.h:71
double snr
SNR in linear scale.
Definition: phy-entity.h:70
SignalNoiseDbm structure.
Definition: phy-entity.h:55
double noise
noise power in dBm
Definition: phy-entity.h:57
double signal
signal strength in dBm
Definition: phy-entity.h:56
WifiSpectrumBandInfo structure containing info about a spectrum band.
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.