A Discrete-Event Network Simulator
API
wifi-phy.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2005,2006 INRIA
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Sébastien Deronne <sebastien.deronne@gmail.com>
20 */
21
22#ifndef WIFI_PHY_H
23#define WIFI_PHY_H
24
25#include "ns3/error-model.h"
26#include "wifi-standards.h"
27#include "interference-helper.h"
29#include "phy-entity.h"
31
32namespace ns3 {
33
34class Channel;
35class WifiNetDevice;
36class MobilityModel;
37class WifiPhyStateHelper;
38class FrameCaptureModel;
39class PreambleDetectionModel;
40class WifiRadioEnergyModel;
41class UniformRandomVariable;
42
48class WifiPhy : public Object
49{
50public:
51 friend class PhyEntity;
56 static TypeId GetTypeId (void);
57
58 WifiPhy ();
59 virtual ~WifiPhy ();
60
67
72 void SetReceiveOkCallback (RxOkCallback callback);
78
85 void RegisterListener (WifiPhyListener *listener);
92 void UnregisterListener (WifiPhyListener *listener);
93
98
106 void StartReceivePreamble (Ptr<WifiPpdu> ppdu, RxPowerWattPerChannelBand& rxPowersW, Time rxDuration);
107
113 void ResetReceive (Ptr<Event> event);
114
119 void EndReceiveInterBss (void);
120
131
143 void Send (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
150 void Send (WifiConstPsduMap psdus, const WifiTxVector& txVector);
151
155 virtual void StartTx (Ptr<WifiPpdu> ppdu) = 0;
156
160 void SetSleepMode (void);
164 void ResumeFromSleep (void);
168 void SetOffMode (void);
172 void ResumeFromOff (void);
173
177 bool IsStateIdle (void) const;
181 bool IsStateCcaBusy (void) const;
185 bool IsStateRx (void) const;
189 bool IsStateTx (void) const;
193 bool IsStateSwitching (void) const;
197 bool IsStateSleep (void) const;
201 bool IsStateOff (void) const;
202
209 Time GetDelayUntilIdle (void);
210
216 Time GetLastRxStartTime (void) const;
222 Time GetLastRxEndTime (void) const;
223
232 static Time CalculateTxDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band,
233 uint16_t staId = SU_STA_ID);
248 static Time CalculateTxDuration (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, WifiPhyBand band);
256 static Time CalculateTxDuration (WifiConstPsduMap psduMap, const WifiTxVector& txVector, WifiPhyBand band);
257
277 static Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype = NORMAL_MPDU,
278 uint16_t staId = SU_STA_ID);
295 static Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype,
296 bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols,
297 uint16_t staId);
303 static Time GetStartOfPacketDuration (const WifiTxVector& txVector);
304
319 std::list<WifiMode> GetModeList (void) const;
329 std::list<WifiMode> GetModeList (WifiModulationClass modulation) const;
338 bool IsModeSupported (WifiMode mode) const;
346 WifiMode GetDefaultMode (void) const;
356 bool IsMcsSupported (WifiModulationClass modulation, uint8_t mcs) const;
357
365 double CalculateSnr (const WifiTxVector& txVector, double ber) const;
366
372 void SetSifs (Time sifs);
378 Time GetSifs (void) const;
384 void SetSlot (Time slot);
390 Time GetSlot (void) const;
396 void SetPifs (Time pifs);
402 Time GetPifs (void) const;
408 Time GetAckTxTime (void) const;
414 Time GetBlockAckTxTime (void) const;
415
422 static uint32_t GetMaxPsduSize (WifiModulationClass modulation);
423
434 std::list<uint8_t> GetBssMembershipSelectorList (void) const;
440 uint16_t GetNMcs (void) const;
449 std::list<WifiMode> GetMcsList (void) const;
459 std::list<WifiMode> GetMcsList (WifiModulationClass modulation) const;
470 WifiMode GetMcs (WifiModulationClass modulation, uint8_t mcs) const;
471
477 uint8_t GetChannelNumber (void) const;
481 Time GetChannelSwitchDelay (void) const;
482
488 virtual void ConfigureStandard (WifiStandard standard);
489
495 WifiStandard GetStandard (void) const;
496
502 WifiPhyBand GetPhyBand (void) const;
503
510
516 virtual Ptr<Channel> GetChannel (void) const = 0;
517
525 void NotifyTxBegin (WifiConstPsduMap psdus, double txPowerW);
532 void NotifyTxEnd (WifiConstPsduMap psdus);
547 void NotifyRxBegin (Ptr<const WifiPsdu> psdu, const RxPowerWattPerChannelBand& rxPowersW);
563
585 uint16_t channelFreqMhz,
586 WifiTxVector txVector,
587 SignalNoiseDbm signalNoise,
588 std::vector<bool> statusPerMpdu,
589 uint16_t staId = SU_STA_ID);
590
612 uint16_t channelFreqMhz,
613 WifiTxVector txVector,
614 MpduInfo aMpdu,
615 SignalNoiseDbm signalNoise,
616 uint16_t staId);
617
632 uint16_t channelFreqMhz,
633 WifiTxVector txVector,
634 uint16_t staId = SU_STA_ID);
635
649 typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
650 uint16_t channelFreqMhz,
651 WifiTxVector txVector,
652 MpduInfo aMpdu,
653 uint16_t staId);
654
661 typedef void (* PhyTxBeginTracedCallback)(Ptr<const Packet> packet, double txPowerW);
662
670 typedef void (* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW);
671
679
686 typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
687
696 virtual int64_t AssignStreams (int64_t stream);
697
705 void SetRxSensitivity (double threshold);
711 double GetRxSensitivity (void) const;
719 void SetCcaEdThreshold (double threshold);
725 double GetCcaEdThreshold (void) const;
731 void SetRxNoiseFigure (double noiseFigureDb);
737 void SetTxPowerStart (double start);
743 double GetTxPowerStart (void) const;
749 void SetTxPowerEnd (double end);
755 double GetTxPowerEnd (void) const;
763 void SetNTxPower (uint8_t n);
769 uint8_t GetNTxPower (void) const;
775 void SetTxGain (double gain);
781 double GetTxGain (void) const;
787 void SetRxGain (double gain);
793 double GetRxGain (void) const;
794
800 void SetDevice (const Ptr<WifiNetDevice> device);
806 Ptr<WifiNetDevice> GetDevice (void) const;
827 Ptr<MobilityModel> GetMobility (void) const;
828
829 using ChannelTuple = std::tuple<uint8_t /* channel number */,
830 uint16_t /* channel width */,
831 int /* WifiPhyBand */,
832 uint8_t /* primary20 index*/>;
833
843 void SetOperatingChannel (const ChannelTuple& channelTuple);
847 uint16_t GetFrequency (void) const;
851 uint8_t GetPrimary20Index (void) const;
855 void SetNumberOfAntennas (uint8_t antennas);
859 uint8_t GetNumberOfAntennas (void) const;
863 void SetMaxSupportedTxSpatialStreams (uint8_t streams);
867 uint8_t GetMaxSupportedTxSpatialStreams (void) const;
871 void SetMaxSupportedRxSpatialStreams (uint8_t streams);
875 uint8_t GetMaxSupportedRxSpatialStreams (void) const;
881 void SetShortPhyPreambleSupported (bool preamble);
887 bool GetShortPhyPreambleSupported (void) const;
888
894 void SetErrorRateModel (const Ptr<ErrorRateModel> rate);
912 void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
918 void SetPreambleDetectionModel (const Ptr<PreambleDetectionModel> preambleDetectionModel);
924 void SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
925
929 uint16_t GetChannelWidth (void) const;
933 void AddSupportedChannelWidth (uint16_t width);
937 std::vector<uint16_t> GetSupportedChannelWidthSet (void) const;
938
947 double GetPowerDbm (uint8_t power) const;
948
956 void ResetCca (bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
974
975
986 virtual WifiSpectrumBand ConvertHeRuSubcarriers (uint16_t bandWidth, uint16_t guardBandwidth,
987 HeRu::SubcarrierRange range, uint8_t bandIndex = 0) const;
988
998 static void AddStaticPhyEntity (WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
999
1009
1018
1022 uint64_t GetPreviouslyRxPpduUid (void) const;
1023
1037 virtual uint16_t GetGuardBandwidth (uint16_t currentChannelWidth) const = 0;
1046 virtual std::tuple<double, double, double> GetTxMaskRejectionParams (void) const = 0;
1047
1054 uint8_t GetPrimaryChannelNumber (uint16_t primaryChannelWidth) const;
1055
1056protected:
1057 virtual void DoDispose (void);
1058
1062 void Reset (void);
1063
1077 virtual void DoChannelSwitch (void);
1078
1087 void SwitchMaybeToCcaBusy (uint16_t channelWidth);
1088
1097 uint16_t GetMeasurementChannelWidth (const Ptr<const WifiPpdu> ppdu) const;
1098
1107 virtual WifiSpectrumBand GetBand (uint16_t bandWidth, uint8_t bandIndex = 0);
1108
1120 WifiSpectrumBand GetPrimaryBand (uint16_t bandWidth);
1121
1132 void AddPhyEntity (WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1133
1137
1140
1143
1145 std::map <std::pair<uint64_t /* UID*/, WifiPreamble>, Ptr<Event> > m_currentPreambleEvents;
1146
1148
1166 std::map<WifiModulationClass, Ptr<PhyEntity> > m_phyEntities;
1167
1168
1169private:
1174 void Configure80211a (void);
1179 void Configure80211b (void);
1184 void Configure80211g (void);
1189 void Configure80211p (void);
1194 void Configure80211n (void);
1199 void Configure80211ac (void);
1204 void Configure80211ax (void);
1215 void PushMcs (WifiMode mode);
1219 void RebuildMcsMap (void);
1220
1227
1235
1250
1258
1266
1274
1290
1298
1305
1318 TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, SignalNoiseDbm, uint16_t /* STA-ID*/> m_phyMonitorSniffRxTrace;
1319
1332 TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, uint16_t /* STA-ID*/> m_phyMonitorSniffTxTrace;
1333
1341 static std::map<WifiModulationClass, Ptr<PhyEntity> > & GetStaticPhyEntities (void);
1342
1347 std::vector<uint16_t> m_supportedChannelWidthSet;
1348
1354
1357 double m_txGainDb;
1358 double m_rxGainDb;
1361 uint8_t m_nTxPower;
1363
1368
1373
1375
1378
1384
1386};
1387
1393std::ostream& operator<< (std::ostream& os, RxSignalInfo rxSignalInfo);
1394
1395} //namespace ns3
1396
1397#endif /* WIFI_PHY_H */
An identifier for simulation events.
Definition: event-id.h:54
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition: he-ru.h:53
handles interference calculations
A base class which provides memory management and object aggregation.
Definition: object.h:88
Abstract class for PHY entities.
Definition: phy-entity.h:94
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
represent a single transmission mode
Definition: wifi-mode.h:48
802.11 PHY layer model
Definition: wifi-phy.h:49
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1060
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1136
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:1358
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:1377
bool IsStateIdle(void) const
Definition: wifi-phy.cc:1798
void(* PhyTxBeginTracedCallback)(Ptr< const Packet > packet, double txPowerW)
TracedCallback signature for Phy transmit events.
Definition: wifi-phy.h:661
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
Definition: wifi-phy.h:1371
void Send(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
This function is a wrapper for the Send variant that accepts a WifiConstPsduMap as first argument.
Definition: wifi-phy.cc:1485
bool IsStateTx(void) const
Definition: wifi-phy.cc:1810
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:1604
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1135
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:895
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:1381
virtual ~WifiPhy()
Definition: wifi-phy.cc:332
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:1374
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Definition: wifi-phy.cc:1750
void SetCcaEdThreshold(double threshold)
Sets the CCA threshold (dBm).
Definition: wifi-phy.cc:427
TracedCallback< Ptr< const Packet >, WifiPhyRxfailureReason > m_phyRxDropTrace
The trace source fired when the PHY layer drops a packet it has received.
Definition: wifi-phy.h:1304
WifiPhyOperatingChannel m_operatingChannel
Operating channel.
Definition: wifi-phy.h:1346
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:1265
TracedCallback< Ptr< const Packet >, RxPowerWattPerChannelBand > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1273
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
Definition: wifi-phy.h:1367
static Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype=NORMAL_MPDU, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1282
TracedCallback< Ptr< const Packet >, double > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Definition: wifi-phy.h:1242
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:544
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1105
const WifiPhyOperatingChannel & GetOperatingChannel(void) const
Get a const reference to the operating channel.
Definition: wifi-phy.cc:883
Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
Definition: wifi-phy.cc:1956
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:520
void NotifyTxEnd(WifiConstPsduMap psdus)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:1348
std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > m_currentPreambleEvents
store event associated to a PPDU (that has a unique ID and preamble combination) whose preamble is be...
Definition: wifi-phy.h:1145
Time m_slot
Slot duration.
Definition: wifi-phy.h:1350
double m_powerDensityLimit
the power density limit (dBm/MHz)
Definition: wifi-phy.h:1362
WifiMode GetDefaultMode(void) const
Get the default WifiMode supported by the PHY.
Definition: wifi-phy.cc:1675
std::vector< uint16_t > GetSupportedChannelWidthSet(void) const
Definition: wifi-phy.cc:1153
bool IsStateRx(void) const
Definition: wifi-phy.cc:1804
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:653
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:870
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1141
double m_txPowerBaseDbm
Minimum transmission power (dBm)
Definition: wifi-phy.h:1359
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:378
Ptr< WifiNetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:532
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:1399
bool IsMcsSupported(WifiModulationClass modulation, uint8_t mcs) const
Check if the given MCS of the given modulation class is supported by the PHY.
Definition: wifi-phy.cc:1690
WifiStandard GetStandard(void) const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:877
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-phy.cc:338
Time m_blockAckTxTime
estimated BlockAck TX time
Definition: wifi-phy.h:1353
uint8_t GetPrimaryChannelNumber(uint16_t primaryChannelWidth) const
Get channel number of the primary channel.
Definition: wifi-phy.cc:2012
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
Definition: wifi-phy.cc:701
std::list< uint8_t > GetBssMembershipSelectorList(void) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1123
void ResetCca(bool powerRestricted, double txPowerMaxSiso=0, double txPowerMaxMimo=0)
Reset PHY to IDLE, with some potential TX power restrictions for the next transmission.
Definition: wifi-phy.cc:1904
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:1366
Time GetSlot(void) const
Return the slot duration for this PHY.
Definition: wifi-phy.cc:671
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted.
Definition: wifi-phy.cc:1868
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:1379
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1297
void NotifyRxBegin(Ptr< const WifiPsdu > psdu, const RxPowerWattPerChannelBand &rxPowersW)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:1375
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1074
uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const
Return the channel width used to measure the RSSI.
Definition: wifi-phy.cc:1963
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:468
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: wifi-phy.h:1349
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:390
void ResetReceive(Ptr< Event > event)
Reset PHY at the end of the packet under reception after it has failed the PHY header.
Definition: wifi-phy.cc:1644
virtual uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const =0
InterferenceHelper m_interference
the class handling interference computations
Definition: wifi-phy.h:1134
void(* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:670
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:818
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1117
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:564
WifiMode GetMcs(WifiModulationClass modulation, uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the given modulation class.
Definition: wifi-phy.cc:1785
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
uint8_t m_numberOfAntennas
Number of transmitters.
Definition: wifi-phy.h:1370
ChannelTuple m_channelSettings
Store operating channel settings until initialization.
Definition: wifi-phy.h:1345
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1138
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1306
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
Definition: wifi-phy.cc:1840
Time GetBlockAckTxTime(void) const
Return the estimated BlockAck TX time for this PHY.
Definition: wifi-phy.cc:695
void Configure80211p(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard.
Definition: wifi-phy.cc:746
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:683
static uint32_t GetMaxPsduSize(WifiModulationClass modulation)
Get the maximum PSDU size in bytes for the given modulation class.
Definition: wifi-phy.cc:1327
void NotifyTxBegin(WifiConstPsduMap psdus, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:1333
void Reset(void)
Reset data upon end of TX or RX.
Definition: wifi-phy.cc:1592
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:513
void SetNTxPower(uint8_t n)
Sets the number of transmission power levels available between the minimum level and the maximum leve...
Definition: wifi-phy.cc:474
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-phy.cc:56
WifiPhyBand m_band
WifiPhyBand.
Definition: wifi-phy.h:1344
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
Definition: wifi-phy.cc:716
void SetSleepMode(void)
Put in sleep mode.
Definition: wifi-phy.cc:1159
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:414
uint8_t GetPrimary20Index(void) const
Definition: wifi-phy.cc:907
static const Ptr< const PhyEntity > GetStaticPhyEntity(WifiModulationClass modulation)
Get the implemented PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:619
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1099
void(* MonitorSnifferTxCallback)(const Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, uint16_t staId)
TracedCallback signature for monitor mode transmit events.
Definition: wifi-phy.h:649
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
Definition: wifi-phy.cc:733
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo, uint16_t > m_phyMonitorSniffTxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being transmitted.
Definition: wifi-phy.h:1332
Time GetChannelSwitchDelay(void) const
Definition: wifi-phy.cc:607
virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t bandWidth, uint16_t guardBandwidth, HeRu::SubcarrierRange range, uint8_t bandIndex=0) const
Definition: wifi-phy.cc:1625
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:1365
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
Definition: wifi-phy.h:1166
void RebuildMcsMap(void)
Rebuild the mapping of MCS values to indices in the device MCS set.
void AddPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of supported PHY entities for the given modulation class for the WifiPh...
Definition: wifi-phy.cc:643
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo, SignalNoiseDbm, uint16_t > m_phyMonitorSniffRxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being received.
Definition: wifi-phy.h:1318
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:1382
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:455
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1142
void ConfigureHtDeviceMcsSet(void)
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
static WifiConstPsduMap GetWifiConstPsduMap(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
Definition: wifi-phy.cc:1479
uint16_t GetNMcs(void) const
Definition: wifi-phy.cc:1736
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:665
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
Definition: wifi-phy.cc:913
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:1144
double m_ccaEdThresholdW
Clear channel assessment (CCA) threshold in watts.
Definition: wifi-phy.h:1356
void NotifyMonitorSniffTx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector, uint16_t staId=SU_STA_ID)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being transmitted.
Definition: wifi-phy.cc:1448
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class, for the WifiPhy instance.
Definition: wifi-phy.cc:627
virtual WifiSpectrumBand GetBand(uint16_t bandWidth, uint8_t bandIndex=0)
Get the start band index and the stop band index for a given band.
Definition: wifi-phy.cc:1975
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium.
Definition: wifi-phy.h:1257
void ResumeFromSleep(void)
Resume from sleep mode.
Definition: wifi-phy.cc:1208
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
Definition: wifi-phy.h:1147
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard.
Definition: wifi-phy.cc:795
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1139
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:583
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:526
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:1655
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:1380
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1068
void SwitchMaybeToCcaBusy(uint16_t channelWidth)
Check if PHY state should move to CCA busy state based on current state of interference tracker.
Definition: wifi-phy.cc:1852
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:461
virtual std::tuple< double, double, double > GetTxMaskRejectionParams(void) const =0
static std::map< WifiModulationClass, Ptr< PhyEntity > > & GetStaticPhyEntities(void)
Definition: wifi-phy.cc:371
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
Definition: wifi-phy.cc:635
void(* MonitorSnifferRxCallback)(Ptr< const Packet > packet, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId)
TracedCallback signature for monitor mode receive events.
Definition: wifi-phy.h:611
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:1387
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition: wifi-phy.cc:1701
TracedCallback< WifiConstPsduMap, WifiTxVector, double > m_phyTxPsduBeginTrace
The trace source fired when a PSDU map begins the transmission process on the medium.
Definition: wifi-phy.h:1249
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:1357
std::vector< uint16_t > m_supportedChannelWidthSet
Supported channel width set (MHz)
Definition: wifi-phy.h:1347
WifiSpectrumBand GetPrimaryBand(uint16_t bandWidth)
If the operating channel width is a multiple of 20 MHz, return the start band index and the stop band...
Definition: wifi-phy.cc:1984
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:1834
uint64_t GetPreviouslyRxPpduUid(void) const
Definition: wifi-phy.cc:1586
WifiStandard m_standard
WifiStandard.
Definition: wifi-phy.h:1343
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:589
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:1361
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:577
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:677
Time GetSifs(void) const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:659
static Time GetStartOfPacketDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1276
virtual void StartTx(Ptr< WifiPpdu > ppdu)=0
Time GetAckTxTime(void) const
Return the estimated Ack TX time for this PHY.
Definition: wifi-phy.cc:689
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:402
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:500
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:538
double GetRxGain(void) const
Return the reception gain (dB).
Definition: wifi-phy.cc:507
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:487
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Definition: wifi-phy.h:1372
double m_txPowerEndDbm
Maximum transmission power (dBm)
Definition: wifi-phy.h:1360
void SetOffMode(void)
Put in off mode.
Definition: wifi-phy.cc:1193
double CalculateSnr(const WifiTxVector &txVector, double ber) const
Definition: wifi-phy.cc:613
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard.
Definition: wifi-phy.cc:776
void(* PhyRxBeginTracedCallback)(Ptr< const Packet > packet, RxPowerWattPerChannelBand rxPowersW)
TracedCallback signature for PhyRxBegin trace source.
Definition: wifi-phy.h:678
bool IsStateSwitching(void) const
Definition: wifi-phy.cc:1816
double GetTxGain(void) const
Return the transmission gain (dB).
Definition: wifi-phy.cc:494
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:481
Time GetDelayUntilChannelSwitch(void)
Perform any actions necessary when user changes operating channel after initialization.
Definition: wifi-phy.cc:953
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:1634
double GetCcaEdThreshold(void) const
Return the CCA threshold (dBm).
Definition: wifi-phy.cc:434
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:421
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:396
Ptr< WifiNetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:1376
bool IsStateSleep(void) const
Definition: wifi-phy.cc:1822
bool IsStateCcaBusy(void) const
Definition: wifi-phy.cc:1792
bool m_shortPreamble
Flag if short PHY preamble is supported.
Definition: wifi-phy.h:1369
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: wifi-phy.h:1351
void SetRxNoiseFigure(double noiseFigureDb)
Sets the RX loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
Definition: wifi-phy.cc:440
double GetTxPowerForTransmission(Ptr< const WifiPpdu > ppdu) const
Compute the transmit power for the next transmission.
Definition: wifi-phy.cc:1923
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:686
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:408
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:384
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:571
void ResumeFromOff(void)
Resume from off mode.
Definition: wifi-phy.cc:1239
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard.
Definition: wifi-phy.cc:803
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Definition: wifi-phy.h:1364
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Definition: wifi-phy.h:1385
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
void AddSupportedChannelWidth(uint16_t width)
Definition: wifi-phy.cc:1138
void NotifyMonitorSniffRx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector, SignalNoiseDbm signalNoise, std::vector< bool > statusPerMpdu, uint16_t staId=SU_STA_ID)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being received.
Definition: wifi-phy.cc:1411
virtual void DoChannelSwitch(void)
Actually switch channel based on the stored channel settings.
Definition: wifi-phy.cc:1004
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:1289
static Time GetPreambleDetectionDuration(void)
Definition: wifi-phy.cc:1270
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Definition: wifi-phy.h:832
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:1383
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:1355
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Definition: wifi-phy.cc:1846
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:901
bool IsStateOff(void) const
Definition: wifi-phy.cc:1828
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:448
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: wifi-phy.cc:1995
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1300
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:1662
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:889
Time m_ackTxTime
estimated Ack TX time
Definition: wifi-phy.h:1352
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:1363
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
Definition: wifi-phy.cc:557
receive notifications about PHY events.
Class that keeps track of all information about the current PHY operating channel.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
MpduType
The type of an MPDU.
@ NORMAL_MPDU
The MPDU is not part of an A-MPDU.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Definition: phy-entity.h:75
mobility
Definition: third.py:107
def start()
Definition: core.py:1853
Declaration of:
MpduInfo structure.
Definition: phy-entity.h:60
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:67
SignalNoiseDbm structure.
Definition: phy-entity.h:53
#define SU_STA_ID
Definition: wifi-mode.h:32