22#include "ns3/attribute-container.h"
23#include "ns3/channel.h"
24#include "ns3/dsss-phy.h"
25#include "ns3/eht-phy.h"
26#include "ns3/erp-ofdm-phy.h"
27#include "ns3/error-model.h"
28#include "ns3/ht-configuration.h"
30#include "ns3/mobility-model.h"
31#include "ns3/pointer.h"
32#include "ns3/random-variable-stream.h"
33#include "ns3/simulator.h"
34#include "ns3/string.h"
36#include "ns3/vht-configuration.h"
41#undef NS_LOG_APPEND_CONTEXT
42#define NS_LOG_APPEND_CONTEXT \
43 WIFI_PHY_NS_LOG_APPEND_CONTEXT( \
44 (m_device && (m_device->GetNPhys() > m_phyId) && m_device->GetPhy(m_phyId) \
45 ? m_device->GetPhy(m_phyId) \
66 .AddAttribute(
"Channel",
67 "The channel attached to this PHY",
74 "A vector of tuple {channel number, channel width (MHz), PHY band, primary20 "
76 "describing the settings of the operating channel for each segment. "
77 "The primary20 index (only the value set for the first segment is used) "
78 "is the index of the primary 20 MHz channel within the operating channel "
79 "(0 indicates the 20 MHz subchannel with the lowest center frequency) and "
80 "is only valid if the width of the operating channel is a multiple of 20 MHz. "
81 "If the standard for this object has not been set yet, the value of this "
82 "attribute is saved and will be used to set the operating channel when the "
83 "standard is configured. If the PHY band is left unspecified, the default "
84 "band for the configured standard is used. If the channel width and the "
85 "channel number are both 0, the default channel width for the configured "
86 "standard and band are used. If the channel number is 0, the default "
87 "channel number for the configured standard, band and channel width is used. "
88 "Note that the channel width can be left unspecified (0) if the channel "
89 "number uniquely identify a frequency channel for the given standard and band.",
112 .AddAttribute(
"Frequency",
113 "The center frequency (MHz) of the current operating channel.",
118 .AddAttribute(
"ChannelNumber",
119 "The channel number of the current operating channel.",
126 "The width in MHz of the current operating channel (5, 10, 20, 22, 40, 80, 160 or "
127 "320). If 80+80MHz is used, this corresponds to the total channel width, hence 160 "
135 "The index of the primary 20 MHz channel within the current operating channel "
136 "(0 indicates the 20 MHz subchannel with the lowest center frequency).",
140 .AddAttribute(
"FixedPhyBand",
141 "If set to true, changing PHY band is prohibited after initialization.",
147 "The maximum width supported by the radio. It is not possible to configure an "
148 "operating channel with a total width larger than this value. A value of 0 means "
156 "The energy of a received signal should be higher than "
157 "this threshold (dBm) for the PHY to detect the signal. "
158 "This threshold refers to a width of 20 MHz and will be "
159 "scaled to match the width of the received signal.",
165 "The energy of all received signals should be higher than "
166 "this threshold (dBm) in the primary channel to allow the PHY layer "
167 "to declare CCA BUSY state.",
171 .AddAttribute(
"CcaSensitivity",
172 "The energy of a received wifi signal should be higher than "
173 "this threshold (dBm) in the primary channel to allow the PHY layer "
174 "to declare CCA BUSY state.",
179 .AddAttribute(
"TxGain",
180 "Transmission gain (dB).",
184 .AddAttribute(
"RxGain",
185 "Reception gain (dB).",
189 .AddAttribute(
"TxPowerLevels",
190 "Number of transmission power levels available between "
191 "TxPowerStart and TxPowerEnd included.",
195 .AddAttribute(
"TxPowerEnd",
196 "Maximum available transmission level (dBm).",
200 .AddAttribute(
"TxPowerStart",
201 "Minimum available transmission level (dBm).",
202 DoubleValue(16.0206),
207 "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
208 " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
209 "\"the difference in decibels (dB) between"
210 " the noise output of the actual receiver to the noise output of an "
211 " ideal receiver with the same overall gain and bandwidth when the receivers "
212 " are connected to sources at the standard noise temperature T0 (usually 290 K)\".",
216 .AddAttribute(
"State",
217 "The state of the PHY layer.",
221 .AddAttribute(
"ChannelSwitchDelay",
222 "Delay between two short frames transmitted on different frequencies.",
228 "The number of antennas on the device.",
232 .AddAttribute(
"MaxSupportedTxSpatialStreams",
233 "The maximum number of supported TX spatial streams."
234 "This parameter is only valuable for 802.11n/ac/ax STAs and APs.",
239 .AddAttribute(
"MaxSupportedRxSpatialStreams",
240 "The maximum number of supported RX spatial streams."
241 "This parameter is only valuable for 802.11n/ac/ax STAs and APs.",
246 .AddAttribute(
"ShortPlcpPreambleSupported",
247 "Whether or not short PHY preamble is supported."
248 "This parameter is only valuable for 802.11b STAs and APs."
249 "Note: 802.11g APs and STAs always support short PHY preamble.",
254 .AddAttribute(
"FrameCaptureModel",
255 "Ptr to an object that implements the frame capture model",
259 .AddAttribute(
"PreambleDetectionModel",
260 "Ptr to an object that implements the preamble detection model",
264 .AddAttribute(
"PostReceptionErrorModel",
265 "An optional packet error model can be added to the receive "
266 "packet process after any propagation-based (SNR-based) error "
267 "models have been applied. Typically this is used to force "
268 "specific packet drops, for testing purposes.",
272 .AddAttribute(
"InterferenceHelper",
273 "Ptr to an object that implements the interference helper",
277 .AddAttribute(
"Sifs",
278 "The duration of the Short Interframe Space. "
279 "NOTE that the default value is overwritten by the value defined "
280 "by the standard; if you want to set this attribute, you have to "
281 "do it after that the PHY object is initialized.",
285 .AddAttribute(
"Slot",
286 "The duration of a slot. "
287 "NOTE that the default value is overwritten by the value defined "
288 "by the standard; if you want to set this attribute, you have to "
289 "do it after that the PHY object is initialized.",
293 .AddAttribute(
"Pifs",
294 "The duration of the PCF Interframe Space. "
295 "NOTE that the default value is overwritten by the value defined "
296 "by the standard; if you want to set this attribute, you have to "
297 "do it after that the PHY object is initialized.",
301 .AddAttribute(
"PowerDensityLimit",
302 "The mean equivalent isotropically radiated power density"
303 "limit (in dBm/MHz) set by regulators.",
307 .AddAttribute(
"NotifyMacHdrRxEnd",
308 "Whether the PHY is capable of notifying the MAC about the end of "
309 "the reception of the MAC header of every MPDU.",
315 "Trace source indicating a packet has begun transmitting over the medium; "
316 "the packet holds a single MPDU even if the MPDU is transmitted within an A-MPDU "
317 "(in which case this trace fires for each MPDU in the "
320 "ns3::WifiPhy::PhyTxBeginTracedCallback")
323 "Trace source indicating a PSDU has begun transmitting over the channel medium; "
324 "this trace returns a WifiConstPsduMap with a single element (in the case of SU "
326 "or multiple elements (in the case of MU PPDU)",
328 "ns3::WifiPhy::PsduTxBeginCallback")
329 .AddTraceSource(
"PhyTxEnd",
330 "Trace source indicating a packet "
331 "has been completely transmitted over the channel.",
333 "ns3::Packet::TracedCallback")
334 .AddTraceSource(
"PhyTxDrop",
335 "Trace source indicating a packet "
336 "has been dropped by the device during transmission",
338 "ns3::Packet::TracedCallback")
339 .AddTraceSource(
"PhyRxBegin",
340 "Trace source indicating a packet "
341 "has begun being received from the channel medium "
344 "ns3::WifiPhy::PhyRxBeginTracedCallback")
345 .AddTraceSource(
"PhyRxPayloadBegin",
346 "Trace source indicating the reception of the "
347 "payload of a PPDU has begun",
349 "ns3::WifiPhy::PhyRxPayloadBeginTracedCallback")
350 .AddTraceSource(
"PhyRxMacHeaderEnd",
351 "Trace source indicating the MAC header of an MPDU has been "
352 "completely received.",
354 "ns3::WifiPhy::PhyRxMacHeaderEndTracedCallback")
355 .AddTraceSource(
"PhyRxEnd",
356 "Trace source indicating a packet "
357 "has been completely received from the channel medium "
360 "ns3::Packet::TracedCallback")
361 .AddTraceSource(
"PhyRxDrop",
362 "Trace source indicating a packet "
363 "has been dropped by the device during reception",
365 "ns3::WifiPhy::PhyRxDropTracedCallback")
366 .AddTraceSource(
"PhyRxPpduDrop",
367 "Trace source indicating a ppdu "
368 "has been dropped by the device during reception",
370 "ns3::WifiPhy::PhyRxPpduDropTracedCallback")
371 .AddTraceSource(
"MonitorSnifferRx",
372 "Trace source simulating a wifi device in monitor mode "
373 "sniffing all received frames",
375 "ns3::WifiPhy::MonitorSnifferRxTracedCallback")
376 .AddTraceSource(
"MonitorSnifferTx",
377 "Trace source simulating the capability of a wifi device "
378 "in monitor mode to sniff all frames being transmitted",
380 "ns3::WifiPhy::MonitorSnifferTxTracedCallback")
381 .AddTraceSource(
"SignalTransmission",
382 "Trace start of signal transmission",
384 "ns3::SpectrumWifiPhy::SignalTransmissionCallback");
434 "Either install a MobilityModel on this object or ensure that this "
435 "object is part of a Node and NetDevice");
439 NS_LOG_WARN(
"Mobility not found, propagation models might not work properly");
468 phyEntity.second =
nullptr;
473std::map<WifiModulationClass, Ptr<PhyEntity>>&
476 static std::map<WifiModulationClass, Ptr<PhyEntity>> g_staticPhyEntities;
477 return g_staticPhyEntities;
489 m_state->SetReceiveOkCallback(callback);
495 m_state->SetReceiveErrorCallback(callback);
501 m_state->RegisterListener(listener);
512 m_state->UnregisterListener(listener);
741 "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1");
756 return m_interference->GetErrorRateModel()->CalculateSnr(txVector, ber);
764 "Unimplemented Wi-Fi modulation class " << modulation);
773 "Unsupported Wi-Fi modulation class " << modulation);
793 const auto modulation = ppdu->GetModulation();
813 "The PHY entity has already been added. The setting should only be done once per "
823 "Cannot add an unimplemented PHY to supported list. Update the former first.");
825 "The PHY entity has already been added. The setting should only be done once per "
827 phyEntity->SetOwner(
this);
1002 "Cannot change standard");
1127 for (std::size_t segmentId = 0; segmentId < channel.GetNSegments(); ++segmentId)
1129 segments.emplace_back(channel.GetNumber(segmentId),
1130 channel.GetWidth(segmentId),
1131 channel.GetPhyBand(),
1132 channel.GetPrimaryChannelIndex(
MHz_u{20}));
1147 << std::get<1>(channelSegments.front())
1148 <<
static_cast<WifiPhyBand>(std::get<2>(channelSegments.front()))
1149 << +std::get<3>(channelSegments.front()));
1155 NS_LOG_DEBUG(
"Channel information will be applied when a standard is configured");
1162 if (!delay.has_value())
1167 if (delay.value().IsStrictlyPositive())
1190 std::optional<Time> delay;
1194 NS_LOG_DEBUG(
"drop packet because of channel switching while reception");
1199 NS_LOG_DEBUG(
"channel switching postponed until end of current transmission");
1211 NS_LOG_DEBUG(
"channel switching ignored in sleep mode");
1230 std::optional<uint8_t> prevChannelNumber{};
1237 if (width ==
MHz_u{0} && number == 0)
1249 prevChannelNumber = number;
1255 bool changingPhyBand =
1259 "Trying to change PHY band while prohibited.");
1264 std::vector<FrequencyChannelInfo> segments{};
1267 std::back_inserter(segments),
1268 [
this](
const auto& channelTuple) {
1269 return FrequencyChannelInfo{std::get<0>(channelTuple),
1271 std::get<1>(channelTuple),
1274 m_operatingChannel.Set(segments, m_standard);
1275 m_operatingChannel.SetPrimary20Index(std::get<3>(m_channelSettings.front()));
1278 if (
const auto chWidth = GetChannelWidth();
1279 (m_maxRadioBw !=
MHz_u{0}) && (chWidth > m_maxRadioBw))
1282 throw std::runtime_error(
"Attempting to set a " + std::to_string(chWidth) +
1283 " MHz channel on a station only supporting " +
1284 std::to_string(m_maxRadioBw) +
" MHz operation");
1287 if (changingPhyBand)
1289 ConfigureStandard(m_standard);
1292 FinalizeChannelSwitch();
1294 if (IsInitialized())
1297 m_state->SwitchToChannelSwitching(GetChannelSwitchDelay());
1313 NS_ASSERT_MSG(antennas > 0 && antennas <= 8,
"unsupported number of antennas");
1341 htPhy->SetMaxSupportedNss(
1380 std::list<uint8_t>
list;
1386 list.emplace_back(htPhy->GetBssMembershipSelector());
1401 NS_LOG_DEBUG(
"setting sleep mode postponed until end of current transmission");
1406 << (forceSleepInRx ?
"" :
"postponed until end of current reception"));
1418 NS_LOG_DEBUG(
"setting sleep mode postponed until end of channel switching");
1459 NS_LOG_DEBUG(
"not in sleep mode, there is nothing to resume");
1487 NS_LOG_DEBUG(
"not in off mode, there is nothing to resume");
1523 double totalAmpduNumSymbols;
1530 totalAmpduNumSymbols,
1541 double& totalAmpduNumSymbols,
1545 ->GetPayloadDuration(size,
1551 totalAmpduNumSymbols,
1559 ->CalculatePhyPreambleAndHeaderDuration(txVector);
1590 ->CalculateTxDuration(psduMap, txVector, band);
1604 for (
const auto& psdu : psdus)
1619 for (
const auto& psdu : psdus)
1689 const std::vector<bool>& statusPerMpdu,
1693 if (psdu->IsAggregate())
1697 "TxVector with aggregate flag expected here according to PSDU");
1699 size_t nMpdus = psdu->GetNMpdus();
1700 NS_ASSERT_MSG(statusPerMpdu.size() == nMpdus,
"Should have one reception status per MPDU");
1704 for (
size_t i = 0; i < nMpdus;)
1706 if (statusPerMpdu.at(i))
1709 static_cast<uint16_t
>(channelFreq),
1724 "Should have one reception status for normal MPDU");
1729 static_cast<uint16_t
>(channelFreq),
1745 if (psdu->IsAggregate())
1749 "TxVector with aggregate flag expected here according to PSDU");
1753 size_t nMpdus = psdu->GetNMpdus();
1755 for (
size_t i = 0; i < nMpdus;)
1783 if (
auto remTime = phyEntity->GetTimeToPreambleDetectionEnd())
1788 return std::nullopt;
1796 if (
auto remTime = phyEntity->GetTimeToMacHdrEnd(staId))
1801 return std::nullopt;
1836 if (txVector.
IsMu())
1861 for (
const auto& psdu : psdus)
1894 NS_LOG_DEBUG(
"Transmission canceled because device is OFF");
1907 for (
const auto& psdu : psdus)
1916 ppdu->SetTruncatedTx();
1923 ppdu->ResetTxVector();
1964 phyEntity.second->CancelAllEvents();
1981 it->second->StartReceivePreamble(ppdu, rxPowersW, rxDuration);
1987 NS_LOG_DEBUG(
"Unsupported modulation received (" << modulation <<
"), consider as noise");
1993std::optional<std::reference_wrapper<const WifiTxVector>>
2001 return std::nullopt;
2026 if (phyEntity.second->IsModeSupported(mode))
2041 for (
const auto& mode : *(phyEntity.second))
2046 NS_ASSERT_MSG(
false,
"Should have found at least one default mode");
2058 return phyEntity->second->IsMcsSupported(mcs);
2064 std::list<WifiMode>
list;
2067 if (!phyEntity.second->HandlesMcsModes())
2069 for (
const auto& mode : *(phyEntity.second))
2071 list.emplace_back(mode);
2081 std::list<WifiMode>
list;
2085 if (!phyEntity->second->HandlesMcsModes())
2087 for (
const auto& mode : *(phyEntity->second))
2089 list.emplace_back(mode);
2099 uint16_t numMcs = 0;
2102 if (phyEntity.second->HandlesMcsModes())
2104 numMcs += phyEntity.second->GetNumModes();
2113 std::list<WifiMode>
list;
2116 if (phyEntity.second->HandlesMcsModes())
2118 for (
const auto& mode : *(phyEntity.second))
2120 list.emplace_back(mode);
2130 std::list<WifiMode>
list;
2134 if (phyEntity->second->HandlesMcsModes())
2136 for (
const auto& mode : *(phyEntity->second))
2138 list.emplace_back(mode);
2155 return m_state->IsStateCcaBusy();
2161 return m_state->IsStateIdle();
2179 return m_state->IsStateSwitching();
2185 return m_state->IsStateSleep();
2197 return m_state->GetDelayUntilIdle();
2203 return m_state->GetLastRxStartTime();
2209 return m_state->GetLastRxEndTime();
2243 phyEntity.second->CancelAllEvents();
2279 NS_LOG_FUNCTION(
this << powerRestricted << txPowerMaxSiso << txPowerMaxMimo);
2303 const auto& txVector = ppdu->GetTxVector();
2308 txPower =
GetPower(txVector.GetTxPowerLevel());
2312 if (txVector.GetNssMax() > 1 || txVector.GetNssTotal() > 1)
2323 const auto channelWidth = ppdu->GetTxChannelWidth();
2326 NS_LOG_INFO(
"txPower=" << txPower <<
"dBm with txPowerDbmPerMhz=" << txPowerDbmPerMhz
2327 <<
" over " << channelWidth <<
" MHz");
2346 int64_t currentStream = stream;
2347 m_random->SetStream(currentStream++);
2348 currentStream +=
m_interference->GetErrorRateModel()->AssignStreams(currentStream);
2349 return (currentStream - stream);
2356 <<
", RSSI:" << rxSignalInfo.
rssi <<
" dBm";
2369 Hz_u subcarrierSpacing{0};
2397 return subcarrierSpacing;
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
Keep track of the current position and velocity of an object.
bool IsInitialized() const
Check if the object has been initialized.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
bool IsStrictlyPositive() const
Exactly equivalent to t > 0.
AttributeValue implementation for Tuple.
a unique identifier for an interface.
@ ATTR_GET
The attribute can be read.
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
represent a single transmission mode
WifiModulationClass GetModulationClass() const
static TypeId GetTypeId()
Get the type ID.
void SetNumberOfAntennas(uint8_t antennas)
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
dBm_u m_ccaEdThreshold
Clear channel assessment (CCA) energy detection (ED) threshold.
dBm_u GetTxPowerStart() const
Return the minimum available transmission power level.
WifiModulationClass GetMaxModulationClassSupported() const
void SetRxGain(dB_u gain)
Sets the reception gain.
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
bool IsStateCcaBusy() const
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.
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
void SetRxNoiseFigure(dB_u noiseFigure)
Sets the RX loss in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
void Configure80211ax()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard.
void SetRxSensitivity(dBm_u threshold)
Sets the receive sensitivity threshold.
Time m_channelSwitchDelay
Time required to switch between channel.
dB_u GetTxGain() const
Return the transmission gain.
void SetTxPowerEnd(dBm_u end)
Sets the maximum available transmission power level.
dBm_per_MHz_u m_powerDensityLimit
the power density limit
void NotifyCcaBusy(const Ptr< const WifiPpdu > ppdu, Time duration)
Notify PHY state helper to switch to CCA busy state,.
void NotifyMonitorSniffTx(Ptr< const WifiPsdu > psdu, MHz_u channelFreq, const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being transmitted.
WifiPhyOperatingChannel m_operatingChannel
Operating channel.
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
The trace source fired when the PHY layer drops a packet as it tries to transmit it.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
static Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype=NORMAL_MPDU, uint16_t staId=SU_STA_ID)
Time GetSlot() const
Return the slot duration for this PHY.
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
void Configure80211g()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
uint8_t GetPrimary20Index() const
dBm_u m_rxSensitivity
Receive sensitivity threshold.
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...
uint8_t GetNumberOfAntennas() const
Time m_slot
Slot duration.
dBm_u GetRxSensitivity() const
Return the receive sensitivity threshold.
MHz_u m_maxRadioBw
Maximum radio bandwidth.
bool GetShortPhyPreambleSupported() const
Return whether short PHY preamble is supported.
void SetSifs(Time sifs)
Set the Short Interframe Space (SIFS) for this PHY.
std::list< uint8_t > GetBssMembershipSelectorList() const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
void Configure80211n()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard.
EventId m_endPhyRxEvent
the end of PHY receive event
dBm_u m_ccaSensitivityThreshold
Clear channel assessment (CCA) modulation and coding rate sensitivity threshold.
void Configure80211be()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11be standard.
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
bool IsMcsSupported(WifiModulationClass modulation, uint8_t mcs) const
Check if the given MCS of the given modulation class is supported by the PHY.
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
dBm_u m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction.
bool m_notifyRxMacHeaderEnd
whether the PHY is capable of notifying MAC header RX end
Hz_u GetSubcarrierSpacing() const
std::tuple< uint8_t, MHz_u, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying a segment of an operating channel.
MHz_u GetFrequency() const
Ptr< MobilityModel > GetMobility() const
Return the mobility model this PHY is associated with.
void SetSleepMode(bool forceSleepWhileInRx=false)
Put in sleep mode.
void ResumeFromSleep()
Resume from sleep mode.
void SetTxPowerStart(dBm_u start)
Sets the minimum available transmission power level.
static Time GetPreambleDetectionDuration()
void Configure80211p()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11p standard.
dBm_u m_txPowerEnd
Maximum transmission power.
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted.
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
void NotifyRxBegin(Ptr< const WifiPsdu > psdu, const RxPowerWattPerChannelBand &rxPowersW)
Public method used to fire a PhyRxBegin trace.
Time GetChannelSwitchDelay() const
void SetTxGain(dB_u gain)
Sets the transmission gain.
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
void NotifyTxBegin(const WifiConstPsduMap &psdus, Watt_u txPower)
Public method used to fire a PhyTxBegin trace.
Time m_sifs
Short Interframe Space (SIFS) duration.
void SetReceiveErrorCallback(RxErrorCallback callback)
TracedCallback< Ptr< const WifiPpdu >, const WifiTxVector & > m_signalTransmissionCb
Signal Transmission callback.
void NotifyMonitorSniffRx(Ptr< const WifiPsdu > psdu, MHz_u channelFreq, const WifiTxVector &txVector, SignalNoiseDbm signalNoise, const std::vector< bool > &statusPerMpdu, uint16_t staId=SU_STA_ID)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being received.
dBm_u GetTxPowerEnd() const
Return the maximum available transmission power level.
uint8_t GetMaxSupportedRxSpatialStreams() const
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
WifiMode GetMcs(WifiModulationClass modulation, uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the given modulation class.
uint8_t m_numberOfAntennas
Number of transmitters.
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU.
TracedCallback< Ptr< const WifiPpdu >, WifiPhyRxfailureReason > m_phyRxPpduDropTrace
The trace source fired when the PHY layer drops a packet it has received.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
static uint32_t GetMaxPsduSize(WifiModulationClass modulation)
Get the maximum PSDU size in bytes for the given modulation class.
dBm_u GetCcaEdThreshold() const
Return the CCA energy detection threshold.
Ptr< WifiPhyStateHelper > GetState() const
Return the WifiPhyStateHelper of this PHY.
dBm_u m_txPowerBase
Minimum transmission power.
virtual Ptr< Channel > GetChannel() const =0
Return the Channel this WifiPhy is connected to.
void NotifyTxEnd(const WifiConstPsduMap &psdus)
Public method used to fire a PhyTxEnd trace.
void EndReceiveInterBss()
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
void SetNTxPower(uint8_t n)
Sets the number of transmission power levels available between the minimum level and the maximum leve...
void SetCcaSensitivityThreshold(dBm_u threshold)
Sets the CCA sensitivity threshold.
WifiPhyBand m_band
WifiPhyBand.
dBm_u m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction.
static const Ptr< const PhyEntity > GetStaticPhyEntity(WifiModulationClass modulation)
Get the implemented PHY entity corresponding to the modulation class.
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.
virtual std::optional< Time > GetTimeToMacHdrEnd(uint16_t staId) const
Get the remaining time to the end of the MAC header reception of the next MPDU being received from th...
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
MHz_u GetTxBandwidth(WifiMode mode, MHz_u maxAllowedBandWidth=MHz_u{ std::numeric_limits< double >::max()}) const
Get the bandwidth for a transmission occurring on the current operating channel and using the given W...
void NotifyRxPpduDrop(Ptr< const WifiPpdu > ppdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxPpduDrop trace.
virtual void StartTx(Ptr< const WifiPpdu > ppdu)=0
void SetMaxModulationClassSupported(WifiModulationClass modClass)
Set the maximum modulation class that has to be supported by this PHY object.
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...
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.
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
EventId m_endTxEvent
the end of transmit event
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.
void RegisterListener(const std::shared_ptr< WifiPhyListener > &listener)
static std::map< WifiModulationClass, Ptr< PhyEntity > > & GetStaticPhyEntities()
void SetSlot(Time slot)
Set the slot duration for this PHY.
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
void SetPreviouslyRxPpduUid(uint64_t uid)
Set the UID of the previously received PPDU.
Ptr< Event > m_currentEvent
Hold the current event.
Time GetLastRxStartTime() const
Return the start time of the last received packet.
WifiMode GetDefaultMode() const
Get the default WifiMode supported by the PHY.
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
uint8_t GetChannelNumber() const
Return current channel number.
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium.
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
std::optional< Time > GetDelayUntilChannelSwitch()
Perform any actions necessary when user changes operating channel after initialization.
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU.
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
TracedCallback< Ptr< const Packet >, double > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
virtual void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
virtual std::optional< std::reference_wrapper< const WifiTxVector > > GetInfoIfRxingPhyHeader() const
Time GetPifs() const
Return the PCF Interframe Space (PIFS) for this PHY.
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
void StartReceivePreamble(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
TracedCallback< WifiConstPsduMap, WifiTxVector, double > m_phyTxPsduBeginTrace
The trace source fired when a PSDU map begins the transmission process on the medium.
std::vector< ChannelTuple > ChannelSegments
segments identifying an operating channel
dB_u m_txGain
Transmission gain.
MHz_u GetChannelWidth() const
bool IsStateSleep() const
void SetOperatingChannel(const WifiPhyOperatingChannel &channel)
If the standard for this object has not been set yet, store the channel settings corresponding to the...
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
WifiStandard m_standard
WifiStandard.
uint8_t m_nTxPower
Number of available transmission power levels.
void DoDispose() override
Destructor implementation.
void ResetCca(bool powerRestricted, dBm_u txPowerMaxSiso=dBm_u{0}, dBm_u txPowerMaxMimo=dBm_u{0})
Reset PHY to IDLE, with some potential TX power restrictions for the next transmission.
dB_u GetRxGain() const
Return the reception gain.
bool IsStateSwitching() const
void SetPhyId(uint8_t phyId)
Set the index allocated to this PHY.
virtual void DoChannelSwitch()
Actually switch channel based on the stored channel settings.
void SetOffMode()
Put in off mode.
TracedCallback< Ptr< const Packet >, WifiPhyRxfailureReason > m_phyRxDropTrace
The trace source fired when the PHY layer drops a packet it has received.
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
uint8_t m_phyId
the index of the PHY in the vector of PHYs held by the WifiNetDevice
void SetPifs(Time pifs)
Set the PCF Interframe Space (PIFS) for this PHY.
void Configure80211b()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
void SetCcaEdThreshold(dBm_u threshold)
Sets the CCA energy detection threshold.
dB_u m_noiseFigure
The noise figure.
static Time GetStartOfPacketDuration(const WifiTxVector &txVector)
virtual FrequencyRange GetCurrentFrequencyRange() const =0
Get the frequency range of the current RF interface.
void SwitchMaybeToCcaBusy(const Ptr< const WifiPpdu > ppdu=nullptr)
Check if PHY state should move to CCA busy state based on current state of interference tracker.
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
dB_u m_rxGain
Reception gain.
double CalculateSnr(const WifiTxVector &txVector, double ber) const
void SetFixedPhyBand(bool enable)
Configure whether it is prohibited to change PHY band after initialization.
void Configure80211ac()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard.
bool HasFixedPhyBand() const
TracedCallback< Ptr< const Packet >, RxPowerWattPerChannelBand > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Ptr< WifiNetDevice > m_device
Pointer to the device.
Ptr< InterferenceHelper > m_interference
Pointer to a helper responsible for interference computations.
void DoInitialize() override
Initialize() implementation.
bool m_shortPreamble
Flag if short PHY preamble is supported.
uint8_t GetPhyId() const
Get the index allocated to this PHY.
Time m_pifs
PCF Interframe Space (PIFS) duration.
WifiModulationClass m_maxModClassSupported
max modulation class supported
WifiStandard GetStandard() const
Get the configured Wi-Fi standard.
void SetCapabilitiesChangedCallback(Callback< void > callback)
void SetReceiveOkCallback(RxOkCallback callback)
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
void NotifyChannelAccessRequested()
Notify the PHY that an access to the channel was requested.
dBm_u GetTxPowerForTransmission(Ptr< const WifiPpdu > ppdu) const
Compute the transmit power for the next transmission.
void ResumeFromOff()
Resume from off mode.
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
Ptr< PhyEntity > GetPhyEntityForPpdu(const Ptr< const WifiPpdu > ppdu) const
Get the supported PHY entity to use for a received PPDU.
uint64_t GetPreviouslyRxPpduUid() const
void Reset()
Reset data upon end of TX or RX.
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
Time GetLastRxEndTime() const
Return the end time of the last received packet.
TracedCallback< const WifiMacHeader &, const WifiTxVector &, Time > m_phyRxMacHeaderEndTrace
The trace source fired when the reception of a MAC header ends.
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
uint8_t GetMaxSupportedTxSpatialStreams() const
void Configure80211a()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
std::list< WifiMode > GetMcsList() const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
std::list< WifiMode > GetModeList() const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
ChannelSegments m_channelSettings
Store operating channel settings until initialization.
void TxDone(const WifiConstPsduMap &psdus)
Callback function when a transmission is completed.
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
virtual std::optional< Time > GetTimeToPreambleDetectionEnd() const
Get the remaining time to preamble detection period to elapse, if preamble detection is ongoing.
uint8_t GetPrimaryChannelNumber(MHz_u primaryChannelWidth) const
Get channel number of the primary channel.
dBm_u GetPower(uint8_t powerLevel) const
Get the power of the given power level.
bool m_fixedPhyBand
True to prohibit changing PHY band after initialization.
Ptr< PhyEntity > GetLatestPhyEntity() const
Get the latest PHY entity supported by this PHY instance.
uint8_t GetNTxPower() const
Return the number of available transmission power levels.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
void UnregisterListener(const std::shared_ptr< WifiPhyListener > &listener)
dBm_u GetCcaSensitivityThreshold() const
Return the CCA sensitivity threshold.
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
Class that keeps track of all information about the current PHY operating channel.
static uint8_t GetDefaultChannelNumber(MHz_u width, WifiStandard standard, WifiPhyBand band, std::optional< uint8_t > previousChannelNumber=std::nullopt)
Get the default channel number for a given segment of the given width and for the given standard and ...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
bool IsValid(WifiPhyBand band=WIFI_PHY_BAND_UNSPECIFIED) const
The standard disallows certain combinations of WifiMode, number of spatial streams,...
uint8_t GetNssTotal() const
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
uint8_t GetNssMax() const
uint8_t GetTxPowerLevel() const
bool IsAggregation() const
Checks whether the PSDU contains A-MPDU.
bool IsDlMuMimo() const
Return true if this TX vector is used for a downlink multi-user transmission using MU-MIMO.
static void Send(Ptr< NetDevice > dev, int level, std::string emuMode)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< AttributeChecker > MakeAttributeContainerChecker(const AttributeContainerValue< A, Sep, C > &value)
Make AttributeContainerChecker from AttributeContainerValue.
Ptr< const AttributeAccessor > MakeAttributeContainerAccessor(T1 a1)
Make AttributeContainerAccessor using explicit types.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Ptr< const AttributeChecker > MakeTupleChecker(Ts... checkers)
Create a TupleChecker from AttributeCheckers associated with TupleValue elements.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPhyBand
Identifies the PHY band.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
MpduType
The type of an MPDU.
@ WIFI_STANDARD_UNSPECIFIED
@ SIGNAL_DETECTION_ABORTED_BY_TX
@ RECEPTION_ABORTED_BY_TX
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_UNSPECIFIED
Unspecified.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
@ WIFI_MOD_CLASS_UNKNOWN
Modulation class unknown or unspecified.
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_EHT
EHT (Clause 36)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
@ LAST_MPDU_IN_AGGREGATE
The MPDU is the last aggregate in an A-MPDU with multiple MPDUs.
@ NORMAL_MPDU
The MPDU is not part of an A-MPDU.
@ FIRST_MPDU_IN_AGGREGATE
The MPDU is the first aggregate in an A-MPDU with multiple MPDUs, but is not the last aggregate.
@ SINGLE_MPDU
The MPDU is a single MPDU.
@ MIDDLE_MPDU_IN_AGGREGATE
The MPDU is part of an A-MPDU with multiple MPDUs, but is neither the first nor the last aggregate.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
const Time DSSS_SIFS_TIME
aSIFSTime duration for DSSS (Table 16-4 "HR/DSSS PHY characteristics" of 802.11-2020)
U * PeekPointer(const Ptr< U > &p)
Ptr< const AttributeChecker > MakeUintegerChecker()
Callback< void, Ptr< const WifiPsdu > > RxErrorCallback
Callback if PSDU unsuccessfuly received.
@ SWITCHING
The PHY layer is switching to other channel.
@ TX
The PHY layer is sending a packet.
@ OFF
The PHY layer is switched off.
@ IDLE
The PHY layer is IDLE.
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
@ SLEEP
The PHY layer is sleeping.
@ RX
The PHY layer is receiving a packet.
const Time DSSS_SLOT_TIME
aSlotTime duration for DSSS (Table 16-4 "HR/DSSS PHY characteristics" of 802.11-2020)
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
const Time OFDM_SIFS_TIME_10MHZ
aSIFSTime value for OFDM (10 MHz channel spacing) (Table 17-21 "OFDM PHY characteristics" of 802....
dB_u RatioToDb(double ratio)
Convert from ratio to dB.
Ptr< const AttributeChecker > MakeDoubleChecker()
const Time OFDM_SLOT_TIME_20MHZ
aSlotTime duration for OFDM (20 MHz channel spacing) (Table 17-21 "OFDM PHY characteristics" of 802....
double MHz_u
MHz weak type.
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
MHz_u GetDefaultChannelWidth(WifiStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
const Time OFDM_SIFS_TIME_5MHZ
aSIFSTime value for OFDM (5 MHz channel spacing) (Table 17-21 "OFDM PHY characteristics" of 802....
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
MHz_u GetMaximumChannelWidth(WifiModulationClass modulation)
Get the maximum channel width allowed for the given modulation class.
double dBm_u
dBm weak type
double DbToRatio(dB_u val)
Convert from dB to ratio.
const Time OFDM_SLOT_TIME_5MHZ
aSlotTime duration for OFDM (5 MHz channel spacing) (Table 17-21 "OFDM PHY characteristics" of 802....
static constexpr uint32_t SUBCARRIER_FREQUENCY_SPACING
Subcarrier frequency spacing in Hz (Table 19-6 "Timing-related constants" of 802.11-2020)
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
WifiModulationClass GetModulationClassForStandard(WifiStandard standard)
Return the modulation class corresponding to a given standard.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Callback< void, Ptr< const WifiPsdu >, RxSignalInfo, const WifiTxVector &, const std::vector< bool > & > RxOkCallback
Callback if PSDU successfully received (i.e.
static constexpr uint32_t SUBCARRIER_FREQUENCY_SPACING_HE
Subcarrier frequency spacing for the HE modulated fields in Hz (Table 27-12 "Timing-relatedconstants"...
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
const Time OFDM_SIFS_TIME_20MHZ
aSIFSTime value for OFDM (20 MHz channel spacing) (Table 17-21 "OFDM PHY characteristics" of 802....
double Watt_u
Watt weak type.
double dBm_per_MHz_u
dBm/MHz weak type
const Time OFDM_SLOT_TIME_10MHZ
aSlotTime duration for OFDM (10 MHz channel spacing) (Table 17-21 "OFDM PHY characteristics" of 802....
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
std::ostream & operator<<(std::ostream &os, const PairObject &obj)
Stream insertion operator.
MpduType type
type of MPDU
uint32_t mpduRefNumber
MPDU ref number.
RxSignalInfo structure containing info on the received signal.
double snr
SNR in linear scale.
SignalNoiseDbm structure.
Declaration of ns3::WifiPpdu class and ns3::WifiConstPsduMap.