A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::InterferenceHelper Class Reference

handles interference calculations More...

#include "interference-helper.h"

+ Inheritance diagram for ns3::InterferenceHelper:
+ Collaboration diagram for ns3::InterferenceHelper:

Classes

class  NiChange
 Noise and Interference (thus Ni) event. More...
 

Public Member Functions

 InterferenceHelper ()
 
 ~InterferenceHelper () override
 
Ptr< EventAdd (Ptr< const WifiPpdu > ppdu, Time duration, RxPowerWattPerChannelBand &rxPower, const FrequencyRange &freqRange, bool isStartHePortionRxing=false)
 Add the PPDU-related signal to interference helper.
 
void AddBand (const WifiSpectrumBandInfo &band)
 Add a frequency band.
 
void AddForeignSignal (Time duration, RxPowerWattPerChannelBand &rxPower, const FrequencyRange &freqRange)
 Add a non-Wifi signal to interference helper.
 
PhyEntity::SnrPer CalculatePayloadSnrPer (Ptr< Event > event, MHz_u channelWidth, const WifiSpectrumBandInfo &band, uint16_t staId, std::pair< Time, Time > relativeMpduStartStop) const
 Calculate the SNIR at the start of the payload and accumulate all SNIR changes in the SNIR vector for each MPDU of an A-MPDU.
 
PhyEntity::SnrPer CalculatePhyHeaderSnrPer (Ptr< Event > event, MHz_u channelWidth, const WifiSpectrumBandInfo &band, WifiPpduField header) const
 Calculate the SNIR at the start of the PHY header and accumulate all SNIR changes in the SNIR vector.
 
double CalculateSnr (Ptr< Event > event, MHz_u channelWidth, uint8_t nss, const WifiSpectrumBandInfo &band) const
 Calculate the SNIR for the event (starting from now until the event end).
 
Time GetEnergyDuration (Watt_u energy, const WifiSpectrumBandInfo &band)
 
Ptr< ErrorRateModelGetErrorRateModel () const
 Return the error rate model.
 
bool HasBands () const
 Check whether bands are already tracked by this interference helper.
 
void NotifyRxEnd (Time endTime, const FrequencyRange &freqRange)
 Notify that RX has ended.
 
void NotifyRxStart (const FrequencyRange &freqRange)
 Notify that RX has started.
 
void RemoveBand (const WifiSpectrumBandInfo &band)
 Remove a frequency band.
 
void SetErrorRateModel (const Ptr< ErrorRateModel > rate)
 Set the error rate model for this interference helper.
 
void SetNoiseFigure (double value)
 Set the noise figure.
 
void SetNumberOfReceiveAntennas (uint8_t rx)
 Set the number of RX antennas in the receiver corresponding to this interference helper.
 
void UpdateBands (const std::vector< WifiSpectrumBandInfo > &bands, const FrequencyRange &freqRange)
 Update the frequency bands that belongs to a given frequency range when the spectrum model is changed.
 
void UpdateEvent (Ptr< Event > event, const RxPowerWattPerChannelBand &rxPower)
 Update event to scale its received power (W) per band.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Types

using FirstPowerPerBand = std::map<WifiSpectrumBandInfo, Watt_u>
 Map of first power per band.
 
using NiChanges = std::multimap<Time, NiChange>
 typedef for a multimap of NiChange
 
using NiChangesPerBand = std::map<WifiSpectrumBandInfo, NiChanges>
 Map of NiChanges per band.
 

Protected Member Functions

double CalculateChunkSuccessRate (double snir, Time duration, WifiMode mode, const WifiTxVector &txVector, WifiPpduField field) const
 Calculate the success rate of the chunk given the SINR, duration, and TXVECTOR.
 
double CalculatePayloadChunkSuccessRate (double snir, Time duration, const WifiTxVector &txVector, uint16_t staId=SU_STA_ID) const
 Calculate the success rate of the payload chunk given the SINR, duration, and TXVECTOR.
 
double CalculateSnr (Watt_u signal, Watt_u noiseInterference, MHz_u channelWidth, uint8_t nss) const
 Calculate SNR (linear ratio) from the given signal power and noise+interference power.
 
void DoDispose () override
 Destructor implementation.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Protected Attributes

NiChangesPerBand m_niChanges
 NI Changes for each band.
 
std::map< FrequencyRange, bool > m_rxing
 flag whether it is in receiving state for a given FrequencyRange
 

Private Member Functions

NiChanges::iterator AddNiChangeEvent (Time moment, NiChange change, NiChangesPerBand::iterator niIt)
 Add NiChange to the list at the appropriate position and return the iterator of the new event.
 
void AppendEvent (Ptr< Event > event, const FrequencyRange &freqRange, bool isStartHePortionRxing)
 Append the given Event.
 
Watt_u CalculateMuMimoPowerW (Ptr< const Event > event, const WifiSpectrumBandInfo &band) const
 Calculate power of all other events preceding a given event that belong to the same MU-MIMO transmission.
 
Watt_u CalculateNoiseInterferenceW (Ptr< Event > event, NiChangesPerBand &nis, const WifiSpectrumBandInfo &band) const
 Calculate noise and interference power.
 
double CalculatePayloadPer (Ptr< const Event > event, MHz_u channelWidth, NiChangesPerBand *nis, const WifiSpectrumBandInfo &band, uint16_t staId, std::pair< Time, Time > window) const
 Calculate the error rate of the given PHY payload only in the provided time window (thus enabling per MPDU PER information).
 
double CalculatePhyHeaderPer (Ptr< const Event > event, NiChangesPerBand *nis, MHz_u channelWidth, const WifiSpectrumBandInfo &band, WifiPpduField header) const
 Calculate the error rate of the PHY header.
 
double CalculatePhyHeaderSectionPsr (Ptr< const Event > event, NiChangesPerBand *nis, MHz_u channelWidth, const WifiSpectrumBandInfo &band, PhyEntity::PhyHeaderSections phyHeaderSections) const
 Calculate the success rate of the PHY header sections for the provided event.
 
NiChanges::iterator GetNextPosition (Time moment, NiChangesPerBand::iterator niIt)
 Returns an iterator to the first NiChange that is later than moment.
 
NiChanges::iterator GetPreviousPosition (Time moment, NiChangesPerBand::iterator niIt)
 Returns an iterator to the last NiChange that is before than moment.
 
bool HasBand (const WifiSpectrumBandInfo &band) const
 Check whether a given band is tracked by this interference helper.
 
bool IsBandInFrequencyRange (const WifiSpectrumBandInfo &band, const FrequencyRange &freqRange) const
 Check whether a given band belongs to a given frequency range.
 
bool IsSameMuMimoTransmission (Ptr< const Event > currentEvent, Ptr< const Event > otherEvent) const
 Return whether another event is a MU-MIMO event that belongs to the same transmission and to the same RU.
 

Private Attributes

Ptr< ErrorRateModelm_errorRateModel
 error rate model
 
FirstPowerPerBand m_firstPowers
 first power of each band
 
double m_noiseFigure
 noise figure (linear)
 
uint8_t m_numRxAntennas
 the number of RX antennas in the corresponding receiver
 

Additional Inherited Members

Detailed Description

handles interference calculations

Definition at line 121 of file interference-helper.h.

Member Typedef Documentation

◆ FirstPowerPerBand

Map of first power per band.

Definition at line 406 of file interference-helper.h.

◆ NiChanges

using ns3::InterferenceHelper::NiChanges = std::multimap<Time, NiChange>
protected

typedef for a multimap of NiChange

Definition at line 396 of file interference-helper.h.

◆ NiChangesPerBand

Map of NiChanges per band.

Definition at line 401 of file interference-helper.h.

Constructor & Destructor Documentation

◆ InterferenceHelper()

ns3::InterferenceHelper::InterferenceHelper ( )

Definition at line 164 of file interference-helper.cc.

References NS_LOG_FUNCTION.

◆ ~InterferenceHelper()

ns3::InterferenceHelper::~InterferenceHelper ( )
override

Definition at line 171 of file interference-helper.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Add()

Ptr< Event > ns3::InterferenceHelper::Add ( Ptr< const WifiPpdu > ppdu,
Time duration,
RxPowerWattPerChannelBand & rxPower,
const FrequencyRange & freqRange,
bool isStartHePortionRxing = false )

Add the PPDU-related signal to interference helper.

Parameters
ppduthe PPDU
durationthe PPDU duration
rxPowerreceived power per band (W)
freqRangethe frequency range in which the received signal is detected
isStartHePortionRxingflag whether the event corresponds to the start of the HE portion reception (only used for MU)
Returns
Event

Definition at line 200 of file interference-helper.cc.

References AppendEvent(), and ns3::Create().

Referenced by AddForeignSignal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddBand()

void ns3::InterferenceHelper::AddBand ( const WifiSpectrumBandInfo & band)

Add a frequency band.

Parameters
bandthe band to be added

Definition at line 240 of file interference-helper.cc.

References AddNiChangeEvent(), m_firstPowers, m_niChanges, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by UpdateBands().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddForeignSignal()

void ns3::InterferenceHelper::AddForeignSignal ( Time duration,
RxPowerWattPerChannelBand & rxPower,
const FrequencyRange & freqRange )

Add a non-Wifi signal to interference helper.

Parameters
durationthe duration of the signal
rxPowerreceived power per band (W)
freqRangethe frequency range in which the received signal is detected

Definition at line 212 of file interference-helper.cc.

References Add(), ns3::Create(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), and ns3::WIFI_MAC_QOSDATA.

+ Here is the call graph for this function:

◆ AddNiChangeEvent()

InterferenceHelper::NiChanges::iterator ns3::InterferenceHelper::AddNiChangeEvent ( Time moment,
NiChange change,
NiChangesPerBand::iterator niIt )
private

Add NiChange to the list at the appropriate position and return the iterator of the new event.

Parameters
momenttime to check from
changethe NiChange to add
niItiterator of the band to check
Returns
the iterator of the new event

Definition at line 814 of file interference-helper.cc.

References GetNextPosition().

Referenced by AddBand(), and AppendEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AppendEvent()

void ns3::InterferenceHelper::AppendEvent ( Ptr< Event > event,
const FrequencyRange & freqRange,
bool isStartHePortionRxing )
private

Append the given Event.

Parameters
eventthe event to be appended
freqRangethe frequency range in which the received signal event is detected
isStartHePortionRxingflag whether event corresponds to the start of the HE portion reception (only used for MU)

Definition at line 348 of file interference-helper.cc.

References AddNiChangeEvent(), GetPreviousPosition(), m_firstPowers, m_niChanges, m_rxing, NS_ABORT_IF, and NS_LOG_FUNCTION.

Referenced by Add().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateChunkSuccessRate()

double ns3::InterferenceHelper::CalculateChunkSuccessRate ( double snir,
Time duration,
WifiMode mode,
const WifiTxVector & txVector,
WifiPpduField field ) const
protected

Calculate the success rate of the chunk given the SINR, duration, and TXVECTOR.

The duration and TXVECTOR are used to calculate how many bits are present in the chunk.

Parameters
snirthe SINR
durationthe duration of the chunk
modethe WifiMode
txVectorthe TXVECTOR
fieldthe PPDU field to which the chunk belongs to
Returns
the success rate

Definition at line 525 of file interference-helper.cc.

References ns3::WifiTxVector::GetChannelWidth(), ns3::WifiMode::GetDataRate(), ns3::Time::GetSeconds(), ns3::Time::IsZero(), m_errorRateModel, and m_numRxAntennas.

Referenced by CalculatePhyHeaderSectionPsr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateMuMimoPowerW()

Watt_u ns3::InterferenceHelper::CalculateMuMimoPowerW ( Ptr< const Event > event,
const WifiSpectrumBandInfo & band ) const
private

Calculate power of all other events preceding a given event that belong to the same MU-MIMO transmission.

Parameters
eventthe event
bandthe band
Returns
the power of all other events preceding the event that belong to the same MU-MIMO transmission

Definition at line 488 of file interference-helper.cc.

References ns3::DynamicCast(), IsSameMuMimoTransmission(), m_niChanges, ns3::Simulator::Now(), NS_ASSERT, and ns3::HePpdu::PSD_HE_PORTION.

Referenced by CalculateNoiseInterferenceW(), and CalculatePayloadPer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateNoiseInterferenceW()

Watt_u ns3::InterferenceHelper::CalculateNoiseInterferenceW ( Ptr< Event > event,
NiChangesPerBand & nis,
const WifiSpectrumBandInfo & band ) const
private

Calculate noise and interference power.

Parameters
eventthe event
nisthe NiChanges
bandthe band
Returns
noise and interference power

Definition at line 437 of file interference-helper.cc.

References CalculateMuMimoPowerW(), IsSameMuMimoTransmission(), m_firstPowers, m_niChanges, ns3::Simulator::Now(), NS_ABORT_IF, NS_ASSERT_MSG, NS_LOG_FUNCTION, and ns3::WIFI_PPDU_TYPE_UL_MU.

Referenced by CalculatePayloadSnrPer(), CalculatePhyHeaderSnrPer(), and CalculateSnr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatePayloadChunkSuccessRate()

double ns3::InterferenceHelper::CalculatePayloadChunkSuccessRate ( double snir,
Time duration,
const WifiTxVector & txVector,
uint16_t staId = SU_STA_ID ) const
protected

Calculate the success rate of the payload chunk given the SINR, duration, and TXVECTOR.

The duration and TXVECTOR are used to calculate how many bits are present in the payload chunk.

Parameters
snirthe SINR
durationthe duration of the chunk
txVectorthe TXVECTOR
staIdthe station ID of the PSDU (only used for MU)
Returns
the success rate

Definition at line 543 of file interference-helper.cc.

References ns3::WifiMode::GetDataRate(), ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetNss(), ns3::Time::GetSeconds(), ns3::Time::IsZero(), m_errorRateModel, m_numRxAntennas, and ns3::WIFI_PPDU_FIELD_DATA.

Referenced by CalculatePayloadPer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatePayloadPer()

double ns3::InterferenceHelper::CalculatePayloadPer ( Ptr< const Event > event,
MHz_u channelWidth,
NiChangesPerBand * nis,
const WifiSpectrumBandInfo & band,
uint16_t staId,
std::pair< Time, Time > window ) const
private

Calculate the error rate of the given PHY payload only in the provided time window (thus enabling per MPDU PER information).

The PHY payload can be divided into multiple chunks (e.g. due to interference from other transmissions).

Parameters
eventthe event
channelWidththe channel width used to transmit the PSDU
nisthe NiChanges
bandidentify the band used by the PSDU
staIdthe station ID of the PSDU (only used for MU)
windowtime window (pair of start and end times) of PHY payload to focus on
Returns
the error rate of the payload

Definition at line 568 of file interference-helper.cc.

References CalculateMuMimoPowerW(), CalculatePayloadChunkSuccessRate(), ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), CalculateSnr(), IsSameMuMimoTransmission(), m_firstPowers, Min, NS_ABORT_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WIFI_PPDU_TYPE_DL_MU, and ns3::WIFI_PPDU_TYPE_UL_MU.

Referenced by CalculatePayloadSnrPer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatePayloadSnrPer()

PhyEntity::SnrPer ns3::InterferenceHelper::CalculatePayloadSnrPer ( Ptr< Event > event,
MHz_u channelWidth,
const WifiSpectrumBandInfo & band,
uint16_t staId,
std::pair< Time, Time > relativeMpduStartStop ) const

Calculate the SNIR at the start of the payload and accumulate all SNIR changes in the SNIR vector for each MPDU of an A-MPDU.

This workaround is required in order to provide one PER per MPDU, for reception success/failure evaluation, while hiding aggregation details from this class.

Parameters
eventthe event corresponding to the first time the corresponding PPDU arrives
channelWidththe channel width used to transmit the PSDU
bandidentify the band used by the PSDU
staIdthe station ID of the PSDU (only used for MU)
relativeMpduStartStopthe time window (pair of start and end times) of PHY payload to focus on
Returns
struct of SNR and PER (with PER being evaluated over the provided time window)

Definition at line 743 of file interference-helper.cc.

References CalculateNoiseInterferenceW(), CalculatePayloadPer(), CalculateSnr(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CalculatePhyHeaderPer()

double ns3::InterferenceHelper::CalculatePhyHeaderPer ( Ptr< const Event > event,
NiChangesPerBand * nis,
MHz_u channelWidth,
const WifiSpectrumBandInfo & band,
WifiPpduField header ) const
private

Calculate the error rate of the PHY header.

The PHY header can be divided into multiple chunks (e.g. due to interference from other transmissions).

Parameters
eventthe event
nisthe NiChanges
channelWidththe channel width for header measurement
bandthe band
headerthe PHY header to consider
Returns
the error rate of the HT PHY header

Definition at line 713 of file interference-helper.cc.

References CalculatePhyHeaderSectionPsr(), ns3::WifiPhy::GetStaticPhyEntity(), and NS_LOG_FUNCTION.

Referenced by CalculatePhyHeaderSnrPer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatePhyHeaderSectionPsr()

double ns3::InterferenceHelper::CalculatePhyHeaderSectionPsr ( Ptr< const Event > event,
NiChangesPerBand * nis,
MHz_u channelWidth,
const WifiSpectrumBandInfo & band,
PhyEntity::PhyHeaderSections phyHeaderSections ) const
private

Calculate the success rate of the PHY header sections for the provided event.

Parameters
eventthe event
nisthe NiChanges
channelWidththe channel width for header measurement
bandthe band
phyHeaderSectionsthe map of PHY header sections (
See also
PhyEntity::PhyHeaderSections)
Returns
the success rate of the PHY header sections

Definition at line 649 of file interference-helper.cc.

References CalculateChunkSuccessRate(), CalculateSnr(), m_firstPowers, Max, Min, ns3::Time::NS, NS_ABORT_IF, NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by CalculatePhyHeaderPer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatePhyHeaderSnrPer()

PhyEntity::SnrPer ns3::InterferenceHelper::CalculatePhyHeaderSnrPer ( Ptr< Event > event,
MHz_u channelWidth,
const WifiSpectrumBandInfo & band,
WifiPpduField header ) const

Calculate the SNIR at the start of the PHY header and accumulate all SNIR changes in the SNIR vector.

Parameters
eventthe event corresponding to the first time the corresponding PPDU arrives
channelWidththe channel width for header measurement
bandidentify the band used by the PSDU
headerthe PHY header to consider
Returns
struct of SNR and PER

Definition at line 779 of file interference-helper.cc.

References CalculateNoiseInterferenceW(), CalculatePhyHeaderPer(), CalculateSnr(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CalculateSnr() [1/2]

double ns3::InterferenceHelper::CalculateSnr ( Ptr< Event > event,
MHz_u channelWidth,
uint8_t nss,
const WifiSpectrumBandInfo & band ) const

Calculate the SNIR for the event (starting from now until the event end).

Parameters
eventthe event corresponding to the first time the corresponding PPDU arrives
channelWidththe channel width
nssthe number of spatial streams
bandidentify the band used by the PSDU
Returns
the SNR for the PPDU in linear scale

Definition at line 768 of file interference-helper.cc.

References CalculateNoiseInterferenceW(), and CalculateSnr().

Referenced by CalculatePayloadPer(), CalculatePayloadSnrPer(), CalculatePhyHeaderSectionPsr(), CalculatePhyHeaderSnrPer(), and CalculateSnr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateSnr() [2/2]

double ns3::InterferenceHelper::CalculateSnr ( Watt_u signal,
Watt_u noiseInterference,
MHz_u channelWidth,
uint8_t nss ) const
protected

Calculate SNR (linear ratio) from the given signal power and noise+interference power.

Parameters
signalsignal power
noiseInterferencenoise and interference power
channelWidthsignal width
nssthe number of spatial streams
Returns
SNR in linear scale

Definition at line 405 of file interference-helper.cc.

References m_errorRateModel, m_noiseFigure, m_numRxAntennas, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::RatioToDb().

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::InterferenceHelper::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 187 of file interference-helper.cc.

References m_errorRateModel, m_firstPowers, m_niChanges, and NS_LOG_FUNCTION.

◆ GetEnergyDuration()

Time ns3::InterferenceHelper::GetEnergyDuration ( Watt_u energy,
const WifiSpectrumBandInfo & band )
Parameters
energythe minimum energy requested
bandidentify the requested band
Returns
the expected amount of time the observed energy on the medium for a given band will be higher than the requested threshold.

Definition at line 327 of file interference-helper.cc.

References GetPreviousPosition(), m_niChanges, ns3::Simulator::Now(), NS_ABORT_IF, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetErrorRateModel()

Ptr< ErrorRateModel > ns3::InterferenceHelper::GetErrorRateModel ( ) const

Return the error rate model.

Returns
Error rate model

Definition at line 315 of file interference-helper.cc.

References m_errorRateModel.

◆ GetNextPosition()

InterferenceHelper::NiChanges::iterator ns3::InterferenceHelper::GetNextPosition ( Time moment,
NiChangesPerBand::iterator niIt )
private

Returns an iterator to the first NiChange that is later than moment.

Parameters
momenttime to check from
niItiterator of the band to check
Returns
an iterator to the list of NiChanges

Definition at line 798 of file interference-helper.cc.

Referenced by AddNiChangeEvent(), and GetPreviousPosition().

+ Here is the caller graph for this function:

◆ GetPreviousPosition()

InterferenceHelper::NiChanges::iterator ns3::InterferenceHelper::GetPreviousPosition ( Time moment,
NiChangesPerBand::iterator niIt )
private

Returns an iterator to the last NiChange that is before than moment.

Parameters
momenttime to check from
niItiterator of the band to check
Returns
an iterator to the list of NiChanges

Definition at line 804 of file interference-helper.cc.

References GetNextPosition().

Referenced by AppendEvent(), GetEnergyDuration(), NotifyRxEnd(), and UpdateEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::InterferenceHelper::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 177 of file interference-helper.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ HasBand()

bool ns3::InterferenceHelper::HasBand ( const WifiSpectrumBandInfo & band) const
private

Check whether a given band is tracked by this interference helper.

Parameters
bandthe band to be checked
Returns
true if the band is already tracked by this interference helper, false otherwise

Definition at line 234 of file interference-helper.cc.

References m_niChanges.

Referenced by UpdateBands().

+ Here is the caller graph for this function:

◆ HasBands()

bool ns3::InterferenceHelper::HasBands ( ) const

Check whether bands are already tracked by this interference helper.

Returns
true if bands are tracked by this interference helper, false otherwise

Definition at line 228 of file interference-helper.cc.

References m_niChanges.

◆ IsBandInFrequencyRange()

bool ns3::InterferenceHelper::IsBandInFrequencyRange ( const WifiSpectrumBandInfo & band,
const FrequencyRange & freqRange ) const
private

Check whether a given band belongs to a given frequency range.

Parameters
bandthe band to be checked
freqRangethe frequency range to check whether the band belong to
Returns
true if the band belongs to the frequency range, false otherwise

Definition at line 846 of file interference-helper.cc.

References ns3::WifiSpectrumBandInfo::frequencies.

Referenced by NotifyRxEnd(), and UpdateBands().

+ Here is the caller graph for this function:

◆ IsSameMuMimoTransmission()

bool ns3::InterferenceHelper::IsSameMuMimoTransmission ( Ptr< const Event > currentEvent,
Ptr< const Event > otherEvent ) const
private

Return whether another event is a MU-MIMO event that belongs to the same transmission and to the same RU.

Parameters
currentEventthe current event that is being inspected
otherEventthe other event to compare against
Returns
whether both events belong to the same transmission and to the same RU

Definition at line 858 of file interference-helper.cc.

References NS_ASSERT, and ns3::WIFI_PPDU_TYPE_UL_MU.

Referenced by CalculateMuMimoPowerW(), CalculateNoiseInterferenceW(), and CalculatePayloadPer().

+ Here is the caller graph for this function:

◆ NotifyRxEnd()

void ns3::InterferenceHelper::NotifyRxEnd ( Time endTime,
const FrequencyRange & freqRange )

Notify that RX has ended.

Parameters
endTimethe end time of the signal
freqRangethe frequency range in which the received signal event was detected

Definition at line 827 of file interference-helper.cc.

References GetPreviousPosition(), IsBandInFrequencyRange(), m_firstPowers, m_niChanges, m_rxing, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ NotifyRxStart()

void ns3::InterferenceHelper::NotifyRxStart ( const FrequencyRange & freqRange)

Notify that RX has started.

Parameters
freqRangethe frequency range in which the received signal event is detected

Definition at line 820 of file interference-helper.cc.

References m_rxing, and NS_LOG_FUNCTION.

◆ RemoveBand()

void ns3::InterferenceHelper::RemoveBand ( const WifiSpectrumBandInfo & band)

Remove a frequency band.

Parameters
bandthe band to be removed

Definition at line 254 of file interference-helper.cc.

References m_firstPowers, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by UpdateBands().

+ Here is the caller graph for this function:

◆ SetErrorRateModel()

void ns3::InterferenceHelper::SetErrorRateModel ( const Ptr< ErrorRateModel > rate)

Set the error rate model for this interference helper.

Parameters
rateError rate model

Definition at line 309 of file interference-helper.cc.

References m_errorRateModel.

Referenced by WifiErrorRateModelsTestCaseMimo::DoRun().

+ Here is the caller graph for this function:

◆ SetNoiseFigure()

void ns3::InterferenceHelper::SetNoiseFigure ( double value)

Set the noise figure.

Parameters
valuenoise figure in linear scale

Definition at line 303 of file interference-helper.cc.

References m_noiseFigure.

Referenced by WifiErrorRateModelsTestCaseMimo::DoRun().

+ Here is the caller graph for this function:

◆ SetNumberOfReceiveAntennas()

void ns3::InterferenceHelper::SetNumberOfReceiveAntennas ( uint8_t rx)

Set the number of RX antennas in the receiver corresponding to this interference helper.

Parameters
rxthe number of RX antennas

Definition at line 321 of file interference-helper.cc.

References m_numRxAntennas.

Referenced by WifiErrorRateModelsTestCaseMimo::DoRun().

+ Here is the caller graph for this function:

◆ UpdateBands()

void ns3::InterferenceHelper::UpdateBands ( const std::vector< WifiSpectrumBandInfo > & bands,
const FrequencyRange & freqRange )

Update the frequency bands that belongs to a given frequency range when the spectrum model is changed.

Parameters
bandsthe bands to be added in the new spectrum model
freqRangethe frequency range the bands belong to

Definition at line 266 of file interference-helper.cc.

References AddBand(), HasBand(), IsBandInFrequencyRange(), m_niChanges, NS_LOG_FUNCTION, and RemoveBand().

+ Here is the call graph for this function:

◆ UpdateEvent()

void ns3::InterferenceHelper::UpdateEvent ( Ptr< Event > event,
const RxPowerWattPerChannelBand & rxPower )

Update event to scale its received power (W) per band.

Parameters
eventthe event to be updated
rxPowerthe received power (W) per band to be added to the current event

Definition at line 386 of file interference-helper.cc.

References GetPreviousPosition(), m_niChanges, NS_ABORT_IF, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_errorRateModel

Ptr<ErrorRateModel> ns3::InterferenceHelper::m_errorRateModel
private

◆ m_firstPowers

FirstPowerPerBand ns3::InterferenceHelper::m_firstPowers
private

◆ m_niChanges

◆ m_noiseFigure

double ns3::InterferenceHelper::m_noiseFigure
private

noise figure (linear)

Definition at line 518 of file interference-helper.h.

Referenced by CalculateSnr(), and SetNoiseFigure().

◆ m_numRxAntennas

uint8_t ns3::InterferenceHelper::m_numRxAntennas
private

the number of RX antennas in the corresponding receiver

Definition at line 520 of file interference-helper.h.

Referenced by CalculateChunkSuccessRate(), CalculatePayloadChunkSuccessRate(), CalculateSnr(), and SetNumberOfReceiveAntennas().

◆ m_rxing

std::map<FrequencyRange, bool> ns3::InterferenceHelper::m_rxing
protected

flag whether it is in receiving state for a given FrequencyRange

Definition at line 353 of file interference-helper.h.

Referenced by AppendEvent(), ExtInterferenceHelper::IsRxing(), NotifyRxEnd(), and NotifyRxStart().


The documentation for this class was generated from the following files: