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 
32 namespace ns3 {
33 
34 #define HE_PHY 125
35 #define VHT_PHY 126
36 #define HT_PHY 127
37 
38 class Channel;
39 class NetDevice;
40 class MobilityModel;
41 class WifiPhyStateHelper;
42 class FrameCaptureModel;
43 class PreambleDetectionModel;
44 class WifiRadioEnergyModel;
45 class UniformRandomVariable;
46 class WifiPsdu;
47 class WifiPpdu;
48 
53 {
54  UNKNOWN = 0,
68 };
69 
77 inline std::ostream& operator<< (std::ostream& os, WifiPhyRxfailureReason reason)
78 {
79  switch (reason)
80  {
82  return (os << "UNSUPPORTED_SETTINGS");
83  case CHANNEL_SWITCHING:
84  return (os << "CHANNEL_SWITCHING");
85  case RXING:
86  return (os << "RXING");
87  case TXING:
88  return (os << "TXING");
89  case SLEEPING:
90  return (os << "SLEEPING");
92  return (os << "BUSY_DECODING_PREAMBLE");
94  return (os << "PREAMBLE_DETECT_FAILURE");
96  return (os << "RECEPTION_ABORTED_BY_TX");
97  case L_SIG_FAILURE:
98  return (os << "L_SIG_FAILURE");
99  case SIG_A_FAILURE:
100  return (os << "SIG_A_FAILURE");
102  return (os << "PREAMBLE_DETECTION_PACKET_SWITCH");
104  return (os << "FRAME_CAPTURE_PACKET_SWITCH");
105  case OBSS_PD_CCA_RESET:
106  return (os << "OBSS_PD_CCA_RESET");
107  case UNKNOWN:
108  default:
109  NS_FATAL_ERROR ("Unknown reason");
110  return (os << "UNKNOWN");
111  }
112 }
113 
114 
117 {
118  double signal;
119  double noise;
120 };
121 
123 struct MpduInfo
124 {
126  uint32_t mpduRefNumber;
127 };
128 
131 {
132  double rssiW;
133  uint8_t bssColor;
134 };
135 
141 class WifiPhy : public Object
142 {
143 public:
148  static TypeId GetTypeId (void);
149 
150  WifiPhy ();
151  virtual ~WifiPhy ();
152 
158  Ptr<WifiPhyStateHelper> GetState (void) const;
159 
164  void SetReceiveOkCallback (RxOkCallback callback);
170 
177  void RegisterListener (WifiPhyListener *listener);
184  void UnregisterListener (WifiPhyListener *listener);
185 
190 
197  void StartReceivePreamble (Ptr<WifiPpdu> ppdu, double rxPowerW);
198 
204  void StartReceiveHeader (Ptr<Event> event);
205 
211  void ContinueReceiveHeader (Ptr<Event> event);
212 
218  void StartReceivePayload (Ptr<Event> event);
219 
225  void EndReceive (Ptr<Event> event);
226 
232  void ResetReceive (Ptr<Event> event);
233 
238  void EndReceiveInterBss (void);
239 
246  void Send (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
247 
251  virtual void StartTx (Ptr<WifiPpdu> ppdu) = 0;
252 
256  void SetSleepMode (void);
260  void ResumeFromSleep (void);
264  void SetOffMode (void);
268  void ResumeFromOff (void);
269 
273  bool IsStateIdle (void) const;
277  bool IsStateCcaBusy (void) const;
281  bool IsStateRx (void) const;
285  bool IsStateTx (void) const;
289  bool IsStateSwitching (void) const;
293  bool IsStateSleep (void) const;
297  bool IsStateOff (void) const;
298 
305  Time GetDelayUntilIdle (void);
306 
312  Time GetLastRxStartTime (void) const;
318  Time GetLastRxEndTime (void) const;
319 
327  static Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand band);
328 
339  static Time GetPreambleDetectionDuration (void);
350  static WifiMode GetHtPhyHeaderMode ();
354  static WifiMode GetVhtPhyHeaderMode ();
358  static WifiMode GetHePhyHeaderMode ();
364  static Time GetPhyHtSigHeaderDuration (WifiPreamble preamble);
370  static Time GetPhySigA1Duration (WifiPreamble preamble);
376  static Time GetPhySigA2Duration (WifiPreamble preamble);
382  static Time GetPhySigBDuration (WifiPreamble preamble);
388  static WifiMode GetPhyHeaderMode (WifiTxVector txVector);
394  static Time GetPhyHeaderDuration (WifiTxVector txVector);
400  static Time GetPhyPreambleDuration (WifiTxVector txVector);
409  static Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand band, MpduType mpdutype = NORMAL_MPDU);
425  static Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPhyBand band, MpduType mpdutype, bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols);
431  static Time GetStartOfPacketDuration (WifiTxVector txVector);
432 
450  uint8_t GetNModes (void) const;
470  WifiMode GetMode (uint8_t mode) const;
479  bool IsModeSupported (WifiMode mode) const;
488  bool IsMcsSupported (WifiMode mcs) const;
498  bool IsMcsSupported (WifiModulationClass mc, uint8_t mcs) const;
499 
507  double CalculateSnr (WifiTxVector txVector, double ber) const;
508 
514  void SetSifs (Time sifs);
520  Time GetSifs (void) const;
526  void SetSlot (Time slot);
532  Time GetSlot (void) const;
538  void SetPifs (Time pifs);
544  Time GetPifs (void) const;
550  Time GetAckTxTime (void) const;
556  Time GetBlockAckTxTime (void) const;
557 
567  uint8_t GetNBssMembershipSelectors (void) const;
579  uint8_t GetBssMembershipSelector (uint8_t selector) const;
589  uint8_t GetNMcs (void) const;
601  WifiMode GetMcs (uint8_t mcs) const;
612  WifiMode GetMcs (WifiModulationClass modulation, uint8_t mcs) const;
622  static WifiMode GetHtMcs (uint8_t mcs);
632  static WifiMode GetVhtMcs (uint8_t mcs);
642  static WifiMode GetHeMcs (uint8_t mcs);
643 
656  virtual void SetChannelNumber (uint8_t id);
662  uint8_t GetChannelNumber (void) const;
666  Time GetChannelSwitchDelay (void) const;
667 
674  virtual void ConfigureStandardAndBand (WifiPhyStandard standard, WifiPhyBand band);
675 
681  WifiPhyStandard GetPhyStandard (void) const;
682 
688  WifiPhyBand GetPhyBand (void) const;
689 
706  bool DefineChannelNumber (uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth);
707 
711  typedef std::pair<uint8_t, WifiPhyBand> ChannelNumberBandPair;
715  typedef std::pair<ChannelNumberBandPair, WifiPhyStandard> ChannelNumberStandardPair;
719  typedef std::pair<uint16_t, uint16_t> FrequencyWidthPair;
720 
726  virtual Ptr<Channel> GetChannel (void) const = 0;
727 
733  static WifiMode GetDsssRate1Mbps ();
739  static WifiMode GetDsssRate2Mbps ();
745  static WifiMode GetDsssRate5_5Mbps ();
751  static WifiMode GetDsssRate11Mbps ();
757  static WifiMode GetErpOfdmRate6Mbps ();
763  static WifiMode GetErpOfdmRate9Mbps ();
769  static WifiMode GetErpOfdmRate12Mbps ();
775  static WifiMode GetErpOfdmRate18Mbps ();
781  static WifiMode GetErpOfdmRate24Mbps ();
787  static WifiMode GetErpOfdmRate36Mbps ();
793  static WifiMode GetErpOfdmRate48Mbps ();
799  static WifiMode GetErpOfdmRate54Mbps ();
805  static WifiMode GetOfdmRate6Mbps ();
811  static WifiMode GetOfdmRate9Mbps ();
817  static WifiMode GetOfdmRate12Mbps ();
823  static WifiMode GetOfdmRate18Mbps ();
829  static WifiMode GetOfdmRate24Mbps ();
835  static WifiMode GetOfdmRate36Mbps ();
841  static WifiMode GetOfdmRate48Mbps ();
847  static WifiMode GetOfdmRate54Mbps ();
944 
950  static WifiMode GetHtMcs0 ();
956  static WifiMode GetHtMcs1 ();
962  static WifiMode GetHtMcs2 ();
968  static WifiMode GetHtMcs3 ();
974  static WifiMode GetHtMcs4 ();
980  static WifiMode GetHtMcs5 ();
986  static WifiMode GetHtMcs6 ();
992  static WifiMode GetHtMcs7 ();
998  static WifiMode GetHtMcs8 ();
1004  static WifiMode GetHtMcs9 ();
1010  static WifiMode GetHtMcs10 ();
1016  static WifiMode GetHtMcs11 ();
1022  static WifiMode GetHtMcs12 ();
1028  static WifiMode GetHtMcs13 ();
1034  static WifiMode GetHtMcs14 ();
1040  static WifiMode GetHtMcs15 ();
1046  static WifiMode GetHtMcs16 ();
1052  static WifiMode GetHtMcs17 ();
1058  static WifiMode GetHtMcs18 ();
1064  static WifiMode GetHtMcs19 ();
1070  static WifiMode GetHtMcs20 ();
1076  static WifiMode GetHtMcs21 ();
1082  static WifiMode GetHtMcs22 ();
1088  static WifiMode GetHtMcs23 ();
1094  static WifiMode GetHtMcs24 ();
1100  static WifiMode GetHtMcs25 ();
1106  static WifiMode GetHtMcs26 ();
1112  static WifiMode GetHtMcs27 ();
1118  static WifiMode GetHtMcs28 ();
1124  static WifiMode GetHtMcs29 ();
1130  static WifiMode GetHtMcs30 ();
1136  static WifiMode GetHtMcs31 ();
1137 
1143  static WifiMode GetVhtMcs0 ();
1149  static WifiMode GetVhtMcs1 ();
1155  static WifiMode GetVhtMcs2 ();
1161  static WifiMode GetVhtMcs3 ();
1167  static WifiMode GetVhtMcs4 ();
1173  static WifiMode GetVhtMcs5 ();
1179  static WifiMode GetVhtMcs6 ();
1185  static WifiMode GetVhtMcs7 ();
1191  static WifiMode GetVhtMcs8 ();
1197  static WifiMode GetVhtMcs9 ();
1198 
1204  static WifiMode GetHeMcs0 ();
1210  static WifiMode GetHeMcs1 ();
1216  static WifiMode GetHeMcs2 ();
1222  static WifiMode GetHeMcs3 ();
1228  static WifiMode GetHeMcs4 ();
1234  static WifiMode GetHeMcs5 ();
1240  static WifiMode GetHeMcs6 ();
1246  static WifiMode GetHeMcs7 ();
1252  static WifiMode GetHeMcs8 ();
1258  static WifiMode GetHeMcs9 ();
1264  static WifiMode GetHeMcs10 ();
1270  static WifiMode GetHeMcs11 ();
1271 
1279  void NotifyTxBegin (Ptr<const WifiPsdu> psdu, double txPowerW);
1286  void NotifyTxEnd (Ptr<const WifiPsdu> psdu);
1293  void NotifyTxDrop (Ptr<const WifiPsdu> psdu);
1300  void NotifyRxBegin (Ptr<const WifiPsdu> psdu);
1307  void NotifyRxEnd (Ptr<const WifiPsdu> psdu);
1316 
1337  uint16_t channelFreqMhz,
1338  WifiTxVector txVector,
1339  SignalNoiseDbm signalNoise,
1340  std::vector<bool> statusPerMpdu);
1341 
1362  uint16_t channelFreqMhz,
1363  WifiTxVector txVector,
1364  MpduInfo aMpdu,
1365  SignalNoiseDbm signalNoise);
1366 
1380  uint16_t channelFreqMhz,
1381  WifiTxVector txVector);
1382 
1395  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
1396  uint16_t channelFreqMhz,
1397  WifiTxVector txVector,
1398  MpduInfo aMpdu);
1399 
1407  typedef void (* PsduTxBeginCallback)(Ptr<const WifiPsdu> psdu, WifiTxVector txVector, double txPowerW);
1408 
1415 
1423 
1430  typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
1431 
1440  virtual int64_t AssignStreams (int64_t stream);
1441 
1449  void SetRxSensitivity (double threshold);
1455  double GetRxSensitivity (void) const;
1463  void SetCcaEdThreshold (double threshold);
1469  double GetCcaEdThreshold (void) const;
1475  void SetRxNoiseFigure (double noiseFigureDb);
1481  void SetTxPowerStart (double start);
1487  double GetTxPowerStart (void) const;
1493  void SetTxPowerEnd (double end);
1499  double GetTxPowerEnd (void) const;
1507  void SetNTxPower (uint8_t n);
1513  uint8_t GetNTxPower (void) const;
1519  void SetTxGain (double gain);
1525  double GetTxGain (void) const;
1531  void SetRxGain (double gain);
1537  double GetRxGain (void) const;
1538 
1544  void SetDevice (const Ptr<NetDevice> device);
1550  Ptr<NetDevice> GetDevice (void) const;
1571  Ptr<MobilityModel> GetMobility (void) const;
1572 
1576  virtual void SetFrequency (uint16_t freq);
1580  uint16_t GetFrequency (void) const;
1584  void SetNumberOfAntennas (uint8_t antennas);
1588  uint8_t GetNumberOfAntennas (void) const;
1592  void SetMaxSupportedTxSpatialStreams (uint8_t streams);
1596  uint8_t GetMaxSupportedTxSpatialStreams (void) const;
1600  void SetMaxSupportedRxSpatialStreams (uint8_t streams);
1604  uint8_t GetMaxSupportedRxSpatialStreams (void) const;
1610  void SetShortPhyPreambleSupported (bool preamble);
1616  bool GetShortPhyPreambleSupported (void) const;
1617 
1623  void SetErrorRateModel (const Ptr<ErrorRateModel> rate);
1641  void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
1647  void SetPreambleDetectionModel (const Ptr<PreambleDetectionModel> preambleDetectionModel);
1653  void SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
1654 
1658  uint16_t GetChannelWidth (void) const;
1662  virtual void SetChannelWidth (uint16_t channelWidth);
1666  void AddSupportedChannelWidth (uint16_t width);
1670  std::vector<uint16_t> GetSupportedChannelWidthSet (void) const;
1671 
1680  double GetPowerDbm (uint8_t power) const;
1681 
1689  void ResetCca (bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
1696  double GetTxPowerForTransmission (WifiTxVector txVector) const;
1704  void NotifyChannelAccessRequested (void);
1705 
1706 
1707 protected:
1708  // Inherited
1709  virtual void DoInitialize (void);
1710  virtual void DoDispose (void);
1711 
1721  bool DoChannelSwitch (uint8_t id);
1731  bool DoFrequencySwitch (uint16_t frequency);
1732 
1739  void SwitchMaybeToCcaBusy (void);
1740 
1744 
1747 
1751 
1753 
1754 private:
1770  void Configure80211a (void);
1775  void Configure80211b (void);
1780  void Configure80211g (void);
1785  void Configure80211p (void);
1790  void ConfigureHolland (void);
1795  void Configure80211n (void);
1800  void Configure80211ac (void);
1805  void Configure80211ax (void);
1810  void ConfigureHtDeviceMcsSet (void);
1816  void PushMcs (WifiMode mode);
1820  void RebuildMcsMap (void);
1826  void ConfigureDefaultsForStandard (void);
1833  void ConfigureChannelForStandard (void);
1834 
1841  uint8_t FindChannelNumberForFrequencyWidth (uint16_t frequency, uint16_t width) const;
1849  FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard (uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard) const;
1850 
1857 
1861  void MaybeCcaBusyDuration (void);
1862 
1869  void StartRx (Ptr<Event> event, double rxPowerW);
1880  std::pair<bool, SignalNoiseDbm> GetReceptionStatus (Ptr<const WifiPsdu> psdu,
1881  Ptr<Event> event,
1882  Time relativeMpduStart,
1883  Time mpduDuration);
1893  void EndOfMpdu (Ptr<Event> event, Ptr<const WifiPsdu> psdu, size_t mpduIndex, Time relativeStart, Time mpduDuration);
1894 
1900  void ScheduleEndOfMpdus (Ptr<Event> event);
1901 
1916 
1924 
1932 
1940 
1956 
1964 
1971 
1985 
1999 
2006 
2045  std::map<WifiModulationClass, std::map<uint8_t /* MCS value */, uint8_t /* index */>> m_mcsIndexMap;
2047 
2048  std::vector<uint8_t> m_bssMembershipSelectorSet;
2049 
2056  uint16_t m_channelWidth;
2057 
2063 
2066  double m_txGainDb;
2067  double m_rxGainDb;
2070  uint8_t m_nTxPower;
2071 
2076 
2081 
2082  typedef std::map<ChannelNumberStandardPair, FrequencyWidthPair> ChannelToFrequencyWidthMap;
2084 
2085  std::vector<uint16_t> m_supportedChannelWidthSet;
2088 
2090 
2093 
2100 
2101  std::vector <EventId> m_endOfMpduEvents;
2102 
2103  std::vector<bool> m_statusPerMpdu;
2105 
2107 };
2108 
2109 } //namespace ns3
2110 
2111 #endif /* WIFI_PHY_H */
MpduInfo structure.
Definition: wifi-phy.h:123
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:3951
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:2592
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3605
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1939
Ptr< NetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:2091
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:3296
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:707
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU...
Definition: wifi-phy.h:1745
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:3233
bool IsStateSwitching(void) const
Definition: wifi-phy.cc:4381
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:967
bool IsStateOff(void) const
Definition: wifi-phy.cc:4393
FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard(uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard) const
Lookup frequency/width pair for channelNumber/standard pair.
Definition: wifi-phy.cc:1605
double signal
in dBm
Definition: wifi-phy.h:118
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:4041
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:3308
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:700
uint8_t m_channelNumber
Operating channel number.
Definition: wifi-phy.h:2086
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:2067
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:3967
double GetRxGain(void) const
Return the reception gain (dB).
Definition: wifi-phy.cc:733
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:4081
void AddSupportedChannelWidth(uint16_t width)
Definition: wifi-phy.cc:1584
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:3359
double GetCcaEdThreshold(void) const
Return the CCA threshold (dBm).
Definition: wifi-phy.cc:660
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3506
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:3530
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo, SignalNoiseDbm > m_phyMonitorSniffRxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being received...
Definition: wifi-phy.h:1984
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:2066
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:4138
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3569
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:3903
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted...
Definition: wifi-phy.cc:4434
void MaybeCcaBusyDuration(void)
Eventually switch to CCA busy.
Definition: wifi-phy.cc:2958
virtual ~WifiPhy()
Definition: wifi-phy.cc:539
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:3194
void ResumeFromOff(void)
Resume from off mode.
Definition: wifi-phy.cc:1869
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:576
void ResumeFromSleep(void)
Resume from sleep mode.
Definition: wifi-phy.cc:1839
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:2064
void ConfigureDefaultsForStandard(void)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:845
static WifiMode GetHeMcs5()
Return MCS 5 from HE MCS values.
Definition: wifi-phy.cc:4025
802.11 PHY layer model
Definition: wifi-phy.h:141
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:1425
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:2099
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:3284
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:713
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard...
Definition: wifi-phy.cc:1248
handles interference calculations
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Definition: wifi-phy.cc:3700
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:640
virtual void ConfigureStandardAndBand(WifiPhyStandard standard, WifiPhyBand band)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:1372
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-phy.cc:545
static WifiMode GetHePhyHeaderMode()
Definition: wifi-phy.cc:1912
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:1127
TracedCallback< Ptr< const WifiPsdu >, WifiTxVector, double > m_phyTxPsduBeginTrace
The trace source fired when a PSDU begins the transmission process on the medium. ...
Definition: wifi-phy.h:1915
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
Definition: wifi-phy.cc:3943
uint8_t GetNBssMembershipSelectors(void) const
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
Definition: wifi-phy.cc:1572
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:3820
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:3756
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:3371
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1963
bool IsStateCcaBusy(void) const
Definition: wifi-phy.cc:4357
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:588
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:3078
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
Definition: wifi-phy.cc:3892
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:3812
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:3884
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:955
std::vector< uint8_t > m_bssMembershipSelectorSet
the BSS membership selector set
Definition: wifi-phy.h:2048
std::pair< bool, SignalNoiseDbm > GetReceptionStatus(Ptr< const WifiPsdu > psdu, Ptr< Event > event, Time relativeMpduStart, Time mpduDuration)
Get the reception status for the provided MPDU and notify.
Definition: wifi-phy.cc:3133
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:3724
static Time GetPhyPreambleDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2178
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:739
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:3852
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:1955
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3545
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
Definition: wifi-phy.cc:3780
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:3836
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1749
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3458
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:3431
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:764
std::vector< EventId > m_endOfMpduEvents
the end of MPDU events (only used for A-MPDUs)
Definition: wifi-phy.h:2101
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:600
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:666
#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:4017
void ConfigureHolland(void)
Configure WifiPhy with appropriate channel frequency and supported rates for Holland.
Definition: wifi-phy.cc:1098
bool IsStateIdle(void) const
Definition: wifi-phy.cc:4363
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:1970
std::pair< uint16_t, uint16_t > FrequencyWidthPair
A pair of a center frequency (MHz) and a channel width (MHz)
Definition: wifi-phy.h:719
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:2070
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:3708
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:3788
double GetTxPowerForTransmission(WifiTxVector txVector) const
Compute the transmit power (in dBm) for the next transmission.
Definition: wifi-phy.cc:4471
virtual void SetFrequency(uint16_t freq)
Definition: wifi-phy.cc:1438
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:3935
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:3860
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:797
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:4459
void(* EndOfHePreambleCallback)(HePreambleParameters params)
TracedCallback signature for end of HE-SIG-A events.
Definition: wifi-phy.h:1422
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo > m_phyMonitorSniffTxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being transmitted...
Definition: wifi-phy.h:1998
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:3407
uint8_t m_initialChannelNumber
Initial channel number.
Definition: wifi-phy.h:2087
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:2583
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:3959
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3593
bool IsStateSleep(void) const
Definition: wifi-phy.cc:4387
void NotifyEndOfHePreamble(HePreambleParameters params)
Public method used to fire a EndOfHePreamble trace once both HE SIG fields have been received...
Definition: wifi-phy.cc:2657
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:3927
MpduType
The type of an MPDU.
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:647
void NotifyTxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:2556
WifiModeList m_deviceMcsSet
the device MCS set
Definition: wifi-phy.h:2044
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:2053
void SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:752
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
Definition: wifi-phy.cc:3772
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1515
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Definition: wifi-phy.h:2072
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:3332
static Time GetPhyHtSigHeaderDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:1973
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:3876
void ScheduleEndOfMpdus(Ptr< Event > event)
Schedule end of MPDUs events.
Definition: wifi-phy.cc:3041
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:3732
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:4132
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:2083
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:132
uint8_t bssColor
BSS color.
Definition: wifi-phy.h:133
bool DoFrequencySwitch(uint16_t frequency)
The default implementation does nothing and returns true.
Definition: wifi-phy.cc:1732
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
Definition: wifi-phy.cc:3660
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:2103
void StartReceiveHeader(Ptr< Event > event)
Start receiving the PHY header of a PPDU (i.e.
Definition: wifi-phy.cc:2738
static WifiMode GetHtPhyHeaderMode()
Definition: wifi-phy.cc:1900
Time m_slot
Slot duration.
Definition: wifi-phy.h:2059
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, WifiPhyBand band)
Definition: wifi-phy.cc:2539
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:2092
void StartRx(Ptr< Event > event, double rxPowerW)
Starting receiving the PPDU after having detected the medium is idle or after a reception switch...
Definition: wifi-phy.cc:4492
Time m_blockAckTxTime
estimated BlockAck TX time
Definition: wifi-phy.h:2062
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:1931
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:2074
bool m_shortPreamble
Flag if short PHY preamble is supported.
Definition: wifi-phy.h:2077
static WifiMode GetHeMcs3()
Return MCS 3 from HE MCS values.
Definition: wifi-phy.cc:4009
void(* MonitorSnifferTxCallback)(const Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu)
TracedCallback signature for monitor mode transmit events.
Definition: wifi-phy.h:1395
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1752
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Definition: wifi-phy.cc:3740
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:2097
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:3320
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:687
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:803
std::pair< ChannelNumberBandPair, WifiPhyStandard > ChannelNumberStandardPair
A pair of a ChannelNumberBandPair and a WifiPhyStandard.
Definition: wifi-phy.h:715
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3494
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:3185
static WifiMode GetHeMcs11()
Return MCS 11 from HE MCS values.
Definition: wifi-phy.cc:4073
static WifiMode GetHeMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HE modulation class.
Definition: wifi-phy.cc:4308
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:4399
static Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPhyBand band, MpduType mpdutype=NORMAL_MPDU)
Definition: wifi-phy.cc:2247
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU...
Definition: wifi-phy.h:1746
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:2005
double CalculateSnr(WifiTxVector txVector, double ber) const
Definition: wifi-phy.cc:839
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:3383
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:606
void SetOffMode(void)
Put in off mode.
Definition: wifi-phy.cc:1826
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3482
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3617
void(* MonitorSnifferRxCallback)(Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise)
TracedCallback signature for monitor mode receive events.
Definition: wifi-phy.h:1361
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:1430
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:2096
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:815
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
Definition: wifi-phy.cc:3911
WifiPhyStandard GetPhyStandard(void) const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:1432
EventId m_endPreambleDetectionEvent
the end of preamble detection event
Definition: wifi-phy.h:1750
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:3419
void NotifyRxBegin(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:2574
Time GetBlockAckTxTime(void) const
Return the estimated BlockAck TX time for this PHY.
Definition: wifi-phy.cc:985
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
Definition: wifi-phy.cc:783
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, double rxPowerW)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:2819
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:1906
static WifiMode GetHeMcs9()
Return MCS 9 from HE MCS values.
Definition: wifi-phy.cc:4057
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:3644
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:770
static Time GetPreambleDetectionDuration(void)
Definition: wifi-phy.cc:1918
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: wifi-phy.h:2060
static Time GetPhySigA1Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:1988
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:790
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-phy.cc:288
Time GetChannelSwitchDelay(void) const
Definition: wifi-phy.cc:833
void ContinueReceiveHeader(Ptr< Event > event)
Continue receiving the PHY header of a PPDU (i.e.
Definition: wifi-phy.cc:2790
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiPhyBand m_band
WifiPhyBand.
Definition: wifi-phy.h:2051
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:809
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:1495
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1529
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:3395
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:2565
void(* PsduTxBeginCallback)(Ptr< const WifiPsdu > psdu, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:1407
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: wifi-phy.h:2058
static WifiMode GetHeMcs1()
Return MCS 1 from HE MCS values.
Definition: wifi-phy.cc:3993
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:1908
virtual void StartTx(Ptr< WifiPpdu > ppdu)=0
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
Definition: wifi-phy.cc:3748
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
Definition: wifi-phy.cc:3985
std::map< ChannelNumberStandardPair, FrequencyWidthPair > ChannelToFrequencyWidthMap
channel to frequency width map typedef
Definition: wifi-phy.h:2082
static WifiMode GetHeMcs10()
Return MCS 10 from HE MCS values.
Definition: wifi-phy.cc:4065
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
Definition: wifi-phy.cc:3804
static WifiMode GetHeMcs2()
Return MCS 2 from HE MCS values.
Definition: wifi-phy.cc:4001
static Time GetPhyTrainingSymbolDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:1924
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:3684
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1554
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:746
double m_ccaEdThresholdW
Clear channel assessment (CCA) threshold in watts.
Definition: wifi-phy.h:2065
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
Definition: wifi-phy.cc:3919
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Definition: wifi-phy.cc:1613
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:973
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:3221
Time GetAckTxTime(void) const
Return the estimated Ack TX time for this PHY.
Definition: wifi-phy.cc:979
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard...
Definition: wifi-phy.cc:1228
virtual void DoInitialize(void)
Initialize() implementation.
Definition: wifi-phy.cc:563
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3557
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1666
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:283
WifiPhyStandard m_standard
WifiPhyStandard.
Definition: wifi-phy.h:2050
uint8_t FindChannelNumberForFrequencyWidth(uint16_t frequency, uint16_t width) const
Look for channel number matching the frequency and width.
Definition: wifi-phy.cc:1294
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
Definition: wifi-phy.h:2075
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:3260
void EndReceive(Ptr< Event > event)
The last symbol of the PPDU has arrived.
Definition: wifi-phy.cc:3097
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1742
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
Definition: wifi-phy.h:2079
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:681
Time m_ackTxTime
estimated Ack TX time
Definition: wifi-phy.h:2061
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:2098
static WifiMode GetPhyHeaderMode(WifiTxVector txVector)
Definition: wifi-phy.cc:2036
void InitializeFrequencyChannelNumber(void)
post-construction setting of frequency and/or channel number
Definition: wifi-phy.cc:612
std::vector< uint16_t > GetSupportedChannelWidthSet(void) const
Definition: wifi-phy.cc:1599
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4120
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:2095
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:726
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard...
Definition: wifi-phy.cc:1014
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:943
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:582
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:4126
uint16_t m_channelWidth
Channel width (MHz)
Definition: wifi-phy.h:2056
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:3248
uint8_t GetBssMembershipSelector(uint8_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1578
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:594
bool IsStateTx(void) const
Definition: wifi-phy.cc:4375
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1535
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:3272
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:36
EventId m_endRxEvent
the end of receive event
Definition: wifi-phy.h:1748
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1743
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard...
Definition: wifi-phy.cc:1209
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:674
double m_txPowerBaseDbm
Minimum transmission power (dBm)
Definition: wifi-phy.h:2068
bool IsMcsSupported(WifiMode mcs) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:4094
Time GetSifs(void) const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:949
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:3174
SignalNoiseDbm structure.
Definition: wifi-phy.h:116
uint32_t mpduRefNumber
MPDU ref number.
Definition: wifi-phy.h:126
bool m_frequencyChannelNumberInitialized
Store initialization state.
Definition: wifi-phy.h:2055
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:3796
InterferenceHelper m_interference
Pointer to InterferenceHelper.
Definition: wifi-phy.h:1741
virtual void SetChannelWidth(uint16_t channelWidth)
Definition: wifi-phy.cc:1501
bool m_isConstructed
true when ready to set frequency
Definition: wifi-phy.h:2052
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:3692
void NotifyTxBegin(Ptr< const WifiPsdu > psdu, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:2547
void ConfigureHtDeviceMcsSet(void)
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
Definition: wifi-phy.cc:1139
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
Definition: wifi-phy.cc:1114
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:2104
static Time GetPhySigA2Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:2005
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:3868
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:694
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:3716
Time GetSlot(void) const
Return the slot duration for this PHY.
Definition: wifi-phy.cc:961
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:3164
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
Definition: wifi-phy.cc:3676
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: wifi-phy.cc:2973
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:3844
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
Definition: wifi-phy.cc:4049
void Send(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Definition: wifi-phy.cc:2663
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard...
Definition: wifi-phy.cc:1033
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:758
void NotifyMonitorSniffTx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being transmitted.
Definition: wifi-phy.cc:2632
double GetTxGain(void) const
Return the transmission gain (dB).
Definition: wifi-phy.cc:720
void SetSleepMode(void)
Put in sleep mode.
Definition: wifi-phy.cc:1792
double noise
in dBm
Definition: wifi-phy.h:119
WifiModeList m_deviceRateSet
This vector holds the set of transmission modes that this WifiPhy(-derived class) can support...
Definition: wifi-phy.h:2043
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1521
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:3652
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:2046
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:3828
static Time GetPhyHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2100
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:3206
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:3975
static Time GetStartOfPacketDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2172
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3470
double m_txPowerEndDbm
Maximum transmission power (dBm)
Definition: wifi-phy.h:2069
std::pair< uint8_t, WifiPhyBand > ChannelNumberBandPair
A pair of a channel number and a WifiPhyBand.
Definition: wifi-phy.h:711
void Configure80211p(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard...
Definition: wifi-phy.cc:1054
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3518
MpduType type
type
Definition: wifi-phy.h:125
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:2089
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3629
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Definition: wifi-phy.cc:4411
uint8_t m_numberOfAntennas
Number of transmitters.
Definition: wifi-phy.h:2078
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1548
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:1322
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
Definition: wifi-phy.cc:3764
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:2094
static Time GetPhySigBDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:2022
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
Definition: wifi-phy.cc:4405
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:2073
bool IsStateRx(void) const
Definition: wifi-phy.cc:4369
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:3668
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Definition: wifi-phy.h:2080
std::vector< uint16_t > m_supportedChannelWidthSet
Supported channel width set (MHz)
Definition: wifi-phy.h:2085
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:3347
void SwitchMaybeToCcaBusy(void)
Check if PHY state should move to CCA busy state based on current state of interference tracker...
Definition: wifi-phy.cc:4417
void SetCcaEdThreshold(double threshold)
Sets the CCA threshold (dBm).
Definition: wifi-phy.cc:653
static WifiMode GetVhtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the VHT modulation class.
Definition: wifi-phy.cc:4265
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:4526
static WifiMode GetHeMcs6()
Return MCS 6 from HE MCS values.
Definition: wifi-phy.cc:4033
void NotifyMonitorSniffRx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector, SignalNoiseDbm signalNoise, std::vector< bool > statusPerMpdu)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being received. ...
Definition: wifi-phy.cc:2601
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3581
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Definition: wifi-phy.h:2106
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard...
Definition: wifi-phy.cc:991
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1566
static WifiMode GetHtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HT modulation class.
Definition: wifi-phy.cc:4156
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3446
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1923
uint16_t m_initialFrequency
Store frequency until initialization (MHz)
Definition: wifi-phy.h:2054
Parameters for receive HE preamble.
Definition: wifi-phy.h:130
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:1277
static Time CalculatePhyPreambleAndHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2525
bool DoChannelSwitch(uint8_t id)
The default implementation does nothing and returns true.
Definition: wifi-phy.cc:1672