30 return std::log (val) / std::log (2.0);
37 double ratio = std::pow (10.0, dB / 10.0);
44 double mW = std::pow (10.0, dBm / 10.0);
51 return 10.0 * std::log10 (w * 1000.0);
57 return 10.0 * std::log10 (ratio);
63 if (frequency >= 2400 && frequency <= 2500)
73 if (frequency >= 5000 && frequency <= 6000)
90 gi = htShortGuardInterval ? 400 : 800;
146 IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize)
148 return ((seq - winstart + 4096) % 4096) < winsize;
Simulation virtual time values and global simulation resolution.
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
uint32_t GetRtsSize(void)
Return the total RTS size (including FCS trailer).
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
Convert the guard interval to nanoseconds based on the wifimode.
double DbmToW(double dBm)
Convert from dBm to Watts.
bool Is2_4Ghz(double frequency)
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...
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
uint32_t GetAckSize(void)
Return the total ACK size (including FCS trailer).
bool Is5Ghz(double frequency)
BlockAckType
Enumeration for different block ACK policies.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
double WToDbm(double w)
Convert from Watts to dBm.
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).
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
uint32_t GetBlockAckSize(BlockAckType type)
Return the total Block ACK size (including FCS trailer).
WifiModulationClass GetModulationClass() const
SpectrumValue Log2(const SpectrumValue &arg)
Implements the IEEE 802.11 MAC trailer.
uint32_t GetSerializedSize(void) const