A Discrete-Event Network Simulator
API
wifi-phy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 * Sébastien Deronne <sebastien.deronne@gmail.com>
19 */
20
21#ifndef WIFI_PHY_H
22#define WIFI_PHY_H
23
24#include "phy-entity.h"
27#include "wifi-standards.h"
28
29#include "ns3/error-model.h"
30
31namespace ns3
32{
33
34class Channel;
35class WifiNetDevice;
36class MobilityModel;
37class WifiPhyStateHelper;
38class FrameCaptureModel;
39class PreambleDetectionModel;
40class WifiRadioEnergyModel;
41class UniformRandomVariable;
42class InterferenceHelper;
43class ErrorRateModel;
44
50class WifiPhy : public Object
51{
52 public:
53 friend class PhyEntity;
58 static TypeId GetTypeId();
59
60 WifiPhy();
61 ~WifiPhy() override;
62
69
80
87 void RegisterListener(WifiPhyListener* listener);
94 void UnregisterListener(WifiPhyListener* listener);
95
100
109 RxPowerWattPerChannelBand& rxPowersW,
110 Time rxDuration);
111
116 void EndReceiveInterBss();
117
128 const WifiTxVector& txVector);
129
142 void Send(Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
150 void Send(WifiConstPsduMap psdus, const WifiTxVector& txVector);
151
156 virtual void StartTx(Ptr<const WifiPpdu> ppdu, const WifiTxVector& txVector) = 0;
157
161 void SetSleepMode();
165 void ResumeFromSleep();
169 void SetOffMode();
173 void ResumeFromOff();
174
178 bool IsStateIdle() const;
182 bool IsStateCcaBusy() const;
186 bool IsStateRx() const;
190 bool IsStateTx() const;
194 bool IsStateSwitching() const;
198 bool IsStateSleep() const;
202 bool IsStateOff() const;
203
211
217 Time GetLastRxStartTime() const;
223 Time GetLastRxEndTime() const;
224
234 const WifiTxVector& txVector,
235 WifiPhyBand band,
236 uint16_t staId = SU_STA_ID);
252 const WifiTxVector& txVector,
253 WifiPhyBand band);
262 const WifiTxVector& txVector,
263 WifiPhyBand band);
264
286 static Time GetPayloadDuration(uint32_t size,
287 const WifiTxVector& txVector,
288 WifiPhyBand band,
289 MpduType mpdutype = NORMAL_MPDU,
290 uint16_t staId = SU_STA_ID);
308 static Time GetPayloadDuration(uint32_t size,
309 const WifiTxVector& txVector,
310 WifiPhyBand band,
311 MpduType mpdutype,
312 bool incFlag,
313 uint32_t& totalAmpduSize,
314 double& totalAmpduNumSymbols,
315 uint16_t staId);
321 static Time GetStartOfPacketDuration(const WifiTxVector& txVector);
322
337 std::list<WifiMode> GetModeList() const;
347 std::list<WifiMode> GetModeList(WifiModulationClass modulation) const;
356 bool IsModeSupported(WifiMode mode) const;
364 WifiMode GetDefaultMode() const;
374 bool IsMcsSupported(WifiModulationClass modulation, uint8_t mcs) const;
375
383 double CalculateSnr(const WifiTxVector& txVector, double ber) const;
384
390 void SetSifs(Time sifs);
396 Time GetSifs() const;
402 void SetSlot(Time slot);
408 Time GetSlot() const;
414 void SetPifs(Time pifs);
420 Time GetPifs() const;
426 Time GetAckTxTime() const;
432 Time GetBlockAckTxTime() const;
433
441
452 std::list<uint8_t> GetBssMembershipSelectorList() const;
458 uint16_t GetNMcs() const;
467 std::list<WifiMode> GetMcsList() const;
477 std::list<WifiMode> GetMcsList(WifiModulationClass modulation) const;
488 WifiMode GetMcs(WifiModulationClass modulation, uint8_t mcs) const;
489
495 uint8_t GetChannelNumber() const;
500
506 virtual void ConfigureStandard(WifiStandard standard);
507
514
520 WifiPhyBand GetPhyBand() const;
521
528
534 virtual Ptr<Channel> GetChannel() const = 0;
535
543 void NotifyTxBegin(WifiConstPsduMap psdus, double txPowerW);
550 void NotifyTxEnd(WifiConstPsduMap psdus);
581
604 uint16_t channelFreqMhz,
605 WifiTxVector txVector,
606 SignalNoiseDbm signalNoise,
607 std::vector<bool> statusPerMpdu,
608 uint16_t staId = SU_STA_ID);
609
632 uint16_t channelFreqMhz,
633 WifiTxVector txVector,
634 MpduInfo aMpdu,
635 SignalNoiseDbm signalNoise,
636 uint16_t staId);
637
652 uint16_t channelFreqMhz,
653 WifiTxVector txVector,
654 uint16_t staId = SU_STA_ID);
655
670 typedef void (*MonitorSnifferTxCallback)(const Ptr<const Packet> packet,
671 uint16_t channelFreqMhz,
672 WifiTxVector txVector,
673 MpduInfo aMpdu,
674 uint16_t staId);
675
682 typedef void (*PhyTxBeginTracedCallback)(Ptr<const Packet> packet, double txPowerW);
683
691 typedef void (*PsduTxBeginCallback)(WifiConstPsduMap psduMap,
692 WifiTxVector txVector,
693 double txPowerW);
694
702 RxPowerWattPerChannelBand rxPowersW);
703
710 typedef void (*PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
711
720 virtual int64_t AssignStreams(int64_t stream);
721
729 void SetRxSensitivity(double threshold);
735 double GetRxSensitivity() const;
742 void SetCcaEdThreshold(double threshold);
748 double GetCcaEdThreshold() const;
755 void SetCcaSensitivityThreshold(double threshold);
761 double GetCcaSensitivityThreshold() const;
767 void SetRxNoiseFigure(double noiseFigureDb);
773 void SetTxPowerStart(double start);
779 double GetTxPowerStart() const;
785 void SetTxPowerEnd(double end);
791 double GetTxPowerEnd() const;
799 void SetNTxPower(uint8_t n);
805 uint8_t GetNTxPower() const;
811 void SetTxGain(double gain);
817 double GetTxGain() const;
823 void SetRxGain(double gain);
829 double GetRxGain() const;
830
836 void SetDevice(const Ptr<WifiNetDevice> device);
864
866 std::tuple<uint8_t /* channel number */,
867 uint16_t /* channel width */,
868 int /* WifiPhyBand */,
869 uint8_t /* primary20 index*/>;
870
880 void SetOperatingChannel(const ChannelTuple& channelTuple);
887 void SetFixedPhyBand(bool enable);
891 bool HasFixedPhyBand() const;
895 uint16_t GetFrequency() const;
899 uint8_t GetPrimary20Index() const;
903 void SetNumberOfAntennas(uint8_t antennas);
907 uint8_t GetNumberOfAntennas() const;
911 void SetMaxSupportedTxSpatialStreams(uint8_t streams);
915 uint8_t GetMaxSupportedTxSpatialStreams() const;
919 void SetMaxSupportedRxSpatialStreams(uint8_t streams);
923 uint8_t GetMaxSupportedRxSpatialStreams() const;
929 void SetShortPhyPreambleSupported(bool preamble);
935 bool GetShortPhyPreambleSupported() const;
936
942 virtual void SetInterferenceHelper(const Ptr<InterferenceHelper> helper);
943
949 void SetErrorRateModel(const Ptr<ErrorRateModel> model);
967 void SetFrameCaptureModel(const Ptr<FrameCaptureModel> frameCaptureModel);
973 void SetPreambleDetectionModel(const Ptr<PreambleDetectionModel> preambleDetectionModel);
979 void SetWifiRadioEnergyModel(const Ptr<WifiRadioEnergyModel> wifiRadioEnergyModel);
980
984 uint16_t GetChannelWidth() const;
985
994 double GetPowerDbm(uint8_t power) const;
995
1004 void ResetCca(bool powerRestricted, double txPowerMaxSiso = 0, double txPowerMaxMimo = 0);
1022
1034 virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t bandWidth,
1035 uint16_t guardBandwidth,
1037 uint8_t bandIndex = 0) const;
1038
1048 static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1049
1059
1074
1078 uint64_t GetPreviouslyRxPpduUid() const;
1079
1093 virtual uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const = 0;
1102 virtual std::tuple<double, double, double> GetTxMaskRejectionParams() const = 0;
1103
1110 uint8_t GetPrimaryChannelNumber(uint16_t primaryChannelWidth) const;
1111
1120 virtual WifiSpectrumBand GetBand(uint16_t bandWidth, uint8_t bandIndex = 0);
1121
1122 protected:
1123 void DoDispose() override;
1124
1128 void Reset();
1129
1143 virtual void DoChannelSwitch();
1144
1158 void NotifyCcaBusy(const Ptr<const WifiPpdu> ppdu, Time duration);
1159
1170 void AddPhyEntity(WifiModulationClass modulation, Ptr<PhyEntity> phyEntity);
1171
1174
1177
1182
1185
1187 std::map<std::pair<uint64_t /* UID*/, WifiPreamble>, Ptr<Event>>
1190
1193
1211 std::map<WifiModulationClass, Ptr<PhyEntity>> m_phyEntities;
1212
1213 private:
1218 void Configure80211a();
1223 void Configure80211b();
1228 void Configure80211g();
1233 void Configure80211p();
1238 void Configure80211n();
1243 void Configure80211ac();
1248 void Configure80211ax();
1253 void Configure80211be();
1264 void PushMcs(WifiMode mode);
1269
1276
1284
1299
1307
1315
1323
1339
1347
1354
1368 uint16_t /* frequency (MHz) */,
1370 MpduInfo,
1372 uint16_t /* STA-ID*/>
1374
1388 uint16_t /* frequency (MHz) */,
1390 MpduInfo,
1391 uint16_t /* STA-ID*/>
1393
1401 static std::map<WifiModulationClass, Ptr<PhyEntity>>& GetStaticPhyEntities();
1402
1408
1414
1420
1421 double m_txGainDb;
1422 double m_rxGainDb;
1425 uint8_t m_nTxPower;
1427
1429 double
1431 double
1435
1440
1442
1444
1447
1453
1455};
1456
1462std::ostream& operator<<(std::ostream& os, RxSignalInfo rxSignalInfo);
1463
1464} // namespace ns3
1465
1466#endif /* WIFI_PHY_H */
An identifier for simulation events.
Definition: event-id.h:55
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
Definition: he-ru.h:52
A base class which provides memory management and object aggregation.
Definition: object.h:89
Abstract class for PHY entities.
Definition: phy-entity.h:97
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:60
represent a single transmission mode
Definition: wifi-mode.h:50
802.11 PHY layer model
Definition: wifi-phy.h:51
static TypeId GetTypeId()
Get the type ID.
Definition: wifi-phy.cc:62
void SetNumberOfAntennas(uint8_t antennas)
Definition: wifi-phy.cc:1175
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Definition: wifi-phy.h:1176
Time GetBlockAckTxTime() const
Return the estimated BlockAck TX time for this PHY.
Definition: wifi-phy.cc:764
double GetCcaEdThreshold() const
Return the CCA energy detection threshold (dBm).
Definition: wifi-phy.cc:467
double m_rxGainDb
Reception gain (dB)
Definition: wifi-phy.h:1422
bool IsStateTx() const
Definition: wifi-phy.cc:1956
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
Definition: wifi-phy.h:1446
void(* PhyTxBeginTracedCallback)(Ptr< const Packet > packet, double txPowerW)
TracedCallback signature for Phy transmit events.
Definition: wifi-phy.h:682
bool IsStateIdle() const
Definition: wifi-phy.cc:1944
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
Definition: wifi-phy.cc:606
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
Definition: wifi-phy.h:1438
bool IsStateCcaBusy() const
Definition: wifi-phy.cc:1938
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:1635
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Definition: wifi-phy.h:1175
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
Definition: wifi-phy.h:1450
void Configure80211ax()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard.
Definition: wifi-phy.cc:872
Time m_channelSwitchDelay
Time required to switch between channel.
Definition: wifi-phy.h:1443
void SetCcaEdThreshold(double threshold)
Sets the CCA energy detection threshold (dBm).
Definition: wifi-phy.cc:460
void NotifyCcaBusy(const Ptr< const WifiPpdu > ppdu, Time duration)
Notify PHY state helper to switch to CCA busy state,.
Definition: wifi-phy.cc:2005
WifiPhyOperatingChannel m_operatingChannel
Operating channel.
Definition: wifi-phy.h:1406
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:1314
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
Definition: wifi-phy.cc:614
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
Definition: wifi-phy.h:1433
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:1375
Time GetSlot() const
Return the slot duration for this PHY.
Definition: wifi-phy.cc:740
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1225
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:2108
void Configure80211g()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
Definition: wifi-phy.cc:802
uint8_t GetPrimary20Index() const
Definition: wifi-phy.cc:986
void NotifyTxEnd(WifiConstPsduMap psdus)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:1472
uint16_t GetChannelWidth() const
Definition: wifi-phy.cc:980
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:1188
uint8_t GetNumberOfAntennas() const
Definition: wifi-phy.cc:1187
Time m_slot
Slot duration.
Definition: wifi-phy.h:1410
double m_powerDensityLimit
the power density limit (dBm/MHz)
Definition: wifi-phy.h:1426
Time GetDelayUntilIdle()
Definition: wifi-phy.cc:1980
double GetRxSensitivity() const
Return the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:454
bool GetShortPhyPreambleSupported() const
Return whether short PHY preamble is supported.
Definition: wifi-phy.cc:569
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:722
std::list< uint8_t > GetBssMembershipSelectorList() const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
Definition: wifi-phy.cc:1243
void Configure80211n()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard.
Definition: wifi-phy.cc:845
EventId m_endPhyRxEvent
the end of PHY receive event
Definition: wifi-phy.h:1183
double GetTxGain() const
Return the transmission gain (dB).
Definition: wifi-phy.cc:543
double m_txPowerBaseDbm
Minimum transmission power (dBm)
Definition: wifi-phy.h:1423
Time GetDelayUntilChannelSwitch()
Perform any actions necessary when user changes operating channel after initialization.
Definition: wifi-phy.cc:1043
void Configure80211be()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11be standard.
Definition: wifi-phy.cc:887
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:1523
bool IsStateRx() const
Definition: wifi-phy.cc:1950
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:1836
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
Definition: wifi-phy.cc:728
uint16_t GetFrequency() const
Definition: wifi-phy.cc:968
Ptr< MobilityModel > GetMobility() const
Return the mobility model this PHY is associated with.
Definition: wifi-phy.cc:593
uint16_t GetNMcs() const
Definition: wifi-phy.cc:1882
Time m_blockAckTxTime
estimated BlockAck TX time
Definition: wifi-phy.h:1413
uint8_t GetPrimaryChannelNumber(uint16_t primaryChannelWidth) const
Get channel number of the primary channel.
Definition: wifi-phy.cc:2142
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:2049
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:1432
void ResumeFromSleep()
Resume from sleep mode.
Definition: wifi-phy.cc:1307
static Time GetPreambleDetectionDuration()
Definition: wifi-phy.cc:1363
void Configure80211p()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard.
Definition: wifi-phy.cc:815
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted.
Definition: wifi-phy.cc:2012
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Definition: wifi-phy.h:1448
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1346
void NotifyRxBegin(Ptr< const WifiPsdu > psdu, const RxPowerWattPerChannelBand &rxPowersW)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:1499
Time GetChannelSwitchDelay() const
Definition: wifi-phy.cc:665
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
Definition: wifi-phy.cc:1193
Time m_sifs
Short Interframe Space (SIFS) duration.
Definition: wifi-phy.h:1409
void SetReceiveErrorCallback(RxErrorCallback callback)
Definition: wifi-phy.cc:423
virtual uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const =0
void ConfigureHtDeviceMcsSet()
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
bool IsStateOff() const
Definition: wifi-phy.cc:1974
uint8_t GetMaxSupportedRxSpatialStreams() const
Definition: wifi-phy.cc:1237
void(* PsduTxBeginCallback)(WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
TracedCallback signature for PSDU transmit events.
Definition: wifi-phy.h:691
double GetTxPowerEnd() const
Return the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:517
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:895
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
Definition: wifi-phy.cc:621
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:1931
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
uint8_t m_numberOfAntennas
Number of transmitters.
Definition: wifi-phy.h:1437
ChannelTuple m_channelSettings
Store operating channel settings until initialization.
Definition: wifi-phy.h:1405
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1178
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:1422
static uint32_t GetMaxPsduSize(WifiModulationClass modulation)
Get the maximum PSDU size in bytes for the given modulation class.
Definition: wifi-phy.cc:1451
Ptr< WifiPhyStateHelper > GetState() const
Return the WifiPhyStateHelper of this PHY.
Definition: wifi-phy.cc:411
virtual Ptr< Channel > GetChannel() const =0
Return the Channel this WifiPhy is connected to.
void NotifyTxBegin(WifiConstPsduMap psdus, double txPowerW)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:1457
void EndReceiveInterBss()
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Definition: wifi-phy.cc:1790
void SetSleepMode()
Put in sleep mode.
Definition: wifi-phy.cc:1258
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
Definition: wifi-phy.cc:562
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:523
WifiPhyBand m_band
WifiPhyBand.
Definition: wifi-phy.h:1404
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Definition: wifi-phy.cc:447
static const Ptr< const PhyEntity > GetStaticPhyEntity(WifiModulationClass modulation)
Get the implemented PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:677
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:670
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:1392
virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t bandWidth, uint16_t guardBandwidth, HeRu::SubcarrierRange range, uint8_t bandIndex=0) const
Definition: wifi-phy.cc:1779
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
Definition: wifi-phy.h:1430
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
Definition: wifi-phy.h:1211
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:709
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:1373
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
Definition: wifi-phy.h:1451
EventId m_endTxEvent
the end of transmit event
Definition: wifi-phy.h:1184
double GetRxGain() const
Return the reception gain (dB).
Definition: wifi-phy.cc:556
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:1629
static std::map< WifiModulationClass, Ptr< PhyEntity > > & GetStaticPhyEntities()
Definition: wifi-phy.cc:404
void SetSlot(Time slot)
Set the slot duration for this PHY.
Definition: wifi-phy.cc:734
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:1004
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
Definition: wifi-phy.cc:950
double m_ccaSensitivityThresholdW
Clear channel assessment (CCA) modulation and coding rate sensitivity threshold in watts.
Definition: wifi-phy.h:1418
Ptr< Event > m_currentEvent
Hold the current event.
Definition: wifi-phy.h:1186
Time GetLastRxStartTime() const
Return the start time of the last received packet.
Definition: wifi-phy.cc:1986
WifiMode GetDefaultMode() const
Get the default WifiMode supported by the PHY.
Definition: wifi-phy.cc:1820
void SetCcaSensitivityThreshold(double threshold)
Sets the CCA sensitivity threshold (dBm).
Definition: wifi-phy.cc:473
double m_ccaEdThresholdW
Clear channel assessment (CCA) energy detection (ED) threshold in watts.
Definition: wifi-phy.h:1416
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:1589
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:685
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:2115
uint8_t GetChannelNumber() const
Return current channel number.
Definition: wifi-phy.cc:974
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium.
Definition: wifi-phy.h:1306
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
Definition: wifi-phy.h:1191
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU.
Definition: wifi-phy.h:1180
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
Definition: wifi-phy.cc:640
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:1291
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:575
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
Definition: wifi-phy.h:1449
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:510
Time GetPifs() const
Return the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:752
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:699
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:631
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:1511
void StartReceivePreamble(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
Definition: wifi-phy.cc:1758
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:1298
double m_txGainDb
Transmission gain (dB)
Definition: wifi-phy.h:1421
bool IsStateSleep() const
Definition: wifi-phy.cc:1968
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition: wifi-phy.cc:581
WifiStandard m_standard
WifiStandard.
Definition: wifi-phy.h:1403
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
Definition: wifi-phy.cc:646
uint8_t m_nTxPower
Number of available transmission power levels.
Definition: wifi-phy.h:1425
void DoDispose() override
Destructor implementation.
Definition: wifi-phy.cc:367
bool IsStateSwitching() const
Definition: wifi-phy.cc:1962
virtual void DoChannelSwitch()
Actually switch channel based on the stored channel settings.
Definition: wifi-phy.cc:1094
void SetOffMode()
Put in off mode.
Definition: wifi-phy.cc:1292
double m_noiseFigureDb
The noise figure in dB.
Definition: wifi-phy.h:1441
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:1353
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:634
void RebuildMcsMap()
Rebuild the mapping of MCS values to indices in the device MCS set.
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
Definition: wifi-phy.cc:746
void Configure80211b()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
Definition: wifi-phy.cc:785
static Time GetStartOfPacketDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1369
void UnregisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:435
void SetRxGain(double gain)
Sets the reception gain (dB).
Definition: wifi-phy.cc:549
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
Definition: wifi-phy.cc:587
void SetTxGain(double gain)
Sets the transmission gain (dB).
Definition: wifi-phy.cc:536
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Definition: wifi-phy.h:1439
double m_txPowerEndDbm
Maximum transmission power (dBm)
Definition: wifi-phy.h:1424
double CalculateSnr(const WifiTxVector &txVector, double ber) const
Definition: wifi-phy.cc:671
void SetFixedPhyBand(bool enable)
Configure whether it is prohibited to change PHY band after initialization.
Definition: wifi-phy.cc:992
void(* PhyRxBeginTracedCallback)(Ptr< const Packet > packet, RxPowerWattPerChannelBand rxPowersW)
TracedCallback signature for PhyRxBegin trace source.
Definition: wifi-phy.h:701
~WifiPhy() override
Definition: wifi-phy.cc:361
void Configure80211ac()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard.
Definition: wifi-phy.cc:864
bool HasFixedPhyBand() const
Definition: wifi-phy.cc:998
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:1322
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:429
Ptr< WifiNetDevice > m_device
Pointer to the device.
Definition: wifi-phy.h:1445
Ptr< InterferenceHelper > m_interference
Pointer to a helper responsible for interference computations.
Definition: wifi-phy.h:1173
bool m_shortPreamble
Flag if short PHY preamble is supported.
Definition: wifi-phy.h:1436
Time m_pifs
PCF Interframe Space (PIFS) duration.
Definition: wifi-phy.h:1411
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:486
double GetTxPowerStart() const
Return the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:504
double GetTxPowerForTransmission(Ptr< const WifiPpdu > ppdu) const
Compute the transmit power for the next transmission.
Definition: wifi-phy.cc:2072
void(* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration)
TracedCallback signature for start of PSDU reception events.
Definition: wifi-phy.h:710
WifiStandard GetStandard() const
Get the configured Wi-Fi standard.
Definition: wifi-phy.cc:956
void SetCapabilitiesChangedCallback(Callback< void > callback)
Definition: wifi-phy.cc:441
void SetReceiveOkCallback(RxOkCallback callback)
Definition: wifi-phy.cc:417
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
Definition: wifi-phy.cc:628
void NotifyChannelAccessRequested()
Notify the PHY that an access to the channel was requested.
Definition: wifi-phy.cc:1800
void ResumeFromOff()
Resume from off mode.
Definition: wifi-phy.cc:1335
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Definition: wifi-phy.h:1428
virtual std::tuple< double, double, double > GetTxMaskRejectionParams() const =0
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Definition: wifi-phy.h:1454
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:1535
Time GetAckTxTime() const
Return the estimated Ack TX time for this PHY.
Definition: wifi-phy.cc:758
uint64_t GetPreviouslyRxPpduUid() const
Definition: wifi-phy.cc:1739
void Reset()
Reset data upon end of TX or RX.
Definition: wifi-phy.cc:1745
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Definition: wifi-phy.h:1338
Time GetLastRxEndTime() const
Return the end time of the last received packet.
Definition: wifi-phy.cc:1992
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Definition: wifi-phy.h:869
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
Definition: wifi-phy.h:1452
uint8_t GetMaxSupportedTxSpatialStreams() const
Definition: wifi-phy.cc:1219
void Configure80211a()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
Definition: wifi-phy.cc:770
std::list< WifiMode > GetMcsList() const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Definition: wifi-phy.cc:1896
std::list< WifiMode > GetModeList() const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
Definition: wifi-phy.cc:1847
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:1998
virtual void StartTx(Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector)=0
double m_rxSensitivityW
Receive sensitivity threshold in watts.
Definition: wifi-phy.h:1415
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
Definition: wifi-phy.cc:962
double GetCcaSensitivityThreshold() const
Return the CCA sensitivity threshold (dBm).
Definition: wifi-phy.cc:480
bool m_fixedPhyBand
True to prohibit changing PHY band after initialization.
Definition: wifi-phy.h:1407
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:497
uint8_t GetNTxPower() const
Return the number of available transmission power levels.
Definition: wifi-phy.cc:530
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:2124
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
Definition: wifi-phy.cc:1415
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
Definition: wifi-phy.cc:1807
Time m_ackTxTime
estimated Ack TX time
Definition: wifi-phy.h:1412
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:1487
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:129
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Definition: phy-entity.h:78
mobility
Definition: third.py:96
def start()
Definition: core.py:1861
Declaration of:
MpduInfo structure.
Definition: phy-entity.h:63
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:70
SignalNoiseDbm structure.
Definition: phy-entity.h:56
#define SU_STA_ID
Definition: wifi-mode.h:34