A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::MultiModelSpectrumChannel Class Reference

This SpectrumChannel implementation can handle the presence of SpectrumPhy instances which can use different spectrum models, i.e., different SpectrumModel. More...

#include <multi-model-spectrum-channel.h>

+ Inheritance diagram for ns3::MultiModelSpectrumChannel:
+ Collaboration diagram for ns3::MultiModelSpectrumChannel:

Public Member Functions

 MultiModelSpectrumChannel ()
 
virtual void AddPropagationLossModel (Ptr< PropagationLossModel > loss)
 set the single-frequency propagation loss model to be used More...
 
virtual void AddRx (Ptr< SpectrumPhy > phy)
 add a SpectrumPhy to a channel, so it can receive packets More...
 
virtual void AddSpectrumPropagationLossModel (Ptr< SpectrumPropagationLossModel > loss)
 set the frequency-dependent propagation loss model to be used More...
 
virtual Ptr< NetDeviceGetDevice (uint32_t i) const
 
virtual uint32_t GetNDevices (void) const
 
virtual Ptr
< SpectrumPropagationLossModel
GetSpectrumPropagationLossModel (void)
 
virtual void SetPropagationDelayModel (Ptr< PropagationDelayModel > delay)
 set the propagation delay model to be used More...
 
virtual void StartTx (Ptr< SpectrumSignalParameters > params)
 Used by attached PHY instances to transmit signals on the channel. More...
 
- Public Member Functions inherited from ns3::SpectrumChannel
virtual ~SpectrumChannel ()
 
- Public Member Functions inherited from ns3::Channel
 Channel ()
 
virtual ~Channel ()
 
uint32_t GetId (void) const
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SpectrumChannel
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Channel
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

void DoDispose ()
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Private Member Functions

TxSpectrumModelInfoMap_t::const_iterator FindAndEventuallyAddTxSpectrumModel (Ptr< const SpectrumModel > txSpectrumModel)
 this method checks if m_rxSpectrumModelInfoMap contains an entry for the given TX SpectrumModel. More...
 
virtual void StartRx (Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)
 used internally to reschedule transmission after the propagation delay More...
 

Private Attributes

double m_maxLossDb
 
uint32_t m_numDevices
 
TracedCallback< Ptr
< SpectrumPhy >, Ptr
< SpectrumPhy >, double > 
m_pathLossTrace
 
Ptr< PropagationDelayModelm_propagationDelay
 propagation delay model to be used with this channel More...
 
Ptr< PropagationLossModelm_propagationLoss
 single-frequency propagation loss model to be used with this channel More...
 
RxSpectrumModelInfoMap_t m_rxSpectrumModelInfoMap
 data structure holding, for each RX spectrum model, all the corresponding SpectrumPhy instances. More...
 
Ptr< SpectrumPropagationLossModelm_spectrumPropagationLoss
 frequency-dependent propagation loss model to be used with this channel More...
 
TxSpectrumModelInfoMap_t m_txSpectrumModelInfoMap
 data structure holding, for each TX SpectrumModel, all the converters to any RX SpectrumModel, and all the corresponding SpectrumPhy instances. More...
 

Detailed Description

This SpectrumChannel implementation can handle the presence of SpectrumPhy instances which can use different spectrum models, i.e., different SpectrumModel.

Note
It is allowed for a receiving SpectrumPhy to switch to a different SpectrumModel during the simulation. The requirement for this to work is that, after the SpectrumPhy switched its SpectrumModel, MultiModelSpectrumChannel::AddRx () is called again passing the pointer to that SpectrumPhy.

Config Paths

ns3::MultiModelSpectrumChannel is accessible through the following paths with Config::Set and Config::Connect:

  • /ChannelList/[i]/$ns3::MultiModelSpectrumChannel
  • /ChannelList/[i]/$ns3::SpectrumChannel/$ns3::MultiModelSpectrumChannel

Attributes

  • MaxLossDb: If a single-frequency PropagationLossModel is used, this value represents the maximum loss in dB for which transmissions will be passed to the receiving PHY. Signals for which the PropagationLossModel returns a loss bigger than this value will not be propagated to the receiver. This parameter is to be used to reduce the computational load by not propagating signals that are far beyond the interference range. Note that the default value corresponds to considering all signals for reception. Tune this value with care.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1e+09
    • Flags: construct write read

Attributes defined in parent class ns3::Channel

TraceSources

  • PathLoss: This trace is fired whenever a new path loss value is calculated. The first and second parameters to the trace are pointers respectively to the TX and RX SpectrumPhy instances, whereas the third parameters is the loss value in dB. Note that the loss value reported by this trace is the single-frequency loss value obtained by evaluating only the TX and RX AntennaModels and the PropagationLossModel. In particular, note that SpectrumPropagationLossModel (even if present) is never used to evaluate the loss value reported in this trace.

Definition at line 86 of file multi-model-spectrum-channel.h.

Constructor & Destructor Documentation

ns3::MultiModelSpectrumChannel::MultiModelSpectrumChannel ( )

Definition at line 81 of file multi-model-spectrum-channel.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::MultiModelSpectrumChannel::AddPropagationLossModel ( Ptr< PropagationLossModel loss)
virtual

set the single-frequency propagation loss model to be used

Warning
only models that do not depend on the TX power should be used.
Parameters
lossa pointer to the propagation loss model to be used.

Implements ns3::SpectrumChannel.

Definition at line 419 of file multi-model-spectrum-channel.cc.

References m_propagationLoss, NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::MultiModelSpectrumChannel::AddRx ( Ptr< SpectrumPhy phy)
virtual

add a SpectrumPhy to a channel, so it can receive packets

This method is used to attach a SpectrumPhy instance to a SpectrumChannel instance, so that the SpectrumPhy can receive packets sent on that channel. Note that a SpectrumPhy that only transmits (without receiveing ever) does not need to be added to the channel.

This method is to be implemented by all classes inheriting from SpectrumChannel.

Parameters
phythe SpectrumPhy instance to be added to the channel as a receiver.

Implements ns3::SpectrumChannel.

Definition at line 133 of file multi-model-spectrum-channel.cc.

References ns3::SpectrumPhy::GetRxSpectrumModel(), m_numDevices, m_rxSpectrumModelInfoMap, m_txSpectrumModelInfoMap, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

void ns3::MultiModelSpectrumChannel::AddSpectrumPropagationLossModel ( Ptr< SpectrumPropagationLossModel loss)
virtual

set the frequency-dependent propagation loss model to be used

Parameters
lossa pointer to the propagation loss model to be used.

Implements ns3::SpectrumChannel.

Definition at line 427 of file multi-model-spectrum-channel.cc.

References m_spectrumPropagationLoss, and NS_ASSERT.

void ns3::MultiModelSpectrumChannel::DoDispose ( void  )
protectedvirtual

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

Subclasses are expected to implement their real destruction code in an overriden 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 87 of file multi-model-spectrum-channel.cc.

References ns3::Object::DoDispose(), m_propagationDelay, m_propagationLoss, m_rxSpectrumModelInfoMap, m_spectrumPropagationLoss, m_txSpectrumModelInfoMap, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

TxSpectrumModelInfoMap_t::const_iterator ns3::MultiModelSpectrumChannel::FindAndEventuallyAddTxSpectrumModel ( Ptr< const SpectrumModel txSpectrumModel)
private

this method checks if m_rxSpectrumModelInfoMap contains an entry for the given TX SpectrumModel.

If such entry exists, it returns an interator pointing to it. If not, it creates a new entry in m_txSpectrumMpodelInfoMap, and returns an iterator to it.

Parameters
txSpectrumModelthe TX SpectrumModel being considered
Returns
an iterator pointing to the corresponding entry in m_txSpectrumModelInfoMap

Definition at line 200 of file multi-model-spectrum-channel.cc.

References m_rxSpectrumModelInfoMap, m_txSpectrumModelInfoMap, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by StartTx().

+ Here is the caller graph for this function:

Ptr< NetDevice > ns3::MultiModelSpectrumChannel::GetDevice ( uint32_t  i) const
virtual
Parameters
iindex of NetDevice to retrieve
Returns
one of the NetDevices connected to this channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 386 of file multi-model-spectrum-channel.cc.

References m_numDevices, m_rxSpectrumModelInfoMap, NS_ASSERT, and NS_FATAL_ERROR.

uint32_t ns3::MultiModelSpectrumChannel::GetNDevices ( void  ) const
virtual
Returns
the number of NetDevices connected to this Channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 378 of file multi-model-spectrum-channel.cc.

References m_numDevices.

Ptr< SpectrumPropagationLossModel > ns3::MultiModelSpectrumChannel::GetSpectrumPropagationLossModel ( void  )
virtual

Definition at line 441 of file multi-model-spectrum-channel.cc.

References m_spectrumPropagationLoss, and NS_LOG_FUNCTION.

TypeId ns3::MultiModelSpectrumChannel::GetTypeId ( void  )
static

Definition at line 99 of file multi-model-spectrum-channel.cc.

References m_maxLossDb, m_pathLossTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

Referenced by ns3::LteHelper::LteHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::MultiModelSpectrumChannel::SetPropagationDelayModel ( Ptr< PropagationDelayModel delay)
virtual

set the propagation delay model to be used

Parameters
delayPtr to the propagation delay model to be used.

Implements ns3::SpectrumChannel.

Definition at line 434 of file multi-model-spectrum-channel.cc.

References m_propagationDelay, and NS_ASSERT.

void ns3::MultiModelSpectrumChannel::StartRx ( Ptr< SpectrumSignalParameters params,
Ptr< SpectrumPhy receiver 
)
privatevirtual

used internally to reschedule transmission after the propagation delay

Parameters
params
receiver

Definition at line 369 of file multi-model-spectrum-channel.cc.

References NS_LOG_FUNCTION, and ns3::SpectrumPhy::StartRx().

Referenced by StartTx().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::MultiModelSpectrumChannel::StartTx ( Ptr< SpectrumSignalParameters params)
virtual

Member Data Documentation

double ns3::MultiModelSpectrumChannel::m_maxLossDb
private

Definition at line 174 of file multi-model-spectrum-channel.h.

Referenced by GetTypeId(), and StartTx().

uint32_t ns3::MultiModelSpectrumChannel::m_numDevices
private

Definition at line 172 of file multi-model-spectrum-channel.h.

Referenced by AddRx(), GetDevice(), and GetNDevices().

TracedCallback<Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double > ns3::MultiModelSpectrumChannel::m_pathLossTrace
private

Definition at line 176 of file multi-model-spectrum-channel.h.

Referenced by GetTypeId(), and StartTx().

Ptr<PropagationDelayModel> ns3::MultiModelSpectrumChannel::m_propagationDelay
private

propagation delay model to be used with this channel

Definition at line 141 of file multi-model-spectrum-channel.h.

Referenced by DoDispose(), SetPropagationDelayModel(), and StartTx().

Ptr<PropagationLossModel> ns3::MultiModelSpectrumChannel::m_propagationLoss
private

single-frequency propagation loss model to be used with this channel

Definition at line 147 of file multi-model-spectrum-channel.h.

Referenced by AddPropagationLossModel(), DoDispose(), and StartTx().

RxSpectrumModelInfoMap_t ns3::MultiModelSpectrumChannel::m_rxSpectrumModelInfoMap
private

data structure holding, for each RX spectrum model, all the corresponding SpectrumPhy instances.

Definition at line 170 of file multi-model-spectrum-channel.h.

Referenced by AddRx(), DoDispose(), FindAndEventuallyAddTxSpectrumModel(), GetDevice(), and StartTx().

Ptr<SpectrumPropagationLossModel> ns3::MultiModelSpectrumChannel::m_spectrumPropagationLoss
private

frequency-dependent propagation loss model to be used with this channel

Definition at line 153 of file multi-model-spectrum-channel.h.

Referenced by AddSpectrumPropagationLossModel(), DoDispose(), GetSpectrumPropagationLossModel(), and StartTx().

TxSpectrumModelInfoMap_t ns3::MultiModelSpectrumChannel::m_txSpectrumModelInfoMap
private

data structure holding, for each TX SpectrumModel, all the converters to any RX SpectrumModel, and all the corresponding SpectrumPhy instances.

Definition at line 162 of file multi-model-spectrum-channel.h.

Referenced by AddRx(), DoDispose(), FindAndEventuallyAddTxSpectrumModel(), and StartTx().


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