DESERT 3.5.1
Loading...
Searching...
No Matches
UwOFDMPhy Class Reference

#include <uwofdmphy.h>

Inheritance diagram for UwOFDMPhy:
Collaboration diagram for UwOFDMPhy:

Public Member Functions

 UwOFDMPhy ()
 
virtual ~UwOFDMPhy ()
 
virtual int command (int, const char *const *)
 
void init_ofdm_node (int nn, int cf, int scn, int ID)
 
void setBufferSize (int)
 
int getNodeNum () const
 
int getSentUpPkts ()
 
void setNodeNum (int)
 
int getSubCarNum () const
 
int getLowSnrPktLost () const
 
int getNoiseErrPktLost () const
 
int getCollErrPktLost () const
 
int getTxPenPktLost () const
 
int getTxPenCtrlLost () const
 
int getFreqCollPktLost () const
 
int getCtrlCErrPktLost () const
 
int getCtrlFCollPktLost () const
 
int getModErrPktLost () const
 
int getPhyPktSent () const
 
void setSubCarNum (int)
 
void setNodeID (int)
 
void showSubCar ()
 
void setSubCar (int, int)
 
void setBrokenCar (int, int)
 
int getNodeID () const
 
double getTransmissionTime () const
 
bool freqOverlap (Packet *, bool)
 
- Public Member Functions inherited from UnderwaterPhysical
 UnderwaterPhysical ()
 
virtual ~UnderwaterPhysical ()
 
int recvSyncClMsg (ClMessage *m)
 

Public Attributes

bool txongoing_
 

Protected Member Functions

virtual void recv (Packet *)
 
virtual void endRx (Packet *p)
 
virtual void startRx (Packet *p)
 
virtual void endTx (Packet *p)
 
virtual double getOFDMPER (double _snr, int _nbits, Packet *)
 
virtual double getOFDMNoisePower (Packet *p)
 
double getTxDuration (Packet *p)
 
void createOFDMhdr (Packet *p)
 
void interruptReceptions ()
 
int recvSyncClMsg (ClMessage *m)
 
void plotPktQueue ()
 
- Protected Member Functions inherited from UnderwaterPhysical
virtual void updateInstantaneousStats ()
 
virtual double consumedEnergyTx (const double &_duration)
 
virtual double consumedEnergyRx (const double &_duration)
 
virtual double getPER (double snr, int nbits, Packet *)
 
const bool isZero (const double &value) const
 
double Get_Tx_Time ()
 
double Get_Rx_Time ()
 
double Get_Energy_Tx ()
 
double Get_Energy_Rx ()
 
double Get_Transmitted_bytes ()
 
void incrTot_pkts_lost ()
 
void incrTotCrtl_pkts_lost ()
 
void incrErrorCtrlPktsInterf ()
 
void incrCollisionDATAvsCTRL ()
 
void incrCollisionCTRL ()
 
void incrCollisionDATA ()
 
int getTot_pkts_lost ()
 
int getTot_CtrlPkts_lost ()
 
int getError_CtrlPktsInterf ()
 
int getCollisionsDATAvsCTRL ()
 
int getCollisionsCTRL ()
 
int getCollisionsDATA ()
 
const double log2 (const double &_input) const
 
const double get_prob_error_symbol_mpsk (const double &_snr, const uint32_t _M) const
 

Private Member Functions

virtual double getDistance (Packet *)
 
virtual double getPropagationDelay (Packet *)
 
virtual int getTotalDelay ()
 
string itos (int i)
 
string dtos (double d)
 

Private Attributes

int buffered_pkt_num
 
int current_rcvs
 
int nodeNum_
 
int centerFreq_
 
int subCarrier_
 
int nodeID_
 
double total_delay_
 
int powerScaling
 
int FRAME_BIT
 
int bufferSize_
 
std::vector< Packet > pktqueue_
 
std::vector< Packet * > txqueue_
 
std::vector< double > timesqueue_
 
std::vector< double > brokenCarriers_
 
int sentUpPkts
 
int lostPackets [8] ={0,0,0,0,0,0,0,0}
 
double totTransTime
 
int phySentPkt_
 
int tx_busy_
 
MsgDisplayer msgDisp
 

Additional Inherited Members

- Protected Attributes inherited from UnderwaterPhysical
std::string modulation_name_
 
double time_ready_to_end_rx_
 
double Tx_Time_
 
double Rx_Time_
 
double Energy_Tx_
 
double Energy_Rx_
 
double Transmitted_bytes_
 
double tx_power_
 
double rx_power_
 
int tot_pkts_lost
 
int tot_ctrl_pkts_lost
 
int errorCtrlPktsInterf
 
int collisionDataCTRL
 
int collisionCTRL
 
int collisionDATA
 
std::string Interference_Model
 
uwinterferenceinterference_
 

Detailed Description

Definition at line 66 of file uwofdmphy.h.

Constructor & Destructor Documentation

◆ UwOFDMPhy()

UwOFDMPhy::UwOFDMPhy ( )

Constructor of UwOFDMPhy class.

Definition at line 59 of file uwofdmphy.cpp.

◆ ~UwOFDMPhy()

UwOFDMPhy::~UwOFDMPhy ( )
virtual

Destructor of UwOFDMPhy class.

Definition at line 70 of file uwofdmphy.cpp.

Member Function Documentation

◆ command()

int UwOFDMPhy::command ( int  argc,
const char *const *  argv 
)
virtual

TCL command interpreter.

It implements the following OTcl methods:

Parameters
argcNumber of arguments in argv.
argvArray of strings which are the command parameters (Note that argv[0] is the name of the object).
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.

Reimplemented from UnderwaterPhysical.

Definition at line 74 of file uwofdmphy.cpp.

◆ createOFDMhdr()

void UwOFDMPhy::createOFDMhdr ( Packet *  p)
protected

Creates an OFDM header for non-OFDM packets.

Parameters
Packet*p Pointer to the packet transmitted

Definition at line 986 of file uwofdmphy.cpp.

◆ dtos()

string UwOFDMPhy::dtos ( double  d)
inlineprivate
Parameters
da double
Returns
d converted to string

Definition at line 301 of file uwofdmphy.h.

◆ endRx()

void UwOFDMPhy::endRx ( Packet *  p)
protectedvirtual

Handles the end of a packet reception.

Parameters
Packet*p Pointer to the packet received

Reimplemented from UnderwaterPhysical.

Definition at line 523 of file uwofdmphy.cpp.

◆ endTx()

void UwOFDMPhy::endTx ( Packet *  p)
protectedvirtual

Handles the end of a transmission, redefined to scale the power into the carriers.

Parameters
Packet*p Pointer to the packet transmitted

Reimplemented from UnderwaterPhysical.

Definition at line 377 of file uwofdmphy.cpp.

◆ freqOverlap()

bool UwOFDMPhy::freqOverlap ( Packet *  p2,
bool  isOFDM 
)

Definition at line 959 of file uwofdmphy.cpp.

◆ getCollErrPktLost()

int UwOFDMPhy::getCollErrPktLost ( ) const

Definition at line 1040 of file uwofdmphy.cpp.

◆ getCtrlCErrPktLost()

int UwOFDMPhy::getCtrlCErrPktLost ( ) const

Definition at line 1076 of file uwofdmphy.cpp.

◆ getCtrlFCollPktLost()

int UwOFDMPhy::getCtrlFCollPktLost ( ) const

Definition at line 1070 of file uwofdmphy.cpp.

◆ getDistance()

double UwOFDMPhy::getDistance ( Packet *  _p)
privatevirtual

Return the distance between source and destination.

Parameters
pPacket by witch the module gets information about source and destination.

Definition at line 935 of file uwofdmphy.cpp.

◆ getFreqCollPktLost()

int UwOFDMPhy::getFreqCollPktLost ( ) const

Definition at line 1058 of file uwofdmphy.cpp.

◆ getLowSnrPktLost()

int UwOFDMPhy::getLowSnrPktLost ( ) const

Definition at line 1028 of file uwofdmphy.cpp.

◆ getModErrPktLost()

int UwOFDMPhy::getModErrPktLost ( ) const

Definition at line 1064 of file uwofdmphy.cpp.

◆ getNodeID()

int UwOFDMPhy::getNodeID ( ) const

Definition at line 1092 of file uwofdmphy.cpp.

◆ getNodeNum()

int UwOFDMPhy::getNodeNum ( ) const

Definition at line 1098 of file uwofdmphy.cpp.

◆ getNoiseErrPktLost()

int UwOFDMPhy::getNoiseErrPktLost ( ) const

Definition at line 1034 of file uwofdmphy.cpp.

◆ getOFDMNoisePower()

double UwOFDMPhy::getOFDMNoisePower ( Packet *  p)
protectedvirtual

Handles the end of a transmission, redefined to scale the power into the carriers.

Parameters
Packet*p Pointer to the packet transmitted
Returns
Noise power on used carriers

Definition at line 912 of file uwofdmphy.cpp.

◆ getOFDMPER()

double UwOFDMPhy::getOFDMPER ( double  _snr,
int  _nbits,
Packet *  p 
)
protectedvirtual

Returns the packet error rate by using the length of a packet and the information contained in the packet (position of the source and the destination).

The error rate is computed only on the carriers used by the packet.

Parameters
snrCalculated by nsmiracle with the Urick model (unused).
nbitslength in bit of the packet.
pPacket by witch the module gets information about source and destination.
Returns
PER of the packet passed as parameter.

Definition at line 845 of file uwofdmphy.cpp.

◆ getPhyPktSent()

int UwOFDMPhy::getPhyPktSent ( ) const

Definition at line 1086 of file uwofdmphy.cpp.

◆ getPropagationDelay()

double UwOFDMPhy::getPropagationDelay ( Packet *  _p)
privatevirtual

Return the propagation delay for the packet.

The delay is calculated based on the distance between the source and the sink.

Parameters
pPacket by witch the module gets information about source and destination.

Definition at line 950 of file uwofdmphy.cpp.

◆ getSentUpPkts()

int UwOFDMPhy::getSentUpPkts ( )

Definition at line 1115 of file uwofdmphy.cpp.

◆ getSubCarNum()

int UwOFDMPhy::getSubCarNum ( ) const

Definition at line 1104 of file uwofdmphy.cpp.

◆ getTotalDelay()

virtual int UwOFDMPhy::getTotalDelay ( )
inlineprivatevirtual

returns total delay

Definition at line 281 of file uwofdmphy.h.

◆ getTransmissionTime()

double UwOFDMPhy::getTransmissionTime ( ) const

Definition at line 1081 of file uwofdmphy.cpp.

◆ getTxDuration()

double UwOFDMPhy::getTxDuration ( Packet *  p)
protected

Computes the transmission time duration depending on the used carriers.

Parameters
Packet*p Pointer to the packet transmitted
Returns
Transmission duration

Definition at line 787 of file uwofdmphy.cpp.

◆ getTxPenCtrlLost()

int UwOFDMPhy::getTxPenCtrlLost ( ) const

Definition at line 1052 of file uwofdmphy.cpp.

◆ getTxPenPktLost()

int UwOFDMPhy::getTxPenPktLost ( ) const

Definition at line 1046 of file uwofdmphy.cpp.

◆ init_ofdm_node()

void UwOFDMPhy::init_ofdm_node ( int  nn,
int  cf,
int  scn,
int  ID 
)

Definition at line 217 of file uwofdmphy.cpp.

◆ interruptReceptions()

void UwOFDMPhy::interruptReceptions ( )
protected

Interrupts reception if MAC has other priorities Theoretically should never be called.

Definition at line 771 of file uwofdmphy.cpp.

◆ itos()

string UwOFDMPhy::itos ( int  i)
inlineprivate
Parameters
ian integer
Returns
i converted to string

Definition at line 291 of file uwofdmphy.h.

◆ plotPktQueue()

void UwOFDMPhy::plotPktQueue ( )
protected

Plots pktqueue elements.

Definition at line 1178 of file uwofdmphy.cpp.

◆ recv()

void UwOFDMPhy::recv ( Packet *  p)
protectedvirtual

recv method.

It is called when a packet is received from the channel

Parameters
Packet*Pointer to the packet that are going to be received

Reimplemented from UnderwaterPhysical.

Definition at line 237 of file uwofdmphy.cpp.

◆ recvSyncClMsg()

int UwOFDMPhy::recvSyncClMsg ( ClMessage *  m)
protected

Handles receiving messages from the MAC layer.

Definition at line 1156 of file uwofdmphy.cpp.

◆ setBrokenCar()

void UwOFDMPhy::setBrokenCar ( int  bottom,
int  top 
)

Definition at line 1133 of file uwofdmphy.cpp.

◆ setBufferSize()

void UwOFDMPhy::setBufferSize ( int  s)

Definition at line 210 of file uwofdmphy.cpp.

◆ setNodeID()

void UwOFDMPhy::setNodeID ( int  n)

Definition at line 1121 of file uwofdmphy.cpp.

◆ setNodeNum()

void UwOFDMPhy::setNodeNum ( int  n)

Definition at line 1110 of file uwofdmphy.cpp.

◆ setSubCar()

void UwOFDMPhy::setSubCar ( int  index,
int  value 
)

Definition at line 1149 of file uwofdmphy.cpp.

◆ setSubCarNum()

void UwOFDMPhy::setSubCarNum ( int  n)

Definition at line 1128 of file uwofdmphy.cpp.

◆ showSubCar()

void UwOFDMPhy::showSubCar ( )

Definition at line 1141 of file uwofdmphy.cpp.

◆ startRx()

void UwOFDMPhy::startRx ( Packet *  p)
protectedvirtual

Handles the start of a packet reception.

Parameters
Packet*p Pointer to the packet received

Reimplemented from UnderwaterPhysical.

Definition at line 401 of file uwofdmphy.cpp.

Member Data Documentation

◆ brokenCarriers_

std::vector<double> UwOFDMPhy::brokenCarriers_
private

Definition at line 322 of file uwofdmphy.h.

◆ buffered_pkt_num

int UwOFDMPhy::buffered_pkt_num
private

Definition at line 306 of file uwofdmphy.h.

◆ bufferSize_

int UwOFDMPhy::bufferSize_
private

Definition at line 317 of file uwofdmphy.h.

◆ centerFreq_

int UwOFDMPhy::centerFreq_
private

Definition at line 309 of file uwofdmphy.h.

◆ current_rcvs

int UwOFDMPhy::current_rcvs
private

Definition at line 307 of file uwofdmphy.h.

◆ FRAME_BIT

int UwOFDMPhy::FRAME_BIT
private

Definition at line 315 of file uwofdmphy.h.

◆ lostPackets

int UwOFDMPhy::lostPackets[8] ={0,0,0,0,0,0,0,0}
private

Definition at line 325 of file uwofdmphy.h.

◆ msgDisp

MsgDisplayer UwOFDMPhy::msgDisp
private

Definition at line 340 of file uwofdmphy.h.

◆ nodeID_

int UwOFDMPhy::nodeID_
private

Definition at line 311 of file uwofdmphy.h.

◆ nodeNum_

int UwOFDMPhy::nodeNum_
private

Definition at line 308 of file uwofdmphy.h.

◆ phySentPkt_

int UwOFDMPhy::phySentPkt_
private

Definition at line 327 of file uwofdmphy.h.

◆ pktqueue_

std::vector<Packet> UwOFDMPhy::pktqueue_
private

Definition at line 319 of file uwofdmphy.h.

◆ powerScaling

int UwOFDMPhy::powerScaling
private

Definition at line 313 of file uwofdmphy.h.

◆ sentUpPkts

int UwOFDMPhy::sentUpPkts
private

Definition at line 324 of file uwofdmphy.h.

◆ subCarrier_

int UwOFDMPhy::subCarrier_
private

Definition at line 310 of file uwofdmphy.h.

◆ timesqueue_

std::vector<double> UwOFDMPhy::timesqueue_
private

Definition at line 321 of file uwofdmphy.h.

◆ total_delay_

double UwOFDMPhy::total_delay_
private

Definition at line 312 of file uwofdmphy.h.

◆ totTransTime

double UwOFDMPhy::totTransTime
private

Definition at line 326 of file uwofdmphy.h.

◆ tx_busy_

int UwOFDMPhy::tx_busy_
private

transmission power might be carried out just by re-setting this value.

More complex strategies (e.g., packet-specific transmission power) can be implemented by overriding the getTxPower() method.

Definition at line 338 of file uwofdmphy.h.

◆ txongoing_

bool UwOFDMPhy::txongoing_

Definition at line 164 of file uwofdmphy.h.

◆ txqueue_

std::vector<Packet *> UwOFDMPhy::txqueue_
private

Definition at line 320 of file uwofdmphy.h.


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