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

Generic PHY model. More...

#include <uan-phy-gen.h>

+ Inheritance diagram for ns3::UanPhyGen:
+ Collaboration diagram for ns3::UanPhyGen:

Public Member Functions

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

Protected Member Functions

virtual 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 Types

typedef std::list
< UanPhyListener * > 
ListenerList
 List of Phy Listeners. More...
 

Private Member Functions

double CalculateSinrDb (Ptr< Packet > pkt, Time arrTime, double rxPowerDb, UanTxMode mode, UanPdp pdp)
 Calculate the SINR value for a packet. More...
 
double DbToKp (double db)
 Convert dB to kilopascals. More...
 
double GetInterferenceDb (Ptr< Packet > pkt)
 Calculate interference power from overlapping packet arrivals, in dB. More...
 
double KpToDb (double kp)
 Convert kilopascals to dB. More...
 
void NotifyListenersCcaEnd (void)
 Call UanListener::NotifyCcaEnd on all listeners. More...
 
void NotifyListenersCcaStart (void)
 Call UanListener::NotifyCcaStart on all listeners. More...
 
void NotifyListenersRxBad (void)
 Call UanListener::NotifyRxEndError on all listeners. More...
 
void NotifyListenersRxGood (void)
 Call UanListener::NotifyRxEndOk on all listeners. More...
 
void NotifyListenersRxStart (void)
 Call UanListener::NotifyRxStart on all listeners. More...
 
void NotifyListenersTxStart (Time duration)
 Call UanListener::NotifyTxStart on all listeners. More...
 
void RxEndEvent (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode)
 Event to process end of packet reception. More...
 
void TxEndEvent ()
 Event to process end of packet transmission. More...
 
void UpdatePowerConsumption (const State state)
 Update energy source with new state. More...
 

Private Attributes

double m_ccaThreshDb
 CCA busy threshold. More...
 
Ptr< UanChannelm_channel
 Attached channel. More...
 
bool m_cleared
 Flag when we've been cleared. More...
 
Ptr< UanNetDevicem_device
 Device hosting this Phy. More...
 
bool m_disabled
 Energy depleted. More...
 
DeviceEnergyModel::ChangeStateCallback m_energyCallback
 Energy model callback. More...
 
ListenerList m_listeners
 List of listeners. More...
 
Ptr< UanMacm_mac
 MAC layer. More...
 
double m_minRxSinrDb
 Minimum receive SINR during packet reception. More...
 
UanModesList m_modes
 List of modes supported by this PHY. More...
 
Ptr< UanPhyPerm_per
 Error model. More...
 
Ptr< UniformRandomVariablem_pg
 Provides uniform random variables. More...
 
Ptr< Packetm_pktRx
 Received packet. More...
 
Time m_pktRxArrTime
 Packet arrival time. More...
 
UanTxMode m_pktRxMode
 Packet transmission mode at receiver. More...
 
UanPdp m_pktRxPdp
 Power delay profile of pakket. More...
 
RxErrCallback m_recErrCb
 Callback for packets received with errors. More...
 
RxOkCallback m_recOkCb
 Callback for packets received without error. More...
 
TracedCallback< Ptr< const
Packet >, double, UanTxMode
m_rxErrLogger
 A packet destined for this Phy was received with error. More...
 
double m_rxGainDb
 Receive gain. More...
 
TracedCallback< Ptr< const
Packet >, double, UanTxMode
m_rxOkLogger
 A packet destined for this Phy was received without error. More...
 
double m_rxRecvPwrDb
 Receiver power. More...
 
double m_rxThreshDb
 Receive SINR threshold. More...
 
Ptr< UanPhyCalcSinrm_sinr
 SINR calculator. More...
 
State m_state
 Phy state. More...
 
Ptr< UanTransducerm_transducer
 Associated transducer. More...
 
TracedCallback< Ptr< const
Packet >, double, UanTxMode
m_txLogger
 A packet was sent from this Phy. More...
 
double m_txPwrDb
 Transmit power. More...
 

Additional Inherited Members

- Public Types inherited from ns3::UanPhy
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...
 

Detailed Description

Generic PHY model.

This is a generic PHY class. SINR and PER information are controlled via attributes. By adapting the SINR and PER models to a specific situation, this PHY should be able to model a wide variety of networks.

Config Paths

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

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

Attributes

  • CcaThreshold: Aggregate energy of incoming signals to move to CCA Busy state dB.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 10
    • Flags: construct write read
  • RxThreshold: Required SNR for signal acquisition in dB.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 10
    • Flags: construct write read
  • TxPower: Transmission output power in dB.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 190
    • Flags: construct write read
  • RxGain: Gain added to incoming signal at receiver.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • SupportedModes: List of modes supported by this PHY.
  • PerModel: Functor to calculate PER based on SINR and TxMode.
    • Set with class: ns3::PointerValue
    • Underlying type: ns3::Ptr< ns3::UanPhyPer >
    • Initial value: 0xb31f00
    • Flags: construct write read
  • SinrModel: Functor to calculate SINR based on pkt arrivals and modes.
    • Set with class: ns3::PointerValue
    • Underlying type: ns3::Ptr< ns3::UanPhyCalcSinr >
    • Initial value: 0xb31d10
    • Flags: construct write read

TraceSources

  • RxOk: A packet was received successfully.
  • RxError: A packet was received unsuccessfully.
  • Tx: Packet transmission beginning.

TraceSources defined in parent class ns3::UanPhy

  • 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 219 of file uan-phy-gen.h.

Member Typedef Documentation

List of Phy Listeners.

Definition at line 280 of file uan-phy-gen.h.

Constructor & Destructor Documentation

ns3::UanPhyGen::UanPhyGen ( )

Constructor.

Definition at line 349 of file uan-phy-gen.cc.

References m_energyCallback, m_pg, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().

+ Here is the call graph for this function:

ns3::UanPhyGen::~UanPhyGen ( )
virtual

Dummy destructor, see DoDispose.

Definition at line 369 of file uan-phy-gen.cc.

Member Function Documentation

int64_t ns3::UanPhyGen::AssignStreams ( int64_t  stream)
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.

Implements ns3::UanPhy.

Definition at line 874 of file uan-phy-gen.cc.

References m_pg, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

double ns3::UanPhyGen::CalculateSinrDb ( Ptr< Packet pkt,
Time  arrTime,
double  rxPowerDb,
UanTxMode  mode,
UanPdp  pdp 
)
private

Calculate the SINR value for a packet.

Parameters
pktPacket to calculate SINR for.
arrTimeArrival time of pkt.
rxPowerDbThe received signal strength of the packet in dB re 1 uPa.
modeTX Mode of pkt.
pdpPower delay profile of pkt.
Returns
The SINR in dB re 1 uPa.

Definition at line 901 of file uan-phy-gen.cc.

References ns3::UanTxMode::GetBandwidthHz(), ns3::UanTxMode::GetCenterFreqHz(), m_channel, m_sinr, and m_transducer.

Referenced by StartRxPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanPhyGen::Clear ( void  )
virtual

Clear all pointer references.

Implements ns3::UanPhy.

Definition at line 375 of file uan-phy-gen.cc.

References m_channel, m_cleared, m_device, m_listeners, m_mac, m_per, m_pktRx, m_sinr, and m_transducer.

Referenced by DoDispose().

+ Here is the caller graph for this function:

double ns3::UanPhyGen::DbToKp ( double  db)
private

Convert dB to kilopascals.

\[{\rm{kPa}} = {10^{\frac{{{\rm{dB}}}}{{10}}}}\]

Parameters
dbSignal level in dB.
Returns
Sound pressure in kPa.

Definition at line 930 of file uan-phy-gen.cc.

Referenced by GetInterferenceDb().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::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 417 of file uan-phy-gen.cc.

References Clear(), ns3::Object::DoDispose(), m_energyCallback, and ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::Nullify().

+ Here is the call graph for this function:

void ns3::UanPhyGen::EnergyDepletionHandler ( void  )
virtual

Handle the energy depletion event.

Implements ns3::UanPhy.

Definition at line 507 of file uan-phy-gen.cc.

References m_device, m_disabled, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

double ns3::UanPhyGen::GetCcaThresholdDb ( void  )
virtual

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

Returns
The CCA threshold signal strength in dB.

Implements ns3::UanPhy.

Definition at line 796 of file uan-phy-gen.cc.

References m_ccaThreshDb.

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

Get the attached channel.

Returns
The channel.

Implements ns3::UanPhy.

Definition at line 802 of file uan-phy-gen.cc.

References m_channel.

UanModesList ns3::UanPhyGen::GetDefaultModes ( void  )
static

Get the default transmission modes.

Returns
The default mode list.

Definition at line 425 of file uan-phy-gen.cc.

References ns3::UanModesList::AppendMode(), ns3::UanTxModeFactory::CreateMode(), ns3::UanTxMode::FSK, and ns3::UanTxMode::PSK.

Referenced by ns3::UanPhyDual::GetTypeId(), and GetTypeId().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr< UanNetDevice > ns3::UanPhyGen::GetDevice ( void  )
virtual

Get the device hosting this Phy.

Returns
The net device.

Implements ns3::UanPhy.

Definition at line 808 of file uan-phy-gen.cc.

References m_device.

double ns3::UanPhyGen::GetInterferenceDb ( Ptr< Packet pkt)
private

Calculate interference power from overlapping packet arrivals, in dB.

The "signal" packet power is excluded. Use GetInterferenceDb ( (Ptr<Packet>) 0) to treat all signals as interference, for instance in calculating the CCA busy.

Parameters
pktThe arriving (signal) packet.
Returns
The total interference power, in dB.

Definition at line 908 of file uan-phy-gen.cc.

References DbToKp(), KpToDb(), and m_transducer.

Referenced by NotifyIntChange(), RxEndEvent(), SetSleepMode(), StartRxPacket(), and TxEndEvent().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

UanTxMode ns3::UanPhyGen::GetMode ( uint32_t  n)
virtual

Get a specific transmission mode.

Parameters
nThe mode number.
Returns
The mode.

Implements ns3::UanPhy.

Definition at line 1004 of file uan-phy-gen.cc.

References ns3::UanModesList::GetNModes(), m_modes, and NS_ASSERT.

Referenced by SendPacket(), and StartRxPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::UanPhyGen::GetNModes ( void  )
virtual

Get the number of transmission modes supported by this Phy.

Returns
The number modes.

Implements ns3::UanPhy.

Definition at line 998 of file uan-phy-gen.cc.

References ns3::UanModesList::GetNModes(), and m_modes.

Referenced by StartRxPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Get the packet currently being received.

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

Implements ns3::UanPhy.

Definition at line 1012 of file uan-phy-gen.cc.

References m_pktRx.

double ns3::UanPhyGen::GetRxGainDb ( void  )
virtual

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

Returns
The gain.

Implements ns3::UanPhy.

Definition at line 780 of file uan-phy-gen.cc.

References m_rxGainDb.

double ns3::UanPhyGen::GetRxThresholdDb ( void  )
virtual

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

Returns
The minimum required signal strength, in dB.

Implements ns3::UanPhy.

Definition at line 791 of file uan-phy-gen.cc.

References m_rxThreshDb.

Ptr< UanTransducer > ns3::UanPhyGen::GetTransducer ( void  )
virtual

Get the attached transducer.

Returns
The transducer.

Implements ns3::UanPhy.

Definition at line 814 of file uan-phy-gen.cc.

References m_transducer.

double ns3::UanPhyGen::GetTxPowerDb ( void  )
virtual

Get the current transmit power, in dB.

Returns
The transmit power.

Implements ns3::UanPhy.

Definition at line 785 of file uan-phy-gen.cc.

References m_txPwrDb.

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

Register this type.

Returns
The TypeId.

Definition at line 433 of file uan-phy-gen.cc.

References GetDefaultModes(), m_ccaThreshDb, m_modes, m_per, m_rxErrLogger, m_rxGainDb, m_rxOkLogger, m_rxThreshDb, m_sinr, m_txLogger, m_txPwrDb, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

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

Implements ns3::UanPhy.

Definition at line 736 of file uan-phy-gen.cc.

References IsStateIdle(), and IsStateSleep().

+ Here is the call graph for this function:

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

Implements ns3::UanPhy.

Definition at line 752 of file uan-phy-gen.cc.

References ns3::UanPhy::CCABUSY, and m_state.

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

Implements ns3::UanPhy.

Definition at line 731 of file uan-phy-gen.cc.

References ns3::UanPhy::IDLE, and m_state.

Referenced by IsStateBusy().

+ Here is the caller graph for this function:

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

Implements ns3::UanPhy.

Definition at line 741 of file uan-phy-gen.cc.

References m_state, and ns3::UanPhy::RX.

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

Implements ns3::UanPhy.

Definition at line 726 of file uan-phy-gen.cc.

References m_state, and ns3::UanPhy::SLEEP.

Referenced by IsStateBusy().

+ Here is the caller graph for this function:

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

Implements ns3::UanPhy.

Definition at line 746 of file uan-phy-gen.cc.

References m_state, and ns3::UanPhy::TX.

double ns3::UanPhyGen::KpToDb ( double  kp)
private

Convert kilopascals to dB.

\[{\rm{dB}} = 10{\log _{10}}{\rm{kPa}}\]

Parameters
kpSound pressure in kPa.
Returns
Signal level in dB.

Definition at line 935 of file uan-phy-gen.cc.

Referenced by GetInterferenceDb().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyIntChange ( void  )
virtual

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

Implements ns3::UanPhy.

Definition at line 891 of file uan-phy-gen.cc.

References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_state, and NotifyListenersCcaEnd().

+ Here is the call graph for this function:

void ns3::UanPhyGen::NotifyListenersCcaEnd ( void  )
private

Call UanListener::NotifyCcaEnd on all listeners.

Definition at line 978 of file uan-phy-gen.cc.

References m_listeners.

Referenced by NotifyIntChange().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyListenersCcaStart ( void  )
private

Call UanListener::NotifyCcaStart on all listeners.

Definition at line 969 of file uan-phy-gen.cc.

References m_listeners.

Referenced by RxEndEvent(), SetSleepMode(), StartRxPacket(), and TxEndEvent().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyListenersRxBad ( void  )
private

Call UanListener::NotifyRxEndError on all listeners.

Definition at line 960 of file uan-phy-gen.cc.

References m_listeners.

Referenced by RxEndEvent().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyListenersRxGood ( void  )
private

Call UanListener::NotifyRxEndOk on all listeners.

Definition at line 951 of file uan-phy-gen.cc.

References m_listeners.

Referenced by RxEndEvent().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyListenersRxStart ( void  )
private

Call UanListener::NotifyRxStart on all listeners.

Definition at line 941 of file uan-phy-gen.cc.

References m_listeners.

Referenced by StartRxPacket().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyListenersTxStart ( Time  duration)
private

Call UanListener::NotifyTxStart on all listeners.

Parameters
durationDuration of transmission.

Definition at line 988 of file uan-phy-gen.cc.

References m_listeners.

Referenced by SendPacket().

+ Here is the caller graph for this function:

void ns3::UanPhyGen::NotifyTransStartTx ( Ptr< Packet packet,
double  txPowerDb,
UanTxMode  txMode 
)
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.

Implements ns3::UanPhy.

Definition at line 882 of file uan-phy-gen.cc.

References m_minRxSinrDb, and m_pktRx.

void ns3::UanPhyGen::RegisterListener ( UanPhyListener listener)
virtual

Register a UanPhyListener to be notified of common UanPhy events.

Parameters
listenerNew listener to register.

Implements ns3::UanPhy.

Definition at line 578 of file uan-phy-gen.cc.

References m_listeners.

void ns3::UanPhyGen::RxEndEvent ( Ptr< Packet pkt,
double  rxPowerDb,
UanTxMode  txMode 
)
private

Event to process end of packet reception.

Parameters
pktThe packet.
rxPowerDbReceived signal power.
txModeTransmission mode.

Definition at line 664 of file uan-phy-gen.cc.

References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UniformRandomVariable::GetValue(), ns3::UanPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_ccaThreshDb, m_disabled, m_minRxSinrDb, m_per, m_pg, m_pktRx, m_recErrCb, m_recOkCb, m_rxErrLogger, m_rxOkLogger, m_state, NotifyListenersCcaStart(), NotifyListenersRxBad(), NotifyListenersRxGood(), ns3::UanPhy::NotifyRxDrop(), ns3::UanPhy::NotifyRxEnd(), NS_LOG_DEBUG, ns3::UanPhy::SLEEP, and UpdatePowerConsumption().

Referenced by StartRxPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Send a packet using a specific transmission mode.

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

Implements ns3::UanPhy.

Definition at line 517 of file uan-phy-gen.cc.

References ns3::UanTxMode::GetDataRateBps(), GetMode(), ns3::Packet::GetSize(), m_disabled, m_mac, m_minRxSinrDb, m_pktRx, m_state, m_transducer, m_txLogger, m_txPwrDb, NotifyListenersTxStart(), NS_LOG_DEBUG, ns3::Simulator::Schedule(), ns3::UanPhy::SLEEP, ns3::UanPhy::TX, TxEndEvent(), and UpdatePowerConsumption().

+ Here is the call graph for this function:

void ns3::UanPhyGen::SetCcaThresholdDb ( double  thresh)
virtual

Set the threshold for detecting channel busy.

Parameters
threshSignal power threshold at receiver.

Implements ns3::UanPhy.

Definition at line 775 of file uan-phy-gen.cc.

References m_ccaThreshDb.

void ns3::UanPhyGen::SetChannel ( Ptr< UanChannel channel)
virtual

Attach to a channel.

Parameters
channelThe channel to attach to.

Implements ns3::UanPhy.

Definition at line 819 of file uan-phy-gen.cc.

References m_channel.

void ns3::UanPhyGen::SetDevice ( Ptr< UanNetDevice device)
virtual

Set the device hosting this Phy.

Parameters
deviceThe device.

Implements ns3::UanPhy.

Definition at line 825 of file uan-phy-gen.cc.

References m_device.

void ns3::UanPhyGen::SetEnergyModelCallback ( DeviceEnergyModel::ChangeStateCallback  callback)
virtual

Set the DeviceEnergyModel callback for UanPhy device.

Parameters
callbackThe DeviceEnergyModel change state callback.

Implements ns3::UanPhy.

Definition at line 489 of file uan-phy-gen.cc.

References m_energyCallback, and NS_LOG_FUNCTION.

void ns3::UanPhyGen::SetMac ( Ptr< UanMac mac)
virtual

Set the MAC forwarding messages to this Phy.

Parameters
macThe MAC.

Implements ns3::UanPhy.

Definition at line 831 of file uan-phy-gen.cc.

References m_mac.

void ns3::UanPhyGen::SetReceiveErrorCallback ( RxErrCallback  cb)
virtual

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

Parameters
cbThe callback.

Implements ns3::UanPhy.

Definition at line 721 of file uan-phy-gen.cc.

References m_recErrCb.

void ns3::UanPhyGen::SetReceiveOkCallback ( RxOkCallback  cb)
virtual

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

Parameters
cbThe callback.

Implements ns3::UanPhy.

Definition at line 715 of file uan-phy-gen.cc.

References m_recOkCb.

void ns3::UanPhyGen::SetRxGainDb ( double  gain)
virtual

Set the receiver gain.

Parameters
gainGain added at receiver, in dB.

Implements ns3::UanPhy.

Definition at line 759 of file uan-phy-gen.cc.

References m_rxGainDb.

void ns3::UanPhyGen::SetRxThresholdDb ( double  thresh)
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.

Implements ns3::UanPhy.

Definition at line 770 of file uan-phy-gen.cc.

References m_rxThreshDb.

void ns3::UanPhyGen::SetSleepMode ( bool  sleep)
virtual

Set the Phy SLEEP mode.

Parameters
sleepSLEEP on or off.

Implements ns3::UanPhy.

Definition at line 844 of file uan-phy-gen.cc.

References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UanPhy::IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_ccaThreshDb, m_energyCallback, m_state, NotifyListenersCcaStart(), and ns3::UanPhy::SLEEP.

+ Here is the call graph for this function:

void ns3::UanPhyGen::SetTransducer ( Ptr< UanTransducer trans)
virtual

Attach a transducer to this Phy.

Parameters
transThe transducer.

Implements ns3::UanPhy.

Definition at line 837 of file uan-phy-gen.cc.

References m_transducer.

void ns3::UanPhyGen::SetTxPowerDb ( double  txpwr)
virtual

Set the transmit power.

Parameters
txpwrFinal output transmission power, in dB.

Implements ns3::UanPhy.

Definition at line 765 of file uan-phy-gen.cc.

References m_txPwrDb.

void ns3::UanPhyGen::StartRxPacket ( Ptr< Packet pkt,
double  rxPowerDb,
UanTxMode  txMode,
UanPdp  pdp 
)
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.

Implements ns3::UanPhy.

Definition at line 585 of file uan-phy-gen.cc.

References CalculateSinrDb(), ns3::UanPhy::CCABUSY, ns3::UanTxMode::GetDataRateBps(), GetInterferenceDb(), GetMode(), GetNModes(), ns3::Packet::GetSize(), ns3::UanTxMode::GetUid(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_disabled, m_mac, m_minRxSinrDb, m_pktRx, m_pktRxArrTime, m_pktRxMode, m_pktRxPdp, m_rxRecvPwrDb, m_rxThreshDb, m_state, NotifyListenersCcaStart(), NotifyListenersRxStart(), ns3::UanPhy::NotifyRxBegin(), ns3::UanPhy::NotifyRxDrop(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::UanPhy::RX, RxEndEvent(), ns3::Simulator::Schedule(), ns3::UanPhy::SLEEP, ns3::UanPhy::TX, and UpdatePowerConsumption().

+ Here is the call graph for this function:

void ns3::UanPhyGen::TxEndEvent ( )
private

Event to process end of packet transmission.

Definition at line 556 of file uan-phy-gen.cc.

References ns3::UanPhy::CCABUSY, GetInterferenceDb(), ns3::UanPhy::IDLE, m_ccaThreshDb, m_disabled, m_state, NotifyListenersCcaStart(), NS_ASSERT, NS_LOG_DEBUG, ns3::UanPhy::SLEEP, ns3::UanPhy::TX, and UpdatePowerConsumption().

Referenced by SendPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::UanPhyGen::UpdatePowerConsumption ( const State  state)
private

Update energy source with new state.

Parameters
stateThe new Phy state.

Definition at line 496 of file uan-phy-gen.cc.

References ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), m_energyCallback, and NS_LOG_FUNCTION.

Referenced by RxEndEvent(), SendPacket(), StartRxPacket(), and TxEndEvent().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

double ns3::UanPhyGen::m_ccaThreshDb
private
Ptr<UanChannel> ns3::UanPhyGen::m_channel
private

Attached channel.

Definition at line 288 of file uan-phy-gen.h.

Referenced by CalculateSinrDb(), Clear(), GetChannel(), and SetChannel().

bool ns3::UanPhyGen::m_cleared
private

Flag when we've been cleared.

Definition at line 307 of file uan-phy-gen.h.

Referenced by Clear().

Ptr<UanNetDevice> ns3::UanPhyGen::m_device
private

Device hosting this Phy.

Definition at line 290 of file uan-phy-gen.h.

Referenced by Clear(), EnergyDepletionHandler(), GetDevice(), and SetDevice().

bool ns3::UanPhyGen::m_disabled
private

Energy depleted.

Definition at line 308 of file uan-phy-gen.h.

Referenced by EnergyDepletionHandler(), RxEndEvent(), SendPacket(), StartRxPacket(), and TxEndEvent().

DeviceEnergyModel::ChangeStateCallback ns3::UanPhyGen::m_energyCallback
private

Energy model callback.

Definition at line 314 of file uan-phy-gen.h.

Referenced by DoDispose(), SetEnergyModelCallback(), SetSleepMode(), UanPhyGen(), and UpdatePowerConsumption().

Ptr<UanMac> ns3::UanPhyGen::m_mac
private

MAC layer.

Definition at line 291 of file uan-phy-gen.h.

Referenced by Clear(), SendPacket(), SetMac(), and StartRxPacket().

double ns3::UanPhyGen::m_minRxSinrDb
private

Minimum receive SINR during packet reception.

Definition at line 301 of file uan-phy-gen.h.

Referenced by NotifyTransStartTx(), RxEndEvent(), SendPacket(), and StartRxPacket().

UanModesList ns3::UanPhyGen::m_modes
private

List of modes supported by this PHY.

Definition at line 282 of file uan-phy-gen.h.

Referenced by GetMode(), GetNModes(), and GetTypeId().

Ptr<UanPhyPer> ns3::UanPhyGen::m_per
private

Error model.

Definition at line 292 of file uan-phy-gen.h.

Referenced by Clear(), GetTypeId(), and RxEndEvent().

Ptr<UniformRandomVariable> ns3::UanPhyGen::m_pg
private

Provides uniform random variables.

Definition at line 311 of file uan-phy-gen.h.

Referenced by AssignStreams(), RxEndEvent(), and UanPhyGen().

Ptr<Packet> ns3::UanPhyGen::m_pktRx
private

Received packet.

Definition at line 300 of file uan-phy-gen.h.

Referenced by Clear(), GetPacketRx(), NotifyTransStartTx(), RxEndEvent(), SendPacket(), and StartRxPacket().

Time ns3::UanPhyGen::m_pktRxArrTime
private

Packet arrival time.

Definition at line 303 of file uan-phy-gen.h.

Referenced by StartRxPacket().

UanTxMode ns3::UanPhyGen::m_pktRxMode
private

Packet transmission mode at receiver.

Definition at line 305 of file uan-phy-gen.h.

Referenced by StartRxPacket().

UanPdp ns3::UanPhyGen::m_pktRxPdp
private

Power delay profile of pakket.

Definition at line 304 of file uan-phy-gen.h.

Referenced by StartRxPacket().

RxErrCallback ns3::UanPhyGen::m_recErrCb
private

Callback for packets received with errors.

Definition at line 287 of file uan-phy-gen.h.

Referenced by RxEndEvent(), and SetReceiveErrorCallback().

RxOkCallback ns3::UanPhyGen::m_recOkCb
private

Callback for packets received without error.

Definition at line 286 of file uan-phy-gen.h.

Referenced by RxEndEvent(), and SetReceiveOkCallback().

TracedCallback<Ptr<const Packet>, double, UanTxMode > ns3::UanPhyGen::m_rxErrLogger
private

A packet destined for this Phy was received with error.

Definition at line 318 of file uan-phy-gen.h.

Referenced by GetTypeId(), and RxEndEvent().

double ns3::UanPhyGen::m_rxGainDb
private

Receive gain.

Definition at line 295 of file uan-phy-gen.h.

Referenced by GetRxGainDb(), GetTypeId(), and SetRxGainDb().

TracedCallback<Ptr<const Packet>, double, UanTxMode > ns3::UanPhyGen::m_rxOkLogger
private

A packet destined for this Phy was received without error.

Definition at line 316 of file uan-phy-gen.h.

Referenced by GetTypeId(), and RxEndEvent().

double ns3::UanPhyGen::m_rxRecvPwrDb
private

Receiver power.

Definition at line 302 of file uan-phy-gen.h.

Referenced by StartRxPacket().

double ns3::UanPhyGen::m_rxThreshDb
private

Receive SINR threshold.

Definition at line 297 of file uan-phy-gen.h.

Referenced by GetRxThresholdDb(), GetTypeId(), SetRxThresholdDb(), and StartRxPacket().

Ptr<UanPhyCalcSinr> ns3::UanPhyGen::m_sinr
private

SINR calculator.

Definition at line 293 of file uan-phy-gen.h.

Referenced by CalculateSinrDb(), Clear(), and GetTypeId().

State ns3::UanPhyGen::m_state
private
Ptr<UanTransducer> ns3::UanPhyGen::m_transducer
private

Associated transducer.

Definition at line 289 of file uan-phy-gen.h.

Referenced by CalculateSinrDb(), Clear(), GetInterferenceDb(), GetTransducer(), SendPacket(), and SetTransducer().

TracedCallback<Ptr<const Packet>, double, UanTxMode > ns3::UanPhyGen::m_txLogger
private

A packet was sent from this Phy.

Definition at line 320 of file uan-phy-gen.h.

Referenced by GetTypeId(), and SendPacket().

double ns3::UanPhyGen::m_txPwrDb
private

Transmit power.

Definition at line 296 of file uan-phy-gen.h.

Referenced by GetTxPowerDb(), GetTypeId(), SendPacket(), and SetTxPowerDb().


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