23 #include "ns3/wifi-phy.h" 24 #include "ns3/wifi-psdu.h" 35 :
OfdmPpdu (psdu, txVector, band, uid, false)
37 NS_LOG_FUNCTION (
this << psdu << txVector << ppduDuration << band << uid);
38 uint16_t length = ((ceil ((static_cast<double> (ppduDuration.
GetNanoSeconds () - (20 * 1000)) / 1000) / 4.0) * 3) - 3);
77 uint32_t nSymbols = floor (static_cast<double> ((calculatedDuration - preambleDuration).GetNanoSeconds ()) / tSymbol.
GetNanoSeconds ());
82 ppduDuration = preambleDuration + (nSymbols * tSymbol);
102 m_sgi_disambiguation (0),
117 .SetGroupName (
"Wifi")
132 os <<
"SU_MCS=" << +m_suMcs
133 <<
" CHANNEL_WIDTH=" << GetChannelWidth ()
135 <<
" NSTS=" << +m_nsts
161 if (channelWidth == 160)
165 else if (channelWidth == 80)
169 else if (channelWidth == 40)
204 m_nsts = (nStreams - 1);
222 return m_sgi ? true :
false;
228 m_sgi_disambiguation = disambiguation ? 1 : 0;
234 return m_sgi_disambiguation ? true :
false;
256 start.WriteU8 (byte);
257 uint16_t bytes = (m_nsts & 0x07) << 2;
258 bytes |= (0x01 << (23 - 8));
259 start.WriteU16 (bytes);
263 byte |= ((m_sgi_disambiguation & 0x01) << 1);
264 byte |= ((m_suMcs & 0x0f) << 4);
265 start.WriteU8 (byte);
266 bytes = (0x01 << (9 - 8));
267 start.WriteU16 (bytes);
282 uint8_t byte = i.
ReadU8 ();
285 m_nsts = ((bytes >> 2) & 0x07);
290 m_sgi_disambiguation = ((byte >> 1) & 0x01);
291 m_suMcs = ((byte >> 4) & 0x0f);
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
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)
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
LSigHeader m_lSig
the L-SIG PHY header
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
WifiTxVector GetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
uint64_t m_uid
the unique ID of this PPDU
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint16_t GetGuardInterval(void) const
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
iterator in a Buffer instance
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
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...
uint32_t GetDistanceFrom(Iterator const &o) const
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
WifiPreamble m_preamble
the PHY preamble
VhtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create a VHT PPDU.
void SetNss(uint8_t nss)
Sets the number of Nss.
OFDM PPDU (11a)OfdmPpdu stores a preamble, PHY headers and a PSDU of a PPDU with non-HT header...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Declaration of ns3::VhtPhy class.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
WifiPpduType GetType(void) const override
Return the PPDU type (.
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiPhyBand
Identifies the PHY band.
virtual ~VhtPpdu()
Destructor for VhtPpdu.
Time Seconds(double value)
Construct a Time in the indicated unit.
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
uint8_t GetMcsValue(void) const
Declaration of ns3::VhtPpdu class.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz