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

SpectrumChannel implementation which handles a single spectrum model. More...

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

+ Inheritance diagram for ns3::SingleModelSpectrumChannel:
+ Collaboration diagram for ns3::SingleModelSpectrumChannel:

Public Types

typedef std::vector< Ptr
< SpectrumPhy > > 
PhyList

Public Member Functions

 SingleModelSpectrumChannel ()
virtual void AddPropagationLossModel (Ptr< PropagationLossModel > loss)
virtual void AddRx (Ptr< SpectrumPhy > phy)
 add a SpectrumPhy to a channel, so it can receive packets
virtual void AddSpectrumPropagationLossModel (Ptr< SpectrumPropagationLossModel > loss)
virtual Ptr< NetDeviceGetDevice (uint32_t i) const
virtual uint32_t GetNDevices (void) const
virtual Ptr
< SpectrumPropagationLossModel
GetSpectrumPropagationLossModel (void)
virtual void SetPropagationDelayModel (Ptr< PropagationDelayModel > delay)
virtual void StartTx (Ptr< SpectrumSignalParameters > params)
- 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)
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 Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
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)
 This method returns the TypeId associated to ns3::SingleModelSpectrumChannel.

Private Member Functions

virtual void DoDispose ()
void StartRx (Ptr< SpectrumSignalParameters > params, Ptr< SpectrumPhy > receiver)

Private Attributes

double m_maxLossDb
TracedCallback< Ptr
< SpectrumPhy >, Ptr
< SpectrumPhy >, double > 
m_pathLossTrace
PhyList m_phyList
Ptr< PropagationDelayModelm_propagationDelay
Ptr< PropagationLossModelm_propagationLoss
Ptr< const SpectrumModelm_spectrumModel
Ptr< SpectrumPropagationLossModelm_spectrumPropagationLoss

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void DoDispose (void)
virtual void DoStart (void)
virtual void NotifyNewAggregate (void)

Detailed Description

SpectrumChannel implementation which handles a single spectrum model.

All SpectrumPhy layers attached to this SpectrumChannel

Definition at line 40 of file single-model-spectrum-channel.h.

Member Typedef Documentation

Constructor & Destructor Documentation

ns3::SingleModelSpectrumChannel::SingleModelSpectrumChannel ( )

Definition at line 49 of file single-model-spectrum-channel.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::SingleModelSpectrumChannel::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 234 of file single-model-spectrum-channel.cc.

References m_propagationLoss, NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::SingleModelSpectrumChannel::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 101 of file single-model-spectrum-channel.cc.

References m_phyList, and NS_LOG_FUNCTION.

void ns3::SingleModelSpectrumChannel::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 243 of file single-model-spectrum-channel.cc.

References m_spectrumPropagationLoss, NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::SingleModelSpectrumChannel::DoDispose ( void  )
privatevirtual
Ptr< NetDevice > ns3::SingleModelSpectrumChannel::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 226 of file single-model-spectrum-channel.cc.

References m_phyList, and NS_LOG_FUNCTION.

uint32_t ns3::SingleModelSpectrumChannel::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 218 of file single-model-spectrum-channel.cc.

References m_phyList, and NS_LOG_FUNCTION.

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

Definition at line 260 of file single-model-spectrum-channel.cc.

References m_spectrumPropagationLoss, and NS_LOG_FUNCTION.

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

This method returns the TypeId associated to ns3::SingleModelSpectrumChannel.

Attributes defined for this type:

  • 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 defined for this type:

  • 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.

Reimplemented from ns3::SpectrumChannel.

Definition at line 67 of file single-model-spectrum-channel.cc.

References m_maxLossDb, m_pathLossTrace, ns3::MakeTraceSourceAccessor(), NS_LOG_FUNCTION_NOARGS, 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::SingleModelSpectrumChannel::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 251 of file single-model-spectrum-channel.cc.

References m_propagationDelay, NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::SingleModelSpectrumChannel::StartRx ( Ptr< SpectrumSignalParameters params,
Ptr< SpectrumPhy receiver 
)
private

used internally to reschedule transmission after the propagation delay

Parameters
params
receiver

Definition at line 209 of file single-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:

Member Data Documentation

double ns3::SingleModelSpectrumChannel::m_maxLossDb
private

Definition at line 110 of file single-model-spectrum-channel.h.

Referenced by GetTypeId(), and StartTx().

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

Definition at line 112 of file single-model-spectrum-channel.h.

Referenced by GetTypeId(), and StartTx().

PhyList ns3::SingleModelSpectrumChannel::m_phyList
private

list of SpectrumPhy instances attached to the channel

Definition at line 81 of file single-model-spectrum-channel.h.

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

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

propagation delay model to be used with this channel

Definition at line 94 of file single-model-spectrum-channel.h.

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

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

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

Definition at line 101 of file single-model-spectrum-channel.h.

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

Ptr<const SpectrumModel> ns3::SingleModelSpectrumChannel::m_spectrumModel
private

SpectrumModel that this channel instance is supporting

Definition at line 87 of file single-model-spectrum-channel.h.

Referenced by DoDispose(), and StartTx().

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

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

Definition at line 107 of file single-model-spectrum-channel.h.

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


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