21 #include "ns3/packet.h" 22 #include "ns3/nstime.h" 34 return std::pow (10.0, 0.1 * dB);
40 return std::pow (10.0, 0.1 * (dBm - 30.0));
46 return 10.0 * std::log10 (w) + 30.0;
52 return 10.0 * std::log10 (ratio);
58 return frequency >= 2400 && frequency <= 2500;
64 return frequency >= 5000 && frequency <= 6000;
77 gi = htShortGuardInterval ? 400 : 800;
133 IsInWindow (uint16_t seq, uint16_t winstart, uint16_t winsize)
135 return ((seq - winstart + 4096) % 4096) < winsize;
Simulation virtual time values and global simulation resolution.
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).
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 GetAckSize(void)
Return the total ACK size (including FCS trailer).
bool Is5Ghz(double frequency)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
uint32_t GetSerializedSize(void) const
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.
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).
uint32_t GetBlockAckSize(BlockAckType type)
Return the total Block ACK size (including FCS trailer).
Implements the IEEE 802.11 MAC trailer.
BlockAckType
The different block ACK policies.