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