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 
43 {
44  double signal; //in dBm
45  double noise; //in dBm
46 };
47 
48 struct mpduInfo
49 {
50  uint8_t packetType;
51  uint32_t referenceNumber;
52 };
53 
58 {
59 public:
60  virtual ~WifiPhyListener ();
61 
74  virtual void NotifyRxStart (Time duration) = 0;
80  virtual void NotifyRxEndOk (void) = 0;
86  virtual void NotifyRxEndError (void) = 0;
97  virtual void NotifyTxStart (Time duration, double txPowerDbm) = 0;
113  virtual void NotifyMaybeCcaBusyStart (Time duration) = 0;
121  virtual void NotifySwitchingStart (Time duration) = 0;
125  virtual void NotifySleep (void) = 0;
129  virtual void NotifyWakeup (void) = 0;
130 };
131 
132 
138 class WifiPhy : public Object
139 {
140 public:
144  enum State
145  {
157  TX,
161  RX,
170  };
171 
184 
185  static TypeId GetTypeId (void);
186 
187  WifiPhy ();
188  virtual ~WifiPhy ();
189 
195  virtual double GetTxPowerStart (void) const = 0;
201  virtual double GetTxPowerEnd (void) const = 0;
205  virtual uint32_t GetNTxPower (void) const = 0;
206 
211  virtual void SetReceiveOkCallback (RxOkCallback callback) = 0;
216  virtual void SetReceiveErrorCallback (RxErrorCallback callback) = 0;
217 
227  virtual void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, enum WifiPreamble preamble, uint8_t packetType, uint32_t mpduReferenceNumber) = 0;
228 
235  virtual void RegisterListener (WifiPhyListener *listener) = 0;
242  virtual void UnregisterListener (WifiPhyListener *listener) = 0;
243 
247  virtual void SetSleepMode (void) = 0;
251  virtual void ResumeFromSleep (void) = 0;
252 
256  virtual bool IsStateIdle (void) = 0;
260  virtual bool IsStateCcaBusy (void) = 0;
264  virtual bool IsStateBusy (void) = 0;
268  virtual bool IsStateRx (void) = 0;
272  virtual bool IsStateTx (void) = 0;
276  virtual bool IsStateSwitching (void) = 0;
280  virtual bool IsStateSleep (void) = 0;
284  virtual Time GetStateDuration (void) = 0;
291  virtual Time GetDelayUntilIdle (void) = 0;
292 
298  virtual Time GetLastRxStartTime (void) const = 0;
299 
310  Time CalculateTxDuration (uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag);
311 
318  Time CalculatePlcpPreambleAndHeaderDuration (WifiTxVector txVector, enum WifiPreamble preamble);
319 
326  static Time GetPlcpHtTrainingSymbolDuration (WifiPreamble preamble, WifiTxVector txVector);
333  static WifiMode GetHtPlcpHeaderMode (WifiMode payloadMode);
339  static WifiMode GetVhtPlcpHeaderMode (WifiMode payloadMode);
345  static Time GetPlcpHtSigHeaderDuration (WifiPreamble preamble);
351  static Time GetPlcpVhtSigA1Duration (WifiPreamble preamble);
357  static Time GetPlcpVhtSigA2Duration (WifiPreamble preamble);
363  static Time GetPlcpVhtSigBDuration (WifiPreamble preamble);
371  static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble, WifiTxVector txVector);
378  static Time GetPlcpHeaderDuration (WifiTxVector txVector, WifiPreamble preamble);
385  static Time GetPlcpPreambleDuration (WifiTxVector txVector, WifiPreamble preamble);
396  Time GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag);
397 
415  virtual uint32_t GetNModes (void) const = 0;
435  virtual WifiMode GetMode (uint32_t mode) const = 0;
444  virtual bool IsModeSupported (WifiMode mode) const = 0;
445 
453  virtual double CalculateSnr (WifiMode txMode, double ber) const = 0;
454 
464  virtual uint32_t GetNBssMembershipSelectors (void) const = 0;
476  virtual uint32_t GetBssMembershipSelector (uint32_t selector) const = 0;
490  virtual WifiModeList GetMembershipSelectorModes (uint32_t selector) = 0;
500  virtual uint8_t GetNMcs (void) const = 0;
512  virtual WifiMode GetMcs (uint8_t mcs) const = 0;
513 
524  virtual void SetChannelNumber (uint16_t id) = 0;
530  virtual uint16_t GetChannelNumber (void) const = 0;
534  virtual Time GetChannelSwitchDelay (void) const = 0;
535 
541  virtual void ConfigureStandard (enum WifiPhyStandard standard) = 0;
542 
548  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
549 
555  static WifiMode GetDsssRate1Mbps ();
561  static WifiMode GetDsssRate2Mbps ();
567  static WifiMode GetDsssRate5_5Mbps ();
573  static WifiMode GetDsssRate11Mbps ();
579  static WifiMode GetErpOfdmRate6Mbps ();
585  static WifiMode GetErpOfdmRate9Mbps ();
591  static WifiMode GetErpOfdmRate12Mbps ();
597  static WifiMode GetErpOfdmRate18Mbps ();
603  static WifiMode GetErpOfdmRate24Mbps ();
609  static WifiMode GetErpOfdmRate36Mbps ();
615  static WifiMode GetErpOfdmRate48Mbps ();
621  static WifiMode GetErpOfdmRate54Mbps ();
627  static WifiMode GetOfdmRate6Mbps ();
633  static WifiMode GetOfdmRate9Mbps ();
639  static WifiMode GetOfdmRate12Mbps ();
645  static WifiMode GetOfdmRate18Mbps ();
651  static WifiMode GetOfdmRate24Mbps ();
657  static WifiMode GetOfdmRate36Mbps ();
663  static WifiMode GetOfdmRate48Mbps ();
669  static WifiMode GetOfdmRate54Mbps ();
766 
772  static WifiMode GetHtMcs0 ();
778  static WifiMode GetHtMcs1 ();
784  static WifiMode GetHtMcs2 ();
790  static WifiMode GetHtMcs3 ();
796  static WifiMode GetHtMcs4 ();
802  static WifiMode GetHtMcs5 ();
808  static WifiMode GetHtMcs6 ();
814  static WifiMode GetHtMcs7 ();
820  static WifiMode GetHtMcs8 ();
826  static WifiMode GetHtMcs9 ();
832  static WifiMode GetHtMcs10 ();
838  static WifiMode GetHtMcs11 ();
844  static WifiMode GetHtMcs12 ();
850  static WifiMode GetHtMcs13 ();
856  static WifiMode GetHtMcs14 ();
862  static WifiMode GetHtMcs15 ();
868  static WifiMode GetHtMcs16 ();
874  static WifiMode GetHtMcs17 ();
880  static WifiMode GetHtMcs18 ();
886  static WifiMode GetHtMcs19 ();
892  static WifiMode GetHtMcs20 ();
898  static WifiMode GetHtMcs21 ();
904  static WifiMode GetHtMcs22 ();
910  static WifiMode GetHtMcs23 ();
916  static WifiMode GetHtMcs24 ();
922  static WifiMode GetHtMcs25 ();
928  static WifiMode GetHtMcs26 ();
934  static WifiMode GetHtMcs27 ();
940  static WifiMode GetHtMcs28 ();
946  static WifiMode GetHtMcs29 ();
952  static WifiMode GetHtMcs30 ();
958  static WifiMode GetHtMcs31 ();
959 
965  static WifiMode GetVhtMcs0 ();
971  static WifiMode GetVhtMcs1 ();
977  static WifiMode GetVhtMcs2 ();
983  static WifiMode GetVhtMcs3 ();
989  static WifiMode GetVhtMcs4 ();
995  static WifiMode GetVhtMcs5 ();
1001  static WifiMode GetVhtMcs6 ();
1007  static WifiMode GetVhtMcs7 ();
1013  static WifiMode GetVhtMcs8 ();
1019  static WifiMode GetVhtMcs9 ();
1020 
1027  void NotifyTxBegin (Ptr<const Packet> packet);
1034  void NotifyTxEnd (Ptr<const Packet> packet);
1041  void NotifyTxDrop (Ptr<const Packet> packet);
1048  void NotifyRxBegin (Ptr<const Packet> packet);
1055  void NotifyRxEnd (Ptr<const Packet> packet);
1062  void NotifyRxDrop (Ptr<const Packet> packet);
1063 
1085  void NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz,
1086  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1087  WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise);
1088 
1112  typedef void (* MonitorSnifferRxCallback)(Ptr<const Packet> packet, uint16_t channelFreqMhz,
1113  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1114  WifiTxVector txVector, struct mpduInfo aMpdu,
1115  struct signalNoiseDbm signalNoise);
1116 
1132  void NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz,
1133  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1134  WifiTxVector txVector, struct mpduInfo aMpdu);
1135 
1152  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet, uint16_t channelFreqMhz,
1153  uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
1154  WifiTxVector txVector, struct mpduInfo aMpdu);
1155 
1164  virtual int64_t AssignStreams (int64_t stream) = 0;
1165 
1169  virtual void SetFrequency (uint32_t freq) = 0;
1173  virtual uint32_t GetFrequency (void) const = 0;
1177  virtual void SetNumberOfTransmitAntennas (uint32_t tx) = 0;
1181  virtual uint32_t GetNumberOfTransmitAntennas (void) const = 0;
1185  virtual void SetNumberOfReceiveAntennas (uint32_t rx) = 0;
1189  virtual uint32_t GetNumberOfReceiveAntennas (void) const = 0;
1193  virtual void SetGuardInterval (bool guardInterval) = 0;
1197  virtual bool GetGuardInterval (void) const = 0;
1201  virtual void SetLdpc (bool ldpc) = 0;
1205  virtual bool GetLdpc (void) const = 0;
1209  virtual void SetStbc (bool stbc) = 0;
1213  virtual bool GetStbc (void) const = 0;
1217  virtual void SetGreenfield (bool greenfield) = 0;
1221  virtual bool GetGreenfield (void) const = 0;
1225  virtual uint32_t GetChannelWidth (void) const = 0;
1229  virtual void SetChannelWidth (uint32_t channelwidth) = 0;
1230 
1231 
1232 private:
1240 
1248 
1256 
1264 
1272 
1279 
1292  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
1293  WifiPreamble, WifiTxVector,
1295 
1308  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
1309  WifiPreamble, WifiTxVector,
1311 
1313  uint32_t m_totalAmpduSize;
1314 };
1315 
1321 std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state);
1322 
1323 } //namespace ns3
1324 
1325 #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:1263
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
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:1152
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...
802.11 PHY layer model
Definition: wifi-phy.h:138
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:153
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.
Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:398
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:1312
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:1271
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:178
The PHY layer is sleeping.
Definition: wifi-phy.h:169
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
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:1294
virtual void NotifyRxEndOk(void)=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
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
uint8_t packetType
Definition: wifi-phy.h:50
receive notifications about phy events.
Definition: wifi-phy.h:57
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:1255
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:149
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:161
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
Definition: wifi-phy.h:1278
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:157
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:165
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Definition: wifi-phy.h:1239
virtual bool IsStateSwitching(void)=0
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:1310
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
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble, uint8_t packetType, uint32_t mpduReferenceNumber)=0
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:691
virtual void SetStbc(bool stbc)=0
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:605
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
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).
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
Callback< void, Ptr< const Packet >, double > RxErrorCallback
arg1: packet received unsuccessfully arg2: snr of packet
Definition: wifi-phy.h:183
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:1112
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:1313
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
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:144
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
uint32_t referenceNumber
Definition: wifi-phy.h:51
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
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:1247
virtual void NotifyMaybeCcaBusyStart(Time duration)=0