|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
27 #include "ns3/traced-callback.h"
28 #include "ns3/nstime.h"
29 #include "ns3/device-energy-model.h"
30 #include "ns3/random-variable-stream.h"
31 #include "ns3/event-id.h"
319 virtual void Clear (
void);
401 double DbToKp (
double db);
410 double KpToDb (
double kp);
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > m_txLogger
A packet was sent from this Phy.
a unique identifier for an interface.
virtual uint32_t GetNModes(void)
Get the number of transmission modes supported by this Phy.
static TypeId GetTypeId(void)
Register this type.
double m_ccaThreshDb
CCA busy threshold.
Ptr< UniformRandomVariable > m_pg
Provides uniform random variables.
std::list< UanPhyListener * > ListenerList
List of Phy Listeners.
double m_thresh
SINR threshold.
virtual UanTxMode GetMode(uint32_t n)
Get a specific transmission mode.
An identifier for simulation events.
bool m_cleared
Flag when we've been cleared.
The power delay profile returned by propagation models.
virtual double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const
Calculate the SINR value for a packet.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Register this type.
Callback< void, Ptr< Packet >, double > RxErrCallback
Packet receive error callback function type.
Packet error rate calculation for common tx modes based on UanPhyPerUmodem.
ListenerList m_listeners
List of listeners.
Ptr< UanChannel > m_channel
Attached channel.
UanPhyPerGenDefault()
Constructor.
static TypeId GetTypeId(void)
Register this type.
Ptr< UanNetDevice > m_device
Device hosting this Phy.
double KpToDb(double kp)
Convert kilopascals to dB.
UanPhyPerUmodem()
Constructor.
UanModesList m_modes
List of modes supported by this PHY.
double m_rxRecvPwrDb
Receiver power.
virtual void NotifyIntChange(void)
Called when there has been a change in the amount of interference this node is experiencing from othe...
Time m_pktRxArrTime
Packet arrival time.
double GetInterferenceDb(Ptr< Packet > pkt)
Calculate interference power from overlapping packet arrivals, in dB.
virtual bool IsStateIdle(void)
EventId m_rxEndEvent
Rx event.
Packet error rate calculation assuming WHOI Micromodem-like PHY (FH-FSK)
virtual void SetChannel(Ptr< UanChannel > channel)
Attach to a channel.
virtual void SetSleepMode(bool sleep)
Set the Phy SLEEP mode.
UanPdp m_pktRxPdp
Power delay profile of packet.
virtual ~UanPhyCalcSinrFhFsk()
Destructor.
UanPhyCalcSinrDefault()
Constructor.
Ptr< UanTransducer > m_transducer
Associated transducer.
UanPhyPerCommonModes()
Constructor.
Container for UanTxModes.
Ptr< Packet > m_pktTx
Sent packet.
virtual Ptr< Packet > GetPacketRx(void) const
Get the packet currently being received.
virtual double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode)
Calculate the packet error probability based on SINR at the receiver and a tx mode.
virtual Ptr< UanNetDevice > GetDevice(void) const
Get the device hosting this Phy.
virtual void EnergyDepletionHandler(void)
Handle the energy depletion event.
virtual void SetMac(Ptr< UanMac > mac)
Set the MAC forwarding messages to this Phy.
virtual bool IsStateTx(void)
UanTxMode m_pktRxMode
Packet transmission mode at receiver.
virtual void Clear(void)
Clear all pointer references.
uint32_t m_hops
Number of hops.
Base class for UAN Phy models.
void NotifyListenersTxStart(Time duration)
Call UanListener::NotifyTxStart on all listeners.
void NotifyListenersCcaEnd(void)
Call UanListener::NotifyCcaEnd on all listeners.
virtual ~UanPhyPerUmodem()
Destructor.
Calculate packet error probability, based on received SINR and modulation (mode).
void RxEndEvent(Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode)
Event to process end of packet reception.
void NotifyListenersTxEnd(void)
Call UanListener::NotifyTxEnd on all listeners.
virtual bool IsStateRx(void)
void NotifyListenersCcaStart(void)
Call UanListener::NotifyCcaStart on all listeners.
void NotifyListenersRxBad(void)
Call UanListener::NotifyRxEndError on all listeners.
Ptr< UanPhyPer > m_per
Error model.
virtual double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode)
Calculate the Packet ERror probability based on SINR at the receiver and a tx mode.
Default Packet Error Rate calculator for UanPhyGen.
static TypeId GetTypeId(void)
Register this type.
EventId m_txEndEvent
Tx event.
virtual void SendPacket(Ptr< Packet > pkt, uint32_t modeNum)
Send a packet using a specific transmission mode.
double m_minRxSinrDb
Minimum receive SINR during packet reception.
Simulation virtual time values and global simulation resolution.
Abstraction of packet modulation information.
State
Enum defining possible Phy states.
void NotifyListenersRxStart(void)
Call UanListener::NotifyRxStart on all listeners.
static UanModesList GetDefaultModes(void)
Get the default transmission modes.
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > m_rxOkLogger
A packet destined for this Phy was received without error.
virtual double GetTxPowerDb(void)
Get the current transmit power, in dB.
virtual bool IsStateCcaBusy(void)
void NotifyListenersRxGood(void)
Call UanListener::NotifyRxEndOk on all listeners.
virtual ~UanPhyCalcSinrDefault()
Destructor.
virtual void SetDevice(Ptr< UanNetDevice > device)
Set the device hosting this Phy.
WHOI Micromodem like FH-FSK model.
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > m_rxErrLogger
A packet destined for this Phy was received with error.
RxErrCallback m_recErrCb
Callback for packets received with errors.
virtual void StartRxPacket(Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp)
Packet arriving from channel: i.e.
virtual Ptr< UanTransducer > GetTransducer(void)
Get the attached transducer.
virtual void SetCcaThresholdDb(double thresh)
Set the threshold for detecting channel busy.
virtual bool IsStateSleep(void)
double DbToKp(double db)
Convert dB to kilopascals.
virtual Ptr< UanChannel > GetChannel(void) const
Get the attached channel.
Interface for PHY event listener.
virtual void EnergyRechargeHandler(void)
Handle the energy recharge event.
Ptr< Packet > m_pktRx
Received packet.
std::list< UanPacketArrival > ArrivalList
List of arriving packets overlapping in time.
virtual void SetTxPowerDb(double txpwr)
Set the transmit power.
virtual void SetEnergyModelCallback(DeviceEnergyModel::ChangeStateCallback cb)
Set the DeviceEnergyModel callback for UanPhy device.
UanPhyCalcSinrFhFsk()
Constructor.
Class used for calculating SINR of packet in UanPhy.
double NChooseK(uint32_t n, uint32_t k)
Binomial coefficient.
virtual double GetRxThresholdDb(void)
Get the minimum received signal strength required to receive a packet without errors.
virtual double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode)
Calculate the packet error probability based on SINR at the receiver and a tx mode.
virtual void SetReceiveErrorCallback(RxErrCallback cb)
Default SINR calculator for UanPhyGen.
void UpdatePowerConsumption(const State state)
Update energy source with new state.
Forward calls to a chain of Callback.
RxOkCallback m_recOkCb
Callback for packets received without error.
virtual void DoDispose()
Destructor implementation.
virtual ~UanPhyPerGenDefault()
Destructor.
double m_txPwrDb
Transmit power.
virtual void RegisterListener(UanPhyListener *listener)
Register a UanPhyListener to be notified of common UanPhy events.
static TypeId GetTypeId(void)
Register this type.
virtual void SetReceiveOkCallback(RxOkCallback cb)
Set the callback to be used when a packet is received without error.
virtual ~UanPhyGen()
Dummy destructor, see DoDispose.
virtual void NotifyTransStartTx(Ptr< Packet > packet, double txPowerDb, UanTxMode txMode)
Called when a transmission is beginning on the attached transducer.
Ptr< UanMac > m_mac
MAC layer.
virtual void SetTransducer(Ptr< UanTransducer > trans)
Attach a transducer to this Phy.
virtual bool IsStateBusy(void)
Ptr< UanPhyCalcSinr > m_sinr
SINR calculator.
static TypeId GetTypeId(void)
Register this type.
virtual double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const
Calculate the SINR value for a packet.
double CalculateSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, UanTxMode mode, UanPdp pdp)
Calculate the SINR value for a packet.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
virtual ~UanPhyPerCommonModes()
Destructor.
void TxEndEvent()
Event to process end of packet transmission.
DeviceEnergyModel::ChangeStateCallback m_energyCallback
Energy model callback.
double m_rxThreshDb
Receive SINR threshold.
virtual double GetCcaThresholdDb(void)
Get the CCA threshold signal strength required to detect channel busy.
virtual void SetRxThresholdDb(double thresh)
Set the minimum SINR threshold to receive a packet without errors.