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/event-id.h"
26 #include "ns3/error-model.h"
27 #include "wifi-mpdu-type.h"
28 #include "wifi-standards.h"
29 #include "interference-helper.h"
30 #include "wifi-phy-state-helper.h"
31 #include "wifi-ppdu.h"
32 
33 namespace ns3 {
34 
35 #define HE_PHY 125
36 #define VHT_PHY 126
37 #define HT_PHY 127
38 
39 class Channel;
40 class NetDevice;
41 class MobilityModel;
42 class WifiPhyStateHelper;
43 class FrameCaptureModel;
44 class PreambleDetectionModel;
45 class WifiRadioEnergyModel;
46 class UniformRandomVariable;
47 class WifiPsdu;
48 
53 {
54  UNKNOWN = 0,
69 };
70 
78 inline std::ostream& operator<< (std::ostream& os, WifiPhyRxfailureReason reason)
79 {
80  switch (reason)
81  {
83  return (os << "UNSUPPORTED_SETTINGS");
84  case CHANNEL_SWITCHING:
85  return (os << "CHANNEL_SWITCHING");
86  case RXING:
87  return (os << "RXING");
88  case TXING:
89  return (os << "TXING");
90  case SLEEPING:
91  return (os << "SLEEPING");
93  return (os << "BUSY_DECODING_PREAMBLE");
95  return (os << "PREAMBLE_DETECT_FAILURE");
97  return (os << "RECEPTION_ABORTED_BY_TX");
98  case L_SIG_FAILURE:
99  return (os << "L_SIG_FAILURE");
100  case SIG_A_FAILURE:
101  return (os << "SIG_A_FAILURE");
103  return (os << "PREAMBLE_DETECTION_PACKET_SWITCH");
105  return (os << "FRAME_CAPTURE_PACKET_SWITCH");
106  case OBSS_PD_CCA_RESET:
107  return (os << "OBSS_PD_CCA_RESET");
108  case FILTERED:
109  return (os << "FILTERED");
110  case UNKNOWN:
111  default:
112  NS_FATAL_ERROR ("Unknown reason");
113  return (os << "UNKNOWN");
114  }
115 }
116 
117 
120 {
121  double signal;
122  double noise;
123 };
124 
126 struct MpduInfo
127 {
129  uint32_t mpduRefNumber;
130 };
131 
134 {
135  double rssiW;
136  uint8_t bssColor;
137 };
138 
144 class WifiPhy : public Object
145 {
146 public:
151  static TypeId GetTypeId (void);
152 
153  WifiPhy ();
154  virtual ~WifiPhy ();
155 
159  typedef std::pair<uint8_t, WifiPhyBand> ChannelNumberBandPair;
163  typedef std::pair<ChannelNumberBandPair, WifiPhyStandard> ChannelNumberStandardPair;
167  typedef std::pair<uint16_t, uint16_t> FrequencyWidthPair;
168 
174  Ptr<WifiPhyStateHelper> GetState (void) const;
175 
180  void SetReceiveOkCallback (RxOkCallback callback);
186 
193  void RegisterListener (WifiPhyListener *listener);
200  void UnregisterListener (WifiPhyListener *listener);
201 
206 
214 
220  void StartReceiveHeader (Ptr<Event> event);
221 
227  void ContinueReceiveHeader (Ptr<Event> event);
228 
234  void StartReceivePayload (Ptr<Event> event);
235 
241  void EndReceive (Ptr<Event> event);
242 
248  void ResetReceive (Ptr<Event> event);
249 
254  void EndReceiveInterBss (void);
255 
262  void Send (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
269  void Send (WifiConstPsduMap psdus, WifiTxVector txVector);
270 
274  virtual void StartTx (Ptr<WifiPpdu> ppdu) = 0;
275 
279  void SetSleepMode (void);
283  void ResumeFromSleep (void);
287  void SetOffMode (void);
291  void ResumeFromOff (void);
292 
296  bool IsStateIdle (void) const;
300  bool IsStateCcaBusy (void) const;
304  bool IsStateRx (void) const;
308  bool IsStateTx (void) const;
312  bool IsStateSwitching (void) const;
316  bool IsStateSleep (void) const;
320  bool IsStateOff (void) const;
321 
328  Time GetDelayUntilIdle (void);
329 
335  Time GetLastRxStartTime (void) const;
341  Time GetLastRxEndTime (void) const;
342 
351  static Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand band,
352  uint16_t staId = SU_STA_ID);
360  static Time CalculateTxDuration (WifiConstPsduMap psduMap, WifiTxVector txVector, WifiPhyBand band);
361 
372  static Time GetPreambleDetectionDuration (void);
383  static WifiMode GetHtPhyHeaderMode ();
387  static WifiMode GetVhtPhyHeaderMode ();
391  static WifiMode GetHePhyHeaderMode ();
397  static Time GetPhyHtSigHeaderDuration (WifiPreamble preamble);
403  static Time GetPhySigA1Duration (WifiPreamble preamble);
409  static Time GetPhySigA2Duration (WifiPreamble preamble);
415  static Time GetPhySigBDuration (WifiPreamble preamble);
421  static WifiMode GetPhyHeaderMode (WifiTxVector txVector);
427  static Time GetPhyHeaderDuration (WifiTxVector txVector);
433  static Time GetPhyPreambleDuration (WifiTxVector txVector);
443  static Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand band, MpduType mpdutype = NORMAL_MPDU,
444  uint16_t staId = SU_STA_ID);
461  static Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand band, MpduType mpdutype,
462  bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols,
463  uint16_t staId);
469  static Time GetStartOfPacketDuration (WifiTxVector txVector);
470 
488  uint8_t GetNModes (void) const;
508  WifiMode GetMode (uint8_t mode) const;
517  bool IsModeSupported (WifiMode mode) const;
526  bool IsMcsSupported (WifiMode mcs) const;
536  bool IsMcsSupported (WifiModulationClass mc, uint8_t mcs) const;
537 
545  double CalculateSnr (WifiTxVector txVector, double ber) const;
546 
552  void SetSifs (Time sifs);
558  Time GetSifs (void) const;
564  void SetSlot (Time slot);
570  Time GetSlot (void) const;
576  void SetPifs (Time pifs);
582  Time GetPifs (void) const;
588  Time GetAckTxTime (void) const;
594  Time GetBlockAckTxTime (void) const;
595 
605  uint8_t GetNBssMembershipSelectors (void) const;
617  uint8_t GetBssMembershipSelector (uint8_t selector) const;
627  uint8_t GetNMcs (void) const;
639  WifiMode GetMcs (uint8_t mcs) const;
650  WifiMode GetMcs (WifiModulationClass modulation, uint8_t mcs) const;
660  static WifiMode GetHtMcs (uint8_t mcs);
670  static WifiMode GetVhtMcs (uint8_t mcs);
680  static WifiMode GetHeMcs (uint8_t mcs);
681 
694  virtual void SetChannelNumber (uint8_t id);
700  uint8_t GetChannelNumber (void) const;
704  Time GetChannelSwitchDelay (void) const;
705 
712  virtual void ConfigureStandardAndBand (WifiPhyStandard standard, WifiPhyBand band);
713 
719  WifiPhyStandard GetPhyStandard (void) const;
720 
726  WifiPhyBand GetPhyBand (void) const;
727 
744  bool DefineChannelNumber (uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth);
745 
751  virtual Ptr<Channel> GetChannel (void) const = 0;
752 
758  static WifiMode GetDsssRate1Mbps ();
764  static WifiMode GetDsssRate2Mbps ();
770  static WifiMode GetDsssRate5_5Mbps ();
776  static WifiMode GetDsssRate11Mbps ();
782  static WifiMode GetErpOfdmRate6Mbps ();
788  static WifiMode GetErpOfdmRate9Mbps ();
794  static WifiMode GetErpOfdmRate12Mbps ();
800  static WifiMode GetErpOfdmRate18Mbps ();
806  static WifiMode GetErpOfdmRate24Mbps ();
812  static WifiMode GetErpOfdmRate36Mbps ();
818  static WifiMode GetErpOfdmRate48Mbps ();
824  static WifiMode GetErpOfdmRate54Mbps ();
830  static WifiMode GetOfdmRate6Mbps ();
836  static WifiMode GetOfdmRate9Mbps ();
842  static WifiMode GetOfdmRate12Mbps ();
848  static WifiMode GetOfdmRate18Mbps ();
854  static WifiMode GetOfdmRate24Mbps ();
860  static WifiMode GetOfdmRate36Mbps ();
866  static WifiMode GetOfdmRate48Mbps ();
872  static WifiMode GetOfdmRate54Mbps ();
969 
975  static WifiMode GetHtMcs0 ();
981  static WifiMode GetHtMcs1 ();
987  static WifiMode GetHtMcs2 ();
993  static WifiMode GetHtMcs3 ();
999  static WifiMode GetHtMcs4 ();
1005  static WifiMode GetHtMcs5 ();
1011  static WifiMode GetHtMcs6 ();
1017  static WifiMode GetHtMcs7 ();
1023  static WifiMode GetHtMcs8 ();
1029  static WifiMode GetHtMcs9 ();
1035  static WifiMode GetHtMcs10 ();
1041  static WifiMode GetHtMcs11 ();
1047  static WifiMode GetHtMcs12 ();
1053  static WifiMode GetHtMcs13 ();
1059  static WifiMode GetHtMcs14 ();
1065  static WifiMode GetHtMcs15 ();
1071  static WifiMode GetHtMcs16 ();
1077  static WifiMode GetHtMcs17 ();
1083  static WifiMode GetHtMcs18 ();
1089  static WifiMode GetHtMcs19 ();
1095  static WifiMode GetHtMcs20 ();
1101  static WifiMode GetHtMcs21 ();
1107  static WifiMode GetHtMcs22 ();
1113  static WifiMode GetHtMcs23 ();
1119  static WifiMode GetHtMcs24 ();
1125  static WifiMode GetHtMcs25 ();
1131  static WifiMode GetHtMcs26 ();
1137  static WifiMode GetHtMcs27 ();
1143  static WifiMode GetHtMcs28 ();
1149  static WifiMode GetHtMcs29 ();
1155  static WifiMode GetHtMcs30 ();
1161  static WifiMode GetHtMcs31 ();
1162 
1168  static WifiMode GetVhtMcs0 ();
1174  static WifiMode GetVhtMcs1 ();
1180  static WifiMode GetVhtMcs2 ();
1186  static WifiMode GetVhtMcs3 ();
1192  static WifiMode GetVhtMcs4 ();
1198  static WifiMode GetVhtMcs5 ();
1204  static WifiMode GetVhtMcs6 ();
1210  static WifiMode GetVhtMcs7 ();
1216  static WifiMode GetVhtMcs8 ();
1222  static WifiMode GetVhtMcs9 ();
1223 
1229  static WifiMode GetHeMcs0 ();
1235  static WifiMode GetHeMcs1 ();
1241  static WifiMode GetHeMcs2 ();
1247  static WifiMode GetHeMcs3 ();
1253  static WifiMode GetHeMcs4 ();
1259  static WifiMode GetHeMcs5 ();
1265  static WifiMode GetHeMcs6 ();
1271  static WifiMode GetHeMcs7 ();
1277  static WifiMode GetHeMcs8 ();
1283  static WifiMode GetHeMcs9 ();
1289  static WifiMode GetHeMcs10 ();
1295  static WifiMode GetHeMcs11 ();
1296 
1304  void NotifyTxBegin (WifiConstPsduMap psdus, double txPowerW);
1311  void NotifyTxEnd (WifiConstPsduMap psdus);
1318  void NotifyTxDrop (Ptr<const WifiPsdu> psdu);
1333  void NotifyRxEnd (Ptr<const WifiPsdu> psdu);
1342 
1364  uint16_t channelFreqMhz,
1365  WifiTxVector txVector,
1366  SignalNoiseDbm signalNoise,
1367  std::vector<bool> statusPerMpdu,
1368  uint16_t staId = SU_STA_ID);
1369 
1391  uint16_t channelFreqMhz,
1392  WifiTxVector txVector,
1393  MpduInfo aMpdu,
1394  SignalNoiseDbm signalNoise,
1395  uint16_t staId);
1396 
1411  uint16_t channelFreqMhz,
1412  WifiTxVector txVector,
1413  uint16_t staId = SU_STA_ID);
1414 
1428  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
1429  uint16_t channelFreqMhz,
1430  WifiTxVector txVector,
1431  MpduInfo aMpdu,
1432  uint16_t staId);
1433 
1441  typedef void (* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW);
1442 
1449 
1457 
1464  typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
1465 
1474  virtual int64_t AssignStreams (int64_t stream);
1475 
1483  void SetRxSensitivity (double threshold);
1489  double GetRxSensitivity (void) const;
1497  void SetCcaEdThreshold (double threshold);
1503  double GetCcaEdThreshold (void) const;
1509  void SetRxNoiseFigure (double noiseFigureDb);
1515  void SetTxPowerStart (double start);
1521  double GetTxPowerStart (void) const;
1527  void SetTxPowerEnd (double end);
1533  double GetTxPowerEnd (void) const;
1541  void SetNTxPower (uint8_t n);
1547  uint8_t GetNTxPower (void) const;
1553  void SetTxGain (double gain);
1559  double GetTxGain (void) const;
1565  void SetRxGain (double gain);
1571  double GetRxGain (void) const;
1572 
1578  void SetDevice (const Ptr<NetDevice> device);
1584  Ptr<NetDevice> GetDevice (void) const;
1605  Ptr<MobilityModel> GetMobility (void) const;
1606 
1610  virtual void SetFrequency (uint16_t freq);
1614  uint16_t GetFrequency (void) const;
1618  void SetNumberOfAntennas (uint8_t antennas);
1622  uint8_t GetNumberOfAntennas (void) const;
1626  void SetMaxSupportedTxSpatialStreams (uint8_t streams);
1630  uint8_t GetMaxSupportedTxSpatialStreams (void) const;
1634  void SetMaxSupportedRxSpatialStreams (uint8_t streams);
1638  uint8_t GetMaxSupportedRxSpatialStreams (void) const;
1644  void SetShortPhyPreambleSupported (bool preamble);
1650  bool GetShortPhyPreambleSupported (void) const;
1651 
1657  void SetErrorRateModel (const Ptr<ErrorRateModel> rate);
1675  void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
1681  void SetPreambleDetectionModel (const Ptr<PreambleDetectionModel> preambleDetectionModel);
1687  void SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
1688 
1692  uint16_t GetChannelWidth (void) const;
1696  virtual void SetChannelWidth (uint16_t channelWidth);
1700  void AddSupportedChannelWidth (uint16_t width);
1704  std::vector<uint16_t> GetSupportedChannelWidthSet (void) const;
1705 
1714  double GetPowerDbm (uint8_t power) const;
1715 
1723  void ResetCca (bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
1730  double GetTxPowerForTransmission (WifiTxVector txVector) const;
1738  void NotifyChannelAccessRequested (void);
1739 
1740 
1741 protected:
1742  // Inherited
1743  virtual void DoInitialize (void);
1744  virtual void DoDispose (void);
1745 
1755  bool DoChannelSwitch (uint8_t id);
1765  bool DoFrequencySwitch (uint16_t frequency);
1766 
1773  void SwitchMaybeToCcaBusy (void);
1774 
1781  virtual uint16_t GetStaId (void) const;
1782 
1791  virtual WifiSpectrumBand GetBand (uint16_t bandWidth, uint8_t bandIndex = 0);
1792 
1800  virtual WifiSpectrumBand ConvertHeRuSubcarriers (uint16_t channelWidth, HeRu::SubcarrierRange range) const;
1801 
1805 
1808 
1812 
1814 
1815 private:
1831  void Configure80211a (void);
1836  void Configure80211b (void);
1841  void Configure80211g (void);
1846  void Configure80211p (void);
1851  void ConfigureHolland (void);
1856  void Configure80211n (void);
1861  void Configure80211ac (void);
1866  void Configure80211ax (void);
1871  void ConfigureHtDeviceMcsSet (void);
1877  void PushMcs (WifiMode mode);
1881  void RebuildMcsMap (void);
1887  void ConfigureDefaultsForStandard (void);
1894  void ConfigureChannelForStandard (void);
1895 
1902  uint8_t FindChannelNumberForFrequencyWidth (uint16_t frequency, uint16_t width) const;
1910  FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard (uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard) const;
1911 
1918 
1922  void MaybeCcaBusyDuration (void);
1923 
1929  void StartRx (Ptr<Event> event);
1941  std::pair<bool, SignalNoiseDbm> GetReceptionStatus (Ptr<const WifiPsdu> psdu,
1942  Ptr<Event> event, uint16_t staId,
1943  Time relativeMpduStart,
1944  Time mpduDuration);
1954  void EndOfMpdu (Ptr<Event> event, Ptr<const WifiPsdu> psdu, size_t mpduIndex, Time relativeStart, Time mpduDuration);
1955 
1961  void ScheduleEndOfMpdus (Ptr<Event> event);
1962 
1970 
1979  WifiSpectrumBand GetRuBand (WifiTxVector txVector, uint16_t staId);
1980 
1995 
2003 
2011 
2019 
2035 
2043 
2050 
2063  TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, SignalNoiseDbm, uint16_t /* STA-ID*/> m_phyMonitorSniffRxTrace;
2064 
2077  TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, uint16_t /* STA-ID*/> m_phyMonitorSniffTxTrace;
2078 
2085 
2124  std::map<WifiModulationClass, std::map<uint8_t /* MCS value */, uint8_t /* index */>> m_mcsIndexMap;
2126 
2127  std::vector<uint8_t> m_bssMembershipSelectorSet;
2128 
2135  uint16_t m_channelWidth;
2136 
2142 
2145  double m_txGainDb;
2146  double m_rxGainDb;
2149  uint8_t m_nTxPower;
2150 
2155 
2160 
2161  typedef std::map<ChannelNumberStandardPair, FrequencyWidthPair> ChannelToFrequencyWidthMap;
2163 
2164  std::vector<uint16_t> m_supportedChannelWidthSet;
2167 
2169 
2172 
2179 
2180  std::vector<bool> m_statusPerMpdu;
2182 
2184 };
2185 
2186 } //namespace ns3
2187 
2188 #endif /* WIFI_PHY_H */
MpduInfo structure.
Definition: wifi-phy.h:126
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:4127
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:2633
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3781
Ptr< NetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:2170
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:3472
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:708
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU...
Definition: wifi-phy.h:1806
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:3409
bool IsStateSwitching(void) const
Definition: wifi-phy.cc:4557
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:968
bool IsStateOff(void) const
Definition: wifi-phy.cc:4569
FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard(uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard) const
Lookup frequency/width pair for channelNumber/standard pair.
Definition: wifi-phy.cc:1606
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:2018
double signal
in dBm
Definition: wifi-phy.h:121
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
static WifiMode GetHeMcs7()
Return MCS 7 from HE MCS values.
Definition: wifi-phy.cc:4217
void NotifyTxBegin(WifiConstPsduMap psdus, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:2576
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:3484
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
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:701
uint8_t m_channelNumber
Operating channel number.
Definition: wifi-phy.h:2165
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:2146
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:4143
double GetRxGain(void) const
Return the reception gain (dB).
Definition: wifi-phy.cc:734
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:4257
void AddSupportedChannelWidth(uint16_t width)
Definition: wifi-phy.cc:1585
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:3535
double GetCcaEdThreshold(void) const
Return the CCA threshold (dBm).
Definition: wifi-phy.cc:661
void NotifyTxEnd(WifiConstPsduMap psdus)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:2588
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3682
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static WifiMode GetOfdmRate27MbpsBW10MHz()
Return a WifiMode for OFDM at 27Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3706
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:2145
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
Definition: wifi-phy.cc:4314
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3745
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:4079
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted...
Definition: wifi-phy.cc:4611
void MaybeCcaBusyDuration(void)
Eventually switch to CCA busy.
Definition: wifi-phy.cc:3036
virtual ~WifiPhy()
Definition: wifi-phy.cc:540
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:3370
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand rxPowersW)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:2896
void ResumeFromOff(void)
Resume from off mode.
Definition: wifi-phy.cc:1871
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:577
void ResumeFromSleep(void)
Resume from sleep mode.
Definition: wifi-phy.cc:1840
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:2143
virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t channelWidth, HeRu::SubcarrierRange range) const
Definition: wifi-phy.cc:3332
void ConfigureDefaultsForStandard(void)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:846
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Definition: wifi-ppdu.h:33
virtual uint16_t GetStaId(void) const
Return the STA ID that has been assigned to the station this PHY belongs to.
Definition: wifi-phy.cc:4734
static WifiMode GetHeMcs5()
Return MCS 5 from HE MCS values.
Definition: wifi-phy.cc:4201
802.11 PHY layer model
Definition: wifi-phy.h:144
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:1426
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:4706
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:2178
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:3460
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:714
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard...
Definition: wifi-phy.cc:1249
handles interference calculations
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Definition: wifi-phy.cc:3876
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:641
virtual void ConfigureStandardAndBand(WifiPhyStandard standard, WifiPhyBand band)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:1373
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-phy.cc:546
static WifiMode GetHePhyHeaderMode()
Definition: wifi-phy.cc:1915
def start()
Definition: core.py:1855
Forward calls to a chain of Callback.
void RebuildMcsMap(void)
Rebuild the mapping of MCS values to indices in the device MCS set.
Definition: wifi-phy.cc:1128
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
Definition: wifi-phy.cc:4119
uint8_t GetNBssMembershipSelectors(void) const
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
Definition: wifi-phy.cc:1573
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:3996
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:3932
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:3547
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:2042
bool IsStateCcaBusy(void) const
Definition: wifi-phy.cc:4533
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:589
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: wifi-phy.cc:3202
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
Definition: wifi-phy.cc:4068
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:3988
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:4060
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:956
std::vector< uint8_t > m_bssMembershipSelectorSet
the BSS membership selector set
Definition: wifi-phy.h:2127
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:3900
static Time GetPhyPreambleDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2184
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:740
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:4028
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:2034
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3721
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
Definition: wifi-phy.cc:3956
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:4012
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1810
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3634
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:3607
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:765
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:601
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:667
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
static WifiMode GetHeMcs4()
Return MCS 4 from HE MCS values.
Definition: wifi-phy.cc:4193
void ConfigureHolland(void)
Configure WifiPhy with appropriate channel frequency and supported rates for Holland.
Definition: wifi-phy.cc:1099
bool IsStateIdle(void) const
Definition: wifi-phy.cc:4539
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:2049
std::pair< uint16_t, uint16_t > FrequencyWidthPair
A pair of a center frequency (MHz) and a channel width (MHz)
Definition: wifi-phy.h:167
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:2149
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:3884
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:3964
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:2063
double GetTxPowerForTransmission(WifiTxVector txVector) const
Compute the transmit power (in dBm) for the next transmission.
Definition: wifi-phy.cc:4648
virtual void SetFrequency(uint16_t freq)
Definition: wifi-phy.cc:1439
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:4111
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:4036
WifiSpectrumBand GetRuBand(WifiTxVector txVector, uint16_t staId)
Get the RU band used to transmit a PSDU to a given STA in a HE MU PPDU.
Definition: wifi-phy.cc:3318
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:798
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:4636
void(* EndOfHePreambleCallback)(HePreambleParameters params)
TracedCallback signature for end of HE-SIG-A events.
Definition: wifi-phy.h:1456
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:3583
uint8_t m_initialChannelNumber
Initial channel number.
Definition: wifi-phy.h:2166
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:2621
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:4135
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3769
bool IsStateSleep(void) const
Definition: wifi-phy.cc:4563
void NotifyEndOfHePreamble(HePreambleParameters params)
Public method used to fire a EndOfHePreamble trace once both HE SIG fields have been received...
Definition: wifi-phy.cc:2701
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:4103
MpduType
The type of an MPDU.
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition: he-ru.h:53
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:648
WifiModeList m_deviceMcsSet
the device MCS set
Definition: wifi-phy.h:2123
mobility
Definition: third.py:108
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
uint16_t m_channelCenterFrequency
Center frequency in MHz.
Definition: wifi-phy.h:2132
void SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:753
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
Definition: wifi-phy.cc:3948
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1516
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Definition: wifi-phy.h:2151
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:3508
static Time GetPhyHtSigHeaderDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:1978
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:4052
void ScheduleEndOfMpdus(Ptr< Event > event)
Schedule end of MPDUs events.
Definition: wifi-phy.cc:3162
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:3908
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
Definition: wifi-phy.cc:4308
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:32
static ChannelToFrequencyWidthMap m_channelToFrequencyWidth
the channel to frequency width map
Definition: wifi-phy.h:2162
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
The MPDU is not part of an A-MPDU.
double rssiW
RSSI in W.
Definition: wifi-phy.h:135
uint8_t bssColor
BSS color.
Definition: wifi-phy.h:136
bool DoFrequencySwitch(uint16_t frequency)
The default implementation does nothing and returns true.
Definition: wifi-phy.cc:1733
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
Definition: wifi-phy.cc:3836
std::vector< bool > m_statusPerMpdu
current reception status per MPDU that is filled in as long as MPDUs are being processed by the PHY i...
Definition: wifi-phy.h:2180
void StartReceiveHeader(Ptr< Event > event)
Start receiving the PHY header of a PPDU (i.e.
Definition: wifi-phy.cc:2796
static WifiMode GetHtPhyHeaderMode()
Definition: wifi-phy.cc:1903
Time m_slot
Slot duration.
Definition: wifi-phy.h:2138
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:2171
Time m_blockAckTxTime
estimated BlockAck TX time
Definition: wifi-phy.h:2141
receive notifications about PHY events.
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:2010
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:2153
bool m_shortPreamble
Flag if short PHY preamble is supported.
Definition: wifi-phy.h:2156
static WifiMode GetHeMcs3()
Return MCS 3 from HE MCS values.
Definition: wifi-phy.cc:4185
static Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPhyBand band, MpduType mpdutype=NORMAL_MPDU, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:2253
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1813
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Definition: wifi-phy.cc:3916
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:2176
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:3496
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:688
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:804
std::pair< ChannelNumberBandPair, WifiPhyStandard > ChannelNumberStandardPair
A pair of a ChannelNumberBandPair and a WifiPhyStandard.
Definition: wifi-phy.h:163
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3670
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:3361
static WifiMode GetHeMcs11()
Return MCS 11 from HE MCS values.
Definition: wifi-phy.cc:4249
static WifiMode GetHeMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HE modulation class.
Definition: wifi-phy.cc:4484
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:4575
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU...
Definition: wifi-phy.h:1807
TracedCallback< HePreambleParameters > m_phyEndOfHePreambleTrace
A trace source that indicates the end of both HE SIG fields as well as training fields for received 8...
Definition: wifi-phy.h:2084
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
double CalculateSnr(WifiTxVector txVector, double ber) const
Definition: wifi-phy.cc:840
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:3559
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:607
void SetOffMode(void)
Put in off mode.
Definition: wifi-phy.cc:1827
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3658
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3793
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:1464
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:2175
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:816
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
Definition: wifi-phy.cc:4087
WifiPhyStandard GetPhyStandard(void) const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:1433
EventId m_endPreambleDetectionEvent
the end of preamble detection event
Definition: wifi-phy.h:1811
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:3595
Time GetBlockAckTxTime(void) const
Return the estimated BlockAck TX time for this PHY.
Definition: wifi-phy.cc:986
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
Definition: wifi-phy.cc:784
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
static WifiMode GetVhtPhyHeaderMode()
Definition: wifi-phy.cc:1909
static WifiMode GetHeMcs9()
Return MCS 9 from HE MCS values.
Definition: wifi-phy.cc:4233
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:3820
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:1994
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:771
static Time GetPreambleDetectionDuration(void)
Definition: wifi-phy.cc:1921
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: wifi-phy.h:2139
static Time GetPhySigA1Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:1993
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:791
void(* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:1441
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-phy.cc:288
Time GetChannelSwitchDelay(void) const
Definition: wifi-phy.cc:834
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:1390
void ContinueReceiveHeader(Ptr< Event > event)
Continue receiving the PHY header of a PPDU (i.e.
Definition: wifi-phy.cc:2858
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiPhyBand m_band
WifiPhyBand.
Definition: wifi-phy.h:2130
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:810
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:1496
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1530
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:3571
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:2600
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: wifi-phy.h:2137
static WifiMode GetHeMcs1()
Return MCS 1 from HE MCS values.
Definition: wifi-phy.cc:4169
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:1987
virtual void StartTx(Ptr< WifiPpdu > ppdu)=0
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
Definition: wifi-phy.cc:3924
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
Definition: wifi-phy.cc:4161
std::map< ChannelNumberStandardPair, FrequencyWidthPair > ChannelToFrequencyWidthMap
channel to frequency width map typedef
Definition: wifi-phy.h:2161
static WifiMode GetHeMcs10()
Return MCS 10 from HE MCS values.
Definition: wifi-phy.cc:4241
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
Definition: wifi-phy.cc:3980
static WifiMode GetHeMcs2()
Return MCS 2 from HE MCS values.
Definition: wifi-phy.cc:4177
static Time GetPhyTrainingSymbolDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:1927
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:3860
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1555
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:747
double m_ccaEdThresholdW
Clear channel assessment (CCA) threshold in watts.
Definition: wifi-phy.h:2144
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
Definition: wifi-phy.cc:4095
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Definition: wifi-phy.cc:1614
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:974
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:3397
Time GetAckTxTime(void) const
Return the estimated Ack TX time for this PHY.
Definition: wifi-phy.cc:980
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard...
Definition: wifi-phy.cc:1229
virtual void DoInitialize(void)
Initialize() implementation.
Definition: wifi-phy.cc:564
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3733
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1667
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:286
WifiPhyStandard m_standard
WifiPhyStandard.
Definition: wifi-phy.h:2129
uint8_t FindChannelNumberForFrequencyWidth(uint16_t frequency, uint16_t width) const
Look for channel number matching the frequency and width.
Definition: wifi-phy.cc:1295
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
Definition: wifi-phy.h:2154
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:3436
void EndReceive(Ptr< Event > event)
The last symbol of the PPDU has arrived.
Definition: wifi-phy.cc:3225
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1803
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
Definition: wifi-phy.h:2158
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:682
Time m_ackTxTime
estimated Ack TX time
Definition: wifi-phy.h:2140
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:2177
static WifiMode GetPhyHeaderMode(WifiTxVector txVector)
Definition: wifi-phy.cc:2042
void InitializeFrequencyChannelNumber(void)
post-construction setting of frequency and/or channel number
Definition: wifi-phy.cc:613
std::vector< uint16_t > GetSupportedChannelWidthSet(void) const
Definition: wifi-phy.cc:1600
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4296
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:2174
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:727
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard...
Definition: wifi-phy.cc:1015
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:30
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:944
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:583
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4302
uint16_t m_channelWidth
Channel width (MHz)
Definition: wifi-phy.h:2135
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:3424
uint8_t GetBssMembershipSelector(uint8_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1579
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:595
bool IsStateTx(void) const
Definition: wifi-phy.cc:4551
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: wifi-phy.cc:3274
void NotifyRxBegin(Ptr< const WifiPsdu > psdu, RxPowerWattPerChannelBand rxPowersW)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:2609
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1536
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:3448
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:38
EventId m_endRxEvent
the end of receive event
Definition: wifi-phy.h:1809
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1804
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard...
Definition: wifi-phy.cc:1210
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:675
double m_txPowerBaseDbm
Minimum transmission power (dBm)
Definition: wifi-phy.h:2147
bool IsMcsSupported(WifiMode mcs) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:4270
Time GetSifs(void) const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:950
An identifier for simulation events.
Definition: event-id.h:53
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:3350
SignalNoiseDbm structure.
Definition: wifi-phy.h:119
uint32_t mpduRefNumber
MPDU ref number.
Definition: wifi-phy.h:129
bool m_frequencyChannelNumberInitialized
Store initialization state.
Definition: wifi-phy.h:2134
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:3972
InterferenceHelper m_interference
Pointer to InterferenceHelper.
Definition: wifi-phy.h:1802
virtual void SetChannelWidth(uint16_t channelWidth)
Definition: wifi-phy.cc:1502
bool m_isConstructed
true when ready to set frequency
Definition: wifi-phy.h:2131
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:3868
void ConfigureHtDeviceMcsSet(void)
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
Definition: wifi-phy.cc:1140
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
Definition: wifi-phy.cc:1115
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
Definition: wifi-phy.h:52
SignalNoiseDbm m_signalNoise
latest signal power and noise power in dBm (noise power includes the noise figure) ...
Definition: wifi-phy.h:2181
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:1428
static Time GetPhySigA2Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:2011
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:4044
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:695
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:3892
Time GetSlot(void) const
Return the slot duration for this PHY.
Definition: wifi-phy.cc:962
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:3340
void StartRx(Ptr< Event > event)
Starting receiving the PPDU after having detected the medium is idle or after a reception switch...
Definition: wifi-phy.cc:4669
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:2676
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
Definition: wifi-phy.cc:3852
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: wifi-phy.cc:3051
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:4020
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
Definition: wifi-phy.cc:4225
void Send(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Definition: wifi-phy.cc:2707
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard...
Definition: wifi-phy.cc:1034
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:759
double GetTxGain(void) const
Return the transmission gain (dB).
Definition: wifi-phy.cc:721
void SetSleepMode(void)
Put in sleep mode.
Definition: wifi-phy.cc:1793
double noise
in dBm
Definition: wifi-phy.h:122
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:2645
WifiModeList m_deviceRateSet
This vector holds the set of transmission modes that this WifiPhy(-derived class) can support...
Definition: wifi-phy.h:2122
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1522
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:3828
std::map< WifiModulationClass, std::map< uint8_t, uint8_t > > m_mcsIndexMap
Maps MCS values to indices in m_deviceMcsSet, for HT, VHT and HE modulation classes.
Definition: wifi-phy.h:2125
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:4004
static Time GetPhyHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2106
A base class which provides memory management and object aggregation.
Definition: object.h:87
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
Definition: wifi-phy.cc:3382
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:4151
static Time GetStartOfPacketDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2178
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3646
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:2546
double m_txPowerEndDbm
Maximum transmission power (dBm)
Definition: wifi-phy.h:2148
std::pair< uint8_t, WifiPhyBand > ChannelNumberBandPair
A pair of a channel number and a WifiPhyBand.
Definition: wifi-phy.h:159
void Configure80211p(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard...
Definition: wifi-phy.cc:1055
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3694
MpduType type
type
Definition: wifi-phy.h:128
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:2168
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3805
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Definition: wifi-phy.cc:4587
uint8_t m_numberOfAntennas
Number of transmitters.
Definition: wifi-phy.h:2157
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1549
a unique identifier for an interface.
Definition: type-id.h:58
void ConfigureChannelForStandard(void)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:1323
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
Definition: wifi-phy.cc:3940
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:2173
static Time GetPhySigBDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:2028
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
Definition: wifi-phy.cc:4581
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:2152
bool IsStateRx(void) const
Definition: wifi-phy.cc:4545
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:3844
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Definition: wifi-phy.h:2159
#define SU_STA_ID
Definition: wifi-mode.h:30
std::vector< uint16_t > m_supportedChannelWidthSet
Supported channel width set (MHz)
Definition: wifi-phy.h:2164
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:3523
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:2077
void SwitchMaybeToCcaBusy(void)
Check if PHY state should move to CCA busy state based on current state of interference tracker...
Definition: wifi-phy.cc:4593
void SetCcaEdThreshold(double threshold)
Sets the CCA threshold (dBm).
Definition: wifi-phy.cc:654
static WifiMode GetVhtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the VHT modulation class.
Definition: wifi-phy.cc:4441
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:4758
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
static WifiMode GetHeMcs6()
Return MCS 6 from HE MCS values.
Definition: wifi-phy.cc:4209
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3757
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Definition: wifi-phy.h:2183
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard...
Definition: wifi-phy.cc:992
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1567
static WifiMode GetHtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HT modulation class.
Definition: wifi-phy.cc:4332
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3622
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:2002
uint16_t m_initialFrequency
Store frequency until initialization (MHz)
Definition: wifi-phy.h:2133
Parameters for receive HE preamble.
Definition: wifi-phy.h:133
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth)
Add a channel definition to the WifiPhy.
Definition: wifi-phy.cc:1278
static Time CalculatePhyPreambleAndHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2532
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:4749
bool DoChannelSwitch(uint8_t id)
The default implementation does nothing and returns true.
Definition: wifi-phy.cc:1673