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/deprecated.h"
27 #include "ns3/error-model.h"
28 #include "wifi-mpdu-type.h"
29 #include "wifi-phy-standard.h"
30 #include "interference-helper.h"
31 #include "wifi-phy-state-helper.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 class WifiPpdu;
49 
54 {
55  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 UNKNOWN:
109  default:
110  NS_FATAL_ERROR ("Unknown reason");
111  return (os << "UNKNOWN");
112  }
113 }
114 
115 
118 {
119  double signal;
120  double noise;
121 };
122 
124 struct MpduInfo
125 {
127  uint32_t mpduRefNumber;
128 };
129 
132 {
133  double rssiW;
134  uint8_t bssColor;
135 };
136 
142 class WifiPhy : public Object
143 {
144 public:
149  static TypeId GetTypeId (void);
150 
151  WifiPhy ();
152  virtual ~WifiPhy ();
153 
159  Ptr<WifiPhyStateHelper> GetState (void) const;
160 
165  void SetReceiveOkCallback (RxOkCallback callback);
171 
178  void RegisterListener (WifiPhyListener *listener);
185  void UnregisterListener (WifiPhyListener *listener);
186 
191 
198  void StartReceivePreamble (Ptr<WifiPpdu> ppdu, double rxPowerW);
199 
205  void StartReceiveHeader (Ptr<Event> event);
206 
212  void ContinueReceiveHeader (Ptr<Event> event);
213 
219  void StartReceivePayload (Ptr<Event> event);
220 
226  void EndReceive (Ptr<Event> event);
227 
233  void ResetReceive (Ptr<Event> event);
234 
239  void EndReceiveInterBss (void);
240 
247  void Send (Ptr<const WifiPsdu> psdu, WifiTxVector txVector);
248 
252  virtual void StartTx (Ptr<WifiPpdu> ppdu) = 0;
253 
257  void SetSleepMode (void);
261  void ResumeFromSleep (void);
265  void SetOffMode (void);
269  void ResumeFromOff (void);
270 
274  bool IsStateIdle (void) const;
278  bool IsStateCcaBusy (void) const;
282  bool IsStateRx (void) const;
286  bool IsStateTx (void) const;
290  bool IsStateSwitching (void) const;
294  bool IsStateSleep (void) const;
298  bool IsStateOff (void) const;
299 
306  Time GetDelayUntilIdle (void);
307 
313  Time GetLastRxStartTime (void) const;
319  Time GetLastRxEndTime (void) const;
320 
328  static Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, uint16_t frequency);
329 
340  static Time GetPreambleDetectionDuration (void);
351  static WifiMode GetHtPhyHeaderMode ();
355  static WifiMode GetVhtPhyHeaderMode ();
359  static WifiMode GetHePhyHeaderMode ();
365  static Time GetPhyHtSigHeaderDuration (WifiPreamble preamble);
371  static Time GetPhySigA1Duration (WifiPreamble preamble);
377  static Time GetPhySigA2Duration (WifiPreamble preamble);
383  static Time GetPhySigBDuration (WifiPreamble preamble);
389  static WifiMode GetPhyHeaderMode (WifiTxVector txVector);
395  static Time GetPhyHeaderDuration (WifiTxVector txVector);
401  static Time GetPhyPreambleDuration (WifiTxVector txVector);
410  static Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, uint16_t frequency, MpduType mpdutype = NORMAL_MPDU);
426  static Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, uint16_t frequency, MpduType mpdutype, bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols);
432  static Time GetStartOfPacketDuration (WifiTxVector txVector);
433 
451  uint8_t GetNModes (void) const;
471  WifiMode GetMode (uint8_t mode) const;
480  bool IsModeSupported (WifiMode mode) const;
489  bool IsMcsSupported (WifiMode mcs) const;
499  bool IsMcsSupported (WifiModulationClass mc, uint8_t mcs) const;
500 
508  double CalculateSnr (WifiTxVector txVector, double ber) const;
509 
519  uint8_t GetNBssMembershipSelectors (void) const;
531  uint8_t GetBssMembershipSelector (uint8_t selector) const;
541  uint8_t GetNMcs (void) const;
553  WifiMode GetMcs (uint8_t mcs) const;
564  WifiMode GetMcs (WifiModulationClass modulation, uint8_t mcs) const;
574  WifiMode GetHtMcs (uint8_t mcs) const;
584  WifiMode GetVhtMcs (uint8_t mcs) const;
594  WifiMode GetHeMcs (uint8_t mcs) const;
595 
608  virtual void SetChannelNumber (uint8_t id);
614  uint8_t GetChannelNumber (void) const;
618  Time GetChannelSwitchDelay (void) const;
619 
625  virtual void ConfigureStandard (WifiPhyStandard standard);
626 
632  WifiPhyStandard GetStandard (void) const;
633 
649  bool DefineChannelNumber (uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth);
650 
654  typedef std::pair<uint8_t, WifiPhyStandard> ChannelNumberStandardPair;
658  typedef std::pair<uint16_t, uint16_t> FrequencyWidthPair;
659 
665  virtual Ptr<Channel> GetChannel (void) const = 0;
666 
672  static WifiMode GetDsssRate1Mbps ();
678  static WifiMode GetDsssRate2Mbps ();
684  static WifiMode GetDsssRate5_5Mbps ();
690  static WifiMode GetDsssRate11Mbps ();
696  static WifiMode GetErpOfdmRate6Mbps ();
702  static WifiMode GetErpOfdmRate9Mbps ();
708  static WifiMode GetErpOfdmRate12Mbps ();
714  static WifiMode GetErpOfdmRate18Mbps ();
720  static WifiMode GetErpOfdmRate24Mbps ();
726  static WifiMode GetErpOfdmRate36Mbps ();
732  static WifiMode GetErpOfdmRate48Mbps ();
738  static WifiMode GetErpOfdmRate54Mbps ();
744  static WifiMode GetOfdmRate6Mbps ();
750  static WifiMode GetOfdmRate9Mbps ();
756  static WifiMode GetOfdmRate12Mbps ();
762  static WifiMode GetOfdmRate18Mbps ();
768  static WifiMode GetOfdmRate24Mbps ();
774  static WifiMode GetOfdmRate36Mbps ();
780  static WifiMode GetOfdmRate48Mbps ();
786  static WifiMode GetOfdmRate54Mbps ();
883 
889  static WifiMode GetHtMcs0 ();
895  static WifiMode GetHtMcs1 ();
901  static WifiMode GetHtMcs2 ();
907  static WifiMode GetHtMcs3 ();
913  static WifiMode GetHtMcs4 ();
919  static WifiMode GetHtMcs5 ();
925  static WifiMode GetHtMcs6 ();
931  static WifiMode GetHtMcs7 ();
937  static WifiMode GetHtMcs8 ();
943  static WifiMode GetHtMcs9 ();
949  static WifiMode GetHtMcs10 ();
955  static WifiMode GetHtMcs11 ();
961  static WifiMode GetHtMcs12 ();
967  static WifiMode GetHtMcs13 ();
973  static WifiMode GetHtMcs14 ();
979  static WifiMode GetHtMcs15 ();
985  static WifiMode GetHtMcs16 ();
991  static WifiMode GetHtMcs17 ();
997  static WifiMode GetHtMcs18 ();
1003  static WifiMode GetHtMcs19 ();
1009  static WifiMode GetHtMcs20 ();
1015  static WifiMode GetHtMcs21 ();
1021  static WifiMode GetHtMcs22 ();
1027  static WifiMode GetHtMcs23 ();
1033  static WifiMode GetHtMcs24 ();
1039  static WifiMode GetHtMcs25 ();
1045  static WifiMode GetHtMcs26 ();
1051  static WifiMode GetHtMcs27 ();
1057  static WifiMode GetHtMcs28 ();
1063  static WifiMode GetHtMcs29 ();
1069  static WifiMode GetHtMcs30 ();
1075  static WifiMode GetHtMcs31 ();
1076 
1082  static WifiMode GetVhtMcs0 ();
1088  static WifiMode GetVhtMcs1 ();
1094  static WifiMode GetVhtMcs2 ();
1100  static WifiMode GetVhtMcs3 ();
1106  static WifiMode GetVhtMcs4 ();
1112  static WifiMode GetVhtMcs5 ();
1118  static WifiMode GetVhtMcs6 ();
1124  static WifiMode GetVhtMcs7 ();
1130  static WifiMode GetVhtMcs8 ();
1136  static WifiMode GetVhtMcs9 ();
1137 
1143  static WifiMode GetHeMcs0 ();
1149  static WifiMode GetHeMcs1 ();
1155  static WifiMode GetHeMcs2 ();
1161  static WifiMode GetHeMcs3 ();
1167  static WifiMode GetHeMcs4 ();
1173  static WifiMode GetHeMcs5 ();
1179  static WifiMode GetHeMcs6 ();
1185  static WifiMode GetHeMcs7 ();
1191  static WifiMode GetHeMcs8 ();
1197  static WifiMode GetHeMcs9 ();
1203  static WifiMode GetHeMcs10 ();
1209  static WifiMode GetHeMcs11 ();
1210 
1218  void NotifyTxBegin (Ptr<const WifiPsdu> psdu, double txPowerW);
1225  void NotifyTxEnd (Ptr<const WifiPsdu> psdu);
1232  void NotifyTxDrop (Ptr<const WifiPsdu> psdu);
1239  void NotifyRxBegin (Ptr<const WifiPsdu> psdu);
1246  void NotifyRxEnd (Ptr<const WifiPsdu> psdu);
1255 
1276  uint16_t channelFreqMhz,
1277  WifiTxVector txVector,
1278  SignalNoiseDbm signalNoise,
1279  std::vector<bool> statusPerMpdu);
1280 
1301  uint16_t channelFreqMhz,
1302  WifiTxVector txVector,
1303  MpduInfo aMpdu,
1304  SignalNoiseDbm signalNoise);
1305 
1319  uint16_t channelFreqMhz,
1320  WifiTxVector txVector);
1321 
1334  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
1335  uint16_t channelFreqMhz,
1336  WifiTxVector txVector,
1337  MpduInfo aMpdu);
1338 
1346  typedef void (* PsduTxBeginCallback)(Ptr<const WifiPsdu> psdu, WifiTxVector txVector, double txPowerW);
1347 
1354 
1362 
1369  typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
1370 
1379  virtual int64_t AssignStreams (int64_t stream);
1380 
1390  void SetEdThreshold (double threshold);
1398  void SetRxSensitivity (double threshold);
1404  double GetRxSensitivity (void) const;
1412  void SetCcaEdThreshold (double threshold);
1418  double GetCcaEdThreshold (void) const;
1424  void SetRxNoiseFigure (double noiseFigureDb);
1430  void SetTxPowerStart (double start);
1436  double GetTxPowerStart (void) const;
1442  void SetTxPowerEnd (double end);
1448  double GetTxPowerEnd (void) const;
1456  void SetNTxPower (uint8_t n);
1462  uint8_t GetNTxPower (void) const;
1468  void SetTxGain (double gain);
1474  double GetTxGain (void) const;
1480  void SetRxGain (double gain);
1486  double GetRxGain (void) const;
1487 
1493  void SetDevice (const Ptr<NetDevice> device);
1499  Ptr<NetDevice> GetDevice (void) const;
1520  Ptr<MobilityModel> GetMobility (void) const;
1521 
1525  virtual void SetFrequency (uint16_t freq);
1529  uint16_t GetFrequency (void) const;
1533  void SetNumberOfAntennas (uint8_t antennas);
1537  uint8_t GetNumberOfAntennas (void) const;
1541  void SetMaxSupportedTxSpatialStreams (uint8_t streams);
1545  uint8_t GetMaxSupportedTxSpatialStreams (void) const;
1549  void SetMaxSupportedRxSpatialStreams (uint8_t streams);
1553  uint8_t GetMaxSupportedRxSpatialStreams (void) const;
1561  void SetShortGuardInterval (bool shortGuardInterval);
1569  bool GetShortGuardInterval (void) const;
1575  void SetGuardInterval (Time guardInterval);
1581  Time GetGuardInterval (void) const;
1589  void SetGreenfield (bool greenfield);
1597  bool GetGreenfield (void) const;
1603  void SetShortPhyPreambleSupported (bool preamble);
1609  bool GetShortPhyPreambleSupported (void) const;
1610 
1616  void SetErrorRateModel (const Ptr<ErrorRateModel> rate);
1634  void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
1640  void SetPreambleDetectionModel (const Ptr<PreambleDetectionModel> preambleDetectionModel);
1646  void SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
1647 
1651  uint16_t GetChannelWidth (void) const;
1655  virtual void SetChannelWidth (uint16_t channelWidth);
1659  void AddSupportedChannelWidth (uint16_t width);
1663  std::vector<uint16_t> GetSupportedChannelWidthSet (void) const;
1664 
1673  double GetPowerDbm (uint8_t power) const;
1674 
1682  void ResetCca (bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
1689  double GetTxPowerForTransmission (WifiTxVector txVector) const;
1697  void NotifyChannelAccessRequested (void);
1698 
1699 
1700 protected:
1701  // Inherited
1702  virtual void DoInitialize (void);
1703  virtual void DoDispose (void);
1704 
1714  bool DoChannelSwitch (uint8_t id);
1724  bool DoFrequencySwitch (uint16_t frequency);
1725 
1732  void SwitchMaybeToCcaBusy (void);
1733 
1737 
1740 
1744 
1746 
1747 private:
1763  void Configure80211a (void);
1768  void Configure80211b (void);
1773  void Configure80211g (void);
1778  void Configure80211_10Mhz (void);
1783  void Configure80211_5Mhz ();
1788  void ConfigureHolland (void);
1793  void Configure80211n (void);
1798  void Configure80211ac (void);
1803  void Configure80211ax (void);
1808  void ConfigureHtDeviceMcsSet (void);
1814  void PushMcs (WifiMode mode);
1818  void RebuildMcsMap (void);
1836 
1843  uint8_t FindChannelNumberForFrequencyWidth (uint16_t frequency, uint16_t width) const;
1850  FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard (uint8_t channelNumber, WifiPhyStandard standard) const;
1851 
1858 
1862  void MaybeCcaBusyDuration (void);
1863 
1870  void StartRx (Ptr<Event> event, double rxPowerW);
1881  std::pair<bool, SignalNoiseDbm> GetReceptionStatus (Ptr<const WifiPsdu> psdu,
1882  Ptr<Event> event,
1883  Time relativeMpduStart,
1884  Time mpduDuration);
1885 
1900 
1908 
1916 
1924 
1940 
1948 
1955 
1969 
1983 
1990 
2029  std::map<WifiModulationClass, std::map<uint8_t /* MCS value */, uint8_t /* index */>> m_mcsIndexMap;
2031 
2032  std::vector<uint8_t> m_bssMembershipSelectorSet;
2033 
2039  uint16_t m_channelWidth;
2040 
2043  double m_txGainDb;
2044  double m_rxGainDb;
2047  uint8_t m_nTxPower;
2048 
2053 
2057 
2059 
2063 
2064  typedef std::map<ChannelNumberStandardPair,FrequencyWidthPair> ChannelToFrequencyWidthMap;
2066 
2067  std::vector<uint16_t> m_supportedChannelWidthSet;
2070 
2072 
2075 
2082 
2084 };
2085 
2086 } //namespace ns3
2087 
2088 #endif /* WIFI_PHY_H */
MpduInfo structure.
Definition: wifi-phy.h:124
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:3807
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:2470
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3461
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1923
Ptr< NetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:2073
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:3152
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:589
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU...
Definition: wifi-phy.h:1738
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:3089
bool IsStateSwitching(void) const
Definition: wifi-phy.cc:4054
bool IsStateOff(void) const
Definition: wifi-phy.cc:4066
double signal
in dBm
Definition: wifi-phy.h:119
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
static WifiMode GetHeMcs7()
Return MCS 7 from HE MCS values.
Definition: wifi-phy.cc:3897
std::pair< uint8_t, WifiPhyStandard > ChannelNumberStandardPair
A pair of a ChannelNumber and WifiPhyStandard.
Definition: wifi-phy.h:654
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:3164
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:582
uint8_t m_channelNumber
Operating channel number.
Definition: wifi-phy.h:2068
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:2044
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth)
Add a channel definition to the WifiPhy.
Definition: wifi-phy.cc:1157
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:3823
double GetRxGain(void) const
Return the reception gain (dB).
Definition: wifi-phy.cc:615
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:3937
void AddSupportedChannelWidth(uint16_t width)
Definition: wifi-phy.cc:1461
WifiMode GetHeMcs(uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the HE modulation class.
Definition: wifi-phy.cc:4024
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:3215
double GetCcaEdThreshold(void) const
Return the CCA threshold (dBm).
Definition: wifi-phy.cc:542
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3362
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:3386
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:1968
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:2043
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:3994
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3425
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:3759
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted...
Definition: wifi-phy.cc:4107
void MaybeCcaBusyDuration(void)
Eventually switch to CCA busy.
Definition: wifi-phy.cc:2836
WifiPhyStandard GetStandard(void) const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:1309
virtual ~WifiPhy()
Definition: wifi-phy.cc:415
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:3050
void ResumeFromOff(void)
Resume from off mode.
Definition: wifi-phy.cc:1747
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:452
void ResumeFromSleep(void)
Resume from sleep mode.
Definition: wifi-phy.cc:1717
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:2041
bool GetShortGuardInterval(void) const
Return whether short guard interval is supported.
Definition: wifi-phy.cc:668
bool GetGreenfield(void) const
Return whether Greenfield is supported.
Definition: wifi-phy.cc:637
static WifiMode GetHeMcs5()
Return MCS 5 from HE MCS values.
Definition: wifi-phy.cc:3881
802.11 PHY layer model
Definition: wifi-phy.h:142
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:2081
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:3140
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:595
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard...
Definition: wifi-phy.cc:1128
handles interference calculations
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Definition: wifi-phy.cc:3556
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:522
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-phy.cc:421
static WifiMode GetHePhyHeaderMode()
Definition: wifi-phy.cc:1790
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:1009
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:1899
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
Definition: wifi-phy.cc:3799
uint8_t GetNBssMembershipSelectors(void) const
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
Definition: wifi-phy.cc:1449
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:3676
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:3612
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:3227
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1947
bool IsStateCcaBusy(void) const
Definition: wifi-phy.cc:4030
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:464
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
Definition: wifi-phy.cc:3748
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:3668
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:3740
std::vector< uint8_t > m_bssMembershipSelectorSet
the BSS membership selector set
Definition: wifi-phy.h:2032
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:2989
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:3580
static Time GetPhyPreambleDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2056
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:715
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:3708
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:1939
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3401
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
Definition: wifi-phy.cc:3636
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:3692
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1742
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3314
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:3287
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:752
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:476
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:548
WifiMode GetVhtMcs(uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the VHT modulation class.
Definition: wifi-phy.cc:4018
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
static WifiMode GetHeMcs4()
Return MCS 4 from HE MCS values.
Definition: wifi-phy.cc:3873
void ConfigureHolland(void)
Configure WifiPhy with appropriate channel frequency and supported rates for Holland.
Definition: wifi-phy.cc:984
bool IsStateIdle(void) const
Definition: wifi-phy.cc:4036
void SetGreenfield(bool greenfield)
Enable or disable Greenfield support.
Definition: wifi-phy.cc:621
void Configure80211_10Mhz(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard with 10...
Definition: wifi-phy.cc:954
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:1954
std::pair< uint16_t, uint16_t > FrequencyWidthPair
A pair of a center Frequency (MHz) and a ChannelWidth (MHz)
Definition: wifi-phy.h:658
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:2047
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:3564
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:3644
double GetTxPowerForTransmission(WifiTxVector txVector) const
Compute the transmit power (in dBm) for the next transmission.
Definition: wifi-phy.cc:4144
virtual void SetFrequency(uint16_t freq)
Definition: wifi-phy.cc:1315
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:3791
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:3716
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:785
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:4132
void(* EndOfHePreambleCallback)(HePreambleParameters params)
TracedCallback signature for end of HE-SIG-A events.
Definition: wifi-phy.h:1361
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:1982
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:3263
uint8_t m_initialChannelNumber
Initial channel number.
Definition: wifi-phy.h:2069
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:2461
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:3815
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3449
bool IsStateSleep(void) const
Definition: wifi-phy.cc:4060
void NotifyEndOfHePreamble(HePreambleParameters params)
Public method used to fire a EndOfHePreamble trace once both HE SIG fields have been received...
Definition: wifi-phy.cc:2535
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:3783
void ConfigureDefaultsForStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:833
MpduType
The type of an MPDU.
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:529
void NotifyTxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:2434
WifiModeList m_deviceMcsSet
the device MCS set
Definition: wifi-phy.h:2028
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:2036
void SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:728
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
Definition: wifi-phy.cc:3628
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1392
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Definition: wifi-phy.h:2049
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:3188
static Time GetPhyHtSigHeaderDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:1851
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:3732
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:3588
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:3988
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, uint16_t frequency)
Definition: wifi-phy.cc:2417
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:2065
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:133
uint8_t bssColor
BSS color.
Definition: wifi-phy.h:134
bool DoFrequencySwitch(uint16_t frequency)
The default implementation does nothing and returns true.
Definition: wifi-phy.cc:1610
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
Definition: wifi-phy.cc:3516
void StartReceiveHeader(Ptr< Event > event)
Start receiving the PHY header of a PPDU (i.e.
Definition: wifi-phy.cc:2616
static WifiMode GetHtPhyHeaderMode()
Definition: wifi-phy.cc:1778
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:2074
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:4165
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:1915
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:2051
bool m_shortPreamble
Flag if short PHY preamble is supported.
Definition: wifi-phy.h:2056
static WifiMode GetHeMcs3()
Return MCS 3 from HE MCS values.
Definition: wifi-phy.cc:3865
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:1334
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1745
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Definition: wifi-phy.cc:3596
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:2079
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:3176
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:569
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:791
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3350
WifiMode GetHtMcs(uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the HT modulation class.
Definition: wifi-phy.cc:4012
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:3041
static WifiMode GetHeMcs11()
Return MCS 11 from HE MCS values.
Definition: wifi-phy.cc:3929
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:4072
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU...
Definition: wifi-phy.h:1739
void Configure80211_5Mhz()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard with 5M...
Definition: wifi-phy.cc:969
FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard(uint8_t channelNumber, WifiPhyStandard standard) const
Lookup frequency/width pair for channelNumber/standard pair.
Definition: wifi-phy.cc:1482
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:1989
double CalculateSnr(WifiTxVector txVector, double ber) const
Definition: wifi-phy.cc:827
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:3239
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:482
void SetOffMode(void)
Put in off mode.
Definition: wifi-phy.cc:1704
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3338
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3473
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:1300
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:1369
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:2078
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:803
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
Definition: wifi-phy.cc:3767
EventId m_endPreambleDetectionEvent
the end of preamble detection event
Definition: wifi-phy.h:1743
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:3275
void NotifyRxBegin(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:2452
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
Definition: wifi-phy.cc:771
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, double rxPowerW)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:2697
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:1784
static WifiMode GetHeMcs9()
Return MCS 9 from HE MCS values.
Definition: wifi-phy.cc:3913
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:3500
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:758
static Time GetPreambleDetectionDuration(void)
Definition: wifi-phy.cc:1796
static Time GetPhySigA1Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:1866
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:778
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-phy.cc:162
Time GetChannelSwitchDelay(void) const
Definition: wifi-phy.cc:821
void ContinueReceiveHeader(Ptr< Event > event)
Continue receiving the PHY header of a PPDU (i.e.
Definition: wifi-phy.cc:2668
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:797
Time m_guardInterval
Supported HE guard interval (deprecated)
Definition: wifi-phy.h:2058
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:1372
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1406
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:3251
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:2443
void(* PsduTxBeginCallback)(Ptr< const WifiPsdu > psdu, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:1346
static WifiMode GetHeMcs1()
Return MCS 1 from HE MCS values.
Definition: wifi-phy.cc:3849
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:1892
virtual void StartTx(Ptr< WifiPpdu > ppdu)=0
void SetShortGuardInterval(bool shortGuardInterval)
Enable or disable support for HT/VHT short guard interval.
Definition: wifi-phy.cc:652
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
Definition: wifi-phy.cc:3604
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
Definition: wifi-phy.cc:3841
static WifiMode GetHeMcs10()
Return MCS 10 from HE MCS values.
Definition: wifi-phy.cc:3921
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
Definition: wifi-phy.cc:3660
static WifiMode GetHeMcs2()
Return MCS 2 from HE MCS values.
Definition: wifi-phy.cc:3857
static Time GetPhyTrainingSymbolDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:1802
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:3540
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1431
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:722
double m_ccaEdThresholdW
Clear channel assessment (CCA) threshold in watts.
Definition: wifi-phy.h:2042
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
Definition: wifi-phy.cc:3775
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Definition: wifi-phy.cc:1490
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:3077
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard...
Definition: wifi-phy.cc:1108
virtual void DoInitialize(void)
Initialize() implementation.
Definition: wifi-phy.cc:439
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3413
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:1544
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:2034
void SetGuardInterval(Time guardInterval)
Definition: wifi-phy.cc:683
uint8_t FindChannelNumberForFrequencyWidth(uint16_t frequency, uint16_t width) const
Look for channel number matching the frequency and width.
Definition: wifi-phy.cc:1174
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
Definition: wifi-phy.h:2052
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:3116
void EndReceive(Ptr< Event > event)
The last symbol of the PPDU has arrived.
Definition: wifi-phy.cc:2914
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1735
static Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, uint16_t frequency, MpduType mpdutype=NORMAL_MPDU)
Definition: wifi-phy.cc:2125
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
Definition: wifi-phy.h:2061
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:563
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:2080
static WifiMode GetPhyHeaderMode(WifiTxVector txVector)
Definition: wifi-phy.cc:1914
void InitializeFrequencyChannelNumber(void)
post-construction setting of frequency and/or channel number
Definition: wifi-phy.cc:488
std::vector< uint16_t > GetSupportedChannelWidthSet(void) const
Definition: wifi-phy.cc:1476
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3976
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:2077
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:608
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard...
Definition: wifi-phy.cc:927
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:458
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Definition: wifi-phy.cc:3982
uint16_t m_channelWidth
Channel width (MHz)
Definition: wifi-phy.h:2039
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:3104
uint8_t GetBssMembershipSelector(uint8_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1455
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:470
bool IsStateTx(void) const
Definition: wifi-phy.cc:4048
void ConfigureChannelForStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:1202
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1412
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:3128
bool m_greenfield
Flag if GreenField format is supported (deprecated)
Definition: wifi-phy.h:2054
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:1741
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1736
void SetEdThreshold(double threshold)
Sets the energy detection threshold (dBm).
Definition: wifi-phy.cc:516
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard...
Definition: wifi-phy.cc:1091
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:556
double m_txPowerBaseDbm
Minimum transmission power (dBm)
Definition: wifi-phy.h:2045
bool IsMcsSupported(WifiMode mcs) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:3950
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:3030
SignalNoiseDbm structure.
Definition: wifi-phy.h:117
uint32_t mpduRefNumber
MPDU ref number.
Definition: wifi-phy.h:127
bool m_frequencyChannelNumberInitialized
Store initialization state.
Definition: wifi-phy.h:2038
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:3652
InterferenceHelper m_interference
Pointer to InterferenceHelper.
Definition: wifi-phy.h:1734
virtual void SetChannelWidth(uint16_t channelWidth)
Definition: wifi-phy.cc:1378
bool m_isConstructed
true when ready to set frequency
Definition: wifi-phy.h:2035
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:3548
void NotifyTxBegin(Ptr< const WifiPsdu > psdu, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:2425
void ConfigureHtDeviceMcsSet(void)
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
Definition: wifi-phy.cc:1021
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
Definition: wifi-phy.cc:996
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
Definition: wifi-phy.h:53
static Time GetPhySigA2Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:1883
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:3724
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:576
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:3572
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:3020
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
Definition: wifi-phy.cc:3532
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
Definition: wifi-phy.cc:2851
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:3700
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
Definition: wifi-phy.cc:3905
void Send(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
Definition: wifi-phy.cc:2541
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard...
Definition: wifi-phy.cc:938
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:746
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:2510
double GetTxGain(void) const
Return the transmission gain (dB).
Definition: wifi-phy.cc:602
void SetSleepMode(void)
Put in sleep mode.
Definition: wifi-phy.cc:1670
double noise
in dBm
Definition: wifi-phy.h:120
WifiModeList m_deviceRateSet
This vector holds the set of transmission modes that this WifiPhy(-derived class) can support...
Definition: wifi-phy.h:2027
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1398
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:3508
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:2030
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:3684
static Time GetPhyHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:1978
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:3062
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:3831
virtual void ConfigureStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:1252
static Time GetStartOfPacketDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2050
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3326
double m_txPowerEndDbm
Maximum transmission power (dBm)
Definition: wifi-phy.h:2046
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3374
MpduType type
type
Definition: wifi-phy.h:126
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:2071
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3485
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Definition: wifi-phy.cc:4084
uint8_t m_numberOfAntennas
Number of transmitters.
Definition: wifi-phy.h:2060
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1425
a unique identifier for an interface.
Definition: type-id.h:58
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
Definition: wifi-phy.cc:3620
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:2076
static Time GetPhySigBDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:1900
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
Definition: wifi-phy.cc:4078
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:2050
bool IsStateRx(void) const
Definition: wifi-phy.cc:4042
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:3524
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Definition: wifi-phy.h:2062
std::vector< uint16_t > m_supportedChannelWidthSet
Supported channel width set (MHz)
Definition: wifi-phy.h:2067
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:3203
void SwitchMaybeToCcaBusy(void)
Check if PHY state should move to CCA busy state based on current state of interference tracker...
Definition: wifi-phy.cc:4090
void SetCcaEdThreshold(double threshold)
Sets the CCA threshold (dBm).
Definition: wifi-phy.cc:535
bool m_shortGuardInterval
Flag if HT/VHT short guard interval is supported (deprecated)
Definition: wifi-phy.h:2055
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:4199
static WifiMode GetHeMcs6()
Return MCS 6 from HE MCS values.
Definition: wifi-phy.cc:3889
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:2479
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3437
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Definition: wifi-phy.h:2083
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard...
Definition: wifi-phy.cc:912
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1443
std::map< ChannelNumberStandardPair, FrequencyWidthPair > ChannelToFrequencyWidthMap
channel to frequency width map typedef
Definition: wifi-phy.h:2064
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3302
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1907
uint16_t m_initialFrequency
Store frequency until initialization (MHz)
Definition: wifi-phy.h:2037
Parameters for receive HE preamble.
Definition: wifi-phy.h:131
static Time CalculatePhyPreambleAndHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2403
bool DoChannelSwitch(uint8_t id)
The default implementation does nothing and returns true.
Definition: wifi-phy.cc:1550
Time GetGuardInterval(void) const
Definition: wifi-phy.cc:700