This documentation is not the Latest Release.
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 
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 
240  virtual void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, enum WifiPreamble preamble, enum mpduType mpdutype) = 0;
241 
248  virtual void RegisterListener (WifiPhyListener *listener) = 0;
255  virtual void UnregisterListener (WifiPhyListener *listener) = 0;
256 
260  virtual void SetSleepMode (void) = 0;
264  virtual void ResumeFromSleep (void) = 0;
265 
269  virtual bool IsStateIdle (void) = 0;
273  virtual bool IsStateCcaBusy (void) = 0;
277  virtual bool IsStateBusy (void) = 0;
281  virtual bool IsStateRx (void) = 0;
285  virtual bool IsStateTx (void) = 0;
289  virtual bool IsStateSwitching (void) = 0;
293  virtual bool IsStateSleep (void) = 0;
297  virtual Time GetStateDuration (void) = 0;
304  virtual Time GetDelayUntilIdle (void) = 0;
305 
311  virtual Time GetLastRxStartTime (void) const = 0;
312 
323  Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag);
324 
331  Time CalculatePlcpPreambleAndHeaderDuration (WifiTxVector txVector, enum WifiPreamble preamble);
332 
339  static Time GetPlcpHtTrainingSymbolDuration (WifiPreamble preamble, WifiTxVector txVector);
346  static WifiMode GetHtPlcpHeaderMode (WifiMode payloadMode);
352  static WifiMode GetVhtPlcpHeaderMode (WifiMode payloadMode);
358  static Time GetPlcpHtSigHeaderDuration (WifiPreamble preamble);
364  static Time GetPlcpVhtSigA1Duration (WifiPreamble preamble);
370  static Time GetPlcpVhtSigA2Duration (WifiPreamble preamble);
376  static Time GetPlcpVhtSigBDuration (WifiPreamble preamble);
384  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble, WifiTxVector txVector);
391  static Time GetPlcpHeaderDuration (WifiTxVector txVector, WifiPreamble preamble);
398  static Time GetPlcpPreambleDuration (WifiTxVector txVector, WifiPreamble preamble);
409  Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag);
410 
428  virtual uint32_t GetNModes (void) const = 0;
448  virtual WifiMode GetMode (uint32_t mode) const = 0;
457  virtual bool IsModeSupported (WifiMode mode) const = 0;
458 
466  virtual double CalculateSnr (WifiMode txMode, double ber) const = 0;
467 
477  virtual uint32_t GetNBssMembershipSelectors (void) const = 0;
489  virtual uint32_t GetBssMembershipSelector (uint32_t selector) const = 0;
503  virtual WifiModeList GetMembershipSelectorModes (uint32_t selector) = 0;
513  virtual uint8_t GetNMcs (void) const = 0;
525  virtual WifiMode GetMcs (uint8_t mcs) const = 0;
526 
537  virtual void SetChannelNumber (uint16_t id) = 0;
543  virtual uint16_t GetChannelNumber (void) const = 0;
547  virtual Time GetChannelSwitchDelay (void) const = 0;
548 
554  virtual void ConfigureStandard (enum WifiPhyStandard standard) = 0;
555 
561  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
562 
568  static WifiMode GetDsssRate1Mbps ();
574  static WifiMode GetDsssRate2Mbps ();
580  static WifiMode GetDsssRate5_5Mbps ();
586  static WifiMode GetDsssRate11Mbps ();
592  static WifiMode GetErpOfdmRate6Mbps ();
598  static WifiMode GetErpOfdmRate9Mbps ();
604  static WifiMode GetErpOfdmRate12Mbps ();
610  static WifiMode GetErpOfdmRate18Mbps ();
616  static WifiMode GetErpOfdmRate24Mbps ();
622  static WifiMode GetErpOfdmRate36Mbps ();
628  static WifiMode GetErpOfdmRate48Mbps ();
634  static WifiMode GetErpOfdmRate54Mbps ();
640  static WifiMode GetOfdmRate6Mbps ();
646  static WifiMode GetOfdmRate9Mbps ();
652  static WifiMode GetOfdmRate12Mbps ();
658  static WifiMode GetOfdmRate18Mbps ();
664  static WifiMode GetOfdmRate24Mbps ();
670  static WifiMode GetOfdmRate36Mbps ();
676  static WifiMode GetOfdmRate48Mbps ();
682  static WifiMode GetOfdmRate54Mbps ();
779 
785  static WifiMode GetHtMcs0 ();
791  static WifiMode GetHtMcs1 ();
797  static WifiMode GetHtMcs2 ();
803  static WifiMode GetHtMcs3 ();
809  static WifiMode GetHtMcs4 ();
815  static WifiMode GetHtMcs5 ();
821  static WifiMode GetHtMcs6 ();
827  static WifiMode GetHtMcs7 ();
833  static WifiMode GetHtMcs8 ();
839  static WifiMode GetHtMcs9 ();
845  static WifiMode GetHtMcs10 ();
851  static WifiMode GetHtMcs11 ();
857  static WifiMode GetHtMcs12 ();
863  static WifiMode GetHtMcs13 ();
869  static WifiMode GetHtMcs14 ();
875  static WifiMode GetHtMcs15 ();
881  static WifiMode GetHtMcs16 ();
887  static WifiMode GetHtMcs17 ();
893  static WifiMode GetHtMcs18 ();
899  static WifiMode GetHtMcs19 ();
905  static WifiMode GetHtMcs20 ();
911  static WifiMode GetHtMcs21 ();
917  static WifiMode GetHtMcs22 ();
923  static WifiMode GetHtMcs23 ();
929  static WifiMode GetHtMcs24 ();
935  static WifiMode GetHtMcs25 ();
941  static WifiMode GetHtMcs26 ();
947  static WifiMode GetHtMcs27 ();
953  static WifiMode GetHtMcs28 ();
959  static WifiMode GetHtMcs29 ();
965  static WifiMode GetHtMcs30 ();
971  static WifiMode GetHtMcs31 ();
972 
978  static WifiMode GetVhtMcs0 ();
984  static WifiMode GetVhtMcs1 ();
990  static WifiMode GetVhtMcs2 ();
996  static WifiMode GetVhtMcs3 ();
1002  static WifiMode GetVhtMcs4 ();
1008  static WifiMode GetVhtMcs5 ();
1014  static WifiMode GetVhtMcs6 ();
1020  static WifiMode GetVhtMcs7 ();
1026  static WifiMode GetVhtMcs8 ();
1032  static WifiMode GetVhtMcs9 ();
1033 
1040  void NotifyTxBegin (Ptr<const Packet> packet);
1047  void NotifyTxEnd (Ptr<const Packet> packet);
1054  void NotifyTxDrop (Ptr<const Packet> packet);
1061  void NotifyRxBegin (Ptr<const Packet> packet);
1068  void NotifyRxEnd (Ptr<const Packet> packet);
1075  void NotifyRxDrop (Ptr<const Packet> packet);
1076 
1098  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz,
1099  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1100  WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise);
1101 
1125  typedef void (* MonitorSnifferRxCallback)(Ptr<const Packet> packet, uint16_t channelFreqMhz,
1126  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1127  WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise);
1128 
1144  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz,
1145  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1146  WifiTxVector txVector, struct mpduInfo aMpdu);
1147 
1164  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet, uint16_t channelFreqMhz,
1165  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1166  WifiTxVector txVector, struct mpduInfo aMpdu);
1167 
1176  virtual int64_t AssignStreams (int64_t stream) = 0;
1177 
1181  virtual void SetFrequency (uint32_t freq) = 0;
1185  virtual uint32_t GetFrequency (void) const = 0;
1189  virtual void SetNumberOfTransmitAntennas (uint32_t tx) = 0;
1193  virtual uint32_t GetNumberOfTransmitAntennas (void) const = 0;
1197  virtual void SetNumberOfReceiveAntennas (uint32_t rx) = 0;
1201  virtual uint32_t GetNumberOfReceiveAntennas (void) const = 0;
1205  virtual void SetGuardInterval (bool guardInterval) = 0;
1209  virtual bool GetGuardInterval (void) const = 0;
1213  virtual void SetLdpc (bool ldpc) = 0;
1217  virtual bool GetLdpc (void) const = 0;
1221  virtual void SetStbc (bool stbc) = 0;
1225  virtual bool GetStbc (void) const = 0;
1229  virtual void SetGreenfield (bool greenfield) = 0;
1233  virtual bool GetGreenfield (void) const = 0;
1237  virtual void SetShortPlcpPreamble (bool shortPreamble) = 0;
1241  virtual bool GetShortPlcpPreamble (void) const = 0;
1245  virtual uint32_t GetChannelWidth (void) const = 0;
1249  virtual void SetChannelWidth (uint32_t channelwidth) = 0;
1250 
1251 
1252 private:
1260 
1268 
1276 
1284 
1292 
1299 
1312  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
1314 
1327  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
1329 
1331  uint32_t m_totalAmpduSize;
1332 };
1333 
1339 std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state);
1340 
1341 } //namespace ns3
1342 
1343 #endif /* WIFI_PHY_H */
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:1421
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1075
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1283
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:766
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:703
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
Callback< void, Ptr< const Packet >, double, bool > RxErrorCallback
arg1: packet received unsuccessfully arg2: snr of packet arg3: PHY-RXEND flag
Definition: wifi-phy.h:197
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:1164
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:778
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:655
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:1437
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:829
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:976
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:1000
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:1039
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:1373
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:664
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:754
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:1170
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:1413
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:1290
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:1226
uint32_t m_totalAmpduNumSymbols
Number of symbols previously transmitted for the MPDUs in an A-MPDU, used for the computation of the ...
Definition: wifi-phy.h:1330
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:841
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1291
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:1362
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:1282
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:1354
virtual double CalculateSnr(WifiMode txMode, double ber) const =0
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:1194
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:1322
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1015
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:1250
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:1306
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:928
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:901
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:625
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:1178
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:1258
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:613
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag)
Definition: wifi-phy.cc:605
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:1405
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:1330
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:877
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:1429
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1063
virtual bool IsStateCcaBusy(void)=0
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:1397
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:649
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:1242
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:802
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:1346
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:1202
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:643
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:1313
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:1130
virtual void SetFrequency(uint32_t freq)=0
virtual void SetReceiveErrorCallback(RxErrorCallback callback)=0
Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector, enum WifiPreamble preamble)
Definition: wifi-phy.cc:592
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:1275
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:1210
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:790
virtual Time GetDelayUntilIdle(void)=0
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:964
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:1298
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:631
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:853
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:952
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1087
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:1259
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:1381
virtual bool IsStateBusy(void)=0
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:889
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
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:1114
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
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:1328
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:865
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:1218
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:1274
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:1154
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:1389
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:691
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:1027
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:195
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:730
virtual void SetShortPlcpPreamble(bool shortPreamble)=0
void NotifyTxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:619
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).
Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag)
Definition: wifi-phy.cc:398
virtual bool GetShortPlcpPreamble(void) const =0
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:718
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:742
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:637
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:1266
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:1162
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:1125
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:1338
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:1186
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:1146
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:1314
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:1331
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:1122
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:1298
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble, enum mpduType mpdutype)=0
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:676
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:1445
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:940
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:988
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:1099
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:1234
static Time GetPlcpPreambleDuration(WifiTxVector txVector, WifiPreamble preamble)
Definition: wifi-phy.cc:346
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:1138
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:817
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:1051
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:916
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1267
virtual void NotifyMaybeCcaBusyStart(Time duration)=0
The MPDU is the last aggregate in an A-MPDU.
Definition: wifi-phy.h:52