27 #include "ns3/wifi-phy.h"
28 #include "ns3/wifi-psdu.h"
37 uint16_t txCenterFreq,
40 bool instantiateLSig )
41 :
WifiPpdu(psdu, txVector, txCenterFreq, uid),
43 m_channelWidth(txVector.IsNonHtDuplicate() ? 20 : txVector.GetChannelWidth())
45 NS_LOG_FUNCTION(
this << psdu << txVector << txCenterFreq << band << uid);
57 #ifdef NS3_BUILD_PROFILE_DEBUG
79 #ifdef NS3_BUILD_PROFILE_DEBUG
108 #ifdef NS3_BUILD_PROFILE_DEBUG
113 length = m_lSig.GetLength();
135 .SetGroupName(
"Wifi")
149 os <<
"SIGNAL=" << GetRate() <<
" LENGTH=" << m_length;
161 if (channelWidth == 5)
165 else if (channelWidth == 10)
245 if (channelWidth == 5)
249 else if (channelWidth == 10)
276 byte |= (m_length & 0x07) << 5;
279 bytes |= (m_length & 0x0ff8) >> 3;
280 start.WriteU16(bytes);
288 uint8_t
byte = i.
ReadU8();
289 m_rate =
byte & 0x0f;
290 m_length = (
byte >> 5) & 0x07;
293 m_length |= (bytes << 3) & 0x0ff8;
iterator in a Buffer instance
uint32_t GetDistanceFrom(const Iterator &o) const
static WifiMode GetOfdmRate(uint64_t rate, uint16_t bw=20)
Return a WifiMode for OFDM corresponding to the provided rate and the channel bandwidth (20,...
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
void SetLSigHeader(LSigHeader &lSig, const WifiTxVector &txVector, std::size_t psduSize) const
Fill in the L-SIG header.
OfdmPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint16_t txCenterFreq, WifiPhyBand band, uint64_t uid, bool instantiateLSig=true)
Create an OFDM PPDU.
void SetPhyHeaders(const WifiTxVector &txVector, std::size_t psduSize)
Fill in the PHY headers.
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz (needed to distinguish 5 MHz, 10 MHz or 20 MHz PP...
Ptr< WifiPpdu > Copy() const override
Copy this instance.
virtual void SetTxVectorFromLSigHeader(WifiTxVector &txVector, const LSigHeader &lSig) const
Fill in the TXVECTOR from L-SIG header.
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
WifiPreamble m_preamble
the PHY preamble
const WifiTxVector & GetTxVector() const
Get the TXVECTOR used to send the PPDU.
Ptr< Packet > m_phyHeaders
the PHY headers contained in this PPDU
uint32_t GetSize() const
Return the size of the PSDU in bytes.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
WifiPhyBand
Identifies the PHY band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Declaration of ns3::OfdmPhy class and ns3::OfdmPhyVariant enum.
Declaration of ns3::OfdmPpdu class.