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 <stdint.h>
26 #include "ns3/callback.h"
27 #include "ns3/packet.h"
28 #include "ns3/object.h"
29 #include "ns3/nstime.h"
30 #include "ns3/ptr.h"
31 #include "wifi-mode.h"
32 #include "wifi-preamble.h"
33 #include "wifi-phy-standard.h"
34 #include "ns3/traced-callback.h"
35 #include "wifi-tx-vector.h"
36 
37 namespace ns3 {
38 
39 class WifiChannel;
40 class NetDevice;
41 
46 {
53 };
54 
56 {
57  double signal; //in dBm
58  double noise; //in dBm
59 };
60 
61 struct mpduInfo
62 {
63  enum mpduType type;
64  uint32_t mpduRefNumber;
65 };
66 
71 {
72 public:
73  virtual ~WifiPhyListener ();
74 
87  virtual void NotifyRxStart (Time duration) = 0;
93  virtual void NotifyRxEndOk (void) = 0;
99  virtual void NotifyRxEndError (void) = 0;
110  virtual void NotifyTxStart (Time duration, double txPowerDbm) = 0;
126  virtual void NotifyMaybeCcaBusyStart (Time duration) = 0;
134  virtual void NotifySwitchingStart (Time duration) = 0;
138  virtual void NotifySleep (void) = 0;
142  virtual void NotifyWakeup (void) = 0;
143 };
144 
145 
151 class WifiPhy : public Object
152 {
153 public:
157  enum State
158  {
170  TX,
174  RX,
183  };
184 
197  typedef Callback<void, Ptr<Packet>, double, bool> RxErrorCallback;
198 
199  static TypeId GetTypeId (void);
200 
201  WifiPhy ();
202  virtual ~WifiPhy ();
203 
209  virtual double GetTxPowerStart (void) const = 0;
215  virtual double GetTxPowerEnd (void) const = 0;
219  virtual uint32_t GetNTxPower (void) const = 0;
220 
225  virtual void SetReceiveOkCallback (RxOkCallback callback) = 0;
230  virtual void SetReceiveErrorCallback (RxErrorCallback callback) = 0;
231 
239  virtual void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, enum WifiPreamble preamble) = 0;
248  virtual void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, enum WifiPreamble preamble, enum mpduType mpdutype) = 0;
249 
256  virtual void RegisterListener (WifiPhyListener *listener) = 0;
263  virtual void UnregisterListener (WifiPhyListener *listener) = 0;
264 
268  virtual void SetSleepMode (void) = 0;
272  virtual void ResumeFromSleep (void) = 0;
273 
277  virtual bool IsStateIdle (void) = 0;
281  virtual bool IsStateCcaBusy (void) = 0;
285  virtual bool IsStateBusy (void) = 0;
289  virtual bool IsStateRx (void) = 0;
293  virtual bool IsStateTx (void) = 0;
297  virtual bool IsStateSwitching (void) = 0;
301  virtual bool IsStateSleep (void) = 0;
305  virtual Time GetStateDuration (void) = 0;
312  virtual Time GetDelayUntilIdle (void) = 0;
313 
319  virtual Time GetLastRxStartTime (void) const = 0;
320 
329  Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency);
340  Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag);
341 
348  Time CalculatePlcpPreambleAndHeaderDuration (WifiTxVector txVector, enum WifiPreamble preamble);
349 
356  static Time GetPlcpHtTrainingSymbolDuration (WifiPreamble preamble, WifiTxVector txVector);
363  static WifiMode GetHtPlcpHeaderMode (WifiMode payloadMode);
369  static WifiMode GetVhtPlcpHeaderMode (WifiMode payloadMode);
375  static Time GetPlcpHtSigHeaderDuration (WifiPreamble preamble);
381  static Time GetPlcpVhtSigA1Duration (WifiPreamble preamble);
387  static Time GetPlcpVhtSigA2Duration (WifiPreamble preamble);
393  static Time GetPlcpVhtSigBDuration (WifiPreamble preamble);
401  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble, WifiTxVector txVector);
408  static Time GetPlcpHeaderDuration (WifiTxVector txVector, WifiPreamble preamble);
415  static Time GetPlcpPreambleDuration (WifiTxVector txVector, WifiPreamble preamble);
424  Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency);
435  Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag);
436 
454  virtual uint32_t GetNModes (void) const = 0;
474  virtual WifiMode GetMode (uint32_t mode) const = 0;
483  virtual bool IsModeSupported (WifiMode mode) const = 0;
484 
492  virtual double CalculateSnr (WifiTxVector txVector, double ber) const = 0;
493 
503  virtual uint32_t GetNBssMembershipSelectors (void) const = 0;
515  virtual uint32_t GetBssMembershipSelector (uint32_t selector) const = 0;
529  virtual WifiModeList GetMembershipSelectorModes (uint32_t selector) = 0;
539  virtual uint8_t GetNMcs (void) const = 0;
551  virtual WifiMode GetMcs (uint8_t mcs) const = 0;
552 
563  virtual void SetChannelNumber (uint16_t id) = 0;
569  virtual uint16_t GetChannelNumber (void) const = 0;
573  virtual Time GetChannelSwitchDelay (void) const = 0;
574 
580  virtual void ConfigureStandard (enum WifiPhyStandard standard) = 0;
581 
587  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
588 
594  static WifiMode GetDsssRate1Mbps ();
600  static WifiMode GetDsssRate2Mbps ();
606  static WifiMode GetDsssRate5_5Mbps ();
612  static WifiMode GetDsssRate11Mbps ();
618  static WifiMode GetErpOfdmRate6Mbps ();
624  static WifiMode GetErpOfdmRate9Mbps ();
630  static WifiMode GetErpOfdmRate12Mbps ();
636  static WifiMode GetErpOfdmRate18Mbps ();
642  static WifiMode GetErpOfdmRate24Mbps ();
648  static WifiMode GetErpOfdmRate36Mbps ();
654  static WifiMode GetErpOfdmRate48Mbps ();
660  static WifiMode GetErpOfdmRate54Mbps ();
666  static WifiMode GetOfdmRate6Mbps ();
672  static WifiMode GetOfdmRate9Mbps ();
678  static WifiMode GetOfdmRate12Mbps ();
684  static WifiMode GetOfdmRate18Mbps ();
690  static WifiMode GetOfdmRate24Mbps ();
696  static WifiMode GetOfdmRate36Mbps ();
702  static WifiMode GetOfdmRate48Mbps ();
708  static WifiMode GetOfdmRate54Mbps ();
805 
811  static WifiMode GetHtMcs0 ();
817  static WifiMode GetHtMcs1 ();
823  static WifiMode GetHtMcs2 ();
829  static WifiMode GetHtMcs3 ();
835  static WifiMode GetHtMcs4 ();
841  static WifiMode GetHtMcs5 ();
847  static WifiMode GetHtMcs6 ();
853  static WifiMode GetHtMcs7 ();
859  static WifiMode GetHtMcs8 ();
865  static WifiMode GetHtMcs9 ();
871  static WifiMode GetHtMcs10 ();
877  static WifiMode GetHtMcs11 ();
883  static WifiMode GetHtMcs12 ();
889  static WifiMode GetHtMcs13 ();
895  static WifiMode GetHtMcs14 ();
901  static WifiMode GetHtMcs15 ();
907  static WifiMode GetHtMcs16 ();
913  static WifiMode GetHtMcs17 ();
919  static WifiMode GetHtMcs18 ();
925  static WifiMode GetHtMcs19 ();
931  static WifiMode GetHtMcs20 ();
937  static WifiMode GetHtMcs21 ();
943  static WifiMode GetHtMcs22 ();
949  static WifiMode GetHtMcs23 ();
955  static WifiMode GetHtMcs24 ();
961  static WifiMode GetHtMcs25 ();
967  static WifiMode GetHtMcs26 ();
973  static WifiMode GetHtMcs27 ();
979  static WifiMode GetHtMcs28 ();
985  static WifiMode GetHtMcs29 ();
991  static WifiMode GetHtMcs30 ();
997  static WifiMode GetHtMcs31 ();
998 
1004  static WifiMode GetVhtMcs0 ();
1010  static WifiMode GetVhtMcs1 ();
1016  static WifiMode GetVhtMcs2 ();
1022  static WifiMode GetVhtMcs3 ();
1028  static WifiMode GetVhtMcs4 ();
1034  static WifiMode GetVhtMcs5 ();
1040  static WifiMode GetVhtMcs6 ();
1046  static WifiMode GetVhtMcs7 ();
1052  static WifiMode GetVhtMcs8 ();
1058  static WifiMode GetVhtMcs9 ();
1067  static bool IsValidTxVector (WifiTxVector txVector);
1068 
1075  void NotifyTxBegin (Ptr<const Packet> packet);
1082  void NotifyTxEnd (Ptr<const Packet> packet);
1089  void NotifyTxDrop (Ptr<const Packet> packet);
1096  void NotifyRxBegin (Ptr<const Packet> packet);
1103  void NotifyRxEnd (Ptr<const Packet> packet);
1110  void NotifyRxDrop (Ptr<const Packet> packet);
1111 
1133  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz,
1134  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1135  WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise);
1136 
1160  typedef void (* MonitorSnifferRxCallback)(Ptr<const Packet> packet, uint16_t channelFreqMhz,
1161  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1162  WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise);
1163 
1179  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz,
1180  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1181  WifiTxVector txVector, struct mpduInfo aMpdu);
1182 
1199  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet, uint16_t channelFreqMhz,
1200  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1201  WifiTxVector txVector, struct mpduInfo aMpdu);
1202 
1211  virtual int64_t AssignStreams (int64_t stream) = 0;
1212 
1216  virtual void SetFrequency (uint32_t freq) = 0;
1220  virtual uint32_t GetFrequency (void) const = 0;
1224  virtual void SetNumberOfTransmitAntennas (uint32_t tx) = 0;
1228  virtual uint32_t GetNumberOfTransmitAntennas (void) const = 0;
1232  virtual void SetNumberOfReceiveAntennas (uint32_t rx) = 0;
1236  virtual uint32_t GetNumberOfReceiveAntennas (void) const = 0;
1240  virtual void SetGuardInterval (bool guardInterval) = 0;
1244  virtual bool GetGuardInterval (void) const = 0;
1248  virtual void SetLdpc (bool ldpc) = 0;
1252  virtual bool GetLdpc (void) const = 0;
1256  virtual void SetStbc (bool stbc) = 0;
1260  virtual bool GetStbc (void) const = 0;
1264  virtual void SetGreenfield (bool greenfield) = 0;
1268  virtual bool GetGreenfield (void) const = 0;
1272  virtual void SetShortPlcpPreambleSupported (bool preamble) = 0;
1276  virtual bool GetShortPlcpPreambleSupported (void) const = 0;
1280  virtual uint32_t GetChannelWidth (void) const = 0;
1284  virtual void SetChannelWidth (uint32_t channelwidth) = 0;
1288  virtual uint8_t GetSupportedRxSpatialStreams (void) const = 0;
1292  virtual uint8_t GetSupportedTxSpatialStreams (void) const = 0;
1296  virtual void AddSupportedChannelWidth (uint32_t width) = 0;
1300  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const = 0;
1301 
1302 private:
1310 
1318 
1326 
1334 
1342 
1349 
1362  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
1364 
1377  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
1379 
1381  uint32_t m_totalAmpduSize;
1382 };
1383 
1389 std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state);
1390 
1391 } //namespace ns3
1392 
1393 #endif /* WIFI_PHY_H */
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:1531
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1185
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1333
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:876
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:813
virtual uint32_t GetFrequency(void) const =0
virtual uint32_t GetNumberOfTransmitAntennas(void) const =0
virtual Ptr< WifiChannel > GetChannel(void) const =0
Return the WifiChannel this WifiPhy is connected to.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
void(* MonitorSnifferTxCallback)(const Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
TracedCallback signature for monitor mode transmit events.
Definition: wifi-phy.h:1199
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:888
void NotifyMonitorSniffTx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
Definition: wifi-phy.cc:765
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:1547
virtual void ConfigureStandard(enum WifiPhyStandard standard)=0
Configure the PHY-level parameters for different Wi-Fi standard.
Callback template class.
Definition: callback.h:1164
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:939
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1086
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:1110
virtual void NotifyTxStart(Time duration, double txPowerDbm)=0
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1149
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:1483
virtual void NotifyWakeup(void)=0
Notify listeners that we woke up.
virtual ~WifiPhy()
Definition: wifi-phy.cc:116
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:774
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
enum mpduType type
Definition: wifi-phy.h:63
802.11 PHY layer model
Definition: wifi-phy.h:151
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:864
The PHY layer has sense the medium busy through the CCA mechanism.
Definition: wifi-phy.h:166
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Definition: wifi-phy.cc:1280
static WifiMode GetHtPlcpHeaderMode(WifiMode payloadMode)
Definition: wifi-phy.cc:122
Forward calls to a chain of Callback.
static Time GetPlcpHtSigHeaderDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:180
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
Definition: wifi-phy.cc:1523
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:1400
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:1336
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:951
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1341
virtual uint8_t GetNMcs(void) const =0
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
Definition: wifi-phy.cc:1472
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:1392
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:1464
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:1304
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:1432
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1125
Callback< void, Ptr< Packet >, double, WifiTxVector, enum WifiPreamble > RxOkCallback
arg1: packet received successfully arg2: snr of packet arg3: TXVECTOR of packet arg4: type of preambl...
Definition: wifi-phy.h:191
The PHY layer is sleeping.
Definition: wifi-phy.h:182
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
Definition: wifi-phy.cc:1360
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:1416
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1038
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:1011
virtual void SetLdpc(bool ldpc)=0
virtual void SetNumberOfReceiveAntennas(uint32_t rx)=0
virtual bool GetLdpc(void) const =0
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:735
virtual bool GetShortPlcpPreambleSupported(void) const =0
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:1288
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:1368
Callback< void, Ptr< Packet >, double, bool > RxErrorCallback
arg1: packet received unsuccessfully arg2: snr of packet arg3: PHY-RXEND flag
Definition: wifi-phy.h:197
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:723
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:1515
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:1440
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:987
Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency)
Definition: wifi-phy.cc:398
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:1539
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1173
virtual bool IsStateCcaBusy(void)=0
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:1507
virtual void RegisterListener(WifiPhyListener *listener)=0
void NotifyMonitorSniffRx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
Public method used to fire a MonitorSniffer trace for a wifi packet being received.
Definition: wifi-phy.cc:759
virtual void NotifySwitchingStart(Time duration)=0
virtual WifiMode GetMcs(uint8_t mcs) const =0
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
virtual void ResumeFromSleep(void)=0
Resume from sleep mode.
static WifiMode GetVhtPlcpHeaderMode(WifiMode payloadMode)
Definition: wifi-phy.cc:128
virtual bool IsStateIdle(void)=0
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
Definition: wifi-phy.cc:1352
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:912
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:1456
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:1312
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:753
virtual bool IsStateSleep(void)=0
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
virtual uint32_t GetChannelWidth(void) const =0
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
virtual bool GetStbc(void) const =0
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo, struct signalNoiseDbm > m_phyMonitorSniffRxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being received...
Definition: wifi-phy.h:1363
virtual void NotifyRxEndOk(void)=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
The MPDU is not part of an A-MPDU.
Definition: wifi-phy.h:48
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
Definition: wifi-phy.cc:1240
virtual void SetFrequency(uint32_t freq)=0
virtual void SetReceiveErrorCallback(RxErrorCallback callback)=0
Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector, enum WifiPreamble preamble)
Definition: wifi-phy.cc:696
uint32_t mpduRefNumber
Definition: wifi-phy.h:64
receive notifications about phy events.
Definition: wifi-phy.h:70
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:1325
static WifiMode GetPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble, WifiTxVector txVector)
Definition: wifi-phy.cc:237
virtual void SetGuardInterval(bool guardInterval)=0
The PHY layer is IDLE.
Definition: wifi-phy.h:162
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Definition: wifi-phy.cc:1320
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:900
virtual double CalculateSnr(WifiTxVector txVector, double ber) const =0
virtual Time GetDelayUntilIdle(void)=0
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1074
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency)
Definition: wifi-phy.cc:717
The PHY layer is receiving a packet.
Definition: wifi-phy.h:174
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
Definition: wifi-phy.h:1348
virtual bool IsModeSupported(WifiMode mode) const =0
Check if the given WifiMode is supported by the PHY.
virtual bool GetGuardInterval(void) const =0
virtual ~WifiPhyListener()
Definition: wifi-phy.cc:44
virtual void SetNumberOfTransmitAntennas(uint32_t tx)=0
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:741
The PHY layer is sending a packet.
Definition: wifi-phy.h:170
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:963
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1062
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1197
virtual uint32_t GetNBssMembershipSelectors(void) const =0
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
The PHY layer is switching to other channel.
Definition: wifi-phy.h:178
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Definition: wifi-phy.h:1309
virtual bool IsStateSwitching(void)=0
The MPDU is part of an A-MPDU, but is not the last aggregate.
Definition: wifi-phy.h:50
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
Definition: wifi-phy.cc:1491
virtual bool IsStateBusy(void)=0
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:999
virtual void NotifySleep(void)=0
Notify listeners that we went to sleep.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
virtual void AddSupportedChannelWidth(uint32_t width)=0
virtual uint8_t GetSupportedRxSpatialStreams(void) const =0
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:1224
virtual Time GetChannelSwitchDelay(void) const =0
static TypeId GetTypeId(void)
Definition: wifi-phy.cc:55
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void UnregisterListener(WifiPhyListener *listener)=0
static bool IsValidTxVector(WifiTxVector txVector)
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
Definition: wifi-phy.cc:1563
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo > m_phyMonitorSniffTxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being transmitted...
Definition: wifi-phy.h:1378
virtual std::vector< uint32_t > GetSupportedChannelWidthSet(void) const =0
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:975
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const =0
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
virtual bool IsStateRx(void)=0
virtual void SetGreenfield(bool greenfield)=0
virtual Time GetStateDuration(void)=0
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
Definition: wifi-phy.cc:1328
virtual uint16_t GetChannelNumber(void) const =0
Return current channel number.
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
Definition: wifi-phy.cc:1384
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:1264
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
Definition: wifi-phy.cc:1499
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:801
virtual void SetStbc(bool stbc)=0
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1137
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:225
static Time GetPlcpVhtSigA1Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:195
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:840
void NotifyTxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:729
virtual void SetChannelNumber(uint16_t id)=0
Set channel number.
virtual bool IsStateTx(void)=0
virtual void NotifyRxStart(Time duration)=0
virtual void NotifyRxEndError(void)=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
virtual double GetTxPowerEnd(void) const =0
Return the maximum available transmission power level (dBm).
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:828
virtual void SetShortPlcpPreambleSupported(bool preamble)=0
virtual double GetTxPowerStart(void) const =0
Return the minimum available transmission power level (dBm).
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:852
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:747
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:1376
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:1272
virtual uint32_t GetNTxPower(void) const =0
void(* MonitorSnifferRxCallback)(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
TracedCallback signature for monitor mode receive events.
Definition: wifi-phy.h:1160
double m_totalAmpduNumSymbols
Number of symbols previously transmitted for the MPDUs in an A-MPDU, used for the computation of the ...
Definition: wifi-phy.h:1380
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:1448
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:1296
virtual void SetSleepMode(void)=0
Put in sleep mode.
virtual void SetReceiveOkCallback(RxOkCallback callback)=0
static Time GetPlcpHeaderDuration(WifiTxVector txVector, WifiPreamble preamble)
Definition: wifi-phy.cc:282
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
Definition: wifi-phy.cc:1256
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:1424
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...
uint32_t m_totalAmpduSize
Total size of the previously transmitted MPDUs in an A-MPDU, used for the computation of the number o...
Definition: wifi-phy.h:1381
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble)=0
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:1232
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:1408
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:786
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:1555
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1050
virtual void SetChannelWidth(uint32_t channelwidth)=0
State
The state of the PHY layer.
Definition: wifi-phy.h:157
static Time GetPlcpHtTrainingSymbolDuration(WifiPreamble preamble, WifiTxVector txVector)
Definition: wifi-phy.cc:134
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1098
static Time GetPlcpVhtSigBDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:223
virtual WifiModeList GetMembershipSelectorModes(uint32_t selector)=0
The WifiPhy::GetMembershipSelectorModes() method is used (e.g., by a WifiRemoteStationManager) to det...
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1209
virtual Time GetLastRxStartTime(void) const =0
Return the start time of the last received packet.
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:1344
static Time GetPlcpPreambleDuration(WifiTxVector txVector, WifiPreamble preamble)
Definition: wifi-phy.cc:346
virtual uint8_t GetSupportedTxSpatialStreams(void) const =0
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:1248
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:927
virtual bool GetGreenfield(void) const =0
static Time GetPlcpVhtSigA2Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:209
virtual uint32_t GetNumberOfReceiveAntennas(void) const =0
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1161
mpduType
This enumeration defines the type of an MPDU.
Definition: wifi-phy.h:45
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1026
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1317
virtual void NotifyMaybeCcaBusyStart(Time duration)=0
The MPDU is the last aggregate in an A-MPDU.
Definition: wifi-phy.h:52