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"
28#include "phy-entity.h"
30
31namespace ns3 {
32
33class Channel;
34class WifiNetDevice;
35class MobilityModel;
36class WifiPhyStateHelper;
37class FrameCaptureModel;
38class PreambleDetectionModel;
39class WifiRadioEnergyModel;
40class UniformRandomVariable;
41class InterferenceHelper;
42class ErrorRateModel;
43
49class WifiPhy : public Object
50{
51public:
52 friend class PhyEntity;
57 static TypeId GetTypeId (void);
58
59 WifiPhy ();
60 virtual ~WifiPhy ();
61
68
73 void SetReceiveOkCallback (RxOkCallback callback);
79
86 void RegisterListener (WifiPhyListener *listener);
93 void UnregisterListener (WifiPhyListener *listener);
94
99
108
113 void EndReceiveInterBss (void);
114
125
137 void Send (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
144 void Send (WifiConstPsduMap psdus, const WifiTxVector& txVector);
145
149 virtual void StartTx (Ptr<const WifiPpdu> ppdu) = 0;
150
154 void SetSleepMode (void);
158 void ResumeFromSleep (void);
162 void SetOffMode (void);
166 void ResumeFromOff (void);
167
171 bool IsStateIdle (void) const;
175 bool IsStateCcaBusy (void) const;
179 bool IsStateRx (void) const;
183 bool IsStateTx (void) const;
187 bool IsStateSwitching (void) const;
191 bool IsStateSleep (void) const;
195 bool IsStateOff (void) const;
196
203 Time GetDelayUntilIdle (void);
204
210 Time GetLastRxStartTime (void) const;
216 Time GetLastRxEndTime (void) const;
217
226 static Time CalculateTxDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band,
227 uint16_t staId = SU_STA_ID);
242 static Time CalculateTxDuration (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, WifiPhyBand band);
250 static Time CalculateTxDuration (WifiConstPsduMap psduMap, const WifiTxVector& txVector, WifiPhyBand band);
251
271 static Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype = NORMAL_MPDU,
272 uint16_t staId = SU_STA_ID);
289 static Time GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand band, MpduType mpdutype,
290 bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols,
291 uint16_t staId);
297 static Time GetStartOfPacketDuration (const WifiTxVector& txVector);
298
313 std::list<WifiMode> GetModeList (void) const;
323 std::list<WifiMode> GetModeList (WifiModulationClass modulation) const;
332 bool IsModeSupported (WifiMode mode) const;
340 WifiMode GetDefaultMode (void) const;
350 bool IsMcsSupported (WifiModulationClass modulation, uint8_t mcs) const;
351
359 double CalculateSnr (const WifiTxVector& txVector, double ber) const;
360
366 void SetSifs (Time sifs);
372 Time GetSifs (void) const;
378 void SetSlot (Time slot);
384 Time GetSlot (void) const;
390 void SetPifs (Time pifs);
396 Time GetPifs (void) const;
402 Time GetAckTxTime (void) const;
408 Time GetBlockAckTxTime (void) const;
409
416 static uint32_t GetMaxPsduSize (WifiModulationClass modulation);
417
428 std::list<uint8_t> GetBssMembershipSelectorList (void) const;
434 uint16_t GetNMcs (void) const;
443 std::list<WifiMode> GetMcsList (void) const;
453 std::list<WifiMode> GetMcsList (WifiModulationClass modulation) const;
464 WifiMode GetMcs (WifiModulationClass modulation, uint8_t mcs) const;
465
471 uint8_t GetChannelNumber (void) const;
475 Time GetChannelSwitchDelay (void) const;
476
482 virtual void ConfigureStandard (WifiStandard standard);
483
489 WifiStandard GetStandard (void) const;
490
496 WifiPhyBand GetPhyBand (void) const;
497
504
510 virtual Ptr<Channel> GetChannel (void) const = 0;
511
519 void NotifyTxBegin (WifiConstPsduMap psdus, double txPowerW);
526 void NotifyTxEnd (WifiConstPsduMap psdus);
541 void NotifyRxBegin (Ptr<const WifiPsdu> psdu, const RxPowerWattPerChannelBand& rxPowersW);
557
579 uint16_t channelFreqMhz,
580 WifiTxVector txVector,
581 SignalNoiseDbm signalNoise,
582 std::vector<bool> statusPerMpdu,
583 uint16_t staId = SU_STA_ID);
584
606 uint16_t channelFreqMhz,
607 WifiTxVector txVector,
608 MpduInfo aMpdu,
609 SignalNoiseDbm signalNoise,
610 uint16_t staId);
611
626 uint16_t channelFreqMhz,
627 WifiTxVector txVector,
628 uint16_t staId = SU_STA_ID);
629
643 typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
644 uint16_t channelFreqMhz,
645 WifiTxVector txVector,
646 MpduInfo aMpdu,
647 uint16_t staId);
648
655 typedef void (* PhyTxBeginTracedCallback)(Ptr<const Packet> packet, double txPowerW);
656
664 typedef void (* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW);
665
673
680 typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
681
690 virtual int64_t AssignStreams (int64_t stream);
691
699 void SetRxSensitivity (double threshold);
705 double GetRxSensitivity (void) const;
712 void SetCcaEdThreshold (double threshold);
718 double GetCcaEdThreshold (void) const;
725 void SetCcaSensitivityThreshold (double threshold);
731 double GetCcaSensitivityThreshold (void) const;
737 void SetRxNoiseFigure (double noiseFigureDb);
743 void SetTxPowerStart (double start);
749 double GetTxPowerStart (void) const;
755 void SetTxPowerEnd (double end);
761 double GetTxPowerEnd (void) const;
769 void SetNTxPower (uint8_t n);
775 uint8_t GetNTxPower (void) const;
781 void SetTxGain (double gain);
787 double GetTxGain (void) const;
793 void SetRxGain (double gain);
799 double GetRxGain (void) const;
800
806 void SetDevice (const Ptr<WifiNetDevice> device);
812 Ptr<WifiNetDevice> GetDevice (void) const;
833 Ptr<MobilityModel> GetMobility (void) const;
834
835 using ChannelTuple = std::tuple<uint8_t /* channel number */,
836 uint16_t /* channel width */,
837 int /* WifiPhyBand */,
838 uint8_t /* primary20 index*/>;
839
849 void SetOperatingChannel (const ChannelTuple& channelTuple);
853 uint16_t GetFrequency (void) const;
857 uint8_t GetPrimary20Index (void) const;
861 void SetNumberOfAntennas (uint8_t antennas);
865 uint8_t GetNumberOfAntennas (void) const;
869 void SetMaxSupportedTxSpatialStreams (uint8_t streams);
873 uint8_t GetMaxSupportedTxSpatialStreams (void) const;
877 void SetMaxSupportedRxSpatialStreams (uint8_t streams);
881 uint8_t GetMaxSupportedRxSpatialStreams (void) const;
887 void SetShortPhyPreambleSupported (bool preamble);
893 bool GetShortPhyPreambleSupported (void) const;
894
900 virtual void SetInterferenceHelper (const Ptr<InterferenceHelper> helper);
901
907 void SetErrorRateModel (const Ptr<ErrorRateModel> model);
925 void SetFrameCaptureModel (const Ptr<FrameCaptureModel> frameCaptureModel);
931 void SetPreambleDetectionModel (const Ptr<PreambleDetectionModel> preambleDetectionModel);
937 void SetWifiRadioEnergyModel (const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
938
942 uint16_t GetChannelWidth (void) const;
943
952 double GetPowerDbm (uint8_t power) const;
953
961 void ResetCca (bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
979
980
991 virtual WifiSpectrumBand ConvertHeRuSubcarriers (uint16_t bandWidth, uint16_t guardBandwidth,
992 HeRu::SubcarrierRange range, uint8_t bandIndex = 0) const;
993
1003 static void AddStaticPhyEntity (WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1004
1014
1028 Ptr<PhyEntity> GetPhyEntity (WifiStandard standard) const;
1029
1033 uint64_t GetPreviouslyRxPpduUid (void) const;
1034
1048 virtual uint16_t GetGuardBandwidth (uint16_t currentChannelWidth) const = 0;
1057 virtual std::tuple<double, double, double> GetTxMaskRejectionParams (void) const = 0;
1058
1065 uint8_t GetPrimaryChannelNumber (uint16_t primaryChannelWidth) const;
1066
1075 virtual WifiSpectrumBand GetBand (uint16_t bandWidth, uint8_t bandIndex = 0);
1076
1077protected:
1078 virtual void DoDispose (void);
1079
1083 void Reset (void);
1084
1098 virtual void DoChannelSwitch (void);
1099
1106 void SwitchMaybeToCcaBusy (const Ptr<const WifiPpdu> ppdu);
1113 void NotifyCcaBusy (const Ptr<const WifiPpdu> ppdu, Time duration);
1114
1125 void AddPhyEntity (WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1126
1128
1131
1134
1137
1139 std::map <std::pair<uint64_t /* UID*/, WifiPreamble>, Ptr<Event> > m_currentPreambleEvents;
1140
1142
1160 std::map<WifiModulationClass, Ptr<PhyEntity> > m_phyEntities;
1161
1162
1163private:
1168 void Configure80211a (void);
1173 void Configure80211b (void);
1178 void Configure80211g (void);
1183 void Configure80211p (void);
1188 void Configure80211n (void);
1193 void Configure80211ac (void);
1198 void Configure80211ax (void);
1203 void Configure80211be (void);
1214 void PushMcs (WifiMode mode);
1218 void RebuildMcsMap (void);
1219
1226
1234
1249
1257
1265
1273
1289
1297
1304
1317 TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, SignalNoiseDbm, uint16_t /* STA-ID*/> m_phyMonitorSniffRxTrace;
1318
1331 TracedCallback<Ptr<const Packet>, uint16_t /* frequency (MHz) */, WifiTxVector, MpduInfo, uint16_t /* STA-ID*/> m_phyMonitorSniffTxTrace;
1332
1340 static std::map<WifiModulationClass, Ptr<PhyEntity> > & GetStaticPhyEntities (void);
1341
1346
1352
1356
1357 double m_txGainDb;
1358 double m_rxGainDb;
1361 uint8_t m_nTxPower;
1363
1368
1373
1375
1377
1380
1386
1388};
1389
1395std::ostream& operator<< (std::ostream& os, RxSignalInfo rxSignalInfo);
1396
1397} //namespace ns3
1398
1399#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
A base class which provides memory management and object aggregation.
Definition: object.h:88
Abstract class for PHY entities.
Definition: phy-entity.h:96
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
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:50
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1139
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1130
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:1358
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:1379
bool IsStateIdle(void) const
Definition: wifi-phy.cc:1845
void(* PhyTxBeginTracedCallback)(Ptr< const Packet > packet, double txPowerW)
TracedCallback signature for Phy transmit events.
Definition: wifi-phy.h:655
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
Definition: wifi-phy.cc:594
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:1547
bool IsStateTx(void) const
Definition: wifi-phy.cc:1857
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1129
uint8_t GetChannelNumber(void) const
Return current channel number.
Definition: wifi-phy.cc:957
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:1383
virtual ~WifiPhy()
Definition: wifi-phy.cc:349
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:1376
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:1797
void SetCcaEdThreshold(double threshold)
Sets the CCA energy detection threshold (dBm).
Definition: wifi-phy.cc:448
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:1303
void NotifyCcaBusy(const Ptr< const WifiPpdu > ppdu, Time duration)
Notify PHY state helper to switch to CCA busy state,.
Definition: wifi-phy.cc:1906
WifiPhyOperatingChannel m_operatingChannel
Operating channel.
Definition: wifi-phy.h:1345
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:1264
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:1272
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
Definition: wifi-phy.cc:602
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:1344
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:1241
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:581
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1188
const WifiPhyOperatingChannel & GetOperatingChannel(void) const
Get a const reference to the operating channel.
Definition: wifi-phy.cc:945
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:2001
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:557
void NotifyTxEnd(WifiConstPsduMap psdus)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:1410
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:1139
Time m_slot
Slot duration.
Definition: wifi-phy.h:1348
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:1722
bool IsStateRx(void) const
Definition: wifi-phy.cc:1851
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:704
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:932
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1135
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:399
Ptr< WifiNetDevice > GetDevice(void) const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:569
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:1461
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:1737
WifiStandard GetStandard(void) const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:939
virtual void DoDispose(void)
Destructor implementation.
Definition: wifi-phy.cc:355
Time m_blockAckTxTime
estimated BlockAck TX time
Definition: wifi-phy.h:1351
uint8_t GetPrimaryChannelNumber(uint16_t primaryChannelWidth) const
Get channel number of the primary channel.
Definition: wifi-phy.cc:2034
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
Definition: wifi-phy.cc:752
std::list< uint8_t > GetBssMembershipSelectorList(void) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1206
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:1949
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:722
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted.
Definition: wifi-phy.cc:1913
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:1381
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1296
void NotifyRxBegin(Ptr< const WifiPsdu > psdu, const RxPowerWattPerChannelBand &rxPowersW)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:1437
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1157
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:505
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: wifi-phy.h:1347
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:411
virtual uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const =0
void(* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:664
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:877
uint8_t GetMaxSupportedRxSpatialStreams(void) const
Definition: wifi-phy.cc:1200
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:609
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:1832
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:1344
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1132
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1368
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
Definition: wifi-phy.cc:1887
Time GetBlockAckTxTime(void) const
Return the estimated BlockAck TX time for this PHY.
Definition: wifi-phy.cc:746
void Configure80211p(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard.
Definition: wifi-phy.cc:797
Time GetPifs(void) const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:734
static uint32_t GetMaxPsduSize(WifiModulationClass modulation)
Get the maximum PSDU size in bytes for the given modulation class.
Definition: wifi-phy.cc:1389
void NotifyTxBegin(WifiConstPsduMap psdus, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:1395
void Reset(void)
Reset data upon end of TX or RX.
Definition: wifi-phy.cc:1652
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:550
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:511
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-phy.cc:60
WifiPhyBand m_band
WifiPhyBand.
Definition: wifi-phy.h:1343
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
Definition: wifi-phy.cc:767
void SetSleepMode(void)
Put in sleep mode.
Definition: wifi-phy.cc:1221
void Configure80211be(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11be standard.
Definition: wifi-phy.cc:869
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:435
uint8_t GetPrimary20Index(void) const
Definition: wifi-phy.cc:969
static const Ptr< const PhyEntity > GetStaticPhyEntity(WifiModulationClass modulation)
Get the implemented PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:664
uint8_t GetMaxSupportedTxSpatialStreams(void) const
Definition: wifi-phy.cc:1182
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:643
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
Definition: wifi-phy.cc:784
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:1331
Time GetChannelSwitchDelay(void) const
Definition: wifi-phy.cc:652
virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t bandWidth, uint16_t guardBandwidth, HeRu::SubcarrierRange range, uint8_t bandIndex=0) const
Definition: wifi-phy.cc:1683
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:1160
virtual void StartTx(Ptr< const WifiPpdu > ppdu)=0
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:694
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:1317
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:1384
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:492
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1136
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:1541
uint16_t GetNMcs(void) const
Definition: wifi-phy.cc:1783
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:716
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:975
double m_ccaSensitivityThresholdW
Clear channel assessment (CCA) modulation and coding rate sensitivity threshold in watts.
Definition: wifi-phy.h:1355
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:1138
void SetCcaSensitivityThreshold(double threshold)
Sets the CCA sensitivity threshold (dBm).
Definition: wifi-phy.cc:461
double m_ccaEdThresholdW
Clear channel assessment (CCA) energy detection (ED) threshold in watts.
Definition: wifi-phy.h:1354
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:1510
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:672
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:2008
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium.
Definition: wifi-phy.h:1256
void ResumeFromSleep(void)
Resume from sleep mode.
Definition: wifi-phy.cc:1270
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
Definition: wifi-phy.h:1141
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard.
Definition: wifi-phy.cc:846
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1133
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:628
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:563
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:1702
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:1382
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-phy.cc:1151
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:498
virtual std::tuple< double, double, double > GetTxMaskRejectionParams(void) const =0
static std::map< WifiModulationClass, Ptr< PhyEntity > > & GetStaticPhyEntities(void)
Definition: wifi-phy.cc:392
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:686
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:605
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:1449
void StartReceivePreamble(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:1665
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:1748
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:1248
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:1357
Time GetDelayUntilIdle(void)
Definition: wifi-phy.cc:1881
uint64_t GetPreviouslyRxPpduUid(void) const
Definition: wifi-phy.cc:1646
WifiStandard m_standard
WifiStandard.
Definition: wifi-phy.h:1342
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:634
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:1361
double m_noiseFigureDb
The noise figure in dB.
Definition: wifi-phy.h:1374
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:622
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:728
Time GetSifs(void) const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:710
static Time GetStartOfPacketDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1338
Time GetAckTxTime(void) const
Return the estimated Ack TX time for this PHY.
Definition: wifi-phy.cc:740
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:423
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:537
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:575
double GetRxGain(void) const
Return the reception gain (dB).
Definition: wifi-phy.cc:544
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:524
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:1255
double CalculateSnr(const WifiTxVector &txVector, double ber) const
Definition: wifi-phy.cc:658
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard.
Definition: wifi-phy.cc:827
void(* PhyRxBeginTracedCallback)(Ptr< const Packet > packet, RxPowerWattPerChannelBand rxPowersW)
TracedCallback signature for PhyRxBegin trace source.
Definition: wifi-phy.h:672
bool IsStateSwitching(void) const
Definition: wifi-phy.cc:1863
double GetTxGain(void) const
Return the transmission gain (dB).
Definition: wifi-phy.cc:531
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:518
Time GetDelayUntilChannelSwitch(void)
Perform any actions necessary when user changes operating channel after initialization.
Definition: wifi-phy.cc:1014
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:1692
double GetCcaEdThreshold(void) const
Return the CCA energy detection threshold (dBm).
Definition: wifi-phy.cc:455
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:442
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:417
Ptr< WifiNetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:1378
Ptr< InterferenceHelper > m_interference
Pointer to a helper responsible for interference computations.
Definition: wifi-phy.h:1127
bool IsStateSleep(void) const
Definition: wifi-phy.cc:1869
bool IsStateCcaBusy(void) const
Definition: wifi-phy.cc:1839
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:1349
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:474
double GetTxPowerForTransmission(Ptr< const WifiPpdu > ppdu) const
Compute the transmit power for the next transmission.
Definition: wifi-phy.cc:1968
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:680
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:429
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:405
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:616
void ResumeFromOff(void)
Resume from off mode.
Definition: wifi-phy.cc:1301
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard.
Definition: wifi-phy.cc:854
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:1387
virtual Ptr< Channel > GetChannel(void) const =0
Return the Channel this WifiPhy is connected to.
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:1473
virtual void DoChannelSwitch(void)
Actually switch channel based on the stored channel settings.
Definition: wifi-phy.cc:1065
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:1288
static Time GetPreambleDetectionDuration(void)
Definition: wifi-phy.cc:1332
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Definition: wifi-phy.h:838
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:1385
void SwitchMaybeToCcaBusy(const Ptr< const WifiPpdu > ppdu)
Check if PHY state should move to CCA busy state based on current state of interference tracker.
Definition: wifi-phy.cc:1899
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:1353
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Definition: wifi-phy.cc:1893
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:963
bool IsStateOff(void) const
Definition: wifi-phy.cc:1875
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:485
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:2017
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1362
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:1709
uint16_t GetFrequency(void) const
Definition: wifi-phy.cc:951
Time m_ackTxTime
estimated Ack TX time
Definition: wifi-phy.h:1350
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:1425
double GetCcaSensitivityThreshold(void) const
Return the CCA sensitivity threshold (dBm).
Definition: wifi-phy.cc:468
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:77
mobility
Definition: third.py:98
def start()
Definition: core.py:1852
Declaration of:
MpduInfo structure.
Definition: phy-entity.h:62
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:69
SignalNoiseDbm structure.
Definition: phy-entity.h:55
#define SU_STA_ID
Definition: wifi-mode.h:32