ns-3
ns3::UanPhyGen Class Reference

Generic PHY model. More...

#include <uan-phy-gen.h>

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

List of all members.

Public Member Functions

virtual void SetEnergyModelCallback (DeviceEnergyModel::ChangeStateCallback cb)
virtual void EnergyDepletionHandler (void)
virtual void SendPacket (Ptr< Packet > pkt, uint32_t modeNum)
virtual void RegisterListener (UanPhyListener *listener)
virtual void StartRxPacket (Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
 Packet arriving from channel: i.e. leading bit of packet has arrived.
virtual void SetReceiveOkCallback (RxOkCallback cb)
virtual void SetReceiveErrorCallback (RxErrCallback cb)
virtual bool IsStateSleep (void)
virtual bool IsStateIdle (void)
virtual bool IsStateBusy (void)
virtual bool IsStateRx (void)
virtual bool IsStateTx (void)
virtual bool IsStateCcaBusy (void)
virtual void SetRxGainDb (double gain)
virtual void SetTxPowerDb (double txpwr)
virtual void SetRxThresholdDb (double thresh)
virtual void SetCcaThresholdDb (double thresh)
virtual double GetRxGainDb (void)
virtual double GetTxPowerDb (void)
virtual double GetRxThresholdDb (void)
virtual double GetCcaThresholdDb (void)
virtual Ptr< UanChannelGetChannel (void) const
virtual Ptr< UanNetDeviceGetDevice (void)
virtual Ptr< UanTransducerGetTransducer (void)
virtual void SetChannel (Ptr< UanChannel > channel)
virtual void SetDevice (Ptr< UanNetDevice > device)
virtual void SetMac (Ptr< UanMac > mac)
virtual void SetTransducer (Ptr< UanTransducer > trans)
virtual void NotifyTransStartTx (Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
virtual void NotifyIntChange (void)
virtual uint32_t GetNModes (void)
virtual UanTxMode GetMode (uint32_t n)
virtual Ptr< PacketGetPacketRx (void) const
virtual void Clear (void)
virtual void SetSleepMode (bool sleep)

Static Public Member Functions

static UanModesList GetDefaultModes (void)
static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::UanPhyGen.

Protected Member Functions

virtual void DoDispose ()

Additional Inherited Members

- Public Types inherited from ns3::UanPhy
enum  State {
  IDLE, CCABUSY, RX, TX,
  SLEEP
}
 Enum defining possible Phy states.
typedef Callback< void, Ptr
< Packet >, double, UanTxMode
RxOkCallback
typedef Callback< void, Ptr
< Packet >, double > 
RxErrCallback

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.


Member Function Documentation

void ns3::UanPhyGen::Clear ( void  )
virtual
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.

References Clear().

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

This function handles the energy depletion event. Must be implemented by UanPhy child classes.

Implements ns3::UanPhy.

References ns3::Node::GetId(), ns3::UanNetDevice::GetNode(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

double ns3::UanPhyGen::GetCcaThresholdDb ( void  )
virtual
Returns:
Threshold signal strength in dB to enter CCA busy mode

Implements ns3::UanPhy.

Ptr< UanChannel > ns3::UanPhyGen::GetChannel ( void  ) const
virtual
Returns:
Channel this phy is attached to

Implements ns3::UanPhy.

UanModesList ns3::UanPhyGen::GetDefaultModes ( void  )
static
Ptr< UanNetDevice > ns3::UanPhyGen::GetDevice ( void  )
virtual
Returns:
the Net Device that this Phy is a part of

Implements ns3::UanPhy.

UanTxMode ns3::UanPhyGen::GetMode ( uint32_t  n)
virtual
Parameters:
nMode number of mode to return (place in Modeslist)
Returns:
Mode n

Implements ns3::UanPhy.

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

Referenced by SendPacket(), and StartRxPacket().

uint32_t ns3::UanPhyGen::GetNModes ( void  )
virtual
Returns:
Number of TX modes supported by this PHY

Implements ns3::UanPhy.

References ns3::UanModesList::GetNModes().

Referenced by StartRxPacket().

Ptr< Packet > ns3::UanPhyGen::GetPacketRx ( void  ) const
virtual
Warning:
Returns non-valid pointer if IsStateRx == false
Returns:
Packet currently being received in PHY

Implements ns3::UanPhy.

double ns3::UanPhyGen::GetRxGainDb ( void  )
virtual
Returns:
Gain added to signal at receiver in dB

Implements ns3::UanPhy.

double ns3::UanPhyGen::GetRxThresholdDb ( void  )
virtual
Returns:
Required signal strength, in dB, to begin receiving packet

Implements ns3::UanPhy.

Ptr< UanTransducer > ns3::UanPhyGen::GetTransducer ( void  )
virtual
Returns:
Transducer this Phy outputs to / receives from

Implements ns3::UanPhy.

double ns3::UanPhyGen::GetTxPowerDb ( void  )
virtual
Returns:
Current TX power output

Implements ns3::UanPhy.

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

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

Attributes defined for this type:

  • 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
    • Set with class: UanModesListValue
    • Underlying type: UanModesList
    • Initial value: 2|0|1|
    • Flags: construct write read
  • PerModel: Functor to calculate PER based on SINR and TxMode
  • SinrModel: Functor to calculate SINR based on pkt arrivals and modes

TraceSources defined for this type:

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

Reimplemented from ns3::UanPhy.

References GetDefaultModes(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

bool ns3::UanPhyGen::IsStateBusy ( void  )
virtual
Returns:
True if Phy is not IDLE

Implements ns3::UanPhy.

References IsStateIdle(), and IsStateSleep().

bool ns3::UanPhyGen::IsStateCcaBusy ( void  )
virtual
Returns:
True if Phy is not TX or RX but the channel is sensed busy

Implements ns3::UanPhy.

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

Implements ns3::UanPhy.

Referenced by IsStateBusy().

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

Implements ns3::UanPhy.

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

Implements ns3::UanPhy.

Referenced by IsStateBusy().

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

Implements ns3::UanPhy.

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

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

Implements ns3::UanPhy.

void ns3::UanPhyGen::NotifyTransStartTx ( Ptr< Packet packet,
double  txPowerDb,
UanTxMode  txMode 
)
virtual
Parameters:
packetPacket that is beginning transmission
txPowerDbTransmit power of packet
txModeTransmission mode of packet

Notification that there is a transmission beginning on the transducer that this Phy is attached to.

Implements ns3::UanPhy.

void ns3::UanPhyGen::RegisterListener ( UanPhyListener listener)
virtual
Parameters:
listenerNew listener to register

Register an object to be notified of common Phy events

Implements ns3::UanPhy.

void ns3::UanPhyGen::SendPacket ( Ptr< Packet pkt,
uint32_t  modeNum 
)
virtual
Parameters:
pktPacket to transmit
modeNumIndex of mode in SupportedModes list to use for transmission

Implements ns3::UanPhy.

References ns3::UanMac::GetAddress(), ns3::UanTxMode::GetDataRateBps(), GetMode(), ns3::Packet::GetSize(), NS_LOG_DEBUG, ns3::Simulator::Schedule(), ns3::Seconds(), and ns3::UanTransducer::Transmit().

void ns3::UanPhyGen::SetCcaThresholdDb ( double  thresh)
virtual
Parameters:
threshSignal power at receiver required for CCA busy state

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetChannel ( Ptr< UanChannel channel)
virtual
Parameters:
channelThe channel this Phy is attached to

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetDevice ( Ptr< UanNetDevice device)
virtual
Parameters:
deviceThe Net Device this Phy is a part of

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetEnergyModelCallback ( DeviceEnergyModel::ChangeStateCallback  callback)
virtual
Parameters:
callbackDeviceEnergyModel change state callback.

This function sets the DeviceEnergyModel callback for UanPhy device. Must be implemented by UanPhy child classes.

Implements ns3::UanPhy.

References NS_LOG_FUNCTION.

void ns3::UanPhyGen::SetMac ( Ptr< UanMac mac)
virtual
Parameters:
macThe MAC forwarding messages to this Phy

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetReceiveErrorCallback ( RxErrCallback  cb)
virtual
Parameters:
cbCallback to be enabled when a packet is received with errors

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetReceiveOkCallback ( RxOkCallback  cb)
virtual
Parameters:
cbCallback to be enabled when packet is received without error

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetRxGainDb ( double  gain)
virtual
Parameters:
gainGain added at receiver

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetRxThresholdDb ( double  thresh)
virtual
Parameters:
threshThreshold SINR for propper reception in dB

Implements ns3::UanPhy.

void ns3::UanPhyGen::SetTransducer ( Ptr< UanTransducer trans)
virtual
Parameters:
transTransducer this Phy outputs to / receives from

Implements ns3::UanPhy.

References ns3::UanTransducer::AddPhy().

void ns3::UanPhyGen::SetTxPowerDb ( double  txpwr)
virtual
Parameters:
txpwrFinal output transmission power in dB

Implements ns3::UanPhy.

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
txModeTransmission mode defining modulation of incoming packet
pdpPower delay profile of incoming packet

Implements ns3::UanPhy.

References ns3::UanMac::GetAddress(), ns3::UanTxMode::GetDataRateBps(), GetMode(), GetNModes(), ns3::Packet::GetSize(), ns3::UanTxMode::GetUid(), ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::Simulator::Schedule(), and ns3::Seconds().


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