21 #include "ns3/nstime.h"
27 #include "ns3/ht-configuration.h"
28 #include "ns3/he-configuration.h"
37 return std::pow (10.0, 0.1 * dB);
43 return std::pow (10.0, 0.1 * (dBm - 30.0));
49 return 10.0 * std::log10 (w) + 30.0;
55 return 10.0 * std::log10 (ratio);
66 gi =
static_cast<uint16_t
> (heConfiguration->GetGuardInterval ().GetNanoSeconds ());
72 gi = htConfiguration->GetShortGuardIntervalSupported () ? 400 : 800;
87 gi = htShortGuardInterval ? 400 : 800;
100 if (maxSupportedChannelWidth > 20
112 return maxSupportedChannelWidth;
198 for (
auto& t : types)
203 userInfo.SetMuBarTriggerDepUserInfo (bar);
225 IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize)
227 return ((seq - winstart + 4096) % 4096) < winsize;
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Simulation virtual time values and global simulation resolution.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Implements the IEEE 802.11 MAC trailer.
uint32_t GetSerializedSize(void) const
represent a single transmission mode
WifiModulationClass GetModulationClass() const
Ptr< HtConfiguration > GetHtConfiguration(void) const
Ptr< HeConfiguration > GetHeConfiguration(void) const
#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.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ 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)
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...
bool IsVht(WifiPreamble preamble)
Return whether the preamble is a VHT format preamble.
bool IsHt(WifiPreamble preamble)
Return whether the preamble is a HT format preamble.
double RatioToDb(double ratio)
Convert from ratio to dB.
double WToDbm(double w)
Convert from Watts to dBm.
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY's default ...
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed.
double DbmToW(double dBm)
Convert from dBm to Watts.
uint32_t GetAckSize(void)
Return the total Ack size (including FCS trailer).
uint32_t GetRtsSize(void)
Return the total RTS size (including FCS trailer).
uint32_t GetBlockAckRequestSize(BlockAckReqType type)
Return the total BlockAckRequest size (including FCS trailer).
uint32_t GetMuBarSize(std::list< BlockAckReqType > types)
Return the total MU-BAR size (including FCS trailer).
uint32_t GetCtsSize(void)
Return the total CTS size (including FCS trailer).
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
uint32_t GetSize(Ptr< const Packet > packet, const WifiMacHeader *hdr, bool isAmpdu)
Return the total size of the packet after WifiMacHeader and FCS trailer have been added.
double DbToRatio(double dB)
Convert from dB to ratio.
bool IsHe(WifiPreamble preamble)
Return whether the preamble is a HE format preamble.
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
The different BlockAckRequest variants.
The different BlockAck variants.