11#ifndef WIFI_PHY_COMMON_H
12#define WIFI_PHY_COMMON_H
18#include "ns3/fatal-error.h"
51 std::vector<WifiSpectrumBandIndices>
53 std::vector<WifiSpectrumBandFrequencies>
93 for (std::size_t segmentIndex = 0; segmentIndex < band.
indices.size(); ++segmentIndex)
95 os <<
"indices segment" << segmentIndex <<
": [" << band.
indices.at(segmentIndex).first
96 <<
"-" << band.
indices.at(segmentIndex).second <<
"], frequencies segment"
97 << segmentIndex <<
": [" << band.
frequencies.at(segmentIndex).first <<
"Hz-"
98 << band.
frequencies.at(segmentIndex).second <<
"Hz] ";
140 return (os <<
"Code rate undefined");
142 return (os <<
"Code rate 1/2");
144 return (os <<
"Code rate 2/3");
146 return (os <<
"Code rate 3/4");
148 return (os <<
"Code rate 5/6");
150 return (os <<
"Code rate 5/8");
152 return (os <<
"Code rate 13/16");
154 return (os <<
"Code rate 1/4");
156 return (os <<
"Code rate 13/28");
158 return (os <<
"Code rate 13/21");
160 return (os <<
"Code rate 52/63");
162 return (os <<
"Code rate 13/14");
164 return (os <<
"Code rate 7/8");
167 return (os <<
"Unknown");
206 return (os <<
"LONG");
208 return (os <<
"SHORT");
210 return (os <<
"HT_MF");
212 return (os <<
"VHT_SU");
214 return (os <<
"VHT_MU");
216 return (os <<
"DMG_CTRL");
218 return (os <<
"DMG_SC");
220 return (os <<
"DMG_OFDM");
222 return (os <<
"HE_SU");
224 return (os <<
"HE_ER_SU");
226 return (os <<
"HE_MU");
228 return (os <<
"HE_TB");
230 return (os <<
"EHT_MU");
232 return (os <<
"EHT_TB");
235 return (os <<
"INVALID");
277 return (os <<
"DSSS");
279 return (os <<
"HR/DSSS");
281 return (os <<
"ERP-OFDM");
283 return (os <<
"OFDM");
287 return (os <<
"VHT");
289 return (os <<
"DMG_CTRL");
291 return (os <<
"DMG_OFDM");
293 return (os <<
"DMG_SC");
295 return (os <<
"DMG_LP_SC");
299 return (os <<
"EHT");
302 return (os <<
"unknown");
348 return (os <<
"preamble");
350 return (os <<
"non-HT header");
352 return (os <<
"HT-SIG");
354 return (os <<
"training");
356 return (os <<
"SIG-A");
358 return (os <<
"SIG-B");
360 return (os <<
"U-SIG");
362 return (os <<
"EHT-SIG");
364 return (os <<
"data");
367 return (os <<
"unknown");
397 return (os <<
"DL MU");
399 return (os <<
"UL MU");
402 return (os <<
"unknown");
452 return (os <<
"UNSUPPORTED_SETTINGS");
454 return (os <<
"CHANNEL_SWITCHING");
456 return (os <<
"RXING");
458 return (os <<
"TXING");
460 return (os <<
"SLEEPING");
462 return (os <<
"OFF");
464 return (os <<
"TRUNCATED_TX");
466 return (os <<
"BUSY_DECODING_PREAMBLE");
468 return (os <<
"PREAMBLE_DETECT_FAILURE");
470 return (os <<
"RECEPTION_ABORTED_BY_TX");
472 return (os <<
"L_SIG_FAILURE");
474 return (os <<
"HT_SIG_FAILURE");
476 return (os <<
"SIG_A_FAILURE");
478 return (os <<
"SIG_B_FAILURE");
480 return (os <<
"U_SIG_FAILURE");
482 return (os <<
"EHT_SIG_FAILURE");
484 return (os <<
"PREAMBLE_DETECTION_PACKET_SWITCH");
486 return (os <<
"FRAME_CAPTURE_PACKET_SWITCH");
488 return (os <<
"OBSS_PD_CCA_RESET");
490 return (os <<
"PPDU_TOO_LATE");
492 return (os <<
"FILTERED");
494 return (os <<
"DMG_HEADER_FAILURE");
496 return (os <<
"DMG_ALLOCATION_ENDED");
498 return (os <<
"SIGNAL_DETECTION_ABORTED_BY_TX");
502 return (os <<
"UNKNOWN");
533 return (os <<
"PRIMARY");
535 return (os <<
"SECONDARY");
537 return (os <<
"SECONDARY40");
539 return (os <<
"SECONDARY80");
541 return (os <<
"SECONDARY160");
544 return (os <<
"UNKNOWN");
561 return (os <<
"20MHz");
563 return (os <<
"22MHz");
565 return (os <<
"5MHz");
567 return (os <<
"10MHz");
569 return (os <<
"40MHz");
571 return (os <<
"80MHz");
573 return (os <<
"160MHz");
575 return (os <<
"80+80MHz");
577 return (os <<
"320MHz");
579 return (os <<
"2160MHz");
582 return (os <<
"UNKNOWN");
616 bool useShortPreamble =
false);
638 WifiModulationClass modClassAnswer);
657bool IsMu(WifiPreamble preamble);
665bool IsDlMu(WifiPreamble preamble);
673bool IsUlMu(WifiPreamble preamble);
718bool IsEht(WifiPreamble preamble);
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
WifiChannelWidthType
Enumeration of the possible channel widths.
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
WifiPpduField
The type of PPDU field (grouped for convenience)
@ PREAMBLE_DETECT_FAILURE
@ FRAME_CAPTURE_PACKET_SWITCH
@ SIGNAL_DETECTION_ABORTED_BY_TX
@ RECEPTION_ABORTED_BY_TX
@ PREAMBLE_DETECTION_PACKET_SWITCH
@ WIFI_MOD_CLASS_DMG_OFDM
DMG (Clause 21)
@ WIFI_MOD_CLASS_DMG_CTRL
DMG (Clause 21)
@ 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_DMG_SC
DMG (Clause 21)
@ 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_DMG_LP_SC
DMG (Clause 21)
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
@ WIFI_CHANLIST_SECONDARY40
@ WIFI_CHANLIST_SECONDARY
@ WIFI_CHANLIST_SECONDARY160
@ WIFI_CHANLIST_SECONDARY80
@ WIFI_PPDU_FIELD_SIG_B
SIG-B field.
@ WIFI_PPDU_FIELD_TRAINING
STF + LTF fields (excluding those in preamble for HT-GF)
@ WIFI_PPDU_FIELD_NON_HT_HEADER
PHY header field for DSSS or ERP, short PHY header field for HR/DSSS or ERP, field not present for HT...
@ WIFI_PPDU_FIELD_EHT_SIG
EHT-SIG field.
@ WIFI_PPDU_FIELD_HT_SIG
HT-SIG field.
@ WIFI_PPDU_FIELD_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
@ WIFI_PPDU_FIELD_U_SIG
U-SIG field.
@ WIFI_PPDU_FIELD_DATA
data field
@ WIFI_PPDU_FIELD_SIG_A
SIG-A field.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetPpduMaxTime(WifiPreamble preamble)
Get the maximum PPDU duration (see Section 10.14 of 802.11-2016) for the PHY layers defining the aPPD...
const std::map< WifiChannelListType, dBm_u > channelTypeToScalingFactor
map a given channel list type to the corresponding scaling factor
bool IsEht(WifiPreamble preamble)
Return true if a preamble corresponds to an EHT transmission.
Time GetGuardIntervalForMode(WifiMode mode, const Ptr< WifiNetDevice > device)
Get the guard interval for a given WifiMode.
std::ostream & operator<<(std::ostream &os, const Angles &a)
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed.
bool IsMu(WifiPreamble preamble)
Return true if a preamble corresponds to a multi-user transmission.
std::vector< WifiSpectrumBandInfo > WifiSpectrumBands
vector of spectrum bands
double MHz_u
MHz weak type.
WifiModulationClass GetModulationClassForPreamble(WifiPreamble preamble)
Return the modulation class corresponding to the given preamble type.
std::pair< Hz_u, Hz_u > WifiSpectrumBandFrequencies
typedef for a pair of start and stop frequencies to represent a band
MHz_u GetMaximumChannelWidth(WifiModulationClass modulation)
Get the maximum channel width allowed for the given modulation class.
bool operator<(const EventId &a, const EventId &b)
MHz_u GetChannelWidthInMhz(WifiChannelWidthType width)
Get the total channel width for the channel width type.
WifiModulationClass GetModulationClassForStandard(WifiStandard standard)
Return the modulation class corresponding to a given standard.
bool IsDlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a downlink multi-user transmission.
std::set< MHz_u > GetSupportedChannelWidthSet(WifiStandard standard, WifiPhyBand band)
Get the supported channel width set that can be advertised in PHY capabilities.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
bool IsUlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a uplink multi-user transmission.
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
@ WIFI_CODE_RATE_2_3
2/3 coding rate
@ WIFI_CODE_RATE_13_21
13/21 coding rate
@ WIFI_CODE_RATE_1_2
1/2 coding rate
@ WIFI_CODE_RATE_3_4
3/4 coding rate
@ WIFI_CODE_RATE_1_4
1/4 coding rate
@ WIFI_CODE_RATE_UNDEFINED
undefined coding rate
@ WIFI_CODE_RATE_7_8
7/8 coding rate
@ WIFI_CODE_RATE_52_63
52/63 coding rate
@ WIFI_CODE_RATE_13_14
13/14 coding rate
@ WIFI_CODE_RATE_13_28
13/28 coding rate
@ WIFI_CODE_RATE_5_6
5/6 coding rate
@ WIFI_CODE_RATE_5_8
5/8 coding rate
@ WIFI_CODE_RATE_13_16
13/16 coding rate
WifiSpectrumBandInfo structure containing info about a spectrum band.
std::vector< WifiSpectrumBandFrequencies > frequencies
the start and stop frequencies for each segment of the band
std::vector< WifiSpectrumBandIndices > indices
the start and stop indices for each segment of the band