A Discrete-Event Network Simulator
API
wifi-phy.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  * Sébastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #ifndef WIFI_PHY_H
23 #define WIFI_PHY_H
24 
25 #include "ns3/error-model.h"
26 #include "wifi-standards.h"
27 #include "wifi-phy-state-helper.h"
28 #include "phy-entity.h"
30 
31 namespace ns3 {
32 
33 class Channel;
34 class WifiNetDevice;
35 class MobilityModel;
36 class WifiPhyStateHelper;
37 class FrameCaptureModel;
38 class PreambleDetectionModel;
39 class WifiRadioEnergyModel;
40 class UniformRandomVariable;
41 class InterferenceHelper;
42 class ErrorRateModel;
43 
49 class WifiPhy : public Object
50 {
51 public:
52  friend class PhyEntity;
57  static TypeId GetTypeId (void);
58 
59  WifiPhy ();
60  virtual ~WifiPhy ();
61 
67  Ptr<WifiPhyStateHelper> GetState (void) const;
68 
73  void SetReceiveOkCallback (RxOkCallback callback);
79 
86  void RegisterListener (WifiPhyListener *listener);
93  void UnregisterListener (WifiPhyListener *listener);
94 
99 
107  void StartReceivePreamble (Ptr<WifiPpdu> ppdu, RxPowerWattPerChannelBand& rxPowersW, Time rxDuration);
108 
114  void ResetReceive (Ptr<Event> event);
115 
120  void EndReceiveInterBss (void);
121 
132 
144  void Send (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
151  void Send (WifiConstPsduMap psdus, const WifiTxVector& txVector);
152 
156  virtual void StartTx (Ptr<WifiPpdu> ppdu) = 0;
157 
161  void SetSleepMode (void);
165  void ResumeFromSleep (void);
169  void SetOffMode (void);
173  void ResumeFromOff (void);
174 
178  bool IsStateIdle (void) const;
182  bool IsStateCcaBusy (void) const;
186  bool IsStateRx (void) const;
190  bool IsStateTx (void) const;
194  bool IsStateSwitching (void) const;
198  bool IsStateSleep (void) const;
202  bool IsStateOff (void) const;
203 
210  Time GetDelayUntilIdle (void);
211 
217  Time GetLastRxStartTime (void) const;
223  Time GetLastRxEndTime (void) const;
224 
233  static Time CalculateTxDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band,
234  uint16_t staId = SU_STA_ID);
249  static Time CalculateTxDuration (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, WifiPhyBand band);
257  static Time CalculateTxDuration (WifiConstPsduMap psduMap, const WifiTxVector& txVector, WifiPhyBand band);
258 
268  static Time GetPreambleDetectionDuration (void);
278  static Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype = NORMAL_MPDU,
279  uint16_t staId = SU_STA_ID);
296  static Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype,
297  bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols,
298  uint16_t staId);
304  static Time GetStartOfPacketDuration (const WifiTxVector& txVector);
305 
320  std::list<WifiMode> GetModeList (void) const;
330  std::list<WifiMode> GetModeList (WifiModulationClass modulation) const;
339  bool IsModeSupported (WifiMode mode) const;
347  WifiMode GetDefaultMode (void) const;
357  bool IsMcsSupported (WifiModulationClass modulation, uint8_t mcs) const;
358 
366  double CalculateSnr (const WifiTxVector& txVector, double ber) const;
367 
373  void SetSifs (Time sifs);
379  Time GetSifs (void) const;
385  void SetSlot (Time slot);
391  Time GetSlot (void) const;
397  void SetPifs (Time pifs);
403  Time GetPifs (void) const;
409  Time GetAckTxTime (void) const;
415  Time GetBlockAckTxTime (void) const;
416 
423  static uint32_t GetMaxPsduSize (WifiModulationClass modulation);
424 
435  std::list<uint8_t> GetBssMembershipSelectorList (void) const;
441  uint16_t GetNMcs (void) const;
450  std::list<WifiMode> GetMcsList (void) const;
460  std::list<WifiMode> GetMcsList (WifiModulationClass modulation) const;
471  WifiMode GetMcs (WifiModulationClass modulation, uint8_t mcs) const;
472 
478  uint8_t GetChannelNumber (void) const;
482  Time GetChannelSwitchDelay (void) const;
483 
489  virtual void ConfigureStandard (WifiStandard standard);
490 
496  WifiStandard GetStandard (void) const;
497 
503  WifiPhyBand GetPhyBand (void) const;
504 
510  const WifiPhyOperatingChannel& GetOperatingChannel (void) const;
511 
517  virtual Ptr<Channel> GetChannel (void) const = 0;
518 
526  void NotifyTxBegin (WifiConstPsduMap psdus, double txPowerW);
533  void NotifyTxEnd (WifiConstPsduMap psdus);
540  void NotifyTxDrop (Ptr<const WifiPsdu> psdu);
548  void NotifyRxBegin (Ptr<const WifiPsdu> psdu, const RxPowerWattPerChannelBand& rxPowersW);
555  void NotifyRxEnd (Ptr<const WifiPsdu> psdu);
564 
586  uint16_t channelFreqMhz,
587  WifiTxVector txVector,
588  SignalNoiseDbm signalNoise,
589  std::vector<bool> statusPerMpdu,
590  uint16_t staId = SU_STA_ID);
591 
613  uint16_t channelFreqMhz,
614  WifiTxVector txVector,
615  MpduInfo aMpdu,
616  SignalNoiseDbm signalNoise,
617  uint16_t staId);
618 
633  uint16_t channelFreqMhz,
634  WifiTxVector txVector,
635  uint16_t staId = SU_STA_ID);
636 
650  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
651  uint16_t channelFreqMhz,
652  WifiTxVector txVector,
653  MpduInfo aMpdu,
654  uint16_t staId);
655 
662  typedef void (* PhyTxBeginTracedCallback)(Ptr<const Packet> packet, double txPowerW);
663 
671  typedef void (* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW);
672 
680 
687  typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
688 
697  virtual int64_t AssignStreams (int64_t stream);
698 
706  void SetRxSensitivity (double threshold);
712  double GetRxSensitivity (void) const;
720  void SetCcaEdThreshold (double threshold);
726  double GetCcaEdThreshold (void) const;
732  void SetRxNoiseFigure (double noiseFigureDb);
738  void SetTxPowerStart (double start);
744  double GetTxPowerStart (void) const;
750  void SetTxPowerEnd (double end);
756  double GetTxPowerEnd (void) const;
764  void SetNTxPower (uint8_t n);
770  uint8_t GetNTxPower (void) const;
776  void SetTxGain (double gain);
782  double GetTxGain (void) const;
788  void SetRxGain (double gain);
794  double GetRxGain (void) const;
795 
801  void SetDevice (const Ptr<WifiNetDevice> device);
807  Ptr<WifiNetDevice> GetDevice (void) const;
828  Ptr<MobilityModel> GetMobility (void) const;
829 
830  using ChannelTuple = std::tuple<uint8_t /* channel number */,
831  uint16_t /* channel width */,
832  int /* WifiPhyBand */,
833  uint8_t /* primary20 index*/>;
834 
844  void SetOperatingChannel (const ChannelTuple& channelTuple);
848  uint16_t GetFrequency (void) const;
852  uint8_t GetPrimary20Index (void) const;
856  void SetNumberOfAntennas (uint8_t antennas);
860  uint8_t GetNumberOfAntennas (void) const;
864  void SetMaxSupportedTxSpatialStreams (uint8_t streams);
868  uint8_t GetMaxSupportedTxSpatialStreams (void) const;
872  void SetMaxSupportedRxSpatialStreams (uint8_t streams);
876  uint8_t GetMaxSupportedRxSpatialStreams (void) const;
882  void SetShortPhyPreambleSupported (bool preamble);
888  bool GetShortPhyPreambleSupported (void) const;
889 
895  virtual void SetInterferenceHelper (const Ptr<InterferenceHelper> helper);
896 
902  void SetErrorRateModel (const Ptr<ErrorRateModel> model);
920  void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
926  void SetPreambleDetectionModel (const Ptr<PreambleDetectionModel> preambleDetectionModel);
932  void SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
933 
937  uint16_t GetChannelWidth (void) const;
941  void AddSupportedChannelWidth (uint16_t width);
945  std::vector<uint16_t> GetSupportedChannelWidthSet (void) const;
946 
955  double GetPowerDbm (uint8_t power) const;
956 
964  void ResetCca (bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
981  void NotifyChannelAccessRequested (void);
982 
983 
994  virtual WifiSpectrumBand ConvertHeRuSubcarriers (uint16_t bandWidth, uint16_t guardBandwidth,
995  HeRu::SubcarrierRange range, uint8_t bandIndex = 0) const;
996 
1006  static void AddStaticPhyEntity (WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1007 
1017 
1025  Ptr<PhyEntity> GetPhyEntity (WifiModulationClass modulation) const;
1026 
1030  uint64_t GetPreviouslyRxPpduUid (void) const;
1031 
1045  virtual uint16_t GetGuardBandwidth (uint16_t currentChannelWidth) const = 0;
1054  virtual std::tuple<double, double, double> GetTxMaskRejectionParams (void) const = 0;
1055 
1062  uint8_t GetPrimaryChannelNumber (uint16_t primaryChannelWidth) const;
1063 
1064 protected:
1065  virtual void DoDispose (void);
1066 
1070  void Reset (void);
1071 
1085  virtual void DoChannelSwitch (void);
1086 
1095  void SwitchMaybeToCcaBusy (uint16_t channelWidth);
1096 
1105  uint16_t GetMeasurementChannelWidth (const Ptr<const WifiPpdu> ppdu) const;
1106 
1115  virtual WifiSpectrumBand GetBand (uint16_t bandWidth, uint8_t bandIndex = 0);
1116 
1128  WifiSpectrumBand GetPrimaryBand (uint16_t bandWidth);
1129 
1140  void AddPhyEntity (WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1141 
1143 
1146 
1149 
1152 
1154  std::map <std::pair<uint64_t /* UID*/, WifiPreamble>, Ptr<Event> > m_currentPreambleEvents;
1155 
1157 
1175  std::map<WifiModulationClass, Ptr<PhyEntity> > m_phyEntities;
1176 
1177 
1178 private:
1183  void Configure80211a (void);
1188  void Configure80211b (void);
1193  void Configure80211g (void);
1198  void Configure80211p (void);
1203  void Configure80211n (void);
1208  void Configure80211ac (void);
1213  void Configure80211ax (void);
1224  void PushMcs (WifiMode mode);
1228  void RebuildMcsMap (void);
1229 
1236 
1244 
1259 
1267 
1275 
1283 
1299 
1307 
1314 
1327  TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, SignalNoiseDbm, uint16_t /* STA-ID*/> m_phyMonitorSniffRxTrace;
1328 
1341  TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, uint16_t /* STA-ID*/> m_phyMonitorSniffTxTrace;
1342 
1350  static std::map<WifiModulationClass, Ptr<PhyEntity> > & GetStaticPhyEntities (void);
1351 
1356  std::vector<uint16_t> m_supportedChannelWidthSet;
1357 
1363 
1366  double m_txGainDb;
1367  double m_rxGainDb;
1370  uint8_t m_nTxPower;
1372 
1377 
1382 
1384 
1386 
1389 
1395 
1397 };
1398 
1404 std::ostream& operator<< (std::ostream& os, RxSignalInfo rxSignalInfo);
1405 
1406 } //namespace ns3
1407 
1408 #endif /* WIFI_PHY_H */
An identifier for simulation events.
Definition: event-id.h:54
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition: he-ru.h:53
A base class which provides memory management and object aggregation.
Definition: object.h:88
Abstract class for PHY entities.
Definition: phy-entity.h:94
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
represent a single transmission mode
Definition: wifi-mode.h:48
802.11 PHY layer model
Definition: wifi-phy.h:50
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1077
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1145
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:1367
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:1388
bool IsStateIdle(void) const
Definition: wifi-phy.cc:1815
void(* PhyTxBeginTracedCallback)(Ptr< const Packet > packet, double txPowerW)
TracedCallback signature for Phy transmit events.
Definition: wifi-phy.h:662
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
Definition: wifi-phy.cc:566
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
Definition: wifi-phy.h:1380
void Send(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
This function is a wrapper for the Send variant that accepts a WifiConstPsduMap as first argument.
Definition: wifi-phy.cc:1506
bool IsStateTx(void) const
Definition: wifi-phy.cc:1827
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:1624
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1144
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:912
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:1392
virtual ~WifiPhy()
Definition: wifi-phy.cc:333
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:1385
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Definition: wifi-phy.cc:1767
void SetCcaEdThreshold(double threshold)
Sets the CCA threshold (dBm).
Definition: wifi-phy.cc:433
TracedCallback< Ptr< const Packet >, WifiPhyRxfailureReason > m_phyRxDropTrace
The trace source fired when the PHY layer drops a packet it has received.
Definition: wifi-phy.h:1313
WifiPhyOperatingChannel m_operatingChannel
Operating channel.
Definition: wifi-phy.h:1355
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
The trace source fired when the PHY layer drops a packet as it tries to transmit it.
Definition: wifi-phy.h:1274
TracedCallback< Ptr< const Packet >, RxPowerWattPerChannelBand > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1282
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
Definition: wifi-phy.cc:574
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
Definition: wifi-phy.h:1376
static Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype=NORMAL_MPDU, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1303
TracedCallback< Ptr< const Packet >, double > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Definition: wifi-phy.h:1251
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:553
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1126
const WifiPhyOperatingChannel & GetOperatingChannel(void) const
Get a const reference to the operating channel.
Definition: wifi-phy.cc:900
Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
Definition: wifi-phy.cc:1973
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:529
void NotifyTxEnd(WifiConstPsduMap psdus)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:1369
std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > m_currentPreambleEvents
store event associated to a PPDU (that has a unique ID and preamble combination) whose preamble is be...
Definition: wifi-phy.h:1154
Time m_slot
Slot duration.
Definition: wifi-phy.h:1359
double m_powerDensityLimit
the power density limit (dBm/MHz)
Definition: wifi-phy.h:1371
WifiMode GetDefaultMode(void) const
Get the default WifiMode supported by the PHY.
Definition: wifi-phy.cc:1692
std::vector< uint16_t > GetSupportedChannelWidthSet(void) const
Definition: wifi-phy.cc:1174
bool IsStateRx(void) const
Definition: wifi-phy.cc:1821
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:670
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:887
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1150
double m_txPowerBaseDbm
Minimum transmission power (dBm)
Definition: wifi-phy.h:1368
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:384
Ptr< WifiNetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:541
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:1420
bool IsMcsSupported(WifiModulationClass modulation, uint8_t mcs) const
Check if the given MCS of the given modulation class is supported by the PHY.
Definition: wifi-phy.cc:1707
WifiStandard GetStandard(void) const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:894
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-phy.cc:339
Time m_blockAckTxTime
estimated BlockAck TX time
Definition: wifi-phy.h:1362
uint8_t GetPrimaryChannelNumber(uint16_t primaryChannelWidth) const
Get channel number of the primary channel.
Definition: wifi-phy.cc:2029
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
Definition: wifi-phy.cc:718
std::list< uint8_t > GetBssMembershipSelectorList(void) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1144
void ResetCca(bool powerRestricted, double txPowerMaxSiso=0, double txPowerMaxMimo=0)
Reset PHY to IDLE, with some potential TX power restrictions for the next transmission.
Definition: wifi-phy.cc:1921
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:1375
Time GetSlot(void) const
Return the slot duration for this PHY.
Definition: wifi-phy.cc:688
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted.
Definition: wifi-phy.cc:1885
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:1390
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1306
void NotifyRxBegin(Ptr< const WifiPsdu > psdu, const RxPowerWattPerChannelBand &rxPowersW)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:1396
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1095
uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const
Return the channel width used to measure the RSSI.
Definition: wifi-phy.cc:1980
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:477
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: wifi-phy.h:1358
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:396
void ResetReceive(Ptr< Event > event)
Reset PHY at the end of the packet under reception after it has failed the PHY header.
Definition: wifi-phy.cc:1661
virtual uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const =0
void(* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:671
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:835
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1138
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:581
WifiMode GetMcs(WifiModulationClass modulation, uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the given modulation class.
Definition: wifi-phy.cc:1802
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
uint8_t m_numberOfAntennas
Number of transmitters.
Definition: wifi-phy.h:1379
ChannelTuple m_channelSettings
Store operating channel settings until initialization.
Definition: wifi-phy.h:1354
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1147
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1327
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
Definition: wifi-phy.cc:1857
Time GetBlockAckTxTime(void) const
Return the estimated BlockAck TX time for this PHY.
Definition: wifi-phy.cc:712
void Configure80211p(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard.
Definition: wifi-phy.cc:763
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:700
static uint32_t GetMaxPsduSize(WifiModulationClass modulation)
Get the maximum PSDU size in bytes for the given modulation class.
Definition: wifi-phy.cc:1348
void NotifyTxBegin(WifiConstPsduMap psdus, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:1354
void Reset(void)
Reset data upon end of TX or RX.
Definition: wifi-phy.cc:1611
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:522
void SetNTxPower(uint8_t n)
Sets the number of transmission power levels available between the minimum level and the maximum leve...
Definition: wifi-phy.cc:483
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-phy.cc:57
WifiPhyBand m_band
WifiPhyBand.
Definition: wifi-phy.h:1353
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
Definition: wifi-phy.cc:733
void SetSleepMode(void)
Put in sleep mode.
Definition: wifi-phy.cc:1180
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:420
uint8_t GetPrimary20Index(void) const
Definition: wifi-phy.cc:924
static const Ptr< const PhyEntity > GetStaticPhyEntity(WifiModulationClass modulation)
Get the implemented PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:636
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1120
void(* MonitorSnifferTxCallback)(const Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, uint16_t staId)
TracedCallback signature for monitor mode transmit events.
Definition: wifi-phy.h:650
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
Definition: wifi-phy.cc:750
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo, uint16_t > m_phyMonitorSniffTxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being transmitted.
Definition: wifi-phy.h:1341
Time GetChannelSwitchDelay(void) const
Definition: wifi-phy.cc:624
virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t bandWidth, uint16_t guardBandwidth, HeRu::SubcarrierRange range, uint8_t bandIndex=0) const
Definition: wifi-phy.cc:1642
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:1374
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
Definition: wifi-phy.h:1175
void RebuildMcsMap(void)
Rebuild the mapping of MCS values to indices in the device MCS set.
void AddPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of supported PHY entities for the given modulation class for the WifiPh...
Definition: wifi-phy.cc:660
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo, SignalNoiseDbm, uint16_t > m_phyMonitorSniffRxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being received.
Definition: wifi-phy.h:1327
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:1393
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:464
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1151
void ConfigureHtDeviceMcsSet(void)
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
static WifiConstPsduMap GetWifiConstPsduMap(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
Definition: wifi-phy.cc:1500
uint16_t GetNMcs(void) const
Definition: wifi-phy.cc:1753
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:682
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
Definition: wifi-phy.cc:930
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:1153
virtual std::tuple< double, double, double > GetTxMaskRejectionParams(void) const =0
double m_ccaEdThresholdW
Clear channel assessment (CCA) threshold in watts.
Definition: wifi-phy.h:1365
void NotifyMonitorSniffTx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector, uint16_t staId=SU_STA_ID)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being transmitted.
Definition: wifi-phy.cc:1469
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class, for the WifiPhy instance.
Definition: wifi-phy.cc:644
virtual WifiSpectrumBand GetBand(uint16_t bandWidth, uint8_t bandIndex=0)
Get the start band index and the stop band index for a given band.
Definition: wifi-phy.cc:1992
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium.
Definition: wifi-phy.h:1266
void ResumeFromSleep(void)
Resume from sleep mode.
Definition: wifi-phy.cc:1229
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
Definition: wifi-phy.h:1156
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard.
Definition: wifi-phy.cc:812
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1148
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:600
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:535
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:1672
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:1391
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1089
void SwitchMaybeToCcaBusy(uint16_t channelWidth)
Check if PHY state should move to CCA busy state based on current state of interference tracker.
Definition: wifi-phy.cc:1869
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:470
static std::map< WifiModulationClass, Ptr< PhyEntity > > & GetStaticPhyEntities(void)
Definition: wifi-phy.cc:377
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
Definition: wifi-phy.cc:652
void(* MonitorSnifferRxCallback)(Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId)
TracedCallback signature for monitor mode receive events.
Definition: wifi-phy.h:612
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:1408
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition: wifi-phy.cc:1718
TracedCallback< WifiConstPsduMap, WifiTxVector, double > m_phyTxPsduBeginTrace
The trace source fired when a PSDU map begins the transmission process on the medium.
Definition: wifi-phy.h:1258
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:1366
std::vector< uint16_t > m_supportedChannelWidthSet
Supported channel width set (MHz)
Definition: wifi-phy.h:1356
WifiSpectrumBand GetPrimaryBand(uint16_t bandWidth)
If the operating channel width is a multiple of 20 MHz, return the start band index and the stop band...
Definition: wifi-phy.cc:2001
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:1851
uint64_t GetPreviouslyRxPpduUid(void) const
Definition: wifi-phy.cc:1605
WifiStandard m_standard
WifiStandard.
Definition: wifi-phy.h:1352
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:606
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:1370
double m_noiseFigureDb
The noise figure in dB.
Definition: wifi-phy.h:1383
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:594
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:694
Time GetSifs(void) const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:676
static Time GetStartOfPacketDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1297
virtual void StartTx(Ptr< WifiPpdu > ppdu)=0
Time GetAckTxTime(void) const
Return the estimated Ack TX time for this PHY.
Definition: wifi-phy.cc:706
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:408
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:509
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:547
double GetRxGain(void) const
Return the reception gain (dB).
Definition: wifi-phy.cc:516
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:496
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Definition: wifi-phy.h:1381
double m_txPowerEndDbm
Maximum transmission power (dBm)
Definition: wifi-phy.h:1369
void SetOffMode(void)
Put in off mode.
Definition: wifi-phy.cc:1214
double CalculateSnr(const WifiTxVector &txVector, double ber) const
Definition: wifi-phy.cc:630
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard.
Definition: wifi-phy.cc:793
void(* PhyRxBeginTracedCallback)(Ptr< const Packet > packet, RxPowerWattPerChannelBand rxPowersW)
TracedCallback signature for PhyRxBegin trace source.
Definition: wifi-phy.h:679
bool IsStateSwitching(void) const
Definition: wifi-phy.cc:1833
double GetTxGain(void) const
Return the transmission gain (dB).
Definition: wifi-phy.cc:503
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:490
Time GetDelayUntilChannelSwitch(void)
Perform any actions necessary when user changes operating channel after initialization.
Definition: wifi-phy.cc:970
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:1651
double GetCcaEdThreshold(void) const
Return the CCA threshold (dBm).
Definition: wifi-phy.cc:440
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:427
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:402
Ptr< WifiNetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:1387
Ptr< InterferenceHelper > m_interference
Pointer to a helper responsible for interference computations.
Definition: wifi-phy.h:1142
bool IsStateSleep(void) const
Definition: wifi-phy.cc:1839
bool IsStateCcaBusy(void) const
Definition: wifi-phy.cc:1809
bool m_shortPreamble
Flag if short PHY preamble is supported.
Definition: wifi-phy.h:1378
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: wifi-phy.h:1360
void SetRxNoiseFigure(double noiseFigureDb)
Sets the RX loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition: wifi-phy.cc:446
double GetTxPowerForTransmission(Ptr< const WifiPpdu > ppdu) const
Compute the transmit power for the next transmission.
Definition: wifi-phy.cc:1940
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:687
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:414
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:390
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:588
void ResumeFromOff(void)
Resume from off mode.
Definition: wifi-phy.cc:1260
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard.
Definition: wifi-phy.cc:820
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Definition: wifi-phy.h:1373
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Definition: wifi-phy.h:1396
void AddSupportedChannelWidth(uint16_t width)
Definition: wifi-phy.cc:1159
void NotifyMonitorSniffRx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector, SignalNoiseDbm signalNoise, std::vector< bool > statusPerMpdu, uint16_t staId=SU_STA_ID)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being received.
Definition: wifi-phy.cc:1432
virtual void DoChannelSwitch(void)
Actually switch channel based on the stored channel settings.
Definition: wifi-phy.cc:1021
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:1298
static Time GetPreambleDetectionDuration(void)
Definition: wifi-phy.cc:1291
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Definition: wifi-phy.h:833
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:1394
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:1364
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Definition: wifi-phy.cc:1863
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:918
bool IsStateOff(void) const
Definition: wifi-phy.cc:1845
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:457
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: wifi-phy.cc:2012
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1321
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:1679
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:906
Time m_ackTxTime
estimated Ack TX time
Definition: wifi-phy.h:1361
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:1384
receive notifications about PHY events.
Class that keeps track of all information about the current PHY operating channel.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
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
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
MpduType
The type of an MPDU.
@ NORMAL_MPDU
The MPDU is not part of an A-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::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Definition: phy-entity.h:75
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139
mobility
Definition: third.py:108
def start()
Definition: core.py:1853
Declaration of:
MpduInfo structure.
Definition: phy-entity.h:60
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:67
SignalNoiseDbm structure.
Definition: phy-entity.h:53
#define SU_STA_ID
Definition: wifi-mode.h:32