16#include "ns3/wifi-phy-operating-channel.h"
17#include "ns3/wifi-phy.h"
18#include "ns3/wifi-psdu.h"
36 NS_LOG_FUNCTION(
this << psdu << txVector << channel << ppduDuration << uid);
52 ((ceil((
static_cast<double>(ppduDuration.
GetNanoSeconds() - (20 * 1000)) / 1000) / 4.0) *
61 Time ppduDuration)
const
108 const auto tSymbol =
NanoSeconds(3200) + txVector.GetGuardInterval();
110 const auto calculatedDuration =
111 MicroSeconds(((ceil(
static_cast<double>(length + 3) / 3)) * 4) + 20);
113 floor(
static_cast<double>((calculatedDuration - preambleDuration).GetNanoSeconds()) /
114 tSymbol.GetNanoSeconds());
115 if (sgi && sgiDisambiguation)
119 return (preambleDuration + (nSymbols * tSymbol));
138 m_sgi_disambiguation(0),
153 if (channelWidth == 160)
157 else if (channelWidth == 80)
161 else if (channelWidth == 40)
196 m_nsts = (nStreams - 1);
220 m_sgi_disambiguation = disambiguation ? 1 : 0;
226 return m_sgi_disambiguation;
LSigHeader m_lSig
the L-SIG PHY header
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
virtual void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
WifiPpduType GetType() const override
Return the PPDU type (.
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
VhtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, const WifiPhyOperatingChannel &channel, Time ppduDuration, uint64_t uid)
Create a VHT PPDU.
void SetTxVectorFromPhyHeaders(WifiTxVector &txVector, const LSigHeader &lSig, const VhtSigHeader &vhtSig) const
Fill in the TXVECTOR from PHY headers.
void SetVhtSigHeader(VhtSigHeader &vhtSig, const WifiTxVector &txVector, Time ppduDuration) const
Fill in the VHT-SIG header.
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Ptr< WifiPpdu > Copy() const override
Copy this instance.
virtual void SetLSigHeader(LSigHeader &lSig, Time ppduDuration) const
Fill in the L-SIG header.
uint8_t GetMcsValue() const
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
Class that keeps track of all information about the current PHY operating channel.
WifiPreamble m_preamble
the PHY preamble
Ptr< const WifiPsdu > GetPsdu() const
Get the payload of the PPDU.
const WifiTxVector & GetTxVector() const
Get the TXVECTOR used to send the PPDU.
bool IsAggregate() const
Return true if the PSDU is an S-MPDU or A-MPDU.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetGuardInterval(Time guardInterval)
Sets the guard interval duration (in nanoseconds)
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 SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
void SetChannelWidth(MHz_u channelWidth)
Sets the selected channelWidth.
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.
MHz_u GetChannelWidth() const
Time GetGuardInterval() const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
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_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 ",...
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Declaration of ns3::VhtPhy class.
Declaration of ns3::VhtPpdu class.