22 #include "ns3/simulator.h" 24 #include "ns3/pointer.h" 25 #include "ns3/mobility-model.h" 26 #include "ns3/random-variable-stream.h" 27 #include "ns3/error-model.h" 166 .SetGroupName (
"Wifi")
167 .AddAttribute (
"Frequency",
168 "The operating center frequency (MHz)",
172 MakeUintegerChecker<uint16_t> ())
173 .AddAttribute (
"ChannelWidth",
174 "Whether 5MHz, 10MHz, 20MHz, 22MHz, 40MHz, 80 MHz or 160 MHz.",
178 MakeUintegerChecker<uint16_t> (5, 160))
179 .AddAttribute (
"ChannelNumber",
180 "If set to non-zero defined value, will control Frequency and ChannelWidth assignment",
184 MakeUintegerChecker<uint8_t> (0, 196))
185 .AddAttribute (
"EnergyDetectionThreshold",
186 "The energy of a received signal should be higher than " 187 "this threshold (dBm) to allow the PHY layer to detect the signal.",
190 MakeDoubleChecker<double> (),
192 .AddAttribute (
"RxSensitivity",
193 "The energy of a received signal should be higher than " 194 "this threshold (dBm) for the PHY to detect the signal.",
198 MakeDoubleChecker<double> ())
199 .AddAttribute (
"CcaEdThreshold",
200 "The energy of a non Wi-Fi received signal should be higher than " 201 "this threshold (dBm) to allow the PHY layer to declare CCA BUSY state. " 202 "This check is performed on the 20 MHz primary channel only.",
206 MakeDoubleChecker<double> ())
207 .AddAttribute (
"TxGain",
208 "Transmission gain (dB).",
212 MakeDoubleChecker<double> ())
213 .AddAttribute (
"RxGain",
214 "Reception gain (dB).",
218 MakeDoubleChecker<double> ())
219 .AddAttribute (
"TxPowerLevels",
220 "Number of transmission power levels available between " 221 "TxPowerStart and TxPowerEnd included.",
224 MakeUintegerChecker<uint8_t> ())
225 .AddAttribute (
"TxPowerEnd",
226 "Maximum available transmission level (dBm).",
230 MakeDoubleChecker<double> ())
231 .AddAttribute (
"TxPowerStart",
232 "Minimum available transmission level (dBm).",
236 MakeDoubleChecker<double> ())
237 .AddAttribute (
"RxNoiseFigure",
238 "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." 239 " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is " 240 "\"the difference in decibels (dB) between" 241 " the noise output of the actual receiver to the noise output of an " 242 " ideal receiver with the same overall gain and bandwidth when the receivers " 243 " are connected to sources at the standard noise temperature T0 (usually 290 K)\".",
246 MakeDoubleChecker<double> ())
247 .AddAttribute (
"State",
248 "The state of the PHY layer.",
251 MakePointerChecker<WifiPhyStateHelper> ())
252 .AddAttribute (
"ChannelSwitchDelay",
253 "Delay between two short frames transmitted on different frequencies.",
257 .AddAttribute (
"Antennas",
258 "The number of antennas on the device.",
262 MakeUintegerChecker<uint8_t> (1, 8))
263 .AddAttribute (
"MaxSupportedTxSpatialStreams",
264 "The maximum number of supported TX spatial streams." 265 "This parameter is only valuable for 802.11n/ac/ax STAs and APs.",
269 MakeUintegerChecker<uint8_t> (1, 8))
270 .AddAttribute (
"MaxSupportedRxSpatialStreams",
271 "The maximum number of supported RX spatial streams." 272 "This parameter is only valuable for 802.11n/ac/ax STAs and APs.",
276 MakeUintegerChecker<uint8_t> (1, 8))
277 .AddAttribute (
"ShortGuardEnabled",
278 "Whether or not short guard interval is enabled for HT/VHT transmissions." 279 "This parameter is only valuable for 802.11n/ac/ax STAs and APs.",
285 .AddAttribute (
"GuardInterval",
286 "Whether 800ns, 1600ns or 3200ns guard interval is used for HE transmissions." 287 "This parameter is only valuable for 802.11ax STAs and APs.",
293 .AddAttribute (
"GreenfieldEnabled",
294 "Whether or not Greenfield is enabled." 295 "This parameter is only valuable for 802.11n STAs and APs.",
301 .AddAttribute (
"ShortPlcpPreambleSupported",
302 "Whether or not short PHY preamble is supported." 303 "This parameter is only valuable for 802.11b STAs and APs." 304 "Note: 802.11g APs and STAs always support short PHY preamble.",
309 .AddAttribute (
"FrameCaptureModel",
310 "Ptr to an object that implements the frame capture model",
313 MakePointerChecker <FrameCaptureModel> ())
314 .AddAttribute (
"PreambleDetectionModel",
315 "Ptr to an object that implements the preamble detection model",
318 MakePointerChecker <PreambleDetectionModel> ())
319 .AddAttribute (
"PostReceptionErrorModel",
320 "An optional packet error model can be added to the receive " 321 "packet process after any propagation-based (SNR-based) error " 322 "models have been applied. Typically this is used to force " 323 "specific packet drops, for testing purposes.",
326 MakePointerChecker<ErrorModel> ())
327 .AddTraceSource (
"PhyTxBegin",
328 "Trace source indicating a packet " 329 "has begun transmitting over the channel medium",
331 "ns3::Packet::TracedCallback")
332 .AddTraceSource (
"PhyTxPsduBegin",
333 "Trace source indicating a PSDU " 334 "has begun transmitting over the channel medium",
336 "ns3::WifiPhy::PsduTxBeginCallback")
337 .AddTraceSource (
"PhyTxEnd",
338 "Trace source indicating a packet " 339 "has been completely transmitted over the channel.",
341 "ns3::Packet::TracedCallback")
342 .AddTraceSource (
"PhyTxDrop",
343 "Trace source indicating a packet " 344 "has been dropped by the device during transmission",
346 "ns3::Packet::TracedCallback")
347 .AddTraceSource (
"PhyRxBegin",
348 "Trace source indicating a packet " 349 "has begun being received from the channel medium " 352 "ns3::Packet::TracedCallback")
353 .AddTraceSource (
"PhyRxPayloadBegin",
354 "Trace source indicating the reception of the " 355 "payload of a PPDU has begun",
357 "ns3::WifiPhy::PhyRxPayloadBeginTracedCallback")
358 .AddTraceSource (
"PhyRxEnd",
359 "Trace source indicating a packet " 360 "has been completely received from the channel medium " 363 "ns3::Packet::TracedCallback")
364 .AddTraceSource (
"PhyRxDrop",
365 "Trace source indicating a packet " 366 "has been dropped by the device during reception",
368 "ns3::Packet::TracedCallback")
369 .AddTraceSource (
"MonitorSnifferRx",
370 "Trace source simulating a wifi device in monitor mode " 371 "sniffing all received frames",
373 "ns3::WifiPhy::MonitorSnifferRxTracedCallback")
374 .AddTraceSource (
"MonitorSnifferTx",
375 "Trace source simulating the capability of a wifi device " 376 "in monitor mode to sniff all frames being transmitted",
378 "ns3::WifiPhy::MonitorSnifferTxTracedCallback")
379 .AddTraceSource (
"EndOfHePreamble",
380 "Trace source indicating the end of the 802.11ax preamble (after training fields)",
382 "ns3::WifiPhy::EndOfHePreambleTracedCallback")
388 : m_txMpduReferenceNumber (0xffffffff),
389 m_rxMpduReferenceNumber (0xffffffff),
392 m_endPreambleDetectionEvent (),
395 m_isConstructed (false),
396 m_channelCenterFrequency (0),
397 m_initialFrequency (0),
398 m_frequencyChannelNumberInitialized (false),
400 m_powerRestricted (false),
401 m_channelAccessRequested (false),
402 m_txSpatialStreams (0),
403 m_rxSpatialStreams (0),
405 m_initialChannelNumber (0),
407 m_wifiRadioEnergyModel (0),
408 m_timeLastPreambleDetected (
Seconds (0))
411 m_random = CreateObject<UniformRandomVariable> ();
412 m_state = CreateObject<WifiPhyStateHelper> ();
460 m_state->SetReceiveOkCallback (callback);
466 m_state->SetReceiveErrorCallback (callback);
472 m_state->RegisterListener (listener);
478 m_state->UnregisterListener (listener);
630 htConfiguration->SetGreenfieldSupported (greenfield);
645 return htConfiguration->GetGreenfieldSupported ();
661 htConfiguration->SetShortGuardIntervalSupported (shortGuardInterval);
676 return htConfiguration->GetShortGuardIntervalSupported ();
693 heConfiguration->SetGuardInterval (guardInterval);
708 return heConfiguration->GetGuardInterval ();
732 Ptr<HtConfiguration> htConfiguration = DynamicCast<WifiNetDevice> (device)->GetHtConfiguration ();
738 Ptr<HeConfiguration> heConfiguration = DynamicCast<WifiNetDevice> (device)->GetHeConfiguration ();
906 NS_LOG_WARN (
"Configuring unspecified standard; performing no action");
1016 m_mcsIndexMap[mode.GetModulationClass ()][mode.GetMcsValue ()] = index++;
1025 bool htFound =
false;
1159 NS_LOG_FUNCTION (
this << +channelNumber << standard << frequency << channelWidth);
1161 ChannelToFrequencyWidthMap::const_iterator it;
1165 NS_LOG_DEBUG (
"channel number/standard already defined; returning false");
1182 if (it->second ==
f)
1191 NS_LOG_DEBUG (
"Found, returning " << +it->first.first);
1192 return (it->first.first);
1212 NS_LOG_DEBUG (
"Frequency set; checking whether a channel number corresponds");
1214 if (channelNumberSearched)
1216 NS_LOG_DEBUG (
"Channel number found; setting to " << +channelNumberSearched);
1221 NS_LOG_DEBUG (
"Channel number not found; setting to zero");
1235 NS_LOG_DEBUG (
"Falling back to check WIFI_PHY_STANDARD_UNSPECIFIED");
1244 NS_LOG_DEBUG (
"Setting frequency to " <<
f.first <<
"; width to " << +
f.second);
1320 NS_LOG_DEBUG (
"Saving frequency configuration for initialization");
1332 NS_LOG_DEBUG (
"Setting frequency and channel number to zero");
1343 NS_LOG_DEBUG (
"Setting frequency " << frequency <<
" corresponds to channel " << +nch);
1346 NS_LOG_DEBUG (
"Channel frequency switched to " << frequency <<
"; channel number to " << +nch);
1352 NS_LOG_DEBUG (
"Suppressing reassignment of frequency");
1357 NS_LOG_DEBUG (
"Channel number is unknown for frequency " << frequency);
1360 NS_LOG_DEBUG (
"Channel frequency switched to " << frequency <<
"; channel number to " << 0);
1366 NS_LOG_DEBUG (
"Suppressing reassignment of frequency");
1381 NS_ASSERT_MSG (channelWidth == 5 || channelWidth == 10 || channelWidth == 20 || channelWidth == 22 || channelWidth == 40 || channelWidth == 80 || channelWidth == 160,
"wrong channel width value");
1400 NS_ASSERT_MSG (antennas > 0 && antennas <= 4,
"unsupported number of antennas");
1471 NS_LOG_FUNCTION (
"Adding " << width <<
" to supported channel width set");
1475 std::vector<uint16_t>
1495 NS_LOG_DEBUG (
"Saving channel number configuration for initialization");
1526 NS_LOG_DEBUG (
"Setting frequency to " <<
f.first <<
"; width to " << +
f.second);
1539 NS_FATAL_ERROR (
"Frequency not found for channel number " << +nch);
1565 NS_LOG_DEBUG (
"drop packet because of channel switching while reception");
1572 NS_LOG_DEBUG (
"channel switching postponed until end of current transmission");
1585 NS_LOG_DEBUG (
"channel switching ignored in sleep mode");
1625 NS_LOG_DEBUG (
"drop packet because of channel/frequency switching while reception");
1629 goto switchFrequency;
1632 NS_LOG_DEBUG (
"channel/frequency switching postponed until end of current transmission");
1642 goto switchFrequency;
1645 NS_LOG_DEBUG (
"frequency switching ignored in sleep mode");
1678 NS_LOG_DEBUG (
"setting sleep mode postponed until end of current transmission");
1682 NS_LOG_DEBUG (
"setting sleep mode postponed until end of current reception");
1686 NS_LOG_DEBUG (
"setting sleep mode postponed until end of channel switching");
1728 NS_LOG_DEBUG (
"not in sleep mode, there is nothing to resume");
1735 m_state->SwitchFromSleep (delayUntilCcaEnd);
1759 NS_LOG_DEBUG (
"not in off mode, there is nothing to resume");
1766 m_state->SwitchFromOff (delayUntilCcaEnd);
1804 uint8_t Ndltf, Neltf;
1807 if (txVector.
GetNss () < 3)
1809 Ndltf = txVector.
GetNss ();
1811 else if (txVector.
GetNss () < 5)
1815 else if (txVector.
GetNss () < 7)
2026 NS_FATAL_ERROR (
"modulation class is not matching the preamble type");
2102 NS_FATAL_ERROR (
"modulation class is not matching the preamble type");
2127 uint32_t totalAmpduSize;
2128 double totalAmpduNumSymbols;
2129 return GetPayloadDuration (size, txVector, frequency, mpdutype,
false, totalAmpduSize, totalAmpduNumSymbols);
2134 bool incFlag, uint32_t &totalAmpduSize,
double &totalAmpduNumSymbols)
2163 && txVector.
GetNss () == 3
2169 && txVector.
GetNss () == 2
2175 && txVector.
GetNss () == 3
2181 && txVector.
GetNss () == 3
2187 && txVector.
GetNss () == 4
2193 && txVector.
GetNss () == 4
2204 && txVector.
GetNss () == 2
2210 && txVector.
GetNss () == 2
2216 && txVector.
GetNss () == 3
2222 && txVector.
GetNss () == 3
2228 && txVector.
GetNss () == 3
2234 && txVector.
GetNss () == 4
2240 && txVector.
GetNss () == 4
2246 && txVector.
GetNss () == 4
2252 && txVector.
GetNss () == 4
2297 NS_ASSERT (gi == 800 || gi == 1600 || gi == 3200);
2307 double numSymbols = 0;
2311 numSymbols = (stbc * (16 + size * 8.0 + 6 * Nes) / (stbc * numDataBitsPerSymbol));
2314 totalAmpduSize += size;
2315 totalAmpduNumSymbols += numSymbols;
2321 numSymbols = (stbc * size * 8.0) / (stbc * numDataBitsPerSymbol);
2324 totalAmpduSize += size;
2325 totalAmpduNumSymbols += numSymbols;
2331 uint32_t totalSize = totalAmpduSize + size;
2332 numSymbols = lrint (stbc * ceil ((16 + totalSize * 8.0 + 6 * Nes) / (stbc * numDataBitsPerSymbol)));
2333 NS_ASSERT (totalAmpduNumSymbols <= numSymbols);
2334 numSymbols -= totalAmpduNumSymbols;
2338 totalAmpduNumSymbols = 0;
2346 numSymbols = lrint (stbc * ceil ((16 + size * 8.0 + 6.0 * Nes) / (stbc * numDataBitsPerSymbol)));
2483 if (psdu->IsAggregate ())
2488 size_t nMpdus = psdu->GetNMpdus ();
2489 NS_ASSERT_MSG (statusPerMpdu.size () == nMpdus,
"Should have one reception status per MPDU");
2491 for (
size_t i = 0; i < nMpdus;)
2493 if (statusPerMpdu.at (i))
2504 NS_ASSERT_MSG (statusPerMpdu.size () == 1,
"Should have one reception status for normal MPDU");
2513 if (psdu->IsAggregate ())
2518 size_t nMpdus = psdu->GetNMpdus ();
2520 for (
size_t i = 0; i < nMpdus;)
2560 NS_LOG_DEBUG (
"Dropping packet because in sleep mode");
2585 NS_LOG_DEBUG (
"Transmitting without power restriction");
2590 NS_LOG_DEBUG (
"Transmission canceled because device is OFF");
2604 ppdu->SetTruncatedTx ();
2626 double snr = snrPer.
snr;
2640 m_state->SwitchMaybeToCcaBusy (remainingPreambleHeaderDuration);
2647 m_state->SwitchMaybeToCcaBusy (remainingPreambleAndNonHtHeaderDuration);
2653 NS_LOG_DEBUG (
"Drop packet because PHY preamble detection failed");
2681 m_state->SwitchMaybeToCcaBusy (remainingRxDuration);
2687 NS_LOG_DEBUG (
"Abort reception because non-HT PHY header reception failed");
2701 Time rxDuration = ppdu->GetTxDuration ();
2708 NS_LOG_DEBUG (
"Cannot start RX because device is OFF");
2716 if (ppdu->IsTruncatedTx ())
2718 NS_LOG_DEBUG (
"Packet reception stopped because transmitter has been switched off");
2729 NS_LOG_DEBUG (
"drop packet because of unsupported RX mode");
2741 NS_LOG_DEBUG (
"drop packet because of channel switching");
2769 NS_LOG_DEBUG (
"Drop packet because already in Rx (power=" <<
2780 NS_LOG_DEBUG (
"Drop packet because already in Tx (power=" <<
2802 NS_LOG_DEBUG (
"Drop packet because already in Rx (power=" <<
2844 if (!delayUntilCcaEnd.
IsZero ())
2846 m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd);
2857 WifiMode txMode = txVector.GetMode ();
2858 bool canReceivePayload;
2869 canReceivePayload =
true;
2872 if (canReceivePayload)
2876 NS_LOG_DEBUG (
"Packet reception could not be started because not enough RX antennas");
2879 else if ((txVector.GetChannelWidth () >= 40) && (txVector.GetChannelWidth () >
GetChannelWidth ()))
2881 NS_LOG_DEBUG (
"Packet reception could not be started because not enough channel width");
2886 NS_LOG_DEBUG (
"Drop packet because it was sent using an unsupported mode (" << txMode <<
")");
2891 m_state->SwitchToRx (payloadDuration);
2898 params.
rssiW =
event->GetRxPowerW ();
2899 params.
bssColor =
event->GetTxVector ().GetBssColor ();
2907 NS_LOG_DEBUG (
"Drop packet because HT PHY header reception failed");
2916 Time psduDuration =
event->GetEndTime () -
event->GetStartTime ();
2922 std::vector<bool> statusPerMpdu;
2927 bool receptionOkAtLeastForOneMpdu =
false;
2928 std::pair<bool, SignalNoiseDbm> rxInfo;
2930 size_t nMpdus = psdu->GetNMpdus ();
2934 Time remainingAmpduDuration = psduDuration;
2936 auto mpdu = psdu->begin ();
2937 uint32_t totalAmpduSize = 0;
2938 double totalAmpduNumSymbols = 0.0;
2939 for (
size_t i = 0; i < nMpdus && mpdu != psdu->end (); ++mpdu)
2942 GetFrequency (), mpdutype,
true, totalAmpduSize, totalAmpduNumSymbols);
2943 remainingAmpduDuration -= mpduDuration;
2944 if (i == (nMpdus - 1) && !remainingAmpduDuration.IsZero ())
2946 mpduDuration += remainingAmpduDuration;
2949 event, relativeStart, mpduDuration);
2951 ", correct reception: " << rxInfo.first <<
2952 ", Signal/Noise: " << rxInfo.second.signal <<
"/" << rxInfo.second.noise <<
"dBm");
2953 signalNoise = rxInfo.second;
2954 statusPerMpdu.push_back (rxInfo.first);
2955 receptionOkAtLeastForOneMpdu |= rxInfo.first;
2959 relativeStart += mpduDuration;
2966 signalNoise = rxInfo.second;
2967 statusPerMpdu.push_back (rxInfo.first);
2968 receptionOkAtLeastForOneMpdu = rxInfo.first;
2973 if (receptionOkAtLeastForOneMpdu)
2976 m_state->SwitchFromRxEndOk (
Copy (psdu), snr, txVector, statusPerMpdu);
2988 std::pair<bool, SignalNoiseDbm>
2991 NS_LOG_FUNCTION (
this << *psdu << *event << relativeMpduStart << mpduDuration);
2995 NS_LOG_DEBUG (
"mode=" << (event->GetTxVector ().GetMode ().GetDataRate (event->GetTxVector ())) <<
2996 ", snr(dB)=" <<
RatioToDb (snrPer.
snr) <<
", per=" << snrPer.
per <<
", size=" << psdu->GetSize () <<
3005 signalNoise.noise =
WToDbm (event->GetRxPowerW () / snrPer.
snr);
3010 return std::make_pair (
true, signalNoise);
3015 return std::make_pair (
false, signalNoise);
3939 for (uint8_t i = 0; i <
GetNModes (); i++)
4006 NS_ASSERT (mode.GetModulationClass () == modulation);
4032 return m_state->IsStateCcaBusy ();
4038 return m_state->IsStateIdle ();
4056 return m_state->IsStateSwitching ();
4062 return m_state->IsStateSleep ();
4068 return m_state->IsStateOff ();
4074 return m_state->GetDelayUntilIdle ();
4080 return m_state->GetLastRxStartTime ();
4086 return m_state->GetLastRxEndTime ();
4099 if (!delayUntilCcaEnd.
IsZero ())
4102 m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd);
4126 m_state->SwitchFromRxAbort ();
4134 NS_LOG_FUNCTION (
this << powerRestricted << txPowerMaxSiso << txPowerMaxMimo);
4153 if (txVector.
GetNss () > 1)
4169 NS_LOG_DEBUG (
"sync to signal (power=" << rxPowerW <<
"W)");
4175 Time remainingRxDuration =
event->GetDuration () - startOfPreambleDuration;
4180 NS_LOG_DEBUG (
"Received a stronger signal during preamble detection: drop current packet and switch to new packet");
4186 Time remainingRxDuration =
event->GetDuration () - startOfPreambleDuration;
4191 NS_LOG_DEBUG (
"Drop packet because RX is already decoding preamble");
static class anonymous_namespace{wifi-phy.cc}::Constructor g_constructor
the constructor
ERP-OFDM PHY (Clause 19, Section 19.5)
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Ptr< NetDevice > m_device
Pointer to the device.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
uint8_t GetNTxPower(void) const
Return the number of available transmission power levels.
bool IsStateSwitching(void) const
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
bool IsStateOff(void) const
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
Simulation virtual time values and global simulation resolution.
static WifiMode GetHeMcs7()
Return MCS 7 from HE MCS values.
std::pair< uint8_t, WifiPhyStandard > ChannelNumberStandardPair
A pair of a ChannelNumber and WifiPhyStandard.
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
void SetNTxPower(uint8_t n)
Sets the number of transmission power levels available between the minimum level and the maximum leve...
uint8_t m_channelNumber
Operating channel number.
double m_rxGainDb
Reception gain (dB)
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth)
Add a channel definition to the WifiPhy.
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
AttributeValue implementation for Boolean.
void SetNumberOfReceiveAntennas(uint8_t rx)
Set the number of RX antennas in the receiver corresponding to this interference helper.
Ptr< HeConfiguration > GetHeConfiguration(void) const
double GetRxGain(void) const
Return the reception gain (dB).
bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
void AddSupportedChannelWidth(uint16_t width)
WifiMode GetHeMcs(uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the HE modulation class.
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
double GetCcaEdThreshold(void) const
Return the CCA threshold (dBm).
HT PHY for the 5 GHz band (clause 20)
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model.
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static WifiMode GetOfdmRate27MbpsBW10MHz()
Return a WifiMode for OFDM at 27Mbps with 10MHz channel spacing.
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo, SignalNoiseDbm > m_phyMonitorSniffRxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being received...
double m_txGainDb
Transmission gain (dB)
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
void AbortCurrentReception(WifiPhyRxfailureReason reason)
Due to newly arrived signal, the current reception cannot be continued and has to be aborted...
void MaybeCcaBusyDuration(void)
Eventually switch to CCA busy.
WifiPhyStandard GetStandard(void) const
Get the configured Wi-Fi standard.
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
void ResumeFromOff(void)
Resume from off mode.
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
void ResumeFromSleep(void)
Resume from sleep mode.
double m_rxSensitivityW
Receive sensitivity threshold in watts.
bool GetShortGuardInterval(void) const
Return whether short guard interval is supported.
bool GetGreenfield(void) const
Return whether Greenfield is supported.
static WifiMode GetHeMcs5()
Return MCS 5 from HE MCS values.
Time m_timeLastPreambleDetected
Record the time the last preamble was detected.
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
void SetTxGain(double gain)
Sets the transmission gain (dB).
void Configure80211ax(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ax standard...
double DbmToW(double dBm)
Convert from dBm to Watts.
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
void SetRxSensitivity(double threshold)
Sets the receive sensitivity threshold (dBm).
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void DoDispose(void)
Destructor implementation.
static WifiMode GetHePhyHeaderMode()
bool Is2_4Ghz(double frequency)
void RebuildMcsMap(void)
Rebuild the mapping of MCS values to indices in the device MCS set.
TracedCallback< Ptr< const WifiPsdu >, WifiTxVector, double > m_phyTxPsduBeginTrace
The trace source fired when a PSDU begins the transmission process on the medium. ...
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
uint8_t GetNBssMembershipSelectors(void) const
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
The PHY layer is sleeping.
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
bool IsStateCcaBusy(void) const
void SetReceiveErrorCallback(RxErrorCallback callback)
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
bool IsInitialized(void) const
Check if the object has been initialized.
U * PeekPointer(const Ptr< U > &p)
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Set the error rate model for this interference helper.
std::vector< uint8_t > m_bssMembershipSelectorSet
the BSS membership selector set
HE PHY for the 2.4 GHz band (clause 26)
std::pair< bool, SignalNoiseDbm > GetReceptionStatus(Ptr< const WifiPsdu > psdu, Ptr< Event > event, Time relativeMpduStart, Time mpduDuration)
Get the reception status for the provided MPDU and notify.
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
static Time GetPhyPreambleDuration(WifiTxVector txVector)
void SetShortPhyPreambleSupported(bool preamble)
Enable or disable short PHY preamble.
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
TracedCallback< WifiTxVector, Time > m_phyRxPayloadBeginTrace
The trace source fired when the reception of the PHY payload (PSDU) begins.
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
EventId m_endPhyRxEvent
the end of PHY receive event
bool IsStbc(void) const
Check if STBC is used or not.
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
bool GetModeInitialized(void) const
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
void UnregisterListener(WifiPhyListener *listener)
void SetRxNoiseFigure(double noiseFigureDb)
Sets the RX loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
WifiMode GetVhtMcs(uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the VHT modulation class.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
bool IsStrictlyPositive(void) const
static WifiMode GetHeMcs4()
Return MCS 4 from HE MCS values.
uint8_t GetNess(void) const
void ConfigureHolland(void)
Configure WifiPhy with appropriate channel frequency and supported rates for Holland.
bool IsStateIdle(void) const
uint16_t GetGuardInterval(void) const
bool Is5Ghz(double frequency)
HT PHY for the 2.4 GHz band (clause 20)
void SetGreenfield(bool greenfield)
Enable or disable Greenfield support.
void Configure80211_10Mhz(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard with 10...
TimeWithUnit As(const enum Unit unit) const
Attach a unit to a Time, to facilitate output in a specific unit.
TracedCallback< Ptr< const Packet >, WifiPhyRxfailureReason > m_phyRxDropTrace
The trace source fired when the PHY layer drops a packet it has received.
std::pair< uint16_t, uint16_t > FrequencyWidthPair
A pair of a center Frequency (MHz) and a ChannelWidth (MHz)
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
uint8_t m_nTxPower
Number of available transmission power levels.
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
double GetTxPowerForTransmission(WifiTxVector txVector) const
Compute the transmit power (in dBm) for the next transmission.
virtual void SetFrequency(uint16_t freq)
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
void SetFrameCaptureModel(const Ptr< FrameCaptureModel > frameCaptureModel)
Sets the frame capture model.
void ResetCca(bool powerRestricted, double txPowerMaxSiso=0, double txPowerMaxMimo=0)
Reset PHY to IDLE, with some potential TX power restrictions for the next transmission.
TracedCallback< Ptr< const Packet >, uint16_t, WifiTxVector, MpduInfo > m_phyMonitorSniffTxTrace
A trace source that emulates a Wi-Fi device in monitor mode sniffing a packet being transmitted...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
uint8_t m_initialChannelNumber
Initial channel number.
void NotifyRxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxEnd trace.
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
bool IsStateSleep(void) const
void NotifyEndOfHePreamble(HePreambleParameters params)
Public method used to fire a EndOfHePreamble trace once both HE SIG fields have been received...
double snr
SNR in linear scale.
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
void ConfigureDefaultsForStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
struct InterferenceHelper::SnrPer CalculateNonHtPhyHeaderSnrPer(Ptr< Event > event) const
Calculate the SNIR at the start of the non-HT PHY header and accumulate all SNIR changes in the SNIR ...
MpduType
The type of an MPDU.
double GetRxSensitivity(void) const
Return the receive sensitivity threshold (dBm).
void NotifyTxEnd(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxEnd trace.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
WifiModeList m_deviceMcsSet
the device MCS set
uint16_t m_channelCenterFrequency
Center frequency in MHz.
void SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
uint16_t GetChannelWidth(void) const
bool m_powerRestricted
Flag whether transmit power is restricted by OBSS PD SR.
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
WifiPreamble GetPreambleType(void) const
static Time GetPhyHtSigHeaderDuration(WifiPreamble preamble)
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, uint16_t frequency)
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Keep track of the current position and velocity of an object.
static ChannelToFrequencyWidthMap m_channelToFrequencyWidth
the channel to frequency width map
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
The MPDU is not part of an A-MPDU.
uint8_t bssColor
BSS color.
The MPDU is the first aggregate in an A-MPDU with multiple MPDUs, but is not the last aggregate...
HE PHY for the 5 GHz band (clause 26)
bool DoFrequencySwitch(uint16_t frequency)
The default implementation does nothing and returns true.
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
void StartReceiveHeader(Ptr< Event > event)
Start receiving the PHY header of a PPDU (i.e.
static WifiMode GetHtPhyHeaderMode()
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
AttributeValue implementation for Time.
void StartRx(Ptr< Event > event, double rxPowerW)
Starting receiving the PPDU after having detected the medium is idle or after a reception switch...
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
receive notifications about PHY events.
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
The trace source fired when the PHY layer drops a packet as it tries to transmit it.
Time GetEnergyDuration(double energyW) const
double m_txPowerMaxMimo
MIMO maximum transmit power due to OBSS PD SR power restriction (dBm)
bool m_shortPreamble
Flag if short PHY preamble is supported.
static WifiMode GetHeMcs3()
Return MCS 3 from HE MCS values.
Hold an unsigned integer type.
static WifiMode CreateWifiMode(std::string uniqueName, WifiModulationClass modClass, bool isMandatory, WifiCodeRate codingRate, uint16_t constellationSize)
EventId m_endTxEvent
the end of transmit event
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Ptr< WifiRadioEnergyModel > m_wifiRadioEnergyModel
Wifi radio energy model.
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
The MPDU is part of an A-MPDU with multiple MPDUs, but is neither the first nor the last aggregate...
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
WifiMode GetHtMcs(uint8_t mcs) const
Get the WifiMode object corresponding to the given MCS of the HT modulation class.
void NotifyChannelAccessRequested(void)
Notify the PHY that an access to the channel was requested.
WifiMode GetMode(void) const
static WifiMode GetHeMcs11()
Return MCS 11 from HE MCS values.
The PHY layer has sense the medium busy through the CCA mechanism.
Time GetDelayUntilIdle(void)
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU...
void Configure80211_5Mhz()
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard with 5M...
FrequencyWidthPair GetFrequencyWidthForChannelNumberStandard(uint8_t channelNumber, WifiPhyStandard standard) const
Lookup frequency/width pair for channelNumber/standard pair.
TracedCallback< HePreambleParameters > m_phyEndOfHePreambleTrace
A trace source that indicates the end of both HE SIG fields as well as training fields for received 8...
double CalculateSnr(WifiTxVector txVector, double ber) const
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
void SetCapabilitiesChangedCallback(Callback< void > callback)
void SetOffMode(void)
Put in off mode.
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
WifiModulationClass GetModulationClass() const
Ptr< PreambleDetectionModel > m_preambleDetectionModel
Preamble detection model.
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
EventId m_endPreambleDetectionEvent
the end of preamble detection event
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
void NotifyRxBegin(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyRxBegin trace.
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, double rxPowerW)
Start receiving the PHY preamble of a PPDU (i.e.
static WifiMode GetVhtPhyHeaderMode()
static WifiMode GetHeMcs9()
Return MCS 9 from HE MCS values.
double f(double x, void *params)
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Ptr< MobilityModel > GetMobility(void) const
Return the mobility model this PHY is associated with.
static Time GetPreambleDetectionDuration(void)
static Time GetPhySigA1Duration(WifiPreamble preamble)
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
static TypeId GetTypeId(void)
Get the type ID.
Time GetChannelSwitchDelay(void) const
OFDM PHY for the 5 GHz band (Clause 17)
void ContinueReceiveHeader(Ptr< Event > event)
Continue receiving the PHY header of a PPDU (i.e.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void NotifyRxStart()
Notify that RX has started.
Hold objects of type Ptr<T>.
void SetWifiRadioEnergyModel(const Ptr< WifiRadioEnergyModel > wifiRadioEnergyModel)
Sets the wifi radio energy model.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time m_guardInterval
Supported HE guard interval (deprecated)
void EraseEvents(void)
Erase all events.
uint16_t GetFrequency(void) const
uint8_t GetNumberOfAntennas(void) const
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
void NotifyTxDrop(Ptr< const WifiPsdu > psdu)
Public method used to fire a PhyTxDrop trace.
static WifiMode GetHeMcs1()
Return MCS 1 from HE MCS values.
TracedCallback< Ptr< const Packet >, double > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
virtual void StartTx(Ptr< WifiPpdu > ppdu)=0
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
void SetShortGuardInterval(bool shortGuardInterval)
Enable or disable support for HT/VHT short guard interval.
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
struct InterferenceHelper::SnrPer CalculateHtPhyHeaderSnrPer(Ptr< Event > event) const
Calculate the SNIR at the start of the HT PHY header and accumulate all SNIR changes in the SNIR vect...
static WifiMode GetHeMcs10()
Return MCS 10 from HE MCS values.
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
static WifiMode GetHeMcs2()
Return MCS 2 from HE MCS values.
static Time GetPhyTrainingSymbolDuration(WifiTxVector txVector)
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
void SetMaxSupportedRxSpatialStreams(uint8_t streams)
bool GetShortPhyPreambleSupported(void) const
Return whether short PHY preamble is supported.
double CalculateSnr(Ptr< Event > event) const
Calculate the SNIR for the event (starting from now until the event end).
double m_ccaEdThresholdW
Clear channel assessment (CCA) threshold in watts.
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
virtual void SetChannelNumber(uint8_t id)
Set channel number.
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
void Configure80211ac(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11ac standard...
virtual void DoInitialize(void)
Initialize() implementation.
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
double WToDbm(double w)
Convert from Watts to dBm.
uint8_t GetChannelNumber(void) const
Return current channel number.
WifiPhyStandard m_standard
WifiPhyStandard.
static Time Now(void)
Return the current simulation virtual time.
void SetGuardInterval(Time guardInterval)
uint8_t FindChannelNumberForFrequencyWidth(uint16_t frequency, uint16_t width) const
Look for channel number matching the frequency and width.
bool m_channelAccessRequested
Flag if channels access has been requested (used for OBSS_PD SR)
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
void EndReceive(Ptr< Event > event)
The last symbol of the PPDU has arrived.
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Ptr< Event > Add(Ptr< const WifiPpdu > ppdu, WifiTxVector txVector, Time duration, double rxPower)
Add the PPDU-related signal to interference helper.
struct InterferenceHelper::SnrPer CalculatePayloadSnrPer(Ptr< Event > event, std::pair< Time, Time > relativeMpduStartStop) const
Calculate the SNIR at the start of the payload and accumulate all SNIR changes in the SNIR vector for...
static Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, uint16_t frequency, MpduType mpdutype=NORMAL_MPDU)
double DbToRatio(double dB)
Convert from dB to ratio.
uint8_t m_txSpatialStreams
Number of supported TX spatial streams.
double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
double RatioToDb(double ratio)
Convert from ratio to dB.
Ptr< ErrorModel > m_postReceptionErrorModel
Error model for receive packet events.
static WifiMode GetPhyHeaderMode(WifiTxVector txVector)
void InitializeFrequencyChannelNumber(void)
post-construction setting of frequency and/or channel number
std::vector< uint16_t > GetSupportedChannelWidthSet(void) const
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Ptr< FrameCaptureModel > m_frameCaptureModel
Frame capture model.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetRxGain(double gain)
Sets the reception gain (dB).
void Configure80211b(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11b standard...
No explicit coding (e.g., DSSS rates)
void SetReceiveOkCallback(RxOkCallback callback)
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
uint16_t m_channelWidth
Channel width (MHz)
uint8_t GetBssMembershipSelector(uint8_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
void RegisterListener(WifiPhyListener *listener)
bool IsStateTx(void) const
void ConfigureChannelForStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
void SetMaxSupportedTxSpatialStreams(uint8_t streams)
The PHY layer is sending a packet.
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
bool m_greenfield
Flag if GreenField format is supported (deprecated)
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
EventId m_endRxEvent
the end of receive event
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
void SetEdThreshold(double threshold)
Sets the energy detection threshold (dBm).
void Configure80211n(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11n standard...
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
double m_txPowerBaseDbm
Minimum transmission power (dBm)
bool IsMcsSupported(WifiMode mcs) const
Check if the given WifiMode is supported by the PHY.
void NotifyRxEnd()
Notify that RX has ended.
void SetNoiseFigure(double value)
Set the noise figure.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
void ResetReceive(Ptr< Event > event)
Reset PHY at the end of the packet under reception after it has failed the PHY header.
SignalNoiseDbm structure.
uint32_t mpduRefNumber
MPDU ref number.
bool m_frequencyChannelNumberInitialized
Store initialization state.
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
InterferenceHelper m_interference
Pointer to InterferenceHelper.
virtual void SetChannelWidth(uint16_t channelWidth)
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
bool m_isConstructed
true when ready to set frequency
void NotifyTxBegin(Ptr< const WifiPsdu > psdu, double txPowerW)
Public method used to fire a PhyTxBegin trace.
The MPDU is the last aggregate in an A-MPDU with multiple MPDUs.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void ConfigureHtDeviceMcsSet(void)
Configure the device MCS set with the appropriate HtMcs modes for the number of available transmit sp...
void PushMcs(WifiMode mode)
Add the given MCS to the device MCS set.
Time Seconds(double value)
Construct a Time in the indicated unit.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
The PHY layer is receiving a packet.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
static Time GetPhySigA2Duration(WifiPreamble preamble)
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
void EndReceiveInterBss(void)
For HE receptions only, check and possibly modify the transmit power restriction state at the end of ...
Attribute or trace source is deprecated; user is warned.
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
void StartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
The PHY layer is switched off.
void Send(Ptr< const WifiPsdu > psdu, WifiTxVector txVector)
void Configure80211g(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11g standard...
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
uint8_t GetTxPowerLevel(void) const
void NotifyMonitorSniffTx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being transmitted.
double GetTxGain(void) const
Return the transmission gain (dB).
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
The PHY layer is switching to other channel.
void SetSleepMode(void)
Put in sleep mode.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiModeList m_deviceRateSet
This vector holds the set of transmission modes that this WifiPhy(-derived class) can support...
void SetNumberOfAntennas(uint8_t antennas)
uint16_t GetChannelWidth(void) const
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
std::map< WifiModulationClass, std::map< uint8_t, uint8_t > > m_mcsIndexMap
Maps MCS values to indices in m_deviceMcsSet, for HT, VHT and HE modulation classes.
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
static Time GetPhyHeaderDuration(WifiTxVector txVector)
A base class which provides memory management and object aggregation.
Time FemtoSeconds(uint64_t value)
Construct a Time in the indicated unit.
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
virtual void ConfigureStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
static Time GetStartOfPacketDuration(WifiTxVector txVector)
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
int64_t GetFemtoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
double m_txPowerEndDbm
Maximum transmission power (dBm)
bool IsNull(void) const
Check for null implementation.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
The MPDU is a single MPDU.
Time m_channelSwitchDelay
Time required to switch between channel.
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
uint8_t GetMcsValue(void) const
Ptr< HtConfiguration > GetHtConfiguration(void) const
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass)
uint8_t m_numberOfAntennas
Number of transmitters.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
a unique identifier for an interface.
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
Ptr< Event > m_currentEvent
Hold the current event.
static Time GetPhySigBDuration(WifiPreamble preamble)
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
double m_txPowerMaxSiso
SISO maximum transmit power due to OBSS PD SR power restriction (dBm)
bool IsStateRx(void) const
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
uint8_t m_rxSpatialStreams
Number of supported RX spatial streams.
Ptr< T > Copy(Ptr< T > object)
Return a deep copy of a Ptr.
std::vector< uint16_t > m_supportedChannelWidthSet
Supported channel width set (MHz)
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
void SwitchMaybeToCcaBusy(void)
Check if PHY state should move to CCA busy state based on current state of interference tracker...
void SetCcaEdThreshold(double threshold)
Sets the CCA threshold (dBm).
bool m_shortGuardInterval
Flag if HT/VHT short guard interval is supported (deprecated)
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
static WifiMode GetHeMcs6()
Return MCS 6 from HE MCS values.
void NotifyMonitorSniffRx(Ptr< const WifiPsdu > psdu, uint16_t channelFreqMhz, WifiTxVector txVector, SignalNoiseDbm signalNoise, std::vector< bool > statusPerMpdu)
Public method used to fire a MonitorSniffer trace for a wifi PSDU being received. ...
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
uint8_t GetNss(void) const
Callback< void > m_capabilitiesChangedCallback
Callback when PHY capabilities changed.
void Configure80211a(void)
Configure WifiPhy with appropriate channel frequency and supported rates for 802.11a standard...
uint8_t GetMaxSupportedRxSpatialStreams(void) const
std::map< ChannelNumberStandardPair, FrequencyWidthPair > ChannelToFrequencyWidthMap
channel to frequency width map typedef
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
uint16_t m_initialFrequency
Store frequency until initialization (MHz)
Parameters for receive HE preamble.
static Time CalculatePhyPreambleAndHeaderDuration(WifiTxVector txVector)
bool DoChannelSwitch(uint8_t id)
The default implementation does nothing and returns true.
Time GetGuardInterval(void) const