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

Base class for UAN Phy models. More...

#include <uan-phy.h>

+ Inheritance diagram for ns3::UanPhy:
+ Collaboration diagram for ns3::UanPhy:

Public Types

typedef Callback< void, Ptr
< Packet >, double > 
RxErrCallback
 Packet receive error callback function type. More...
 
typedef Callback< void, Ptr
< Packet >, double, UanTxMode
RxOkCallback
 Packet received successfully callback function type. More...
 
enum  State {
  IDLE, CCABUSY, RX, TX,
  SLEEP
}
 Enum defining possible Phy states. More...
 

Public Member Functions

virtual int64_t AssignStreams (int64_t stream)=0
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
virtual void Clear (void)=0
 Clear all pointer references. More...
 
virtual void EnergyDepletionHandler (void)=0
 Handle the energy depletion event. More...
 
virtual double GetCcaThresholdDb (void)=0
 Get the CCA threshold signal strength required to detect channel busy. More...
 
virtual Ptr< UanChannelGetChannel (void) const =0
 Get the attached channel. More...
 
virtual Ptr< UanNetDeviceGetDevice (void)=0
 Get the device hosting this Phy. More...
 
virtual UanTxMode GetMode (uint32_t n)=0
 Get a specific transmission mode. More...
 
virtual uint32_t GetNModes (void)=0
 Get the number of transmission modes supported by this Phy. More...
 
virtual Ptr< PacketGetPacketRx (void) const =0
 Get the packet currently being received. More...
 
virtual double GetRxGainDb (void)=0
 Get the receiver gain added to signal at receiver in dB. More...
 
virtual double GetRxThresholdDb (void)=0
 Get the minimum received signal strength required to receive a packet without errors. More...
 
virtual Ptr< UanTransducerGetTransducer (void)=0
 Get the attached transducer. More...
 
virtual double GetTxPowerDb (void)=0
 Get the current transmit power, in dB. More...
 
virtual bool IsStateBusy (void)=0
 
virtual bool IsStateCcaBusy (void)=0
 
virtual bool IsStateIdle (void)=0
 
virtual bool IsStateRx (void)=0
 
virtual bool IsStateSleep (void)=0
 
virtual bool IsStateTx (void)=0
 
virtual void NotifyIntChange (void)=0
 Called when there has been a change in the ammount of interference this node is experiencing from other transmissions. More...
 
void NotifyRxBegin (Ptr< const Packet > packet)
 Called when the Phy begins to receive a packet. More...
 
void NotifyRxDrop (Ptr< const Packet > packet)
 Called when the Phy drops a packet. More...
 
void NotifyRxEnd (Ptr< const Packet > packet)
 Called when a packet is received without error. More...
 
virtual void NotifyTransStartTx (Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)=0
 Called when a transmission is beginning on the attched transducer. More...
 
void NotifyTxBegin (Ptr< const Packet > packet)
 Called when the transducer begins transmitting a packet. More...
 
void NotifyTxDrop (Ptr< const Packet > packet)
 Called when the transducer attempts to transmit a new packet while already transmitting a prior packet. More...
 
void NotifyTxEnd (Ptr< const Packet > packet)
 Called when the transducer finishes transmitting a packet. More...
 
virtual void RegisterListener (UanPhyListener *listener)=0
 Register a UanPhyListener to be notified of common UanPhy events. More...
 
virtual void SendPacket (Ptr< Packet > pkt, uint32_t modeNum)=0
 Send a packet using a specific transmission mode. More...
 
virtual void SetCcaThresholdDb (double thresh)=0
 Set the threshold for detecting channel busy. More...
 
virtual void SetChannel (Ptr< UanChannel > channel)=0
 Attach to a channel. More...
 
virtual void SetDevice (Ptr< UanNetDevice > device)=0
 Set the device hosting this Phy. More...
 
virtual void SetEnergyModelCallback (DeviceEnergyModel::ChangeStateCallback callback)=0
 Set the DeviceEnergyModel callback for UanPhy device. More...
 
virtual void SetMac (Ptr< UanMac > mac)=0
 Set the MAC forwarding messages to this Phy. More...
 
virtual void SetReceiveErrorCallback (RxErrCallback cb)=0
 Set the callback to be used when a packet is received with errors. More...
 
virtual void SetReceiveOkCallback (RxOkCallback cb)=0
 Set the callback to be used when a packet is received without error. More...
 
virtual void SetRxGainDb (double gain)=0
 Set the receiver gain. More...
 
virtual void SetRxThresholdDb (double thresh)=0
 Set the minimum SINR threshold to receive a packet without errors. More...
 
virtual void SetSleepMode (bool sleep)=0
 Set the Phy SLEEP mode. More...
 
virtual void SetTransducer (Ptr< UanTransducer > trans)=0
 Attach a transducer to this Phy. More...
 
virtual void SetTxPowerDb (double txpwr)=0
 Set the transmit power. More...
 
virtual void StartRxPacket (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp)=0
 Packet arriving from channel: i.e. More...
 
- 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)
 Register this type. More...
 
- 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...
 

Private Attributes

TracedCallback< Ptr< const
Packet > > 
m_phyRxBeginTrace
 Trace source indicating a packet has begun being received from the channel medium by the device. More...
 
TracedCallback< Ptr< const
Packet > > 
m_phyRxDropTrace
 Trace source indicating a packet has been dropped by the device during reception. More...
 
TracedCallback< Ptr< const
Packet > > 
m_phyRxEndTrace
 Trace source indicating a packet has been completely received from the channel medium by the device. More...
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxBeginTrace
 Trace source indicating a packet has begun transmitting over the channel medium. More...
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxDropTrace
 Trace source indicating a packet has been dropped by the device during transmission. More...
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxEndTrace
 Trace source indicating a packet has been completely transmitted over the channel. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
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...
 

Detailed Description

Base class for UAN Phy models.

Config Paths

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

  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy

No Attributes are defined for this type.

TraceSources

  • PhyTxBegin: Trace source indicating a packet has begun transmitting over the channel medium.
  • PhyTxEnd: Trace source indicating a packet has been completely transmitted over the channel.
  • PhyTxDrop: Trace source indicating a packet has been dropped by the device during transmission.
  • PhyRxBegin: Trace source indicating a packet has begun being received from the channel medium by the device.
  • PhyRxEnd: Trace source indicating a packet has been completely received from the channel medium by the device.
  • PhyRxDrop: Trace source indicating a packet has been dropped by the device during reception.

Definition at line 175 of file uan-phy.h.

Member Typedef Documentation

typedef Callback<void, Ptr<Packet>, double > ns3::UanPhy::RxErrCallback

Packet receive error callback function type.

arg1 Packet received successfully. arg2 SNIR of packet.

Definition at line 203 of file uan-phy.h.

Packet received successfully callback function type.

arg1 Packet received successfully. arg2 SNIR of packet. arg3 Mode of packet.

Definition at line 195 of file uan-phy.h.

Member Enumeration Documentation

Enum defining possible Phy states.

Enumerator
IDLE 

Idle state.

CCABUSY 

Channel busy.

RX 

Receiving.

TX 

Transmitting.

SLEEP 

Sleeping.

Definition at line 179 of file uan-phy.h.

Member Function Documentation

virtual int64_t ns3::UanPhy::AssignStreams ( int64_t  stream)
pure virtual

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamFirst stream index to use.
Returns
The number of stream indices assigned by this model.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::Clear ( void  )
pure virtual

Clear all pointer references.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::EnergyDepletionHandler ( void  )
pure virtual

Handle the energy depletion event.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual double ns3::UanPhy::GetCcaThresholdDb ( void  )
pure virtual

Get the CCA threshold signal strength required to detect channel busy.

Returns
The CCA threshold signal strength in dB.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual Ptr<UanChannel> ns3::UanPhy::GetChannel ( void  ) const
pure virtual

Get the attached channel.

Returns
The channel.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual Ptr<UanNetDevice> ns3::UanPhy::GetDevice ( void  )
pure virtual

Get the device hosting this Phy.

Returns
The net device.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual UanTxMode ns3::UanPhy::GetMode ( uint32_t  n)
pure virtual

Get a specific transmission mode.

Parameters
nThe mode number.
Returns
The mode.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual uint32_t ns3::UanPhy::GetNModes ( void  )
pure virtual

Get the number of transmission modes supported by this Phy.

Returns
The number modes.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual Ptr<Packet> ns3::UanPhy::GetPacketRx ( void  ) const
pure virtual

Get the packet currently being received.

Warning
Returns non-valid pointer if IsStateRx == false.
Returns
The packet.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual double ns3::UanPhy::GetRxGainDb ( void  )
pure virtual

Get the receiver gain added to signal at receiver in dB.

Returns
The gain.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual double ns3::UanPhy::GetRxThresholdDb ( void  )
pure virtual

Get the minimum received signal strength required to receive a packet without errors.

Returns
The minimum required signal strength, in dB.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual Ptr<UanTransducer> ns3::UanPhy::GetTransducer ( void  )
pure virtual

Get the attached transducer.

Returns
The transducer.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual double ns3::UanPhy::GetTxPowerDb ( void  )
pure virtual

Get the current transmit power, in dB.

Returns
The transmit power.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

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

Register this type.

Returns
The TypeId.

Definition at line 72 of file uan-phy.cc.

References m_phyRxBeginTrace, m_phyRxDropTrace, m_phyRxEndTrace, m_phyTxBeginTrace, m_phyTxDropTrace, m_phyTxEndTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

virtual bool ns3::UanPhy::IsStateBusy ( void  )
pure virtual
Returns
True if Phy is neither IDLE nor SLEEP.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual bool ns3::UanPhy::IsStateCcaBusy ( void  )
pure virtual
Returns
True if Phy is in CCABUSY state.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual bool ns3::UanPhy::IsStateIdle ( void  )
pure virtual
Returns
True if Phy is in IDLE state.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual bool ns3::UanPhy::IsStateRx ( void  )
pure virtual
Returns
True if Phy is currently in receive mode.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual bool ns3::UanPhy::IsStateSleep ( void  )
pure virtual
Returns
True if Phy is in SLEEP state.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual bool ns3::UanPhy::IsStateTx ( void  )
pure virtual
Returns
True if Phy is busy transmitting.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::NotifyIntChange ( void  )
pure virtual

Called when there has been a change in the ammount of interference this node is experiencing from other transmissions.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

void ns3::UanPhy::NotifyRxBegin ( Ptr< const Packet packet)

Called when the Phy begins to receive a packet.

This fires a PhyRxBegin trace. Implemented for encapsulation purposes.

Parameters
packetThe packet.

Definition at line 118 of file uan-phy.cc.

References m_phyRxBeginTrace.

Referenced by ns3::UanPhyGen::StartRxPacket().

+ Here is the caller graph for this function:

void ns3::UanPhy::NotifyRxDrop ( Ptr< const Packet packet)

Called when the Phy drops a packet.

This fires a PhyRxDrop trace. Implemented for encapsulation purposes.

Parameters
packetThe packet.

Definition at line 130 of file uan-phy.cc.

References m_phyRxDropTrace.

Referenced by ns3::UanPhyGen::RxEndEvent(), and ns3::UanPhyGen::StartRxPacket().

+ Here is the caller graph for this function:

void ns3::UanPhy::NotifyRxEnd ( Ptr< const Packet packet)

Called when a packet is received without error.

This fires a PhyRxEnd trace. Implemented for encapsulation purposes.

Parameters
packetThe packet.

Definition at line 124 of file uan-phy.cc.

References m_phyRxEndTrace.

Referenced by ns3::UanPhyGen::RxEndEvent().

+ Here is the caller graph for this function:

virtual void ns3::UanPhy::NotifyTransStartTx ( Ptr< Packet packet,
double  txPowerDb,
UanTxMode  txMode 
)
pure virtual

Called when a transmission is beginning on the attched transducer.

Parameters
packetPacket that is beginning transmission.
txPowerDbTransmit power of packet.
txModeTransmission mode of packet.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

void ns3::UanPhy::NotifyTxBegin ( Ptr< const Packet packet)

Called when the transducer begins transmitting a packet.

This fires a PhyTxBegin trace. Implemented for encapsulation purposes.

Parameters
packetThe packet.

Definition at line 100 of file uan-phy.cc.

References m_phyTxBeginTrace.

void ns3::UanPhy::NotifyTxDrop ( Ptr< const Packet packet)

Called when the transducer attempts to transmit a new packet while already transmitting a prior packet.

This fires a PhyTxDrop trace. Implemented for encapsulation purposes.

Parameters
packetThe packet.

Definition at line 112 of file uan-phy.cc.

References m_phyTxDropTrace.

void ns3::UanPhy::NotifyTxEnd ( Ptr< const Packet packet)

Called when the transducer finishes transmitting a packet.

This fires a PhyTxEnd trace. Implemented for encapsulation purposes.

Parameters
packetThe packet.

Definition at line 106 of file uan-phy.cc.

References m_phyTxEndTrace.

Referenced by ns3::UanTransducerHd::Transmit().

+ Here is the caller graph for this function:

virtual void ns3::UanPhy::RegisterListener ( UanPhyListener listener)
pure virtual

Register a UanPhyListener to be notified of common UanPhy events.

Parameters
listenerNew listener to register.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SendPacket ( Ptr< Packet pkt,
uint32_t  modeNum 
)
pure virtual

Send a packet using a specific transmission mode.

Parameters
pktPacket to transmit.
modeNumIndex of mode in SupportedModes list to use for transmission.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetCcaThresholdDb ( double  thresh)
pure virtual

Set the threshold for detecting channel busy.

Parameters
threshSignal power threshold at receiver.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetChannel ( Ptr< UanChannel channel)
pure virtual

Attach to a channel.

Parameters
channelThe channel to attach to.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetDevice ( Ptr< UanNetDevice device)
pure virtual

Set the device hosting this Phy.

Parameters
deviceThe device.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetEnergyModelCallback ( DeviceEnergyModel::ChangeStateCallback  callback)
pure virtual

Set the DeviceEnergyModel callback for UanPhy device.

Parameters
callbackThe DeviceEnergyModel change state callback.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetMac ( Ptr< UanMac mac)
pure virtual

Set the MAC forwarding messages to this Phy.

Parameters
macThe MAC.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetReceiveErrorCallback ( RxErrCallback  cb)
pure virtual

Set the callback to be used when a packet is received with errors.

Parameters
cbThe callback.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetReceiveOkCallback ( RxOkCallback  cb)
pure virtual

Set the callback to be used when a packet is received without error.

Parameters
cbThe callback.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetRxGainDb ( double  gain)
pure virtual

Set the receiver gain.

Parameters
gainGain added at receiver, in dB.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetRxThresholdDb ( double  thresh)
pure virtual

Set the minimum SINR threshold to receive a packet without errors.

Deprecated:
See UanPhyPer.
Parameters
threshThreshold SINR for propper reception in dB re 1 uPa.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetSleepMode ( bool  sleep)
pure virtual

Set the Phy SLEEP mode.

Parameters
sleepSLEEP on or off.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetTransducer ( Ptr< UanTransducer trans)
pure virtual

Attach a transducer to this Phy.

Parameters
transThe transducer.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::SetTxPowerDb ( double  txpwr)
pure virtual

Set the transmit power.

Parameters
txpwrFinal output transmission power, in dB.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

virtual void ns3::UanPhy::StartRxPacket ( Ptr< Packet pkt,
double  rxPowerDb,
UanTxMode  txMode,
UanPdp  pdp 
)
pure virtual

Packet arriving from channel: i.e.

leading bit of packet has arrived.

Parameters
pktPacket which is arriving.
rxPowerDbSignal power of incoming packet in dB re 1 uPa.
txModeTransmission mode defining modulation of incoming packet.
pdpPower delay profile of incoming packet.

Implemented in ns3::UanPhyGen, and ns3::UanPhyDual.

Member Data Documentation

TracedCallback<Ptr<const Packet> > ns3::UanPhy::m_phyRxBeginTrace
private

Trace source indicating a packet has begun being received from the channel medium by the device.

See also
class CallBackTraceSource

Definition at line 533 of file uan-phy.h.

Referenced by GetTypeId(), and NotifyRxBegin().

TracedCallback<Ptr<const Packet> > ns3::UanPhy::m_phyRxDropTrace
private

Trace source indicating a packet has been dropped by the device during reception.

See also
class CallBackTraceSource

Definition at line 549 of file uan-phy.h.

Referenced by GetTypeId(), and NotifyRxDrop().

TracedCallback<Ptr<const Packet> > ns3::UanPhy::m_phyRxEndTrace
private

Trace source indicating a packet has been completely received from the channel medium by the device.

See also
class CallBackTraceSource

Definition at line 541 of file uan-phy.h.

Referenced by GetTypeId(), and NotifyRxEnd().

TracedCallback<Ptr<const Packet> > ns3::UanPhy::m_phyTxBeginTrace
private

Trace source indicating a packet has begun transmitting over the channel medium.

See also
class CallBackTraceSource

Definition at line 509 of file uan-phy.h.

Referenced by GetTypeId(), and NotifyTxBegin().

TracedCallback<Ptr<const Packet> > ns3::UanPhy::m_phyTxDropTrace
private

Trace source indicating a packet has been dropped by the device during transmission.

See also
class CallBackTraceSource

Definition at line 525 of file uan-phy.h.

Referenced by GetTypeId(), and NotifyTxDrop().

TracedCallback<Ptr<const Packet> > ns3::UanPhy::m_phyTxEndTrace
private

Trace source indicating a packet has been completely transmitted over the channel.

See also
class CallBackTraceSource

Definition at line 517 of file uan-phy.h.

Referenced by GetTypeId(), and NotifyTxEnd().


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