A Discrete-Event Network Simulator
API
phy-entity.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Orange Labs
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Rediet <getachew.redieteab@orange.com>
19  * S├ębastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy and spectrum-wifi-phy)
20  * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (for logic ported from wifi-phy)
21  */
22 
23 #ifndef PHY_ENTITY_H
24 #define PHY_ENTITY_H
25 
26 #include "wifi-mpdu-type.h"
27 #include "wifi-tx-vector.h"
28 #include "wifi-phy-band.h"
29 #include "wifi-ppdu.h"
30 #include "wifi-mpdu-type.h"
31 #include "wifi-ppdu.h"
32 #include "ns3/event-id.h"
33 #include "ns3/simple-ref-count.h"
34 #include "ns3/nstime.h"
35 #include "ns3/wifi-spectrum-value-helper.h"
36 #include <list>
37 #include <map>
38 #include <tuple>
39 
49 namespace ns3 {
50 
53 {
54  double signal;
55  double noise;
56 };
57 
59 struct MpduInfo
60 {
62  uint32_t mpduRefNumber;
63 };
64 
67 {
68  double snr;
69  double rssi;
70 };
71 
75 typedef std::map <WifiSpectrumBand, double> RxPowerWattPerChannelBand;
76 
77 class WifiPsdu;
78 class WifiPhy;
79 class InterferenceHelper;
80 class Event;
81 class WifiPhyStateHelper;
82 class WifiPsdu;
83 class WifiPpdu;
84 
93 class PhyEntity : public SimpleRefCount<PhyEntity>
94 {
95 public:
96 
101  {
102  DROP = 0,
104  IGNORE
105  };
106 
111  {
112  /* *NS_CHECK_STYLE_OFF* */
113  bool isSuccess {true};
116 
121  PhyFieldRxStatus (bool s) : isSuccess (s) {};
130  /* *NS_CHECK_STYLE_ON* */
131  };
132 
136  struct SnrPer
137  {
138  double snr {0.0};
139  double per {1.0};
140 
143  SnrPer () {};
150  SnrPer (double s, double p) : snr (s), per (p) {};
151  };
152 
156  virtual ~PhyEntity ();
157 
163  void SetOwner (Ptr<WifiPhy> wifiPhy);
164 
172  virtual bool IsModeSupported (WifiMode mode) const;
176  virtual uint8_t GetNumModes (void) const;
177 
186  virtual WifiMode GetMcs (uint8_t index) const;
196  virtual bool IsMcsSupported (uint8_t index) const;
203  virtual bool HandlesMcsModes (void) const;
204 
213  virtual WifiMode GetSigMode (WifiPpduField field, const WifiTxVector& txVector) const;
214 
220  std::list<WifiMode>::const_iterator begin (void) const;
226  std::list<WifiMode>::const_iterator end (void) const;
227 
235  WifiPpduField GetNextField (WifiPpduField currentField, WifiPreamble preamble) const;
236 
246  virtual Time GetDuration (WifiPpduField field, const WifiTxVector& txVector) const;
253 
270  virtual Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype,
271  bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols,
272  uint16_t staId) const = 0;
273 
283  virtual WifiConstPsduMap GetWifiConstPsduMap (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector) const;
284 
290  virtual uint32_t GetMaxPsduSize (void) const = 0;
291 
296  typedef std::pair<std::pair<Time /* start */, Time /* stop */>, WifiMode> PhyHeaderChunkInfo;
301  typedef std::map<WifiPpduField, PhyHeaderChunkInfo> PhyHeaderSections;
313  PhyHeaderSections GetPhyHeaderSections (const WifiTxVector& txVector, Time ppduStart) const;
314 
324  virtual Ptr<WifiPpdu> BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration);
325 
333  Time GetDurationUpToField (WifiPpduField field, const WifiTxVector& txVector) const;
342 
350 
361  virtual void StartReceivePreamble (Ptr<WifiPpdu> ppdu, RxPowerWattPerChannelBand& rxPowersW,
362  Time rxDuration);
375  void StartReceiveField (WifiPpduField field, Ptr<Event> event);
387  void EndReceiveField (WifiPpduField field, Ptr<Event> event);
388 
394  void EndReceivePayload (Ptr<Event> event);
395 
401  void ResetReceive (Ptr<Event> event);
402 
406  virtual void CancelAllEvents (void);
410  bool NoEndPreambleDetectionEvents (void) const;
416  void CancelRunningEndPreambleDetectionEvents (bool clear = false);
417 
425  virtual uint16_t GetStaId (const Ptr<const WifiPpdu> ppdu) const;
426 
433  virtual uint16_t GetMeasurementChannelWidth (const Ptr<const WifiPpdu> ppdu) const;
434 
441  virtual uint16_t GetRxChannelWidth (const WifiTxVector& txVector) const;
442 
450  virtual void StartTx (Ptr<WifiPpdu> ppdu);
451 
461  void Transmit (Time txDuration, Ptr<WifiPpdu> ppdu, std::string type);
462 
470  virtual Time CalculateTxDuration (WifiConstPsduMap psduMap, const WifiTxVector& txVector, WifiPhyBand band) const;
471 
472 protected:
477  typedef std::map<WifiPreamble, std::vector<WifiPpduField> > PpduFormats;
478 
482  typedef std::pair<WifiCodeRate, uint16_t> CodeRateConstellationSizePair;
483 
487  typedef std::map<std::string, CodeRateConstellationSizePair> ModulationLookupTable;
488 
494  virtual const PpduFormats & GetPpduFormats (void) const = 0;
495 
504  virtual bool DoStartReceiveField (WifiPpduField field, Ptr<Event> event);
514 
550 
556  void StartReceivePayload (Ptr<Event> event);
557 
564  virtual void DoStartReceivePayload (Ptr<Event> event);
565 
572  virtual void DoResetReceive (Ptr<Event> event);
573 
580  virtual void DoAbortCurrentReception (WifiPhyRxfailureReason reason);
581 
589  virtual bool IsConfigSupported (Ptr<const WifiPpdu> ppdu) const;
590 
600  void DropPreambleEvent (Ptr<const WifiPpdu> ppdu, WifiPhyRxfailureReason reason, Time endRx, uint16_t measurementChannelWidth);
601 
609  void ErasePreambleEvent (Ptr<const WifiPpdu> ppdu, Time rxDuration);
610 
622  std::pair<bool, SignalNoiseDbm> GetReceptionStatus (Ptr<const WifiPsdu> psdu,
623  Ptr<Event> event, uint16_t staId,
624  Time relativeMpduStart,
625  Time mpduDuration);
635  void EndOfMpdu (Ptr<Event> event, Ptr<const WifiPsdu> psdu, size_t mpduIndex, Time relativeStart, Time mpduDuration);
636 
642  void ScheduleEndOfMpdus (Ptr<Event> event);
643 
650  virtual void DoEndReceivePayload (Ptr<const WifiPpdu> ppdu);
651 
659  virtual std::pair<uint16_t, WifiSpectrumBand> GetChannelWidthAndBand (const WifiTxVector& txVector, uint16_t staId) const;
660 
667 
674  double GetRandomValue (void) const;
683  SnrPer GetPhyHeaderSnrPer (WifiPpduField field, Ptr<Event> event) const;
691  double GetRxPowerWForPpdu (Ptr<Event> event) const;
698  Ptr<const Event> GetCurrentEvent (void) const;
705  const std::map <std::pair<uint64_t, WifiPreamble>, Ptr<Event> > & GetCurrentPreambleEvents (void) const;
712  void AddPreambleEvent (Ptr<Event> event);
713 
720  Ptr<Event> CreateInterferenceEvent (Ptr<const WifiPpdu> ppdu, const WifiTxVector& txVector, Time duration, RxPowerWattPerChannelBand& rxPower, bool isStartOfdmaRxing = false);
727  void UpdateInterferenceEvent (Ptr<Event> event, const RxPowerWattPerChannelBand& rxPower);
734  void NotifyInterferenceRxEndAndClear (bool reset);
735 
743  virtual uint64_t ObtainNextUid (const WifiTxVector& txVector);
744 
753  virtual Ptr<SpectrumValue> GetTxPowerSpectralDensity (double txPowerW, Ptr<const WifiPpdu> ppdu) const = 0;
754 
763  uint16_t GetCenterFrequencyForChannelWidth (const WifiTxVector& txVector) const;
764 
772  uint16_t GetGuardBandwidth (uint16_t currentChannelWidth) const;
781  std::tuple<double, double, double> GetTxMaskRejectionParams (void) const;
782 
785 
786  std::list<WifiMode> m_modeList;
787 
788  std::vector <EventId> m_endPreambleDetectionEvents;
789  std::vector <EventId> m_endOfMpduEvents;
790 
791  std::vector <EventId> m_endRxPayloadEvents;
792 
796  typedef std::pair <uint64_t /* UID */, uint16_t /* STA-ID */> UidStaIdPair;
797 
798  std::map<UidStaIdPair, std::vector<bool> > m_statusPerMpduMap;
799  std::map<UidStaIdPair, SignalNoiseDbm> m_signalNoiseMap;
800 
801  static uint64_t m_globalPpduUid;
802 }; //class PhyEntity
803 
811 std::ostream& operator<< (std::ostream& os, const PhyEntity::PhyRxFailureAction &action);
819 std::ostream& operator<< (std::ostream& os, const PhyEntity::PhyFieldRxStatus &status);
820 
821 } //namespace ns3
822 
823 #endif /* PHY_ENTITY_H */
ns3::SignalNoiseDbm::noise
double noise
noise power in dBm
Definition: phy-entity.h:55
ns3::PhyEntity::PpduFormats
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:477
ns3::PhyEntity::GetRxChannelWidth
virtual uint16_t GetRxChannelWidth(const WifiTxVector &txVector) const
Return the channel width used in the reception spectrum model.
Definition: phy-entity.cc:1013
ns3::PhyEntity::GetPhyHeaderSections
PhyHeaderSections GetPhyHeaderSections(const WifiTxVector &txVector, Time ppduStart) const
Return a map of PHY header chunk information per PPDU field.
Definition: phy-entity.cc:209
ns3::PhyEntity::StartPreambleDetectionPeriod
void StartPreambleDetectionPeriod(Ptr< Event > event)
Start the preamble detection period.
Definition: phy-entity.cc:786
ns3::PhyEntity::CalculatePhyPreambleAndHeaderDuration
Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector) const
Definition: phy-entity.cc:186
ns3::PhyEntity::ErasePreambleEvent
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:498
ns3::PhyEntity::DoEndReceivePayload
virtual void DoEndReceivePayload(Ptr< const WifiPpdu > ppdu)
Perform amendment-specific actions at the end of the reception of the payload.
Definition: phy-entity.cc:670
ns3::PhyEntity::DoEndReceivePreamble
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:778
ns3::PhyEntity::m_modeList
std::list< WifiMode > m_modeList
the list of supported modes
Definition: phy-entity.h:786
ns3::PhyEntity::EndReceiveField
void EndReceiveField(WifiPpduField field, Ptr< Event > event)
End receiving a given field.
Definition: phy-entity.cc:279
ns3::PhyEntity::DoResetReceive
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:982
ns3::PhyEntity::m_signalNoiseMap
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:799
ns3::PhyEntity::GetCenterFrequencyForChannelWidth
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:1026
ns3::PhyEntity::EndPreambleDetectionPeriod
void EndPreambleDetectionPeriod(Ptr< Event > event)
End the preamble detection period.
Definition: phy-entity.cc:795
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PhyEntity::m_statusPerMpduMap
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:798
ns3::PhyEntity::GetReceptionStatus
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:682
ns3::PhyEntity::GetGuardBandwidth
uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const
Definition: phy-entity.cc:1059
ns3::PhyEntity::SetOwner
void SetOwner(Ptr< WifiPhy > wifiPhy)
Set the WifiPhy owning this PHY entity.
Definition: phy-entity.cc:82
ns3::PhyEntity::SnrPer::snr
double snr
SNR in linear scale.
Definition: phy-entity.h:138
ns3::PhyEntity::EndReceivePayload
void EndReceivePayload(Ptr< Event > event)
The last symbol of the PPDU has arrived.
Definition: phy-entity.cc:631
ns3::PhyEntity::begin
std::list< WifiMode >::const_iterator begin(void) const
Return a const iterator to the first WifiMode.
Definition: phy-entity.cc:129
ns3::PhyEntity::CalculateTxDuration
virtual Time CalculateTxDuration(WifiConstPsduMap psduMap, const WifiTxVector &txVector, WifiPhyBand band) const
Definition: phy-entity.cc:1071
ns3::PhyEntity::ScheduleEndOfMpdus
void ScheduleEndOfMpdus(Ptr< Event > event)
Schedule end of MPDUs events.
Definition: phy-entity.cc:554
ns3::PhyEntity::IsModeSupported
virtual bool IsModeSupported(WifiMode mode) const
Check if the WifiMode is supported.
Definition: phy-entity.cc:90
ns3::PhyEntity::PhyFieldRxStatus::actionIfFailure
PhyRxFailureAction actionIfFailure
action to perform in case of failure
Definition: phy-entity.h:115
ns3::PhyEntity::CreateInterferenceEvent
Ptr< Event > CreateInterferenceEvent(Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector, Time duration, RxPowerWattPerChannelBand &rxPower, bool isStartOfdmaRxing=false)
Create an event using WifiPhy's InterferenceHelper class.
Definition: phy-entity.cc:749
ns3::SimpleRefCount
A template-based reference counting class.
Definition: simple-ref-count.h:74
ns3::PhyEntity::GetStaId
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:519
ns3::Event
handles interference calculations
Definition: interference-helper.h:38
ns3::PhyEntity::GetWifiConstPsduMap
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:197
ns3::PhyEntity::GetRxPowerWForPpdu
double GetRxPowerWForPpdu(Ptr< Event > event) const
Obtain the received power (W) for a given band.
Definition: phy-entity.cc:995
ns3::WifiPpdu
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:52
ns3::PhyEntity::ABORT
@ ABORT
abort reception of PPDU
Definition: phy-entity.h:103
ns3::PhyEntity::DoGetEvent
virtual Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW)
Get the event corresponding to the incoming PPDU.
Definition: phy-entity.cc:737
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiPsdu
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition: wifi-psdu.h:41
ns3::PhyEntity::CancelRunningEndPreambleDetectionEvents
void CancelRunningEndPreambleDetectionEvents(bool clear=false)
Cancel and eventually clear all end preamble detection events.
Definition: phy-entity.cc:933
wifi-phy-band.h
ns3::WifiConstPsduMap
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition: he-frame-exchange-manager.h:43
ns3::PhyEntity::StartTx
virtual void StartTx(Ptr< WifiPpdu > ppdu)
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actio...
Definition: phy-entity.cc:1034
ns3::WifiPhy
802.11 PHY layer model
Definition: wifi-phy.h:49
ns3::PhyEntity::AddPreambleEvent
void AddPreambleEvent(Ptr< Event > event)
Add an entry to the map of current preamble events (stored in WifiPhy).
Definition: phy-entity.cc:729
ns3::PhyEntity::Transmit
void Transmit(Time txDuration, Ptr< WifiPpdu > ppdu, std::string type)
This function prepares most of the WifiSpectrumSignalParameters parameters and invokes SpectrumWifiPh...
Definition: phy-entity.cc:1041
ns3::SignalNoiseDbm
SignalNoiseDbm structure.
Definition: phy-entity.h:53
ns3::PhyEntity::PhyHeaderSections
std::map< WifiPpduField, PhyHeaderChunkInfo > PhyHeaderSections
A map of PhyHeaderChunkInfo elements per PPDU field.
Definition: phy-entity.h:301
ns3::PhyEntity::GetTxPowerSpectralDensity
virtual Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const =0
ns3::MpduInfo::mpduRefNumber
uint32_t mpduRefNumber
MPDU ref number.
Definition: phy-entity.h:62
ns3::PhyEntity::UidStaIdPair
std::pair< uint64_t, uint16_t > UidStaIdPair
A pair of a UID and STA_ID.
Definition: phy-entity.h:796
ns3::PhyEntity::end
std::list< WifiMode >::const_iterator end(void) const
Return a const iterator to past-the-last WifiMode.
Definition: phy-entity.cc:135
wifi-mpdu-type.h
ns3::PhyEntity::GetMeasurementChannelWidth
virtual uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const
Return the channel width used to measure the RSSI.
Definition: phy-entity.cc:1007
ns3::Ptr< WifiPhy >
ns3::WifiPhyStateHelper
This objects implements the PHY state machine of the Wifi device.
Definition: wifi-phy-state-helper.h:66
ns3::PhyEntity::IsMcsSupported
virtual bool IsMcsSupported(uint8_t index) const
Check if the WifiMode corresponding to the given MCS index is supported.
Definition: phy-entity.cc:116
ns3::PhyEntity::IGNORE
@ IGNORE
ignore the reception
Definition: phy-entity.h:104
ns3::PhyEntity::GetCurrentPreambleEvents
const std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > & GetCurrentPreambleEvents(void) const
Get the map of current preamble events (stored in WifiPhy).
Definition: phy-entity.cc:723
ns3::PhyEntity::StartReceivePayload
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: phy-entity.cc:525
ns3::WifiPhyRxfailureReason
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
Definition: wifi-phy-common.h:258
ns3::PhyEntity::GetCurrentEvent
Ptr< const Event > GetCurrentEvent(void) const
Get the pointer to the current event (stored in WifiPhy).
Definition: phy-entity.cc:1001
ns3::MpduInfo
MpduInfo structure.
Definition: phy-entity.h:60
ns3::PhyEntity::SnrPer::SnrPer
SnrPer(double s, double p)
Constructor for SnrPer.
Definition: phy-entity.h:150
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::PhyEntity::PhyFieldRxStatus::reason
WifiPhyRxfailureReason reason
failure reason
Definition: phy-entity.h:114
ns3::PhyEntity::PhyFieldRxStatus
Status of the reception of the PPDU field.
Definition: phy-entity.h:111
ns3::PhyEntity::StartReceiveField
void StartReceiveField(WifiPpduField field, Ptr< Event > event)
Start receiving a given field.
Definition: phy-entity.cc:258
ns3::PhyEntity::EndOfMpdu
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:600
ns3::PhyEntity::DropPreambleEvent
void DropPreambleEvent(Ptr< const WifiPpdu > ppdu, WifiPhyRxfailureReason reason, Time endRx, uint16_t measurementChannelWidth)
Drop the PPDU and the corresponding preamble detection event, but keep CCA busy state after the compl...
Definition: phy-entity.cc:481
ns3::PhyEntity::DoAbortCurrentReception
virtual void DoAbortCurrentReception(WifiPhyRxfailureReason reason)
Perform amendment-specific actions before aborting the current reception.
Definition: phy-entity.cc:958
ns3::PhyEntity::GetChannelWidthAndBand
virtual std::pair< uint16_t, WifiSpectrumBand > 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:716
ns3::PhyEntity::m_wifiPhy
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
Definition: phy-entity.h:783
ns3::PhyEntity::m_endOfMpduEvents
std::vector< EventId > m_endOfMpduEvents
the end of MPDU events (only used for A-MPDUs)
Definition: phy-entity.h:789
wifi-tx-vector.h
ns3::PhyEntity::GetNextField
WifiPpduField GetNextField(WifiPpduField currentField, WifiPreamble preamble) const
Return the field following the provided one.
Definition: phy-entity.cc:148
wifi-ppdu.h
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.
ns3::PhyEntity::DoStartReceiveField
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:332
ns3::RxSignalInfo::rssi
double rssi
RSSI in dBm.
Definition: phy-entity.h:69
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::PhyEntity::GetMaxPsduSize
virtual uint32_t GetMaxPsduSize(void) const =0
Get the maximum PSDU size in bytes.
ns3::PhyEntity::GetDurationUpToField
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:236
ns3::PhyEntity::DoEndReceiveField
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:350
ns3::PhyEntity::CodeRateConstellationSizePair
std::pair< WifiCodeRate, uint16_t > CodeRateConstellationSizePair
A pair to hold modulation information: code rate and constellation size.
Definition: phy-entity.h:482
ns3::WifiPpduField
WifiPpduField
The type of PPDU field (grouped for convenience)
Definition: wifi-phy-common.h:166
ns3::PhyEntity::PhyFieldRxStatus::isSuccess
bool isSuccess
outcome (true if success) of the reception
Definition: phy-entity.h:113
ns3::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-phy-common.h:63
ns3::PhyEntity::NoEndPreambleDetectionEvents
bool NoEndPreambleDetectionEvents(void) const
Definition: phy-entity.cc:927
ns3::PhyEntity::GetRandomValue
double GetRandomValue(void) const
Obtain a random value from the WifiPhy's generator.
Definition: phy-entity.cc:989
ns3::PhyEntity::BuildPpdu
virtual Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration)
Build amendment-specific PPDU.
Definition: phy-entity.cc:228
ns3::PhyEntity::GetPhyHeaderSnrPer
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:250
ns3::PhyEntity::SnrPer::SnrPer
SnrPer()
Default constructor.
Definition: phy-entity.h:143
ns3::PhyEntity::m_state
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper of the WifiPhy (to make it reachable for child classes)
Definition: phy-entity.h:784
ns3::PhyEntity::SnrPer::per
double per
PER.
Definition: phy-entity.h:139
ns3::PhyEntity::HandlesMcsModes
virtual bool HandlesMcsModes(void) const
Check if the WifiModes handled by this PHY are MCSs.
Definition: phy-entity.cc:123
ns3::RxSignalInfo::snr
double snr
SNR in linear scale.
Definition: phy-entity.h:68
ns3::PhyEntity::StartReceivePreamble
virtual void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: phy-entity.cc:362
ns3::PhyEntity::AbortCurrentReception
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Abort the current reception.
Definition: phy-entity.cc:950
ns3::RxSignalInfo
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:67
ns3::PhyEntity::PhyFieldRxStatus::PhyFieldRxStatus
PhyFieldRxStatus(bool s, WifiPhyRxfailureReason r, PhyRxFailureAction a)
Constructor.
Definition: phy-entity.h:129
ns3::PhyEntity::GetNumModes
virtual uint8_t GetNumModes(void) const
Definition: phy-entity.cc:103
ns3::PhyEntity::GetDuration
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:176
ns3::PhyEntity::NotifyInterferenceRxEndAndClear
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:761
ns3::PhyEntity::GetRemainingDurationAfterField
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:325
ns3::PhyEntity::GetMcs
virtual WifiMode GetMcs(uint8_t index) const
Get the WifiMode corresponding to the given MCS index.
Definition: phy-entity.cc:109
ns3::PhyEntity::CancelAllEvents
virtual void CancelAllEvents(void)
Cancel and clear all running events.
Definition: phy-entity.cc:911
ns3::PhyEntity::GetAddressedPsduInPpdu
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:203
ns3::PhyEntity::ModulationLookupTable
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
Definition: phy-entity.h:487
ns3::PhyEntity::PhyHeaderChunkInfo
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:296
ns3::PhyEntity::ResetReceive
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:972
ns3::UNKNOWN
@ UNKNOWN
Definition: wifi-phy-common.h:259
ns3::PhyEntity::m_endPreambleDetectionEvents
std::vector< EventId > m_endPreambleDetectionEvents
the end of preamble detection events
Definition: phy-entity.h:788
ns3::PhyEntity::DoStartReceivePayload
virtual void DoStartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: phy-entity.cc:540
ns3::PhyEntity::SnrPer
A struct for both SNR and PER.
Definition: phy-entity.h:137
ns3::RxPowerWattPerChannelBand
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Definition: phy-entity.h:75
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
ns3::MpduInfo::type
MpduType type
type of MPDU
Definition: phy-entity.h:61
ns3::SignalNoiseDbm::signal
double signal
signal strength in dBm
Definition: phy-entity.h:54
ns3::PhyEntity::GetSigMode
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:141
ns3::PhyEntity::m_endRxPayloadEvents
std::vector< EventId > m_endRxPayloadEvents
the end of receive events (only one unless UL MU reception)
Definition: phy-entity.h:791
ns3::PhyEntity::IsConfigSupported
virtual bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
Definition: phy-entity.cc:899
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::PhyEntity
Abstract class for PHY entities.
Definition: phy-entity.h:94
ns3::PhyEntity::GetTxMaskRejectionParams
std::tuple< double, double, double > GetTxMaskRejectionParams(void) const
Definition: phy-entity.cc:1065
ns3::PhyEntity::GetPayloadDuration
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
ns3::PhyEntity::PhyRxFailureAction
PhyRxFailureAction
Action to perform in case of RX failure.
Definition: phy-entity.h:101
ns3::PhyEntity::GetPpduFormats
virtual const PpduFormats & GetPpduFormats(void) const =0
Return the PPDU formats of the PHY.
ns3::PhyEntity::m_globalPpduUid
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
Definition: phy-entity.h:801
ns3::PhyEntity::UpdateInterferenceEvent
void UpdateInterferenceEvent(Ptr< Event > event, const RxPowerWattPerChannelBand &rxPower)
Update an event in WifiPhy's InterferenceHelper class.
Definition: phy-entity.cc:755
ns3::PhyEntity::PhyFieldRxStatus::PhyFieldRxStatus
PhyFieldRxStatus(bool s)
Constructor setting outcome of reception.
Definition: phy-entity.h:121
ns3::InterferenceHelper
handles interference calculations
Definition: interference-helper.h:133
ns3::PhyEntity::DROP
@ DROP
drop PPDU and set CCA_BUSY
Definition: phy-entity.h:102
ns3::PhyEntity::ObtainNextUid
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
Definition: phy-entity.cc:1019
ns3::PhyEntity::~PhyEntity
virtual ~PhyEntity()
Destructor for PHY entity.
Definition: phy-entity.cc:74
ns3::MpduType
MpduType
The type of an MPDU.
Definition: wifi-mpdu-type.h:31