21 #include "ns3/nstime.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);
87 gi = htShortGuardInterval ? 400 : 800;
100 if (maxSupportedChannelWidth > 20
112 return maxSupportedChannelWidth;
135 else if (useShortPreamble)
213 IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize)
215 return ((seq - winstart + 4096) % 4096) < winsize;
Simulation virtual time values and global simulation resolution.
Ptr< HeConfiguration > GetHeConfiguration(void) const
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
uint32_t GetRtsSize(void)
Return the total RTS size (including FCS trailer).
double DbmToW(double dBm)
Convert from dBm to Watts.
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...
#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.
uint32_t GetAckSize(void)
Return the total Ack size (including FCS trailer).
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield)
Return the preamble to be used for the transmission.
Time GetGuardInterval(void) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
bool GetShortGuardIntervalSupported(void) const
uint32_t GetSerializedSize(void) const
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
WifiModulationClass GetModulationClass() const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
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 IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed...
double WToDbm(double w)
Convert from Watts to dBm.
uint32_t GetBlockAckRequestSize(BlockAckType type)
Return the total BlockAckRequest size (including FCS trailer).
double DbToRatio(double dB)
Convert from dB to ratio.
double RatioToDb(double ratio)
Convert from ratio to dB.
uint32_t GetCtsSize(void)
Return the total CTS size (including FCS trailer).
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Time GetPpduMaxTime(WifiPreamble preamble)
Get the maximum PPDU duration (see Section 10.14 of 802.11-2016) for the PHY layers defining the aPPD...
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< HtConfiguration > GetHtConfiguration(void) const
Implements the IEEE 802.11 MAC trailer.
BlockAckType
The different block ack policies.