|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
23 #include "ns3/wifi-phy.h"
24 #include "ns3/wifi-psdu.h"
25 #include "ns3/wifi-utils.h"
36 :
OfdmPpdu (psdu, txVector, band, uid, false)
38 NS_LOG_FUNCTION (
this << psdu << txVector << ppduDuration << band << uid);
39 uint8_t sigExtension = 0;
44 uint16_t length = ((ceil ((
static_cast<double> (ppduDuration.
GetNanoSeconds () - (20 * 1000) - (sigExtension * 1000)) / 1000) / 4.0) * 3) - 3);
103 .SetGroupName (
"Wifi")
118 os <<
"MCS=" << +m_mcs
119 <<
" HT_LENGTH=" << m_htLength
120 <<
" CHANNEL_WIDTH=" << GetChannelWidth ()
122 <<
" AGGREGATION=" << +m_aggregation;
147 m_cbw20_40 = (channelWidth > 20) ? 1 : 0;
153 return m_cbw20_40 ? 40 : 20;
171 m_aggregation = aggregation ? 1 : 0;
177 return m_aggregation ? true :
false;
189 return m_sgi ? true :
false;
195 uint8_t
byte = m_mcs;
196 byte |= ((m_cbw20_40 & 0x01) << 7);
197 start.WriteU8 (
byte);
198 start.WriteU16 (m_htLength);
200 byte |= ((m_aggregation & 0x01) << 3);
201 byte |= ((m_sgi & 0x01) << 7);
202 start.WriteU8 (
byte);
210 uint8_t
byte = i.
ReadU8 ();
212 m_cbw20_40 = ((
byte >> 7) & 0x01);
215 m_aggregation = ((
byte >> 3) & 0x01);
216 m_sgi = ((
byte >> 7) & 0x01);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
uint32_t GetDistanceFrom(Iterator const &o) const
WifiTxVector GetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual ~HtPpdu()
Destructor for HtPpdu.
static WifiMode GetHtMcs(uint8_t index)
Return the HT MCS corresponding to the provided index.
Declaration of ns3::HtPpdu class.
LSigHeader m_lSig
the L-SIG PHY header
uint32_t GetSize(void) const
Return the size of the PSDU in bytes.
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
Simulation virtual time values and global simulation resolution.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
HtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create an HT PPDU.
HtSigHeader m_htSig
the HT-SIG PHY header
iterator in a Buffer instance
uint16_t GetGuardInterval(void) const
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Time Seconds(double value)
Construct a Time in the indicated unit.
#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.
uint64_t m_uid
the unique ID of this PPDU
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
WifiPreamble m_preamble
the PHY preamble
Declaration of ns3::HtPhy class.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
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.
uint8_t GetMcsValue(void) const