|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/wifi-psdu.h"
25 #include "ns3/wifi-phy.h"
27 #include "ns3/wifi-net-device.h"
28 #include "ns3/sta-wifi-mac.h"
29 #include "ns3/ap-wifi-mac.h"
30 #include "ns3/wifi-utils.h"
31 #include "ns3/simulator.h"
33 #include "ns3/assert.h"
141 uint8_t smallestMcs = 5;
144 smallestMcs =
std::min (smallestMcs, info.second.mcs.GetMcsValue ());
178 uint8_t nDataLtf, uint8_t nExtensionLtf )
const
191 NS_ABORT_MSG_IF (nDataLtf > 8,
"Unsupported number of LTFs " << +nDataLtf <<
" for HE");
192 NS_ABORT_MSG_IF (nExtensionLtf > 0,
"No extension LTFs expected for HE");
193 return stfDuration + ltfDuration * nDataLtf;
214 std::size_t commonFieldSize = 4 + 6 ;
217 commonFieldSize += 8;
221 commonFieldSize += 8 * (bw / 40) + 1 ;
234 std::size_t maxNumStaPerContentChannel =
std::max (numStaPerContentChannel.first, numStaPerContentChannel.second);
235 std::size_t maxNumUserBlockFields = maxNumStaPerContentChannel / 2;
236 std::size_t userSpecificFieldSize = maxNumUserBlockFields * (2 * 21 + 4 + 6 );
237 if (maxNumStaPerContentChannel % 2 != 0)
239 userSpecificFieldSize += 21 + 4 + 6 ;
249 double numSymbols = ceil ((commonFieldSize + userSpecificFieldSize) / numDataBitsPerSymbol);
263 uint8_t sigExtension = 0;
269 uint16_t length = ((ceil ((
static_cast<double> (ppduDuration.
GetNanoSeconds () - (20 * 1000) - (sigExtension * 1000)) / 1000) / 4.0) * 3) - 3 - m);
279 uint8_t sigExtension = 0;
286 Time calculatedDuration =
MicroSeconds (((ceil (
static_cast<double> (length + 3 + m) / 3)) * 4) + 20 + sigExtension);
287 uint32_t nSymbols = floor (
static_cast<double> ((calculatedDuration - preambleDuration).GetNanoSeconds () - (sigExtension * 1000)) / tSymbol.
GetNanoSeconds ());
288 Time ppduDuration = preambleDuration + (nSymbols * tSymbol) +
MicroSeconds (sigExtension);
312 NS_ASSERT (gi == 800 || gi == 1600 || gi == 3200);
340 auto hePpdu = DynamicCast<HePpdu> (ppdu);
351 NS_LOG_INFO (
"Switch to OFDMA part (already started? " << (ofdmaStarted ?
"Y" :
"N") <<
") " <<
362 NS_LOG_INFO (
"Consider OFDMA part of the HE TB PPDU as interference since device dropped the preamble");
380 beginOfdmaPayloadRxEvent.second.Cancel ();
394 endMpduEvent.Cancel ();
414 beginOfdmaPayloadRxEvent.second.Cancel ();
428 auto uidPreamblePair = std::make_pair (ppdu->GetUid (), ppdu->GetPreamble ());
432 auto it = currentPreambleEvents.find (uidPreamblePair);
433 if (it != currentPreambleEvents.end ())
435 NS_LOG_DEBUG (
"Received another HE TB PPDU for UID " << ppdu->GetUid () <<
" from STA-ID " << ppdu->GetStaId () <<
" and BSS color " << +txVector.
GetBssColor ());
446 NS_LOG_DEBUG (
"Drop packet because not received within the 400ns window");
456 NS_LOG_DEBUG (
"Drop packet because already receiving another HE TB PPDU");
463 NS_LOG_DEBUG (
"Received a new HE TB PPDU for UID " << ppdu->GetUid () <<
" from STA-ID " << ppdu->GetStaId () <<
" and BSS color " << +txVector.
GetBssColor ());
480 auto hePpdu = DynamicCast<const HePpdu> (ppdu);
490 uint8_t bssColor = 0;
497 bssColor = heConfiguration->GetBssColor ();
508 return ppdu->GetStaId ();
516 if (
mac &&
mac->IsAssociated ())
518 return mac->GetAssociationId ();
541 if (myBssColor != 0 && rxBssColor != 0 && myBssColor != rxBssColor)
543 NS_LOG_DEBUG (
"The BSS color of this PPDU (" << +rxBssColor <<
") does not match the device's (" << +myBssColor <<
"). The PPDU is filtered.");
557 NS_LOG_DEBUG (
"No PSDU addressed to that PHY in the received MU PPDU. The PPDU is filtered.");
588 NS_LOG_DEBUG (
"No PSDU addressed to that PHY in the received MU PPDU. The PPDU is filtered.");
607 if (info.first == staId)
609 nss = info.second.nss;
617 NS_LOG_DEBUG (
"Packet reception could not be started because not enough RX antennas");
622 NS_LOG_DEBUG (
"Drop packet because it was sent using an unsupported mode (" << txVector.
GetMode () <<
")");
638 bool isAp = device != 0 && (DynamicCast<ApWifiMac> (device->
GetMac ()) != 0);
641 NS_LOG_DEBUG (
"Ignore HE TB PPDU payload received by STA but keep state in Rx");
648 beginOfdmaPayloadRxEvent.second.Cancel ();
657 m_statusPerMpduMap.insert ({std::make_pair (ppdu->GetUid (), staId), std::vector<bool> ()});
663 NS_ASSERT (beginOfdmaPayloadRxEvent.second.IsRunning ());
681 if (it->IsExpired ())
710 auto it = rxPowersW.end ();
713 it = std::max_element (rxPowersW.begin (), rxPowersW.end (),
714 [] (
const std::pair<WifiSpectrumBand, double> &p1,
const std::pair<WifiSpectrumBand, double> &p2) {
715 return p1.second < p2.second;
735 m_statusPerMpduMap.insert ({std::make_pair (ppdu->GetUid (), ppdu->GetStaId ()), std::vector<bool> ()});
738 std::pair<uint16_t, WifiSpectrumBand>
741 if (txVector.
IsMu ())
759 NS_ASSERT (channelWidth <= m_wifiPhy->GetChannelWidth ());
776 NS_ASSERT (channelWidth <= m_wifiPhy->GetChannelWidth ());
791 NS_ASSERT (channelWidth <= m_wifiPhy->GetChannelWidth ());
801 HeRu::SubcarrierRange range = std::make_pair (groupPreamble.front ().first, groupPreamble.back ().second);
869 auto hePpdu = DynamicCast<const HePpdu> (ppdu);
886 channelWidth = ruWidth < 20 ? 20 : ruWidth;
890 std::get<0> (txMaskRejectionParams), std::get<1> (txMaskRejectionParams), std::get<2> (txMaskRejectionParams));
905 if (nonOfdmaWidth != currentWidth)
911 uint16_t startingFrequency = centerFrequency - (currentWidth / 2);
912 centerFrequency = startingFrequency + nonOfdmaWidth * (nonOfdmaRu.
GetPhyIndex () - 1) + nonOfdmaWidth / 2;
914 return centerFrequency;
925 Transmit (nonOfdmaDuration, ppdu,
"non-OFDMA transmission");
928 auto hePpdu = DynamicCast<HePpdu> (ppdu->Copy ());
931 Time ofdmaDuration = ppdu->GetTxDuration () - nonOfdmaDuration;
950 for (
auto & staIdPsdu : psduMap)
956 NS_ABORT_MSG_IF (userInfoMap.find (staIdPsdu.first) == userInfoMap.end (),
"STA-ID in psduMap (" << staIdPsdu.first <<
") should be referenced in txVector");
960 if (current > maxDuration)
962 maxDuration = current;
972 for (uint8_t i = 0; i < 12; ++i)
983 return GetHeMcs ## x (); \
1000 NS_ABORT_MSG (
"Inexistent index (" << +index <<
") requested for HE");
1006 #define GET_HE_MCS(x) \
1008 HePhy::GetHeMcs ## x (void) \
1010 static WifiMode mcs = CreateHeMcs (x); \
1076 uint64_t dataRate =
GetDataRate (mcsValue, channelWidth, guardInterval, nss);
1084 if (txVector.
IsMu ())
1091 txVector.
GetNss (staId));
1098 if (txVector.
IsMu ())
1105 txVector.
GetNss (staId));
1111 NS_ASSERT (guardInterval == 800 || guardInterval == 1600 || guardInterval == 3200);
1122 switch (channelWidth)
1154 switch (constellationSize)
1159 dataRate = 54000000;
1163 NS_FATAL_ERROR (
"Trying to get reference rate for a MCS with wrong combination of coding rate and modulation");
uint64_t m_currentHeTbPpduUid
UID of the HE TB PPDU being received.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
uint8_t GetBssColor(void) const
Get the BSS color.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
PhyFieldRxStatus ProcessSigA(Ptr< Event > event, PhyFieldRxStatus status) override
Process SIG-A, perform amendment-specific actions, and provide an updated status of the reception.
Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const override
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSD for HE TB PPDU non-OFDMA...
uint16_t GetNonOfdmaWidth(HeRu::RuSpec ru) const
Get the width in MHz of the non-OFDMA portion of an HE TB PPDU.
WifiSpectrumBand GetNonOfdmaBand(const WifiTxVector &txVector, uint16_t staId) const
Get the band used to transmit the non-OFDMA part of an HE TB PPDU.
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
uint8_t bssColor
BSS color.
WifiMode GetSigAMode(void) const override
int64_t GetFemtoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
@ WIFI_PPDU_FIELD_SIG_A
SIG-A field.
bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const override
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
Time CalculateNonOfdmaDurationForHeTb(const WifiTxVector &txVector) const
Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector) const
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
@ LOG_FUNCTION
Function tracing.
void ErasePreambleEvent(Ptr< const WifiPpdu > ppdu, Time rxDuration)
Erase the event corresponding to the PPDU from the list of preamble events, but consider it as noise ...
virtual void DoEndReceivePayload(Ptr< const WifiPpdu > ppdu)
Perform amendment-specific actions at the end of the reception of the payload.
std::list< WifiMode > m_modeList
the list of supported modes
static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
Return the rate (in bps) of the non-HT Reference Rate which corresponds to the supplied code rate and...
void StartReceiveOfdmaPayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
const uint16_t WIFI_CODE_RATE_5_6
5/6 coding rate
std::map< UidStaIdPair, SignalNoiseDbm > m_signalNoiseMap
Map of the latest signal power and noise power in dBm (noise power includes the noise figure)
Time GetTrainingDuration(const WifiTxVector &txVector, uint8_t nDataLtf, uint8_t nExtensionLtf=0) const override
uint16_t GetCenterFrequencyForChannelWidth(const WifiTxVector &txVector) const
Get the center frequency of the channel corresponding the current TxVector rather than that of the su...
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< UidStaIdPair, std::vector< bool > > m_statusPerMpduMap
Map of the current reception status per MPDU that is filled in as long as MPDUs are being processed b...
uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
bool IsNull(void) const
Check for null implementation.
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
static bool IsModeAllowed(uint16_t channelWidth, uint8_t nss)
Check whether the combination of <MCS, channel width, NSS> is allowed.
void EndReceivePayload(Ptr< Event > event)
The last symbol of the PPDU has arrived.
std::vector< SubcarrierRange > SubcarrierGroup
a vector of subcarrier ranges defining a subcarrier group
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
static const PpduFormats m_hePpduFormats
HE PPDU formats.
void ScheduleEndOfMpdus(Ptr< Event > event)
Schedule end of MPDUs events.
uint8_t GetNssMax(void) const
Time FemtoSeconds(uint64_t value)
Construct a Time in the indicated unit.
virtual bool IsModeSupported(WifiMode mode) const
Check if the WifiMode is supported.
void BuildModeList(void) override
Build mode list.
Ptr< Event > CreateInterferenceEvent(Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector, Time duration, RxPowerWattPerChannelBand &rxPower, bool isStartOfdmaRxing=false)
Create an event using WifiPhy's InterferenceHelper class.
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
static class anonymous_namespace{he-phy.cc}::ConstructorHe g_constructor_he
the constructor for HE modes
virtual uint16_t GetStaId(const Ptr< const WifiPpdu > ppdu) const
Return the STA ID that has been assigned to the station this PHY belongs to.
uint32_t GetMaxPsduSize(void) const override
Get the maximum PSDU size in bytes.
PhyFieldRxStatus ProcessSigB(Ptr< Event > event, PhyFieldRxStatus status) override
Process SIG-B, perform amendment-specific actions, and provide an updated status of the reception.
double GetRxPowerWForPpdu(Ptr< Event > event) const
Obtain the received power (W) for a given band.
virtual Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW)
Get the event corresponding to the incoming PPDU.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Time GetLSigDuration(WifiPreamble preamble) const override
void CancelAllEvents(void) override
Cancel and clear all running events.
@ WIFI_PPDU_FIELD_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied HE MCS index.
static Ptr< SpectrumValue > CreateHeMuOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, WifiSpectrumBand ru)
Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given R...
Declaration of ns3::HePhy class and ns3::HeSigAParameters struct.
virtual void StartTx(Ptr< WifiPpdu > ppdu)
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actio...
WifiSpectrumBand GetRuBandForTx(const WifiTxVector &txVector, uint16_t staId) const
Get the band in the TX spectrum associated with the RU used by the PSDU transmitted to/by a given STA...
void AddPreambleEvent(Ptr< Event > event)
Add an entry to the map of current preamble events (stored in WifiPhy).
static uint64_t CalculateNonHtReferenceRate(WifiCodeRate codeRate, uint16_t constellationSize)
Return the rate (in bps) of the non-HT Reference Rate which corresponds to the supplied code rate and...
void Transmit(Time txDuration, Ptr< WifiPpdu > ppdu, std::string type)
This function prepares most of the WifiSpectrumSignalParameters parameters and invokes SpectrumWifiPh...
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
uint64_t m_previouslyTxPpduUid
UID of the previously sent PPDU, used by AP to recognize response HE TB PPDUs.
Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const override
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
SignalNoiseDbm structure.
std::size_t GetPhyIndex(void) const
Get the RU PHY index.
static uint16_t GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
std::pair< uint16_t, WifiSpectrumBand > GetChannelWidthAndBand(const WifiTxVector &txVector, uint16_t staId) const override
Get the channel width and band to use (will be overloaded by child classes).
Ptr< HeConfiguration > GetHeConfiguration(void) const
bool IsUlMu(void) const
Return true if this TX vector is used for an uplink multi-user transmission.
@ PSD_NON_HE_TB
non-HE TB PPDU transmissions
Constructor class for HE modes.
uint8_t m_bssMembershipSelector
the BSS membership selector
virtual uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const
Return the channel width used to measure the RSSI.
uint8_t m_maxMcsIndexPerSs
the maximum MCS index per spatial stream as defined by the standard
Smart pointer class similar to boost::intrusive_ptr.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
static uint16_t ConvertHeTbPpduDurationToLSigLength(Time ppduDuration, WifiPhyBand band)
static WifiMode GetVhtMcs3(void)
Return MCS 3 from VHT MCS values.
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
EndOfHeSigACallback m_endOfHeSigACallback
end of HE-SIG-A callback
const std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > & GetCurrentPreambleEvents(void) const
Get the map of current preamble events (stored in WifiPhy).
WifiModulationClass GetModulationClass(void) const
Get the modulation class specified by this TXVECTOR.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
void DoEndReceivePayload(Ptr< const WifiPpdu > ppdu) override
Perform amendment-specific actions at the end of the reception of the payload.
Ptr< const Event > GetCurrentEvent(void) const
Get the pointer to the current event (stored in WifiPhy).
uint16_t GetStaId(const Ptr< const WifiPpdu > ppdu) const override
Return the STA ID that has been assigned to the station this PHY belongs to.
uint8_t m_maxSupportedMcsIndexPerSs
the maximum supported MCS index per spatial stream
void StartTx(Ptr< WifiPpdu > ppdu) override
This function is called by SpectrumWifiPhy to send the PPDU while performing amendment-specific actio...
void SetEndOfHeSigACallback(EndOfHeSigACallback callback)
Set a callback for a end of HE-SIG-A.
represent a single transmission mode
virtual WifiSpectrumBand ConvertHeRuSubcarriers(uint16_t bandWidth, uint16_t guardBandwidth, HeRu::SubcarrierRange range, uint8_t bandIndex=0) const
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Status of the reception of the PPDU field.
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Return the PHY rate corresponding to the supplied TXVECTOR for the STA-ID.
void NotifyRxDrop(Ptr< const WifiPsdu > psdu, WifiPhyRxfailureReason reason)
Public method used to fire a PhyRxDrop trace.
uint8_t GetBssColor(void) const
static WifiMode GetVhtMcs5(void)
Return MCS 5 from VHT MCS values.
uint64_t GetCurrentHeTbPpduUid(void) const
uint64_t ObtainNextUid(const WifiTxVector &txVector) override
Obtain the next UID for the PPDU to transmit.
static WifiMode GetVhtMcs0(void)
Return MCS 0 from VHT MCS values.
Time CalculateTxDuration(WifiConstPsduMap psduMap, const WifiTxVector &txVector, WifiPhyBand band) const override
HePhy(bool buildModeList=true)
Constructor for HE PHY.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const override
static uint64_t CalculateDataRate(double symbolDuration, uint16_t guardInterval, uint16_t usableSubCarriers, uint16_t numberOfBitsPerSubcarrier, double codingRate, uint8_t nss)
Calculates data rate from the supplied parameters.
Time GetLastRxEndTime(void) const
Return the end time of the last received packet.
Time GetSigBDuration(const WifiTxVector &txVector) const override
virtual void DoAbortCurrentReception(WifiPhyRxfailureReason reason)
Perform amendment-specific actions before aborting the current reception.
virtual std::pair< uint16_t, WifiSpectrumBand > GetChannelWidthAndBand(const WifiTxVector &txVector, uint16_t staId) const
Get the channel width and band to use (will be overloaded by child classes).
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
std::vector< EventId > m_endOfMpduEvents
the end of MPDU events (only used for A-MPDUs)
uint64_t GetPreviouslyRxPpduUid(void) const
static Time ConvertLSigLengthToHeTbPpduDuration(uint16_t length, const WifiTxVector &txVector, WifiPhyBand band)
Declaration of ns3::HePpdu class.
const HeMuUserInfoMap & GetHeMuUserInfoMap(void) const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
static RuType GetRuType(uint16_t bandwidth)
Get the RU corresponding to the approximate bandwidth.
void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration) override
Start receiving the PHY preamble of a PPDU (i.e.
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, WifiModulationClass modClass, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, NonHtReferenceRateCallback nonHtReferenceRateCallback, ModeAllowedCallback isModeAllowedCallback)
WifiSpectrumBand GetRuBandForRx(const WifiTxVector &txVector, uint16_t staId) const
Get the band in the RX spectrum associated with the RU used by the PSDU transmitted to/by a given STA...
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
void DoStartReceivePayload(Ptr< Event > event) override
Start receiving the PSDU (i.e.
const WifiPhyOperatingChannel & GetOperatingChannel(void) const
Get a const reference to the operating channel.
Simulation virtual time values and global simulation resolution.
std::size_t GetIndex(void) const
Get the RU index.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
uint16_t GetChannelWidth(void) const
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
WifiPpduField
The type of PPDU field (grouped for convenience)
void NotifyEndOfHeSigA(HeSigAParameters params)
Fire a EndOfHeSigA callback (if connected) once HE-SIG-A field has been received.
bool IsMu(void) const
Return true if this TX vector is used for a multi-user transmission.
@ PSD_HE_TB_NON_OFDMA_PORTION
preamble of HE TB PPDU, which should only be sent on minimum subset of 20 MHz channels containing RU
bool isSuccess
outcome (true if success) of the reception
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
static WifiMode GetVhtMcs2(void)
Return MCS 2 from VHT MCS values.
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Time GetSymbolDuration(const WifiTxVector &txVector) const override
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
const PpduFormats & GetPpduFormats(void) const override
Return the PPDU formats of the PHY.
void DoAbortCurrentReception(WifiPhyRxfailureReason reason) override
Perform amendment-specific actions before aborting the current reception.
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied HE MCS index.
std::map< uint16_t, EventId > m_beginOfdmaPayloadRxEvents
the beginning of the OFDMA payload reception events (indexed by STA-ID)
uint16_t GetGuardInterval(void) const
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
@ PSD_HE_TB_OFDMA_PORTION
OFDMA portion of HE TB PPDU, which should only be sent on RU.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
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.
void SetPhyIndex(uint16_t bw, uint8_t p20Index)
Set the RU PHY index.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId=SU_STA_ID)
Return the data rate corresponding to the supplied TXVECTOR for the STA-ID.
virtual void StartReceivePreamble(Ptr< WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
static uint64_t CalculatePhyRate(WifiCodeRate codeRate, uint64_t dataRate)
Return the PHY rate corresponding to the supplied code rate and data rate.
Time Seconds(double value)
Construct a Time in the indicated unit.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
uint8_t GetNumberBccEncoders(const WifiTxVector &txVector) const override
void NotifyInterferenceRxEndAndClear(bool reset)
Notify WifiPhy's InterferenceHelper of the end of the reception, clear maps and end of MPDU event,...
static void InitializeModes(void)
Initialize all HE modes.
#define HE_PHY
This defines the BSS membership value for HE PHY.
virtual void CancelAllEvents(void)
Cancel and clear all running events.
RuType GetRuType(void) const
Get the RU type.
uint16_t GetChannelWidth(void) const
virtual Ptr< const WifiPsdu > GetAddressedPsduInPpdu(Ptr< const WifiPpdu > ppdu) const
Get the PSDU addressed to that PHY in a PPDU (useful for MU PPDU).
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
static Ptr< SpectrumValue > CreateHeOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, double minInnerBandDbr=-20, double minOuterbandDbr=-28, double lowestPointDbr=-40)
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802....
Ptr< Event > DoGetEvent(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW) override
Get the event corresponding to the incoming PPDU.
virtual ~HePhy()
Destructor for HE PHY.
uint8_t GetMaxSupportedRxSpatialStreams(void) const
void ResetReceive(Ptr< Event > event)
Reset PHY at the end of the PPDU under reception after it has failed the PHY header.
uint8_t GetPrimaryChannelIndex(uint16_t primaryChannelWidth) const
If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of th...
static uint64_t GetPhyRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the PHY rate corresponding to the supplied HE MCS index, channel width, guard interval,...
@ WIFI_PPDU_FIELD_DATA
data field
static RuSpec FindOverlappingRu(uint16_t bw, RuSpec referenceRu, RuType searchedRuType)
Find the RU allocation of the given RU type overlapping the given reference RU allocation.
virtual void DoStartReceivePayload(Ptr< Event > event)
Start receiving the PSDU (i.e.
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
uint16_t GetLength(void) const
Get the LENGTH field of the L-SIG.
PHY entity for VHT (11ac)
static uint16_t GetUsableSubcarriers(uint16_t channelWidth)
static uint16_t GetConstellationSize(uint8_t mcsValue)
Return the constellation size corresponding to the supplied VHT MCS index.
static double GetCodeRatio(WifiCodeRate codeRate)
Convert WifiCodeRate to a ratio, e.g., code ratio of WIFI_CODE_RATE_1_2 is 0.5.
static uint64_t GetNonHtReferenceRate(uint8_t mcsValue)
Calculate the rate in bps of the non-HT Reference Rate corresponding to the supplied HE MCS index.
static WifiMode GetVhtMcs4(void)
Return MCS 4 from VHT MCS values.
@ WIFI_PPDU_FIELD_TRAINING
STF + LTF fields (excluding those in preamble for HT-GF)
WifiPhyBand
Identifies the PHY band.
uint16_t GetCenterFrequencyForNonOfdmaPart(const WifiTxVector &txVector, uint16_t staId) const
Get the center frequency of the non-OFDMA part of the current TxVector for the given STA-ID.
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
const uint16_t WIFI_CODE_RATE_3_4
3/4 coding rate
Parameters for received HE-SIG-A for OBSS_PD based SR.
std::pair< std::size_t, std::size_t > GetNumRusPerHeSigBContentChannel(void) const
Get the number of RUs per HE-SIG-B content channel.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
std::vector< EventId > m_endRxPayloadEvents
the end of receive events (only one unless UL MU reception)
std::tuple< double, double, double > GetTxMaskRejectionParams(void) const
static WifiMode GetVhtMcs1(void)
Return MCS 1 from VHT MCS values.
static uint64_t GetDataRate(uint8_t mcsValue, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate corresponding to the supplied HE MCS index, channel width, guard interval,...
uint16_t GetMeasurementChannelWidth(const Ptr< const WifiPpdu > ppdu) const override
Return the channel width used to measure the RSSI.
Time GetSigADuration(WifiPreamble preamble) const override
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
static const Ptr< const PhyEntity > GetStaticPhyEntity(WifiModulationClass modulation)
Get the implemented PHY entity corresponding to the modulation class.
static WifiMode CreateHeMcs(uint8_t index)
Create and return the HE MCS corresponding to the provided index.
WifiConstPsduMap GetWifiConstPsduMap(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector) const override
Get a WifiConstPsduMap from a PSDU and the TXVECTOR to use to send the PSDU.
@ WIFI_PPDU_FIELD_SIG_B
SIG-B field.
void UpdateInterferenceEvent(Ptr< Event > event, const RxPowerWattPerChannelBand &rxPower)
Update an event in WifiPhy's InterferenceHelper class.
@ WIFI_PPDU_FIELD_NON_HT_HEADER
PHY header field for DSSS or ERP, short PHY header field for HR/DSSS or ERP, field not present for HT...
bool IsDlMu(void) const
Return true if this TX vector is used for a downlink multi-user transmission.
static SubcarrierGroup GetSubcarrierGroup(uint16_t bw, RuType ruType, std::size_t phyIndex)
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (nu...
static WifiCodeRate GetCodeRate(uint8_t mcsValue)
Return the coding rate corresponding to the supplied VHT MCS index.
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.
@ DROP
drop PPDU and set CCA_BUSY
WifiMode GetSigBMode(const WifiTxVector &txVector) const override
static WifiMode GetHeMcs(uint8_t index)
Return the HE MCS corresponding to the provided index.
Ptr< WifiMac > GetMac(void) const
void DoResetReceive(Ptr< Event > event) override
Perform amendment-specific actions before resetting PHY at the end of the PPDU under reception after ...
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
uint8_t GetMcsValue(void) const
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.