DESERT 4.0.0
Uwal Class Reference

#include <uwal.h>

Inheritance diagram for Uwal:
Inheritance graph
Collaboration diagram for Uwal:
Collaboration graph

Public Member Functions

 Uwal ()
 
 ~Uwal ()
 
virtual int recvSyncClMsg (ClMessage *m)
 
virtual void recv (Packet *)
 
virtual int command (int, const char *const *)
 
size_t getPSDU ()
 

Protected Member Functions

void ALqueueManager ()
 
void initializeHdr (Packet *, unsigned int)
 
void fragmentPkt (Packet *)
 
void reassembleFrames (Packet *)
 
void checkRxFrameSet ()
 
virtual void startTx (Packet *)
 
virtual void endTx (Packet *)
 
virtual void startRx (Packet *)
 
virtual void endRx (Packet *)
 
virtual double getTxDuration (Packet *)
 
virtual int getModulationType (Packet *)
 
virtual bool isInPERList (int mac_addr)
 
virtual double getPERfromID (int mac_addr)
 

Protected Attributes

int nodeID
 
unsigned int pkt_counter
 
packerpPacker
 
size_t PSDU
 
string dummyStr
 
int debug_
 
std::queue< Packet * > sendDownPkts
 
std::queue< Packet * > sendDownFrames
 
std::queue< Packet * > sendUpFrames
 
std::queue< Packet * > sendUpPkts
 
list< PERListElementPERList
 
std::map< RxFrameSetKey, RxFrameSetsendUpFrameSet
 

Private Attributes

TxFrameTimer InterframeTmr
 
double interframe_period
 
double frame_set_validity
 
int frame_padding
 
int force_endTx_
 
bool has_tap_clmsg
 

Friends

class TxFrameTimer
 

Detailed Description

The main class implementing the module used to implement the adaptation layer between ns2/NS-Miracle and binary data packets.

Constructor & Destructor Documentation

◆ Uwal()

Uwal::Uwal ( )

◆ ~Uwal()

Uwal::~Uwal ( )

Class destructor.

References InterframeTmr.

Member Function Documentation

◆ ALqueueManager()

void Uwal::ALqueueManager ( )
protected

Method responsible to manage the queueing system of Adaptation Layer

References ALqueueManager(), checkRxFrameSet(), endRx(), fragmentPkt(), reassembleFrames(), sendDownFrames, sendDownPkts, sendUpFrames, sendUpPkts, startRx(), and startTx().

Referenced by ALqueueManager(), TxFrameTimer::expire(), and recv().

Here is the call graph for this function:

◆ checkRxFrameSet()

void Uwal::checkRxFrameSet ( )
protected

Method responsible to check for errors the received frames

References hdr_uwal::binHdrLength(), hdr_uwal::binPkt(), hdr_uwal::binPktLength(), debug_, frame_set_validity, getPERfromID(), initializeHdr(), isInPERList(), nodeID, pPacker, sendUpFrameSet, sendUpPkts, hdr_uwal::srcID(), and packer::unpackPayload().

Referenced by ALqueueManager().

Here is the call graph for this function:

◆ command()

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

Method to map tcl commands into c++ methods.

Parameters
argcnumber of arguments in argv
argvarray of arguments where argv[3] is the tcl command name and argv[4, 5, ...] are the parameters for the corresponding c++ method.

References dummyStr, PERListElement::node_ID, PERListElement::per, PERList, pPacker, and PSDU.

◆ endRx()

void Uwal::endRx ( Packet *  p)
protectedvirtual

Method to end a packet reception.

Parameters
ppointer to the last received packet.

Referenced by ALqueueManager().

◆ endTx()

void Uwal::endTx ( Packet *  p)
protectedvirtual

Method to end a packet transmission. This method is also in charge to send a cross layer message Phy2MacEndTx(p) to notify the above layers of the simulator about the end of a transmission, see http://telecom.dei.unipd.it/ns/miracle/doxygen/classMPhy.html#c8c2f52d3833fed8ac736aca0ee52c98.

Parameters
ppointer to the last transmitted packet.

Referenced by startTx().

◆ fragmentPkt()

void Uwal::fragmentPkt ( Packet *  p)
protected

Method responsible to fragment the packet

Parameters
Pointerto the packet that are going to be fragmented

References hdr_uwal::binHdrLength(), hdr_uwal::binPkt(), hdr_uwal::binPktLength(), debug_, frame_padding, hdr_uwal::framePayloadOffset(), packer::getHdrBytesLength(), packer::hexdump(), initializeHdr(), hdr_uwal::Mbit(), packer::packHdr(), hdr_uwal::pktID(), pPacker, PSDU, and sendDownFrames.

Referenced by ALqueueManager().

Here is the call graph for this function:

◆ getModulationType()

virtual int Uwal::getModulationType ( Packet *  )
inlineprotectedvirtual

Unused method at the moment. To be implemented because defined as virtual in MPhy.

◆ getPERfromID()

double Uwal::getPERfromID ( int  mac_addr)
protectedvirtual

Method to search for the PER associated with a particular MAC address

Parameters
mac_addrAddr of the node for which search the related Packet Error Rate
Returns
the Packet Error Rate associated

References PERList.

Referenced by checkRxFrameSet().

◆ getPSDU()

size_t Uwal::getPSDU ( )
inline

References PSDU.

◆ getTxDuration()

virtual double Uwal::getTxDuration ( Packet *  )
inlineprotectedvirtual

Unused method at the moment. To be implemented because defined as virtual in MPhy.

◆ initializeHdr()

void Uwal::initializeHdr ( Packet *  p,
unsigned int  pkt_counter_ 
)
protected

Method responsible to initialize the headers of the packet

Parameters
Pointerto the packet
IDof the packet

References hdr_uwal::binHdrLength(), hdr_uwal::binPkt(), hdr_uwal::binPktLength(), hdr_uwal::dummyStr(), dummyStr, hdr_uwal::framePayloadOffset(), hdr_uwal::Mbit(), nodeID, hdr_uwal::pktID(), and hdr_uwal::srcID().

Referenced by checkRxFrameSet(), fragmentPkt(), recv(), and recvSyncClMsg().

Here is the call graph for this function:

◆ isInPERList()

bool Uwal::isInPERList ( int  mac_addr)
protectedvirtual

Method to search a MAC address in the PER List

Parameters
mac_addrAddress to search
Returns
true if mac_addr in in the PERList, false otherwise

References PERList.

Referenced by checkRxFrameSet().

◆ reassembleFrames()

void Uwal::reassembleFrames ( Packet *  p)
protected

Method responsible to reassemble the various fragments in a unique packets

Parameters
pointerto the original Packet

References hdr_uwal::binHdrLength(), hdr_uwal::binPkt(), hdr_uwal::binPktLength(), debug_, hdr_uwal::framePayloadOffset(), hdr_uwal::Mbit(), nodeID, hdr_uwal::pktID(), pPacker, PSDU, sendUpFrameSet, sendUpPkts, RxFrameSet::setError(), hdr_uwal::srcID(), and RxFrameSet::UpdateRxFrameSet().

Referenced by ALqueueManager().

Here is the call graph for this function:

◆ recv()

void Uwal::recv ( Packet *  p)
virtual

Method to handle the reception of packets arriving from the upper layers of the network simulator.

Parameters
ppointer to the packet that has been received from the simulator's upper layers.

References ALqueueManager(), debug_, has_tap_clmsg, initializeHdr(), nodeID, packer::packHdr(), packer::packPayload(), pkt_counter, pPacker, sendDownPkts, sendUpFrames, and packer::unpackHdr().

Here is the call graph for this function:

◆ recvSyncClMsg()

int Uwal::recvSyncClMsg ( ClMessage *  m)
virtual

Method to handle the reception of a synchronous crosslayer message

Parameters
mpointer to the crosslayer message.
Returns
0 if seccess

References debug_, force_endTx_, has_tap_clmsg, initializeHdr(), hdr_uwal::Mbit(), nodeID, packer::packHdr(), packer::packPayload(), pkt_counter, and pPacker.

Here is the call graph for this function:

◆ startRx()

void Uwal::startRx ( Packet *  p)
protectedvirtual

Method to start a packet reception. This method is also in charge to send a cross layer message Phy2MacStartRx(p) to notify the above layers of the simulator about the start of a reception, see http://telecom.dei.unipd.it/ns/miracle/doxygen/classMPhy.html#a15cc91b98013e1c631ad85072867ab6.

Parameters
ppointer to the last received packet.

Referenced by ALqueueManager().

◆ startTx()

void Uwal::startTx ( Packet *  p)
protectedvirtual

Method to start the packet transmission.

Parameters
ppointer to the packet to be transmitted.

References endTx(), force_endTx_, interframe_period, InterframeTmr, and hdr_uwal::Mbit().

Referenced by ALqueueManager().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ TxFrameTimer

friend class TxFrameTimer
friend

Friend class used to implement the timer handler.

See also
TxFrameTimer

Member Data Documentation

◆ debug_

int Uwal::debug_
protected

String containing dummy characters to be used as padding chars if necessary. Flag to enable debug mode (i.e., printing of debug messages) if set to 1.

Referenced by checkRxFrameSet(), fragmentPkt(), reassembleFrames(), recv(), recvSyncClMsg(), and Uwal().

◆ dummyStr

string Uwal::dummyStr
protected

Referenced by command(), initializeHdr(), and Uwal().

◆ force_endTx_

int Uwal::force_endTx_
private

0 not force, otherwise force endTx

Referenced by recvSyncClMsg(), startTx(), and Uwal().

◆ frame_padding

int Uwal::frame_padding
private

Flag to determine if perfoming bit padding up to PSDU size.

Referenced by fragmentPkt(), and Uwal().

◆ frame_set_validity

double Uwal::frame_set_validity
private

Time of validity of a frame set

Referenced by checkRxFrameSet(), and Uwal().

◆ has_tap_clmsg

bool Uwal::has_tap_clmsg
private

True if received a ClMessage from uwTAP.

Referenced by recv(), and recvSyncClMsg().

◆ interframe_period

double Uwal::interframe_period
private

Time period [s] between two successive frame to be sent down.

Referenced by startTx(), and Uwal().

◆ InterframeTmr

TxFrameTimer Uwal::InterframeTmr
private

Object of the class TxFrameTimer

Referenced by startTx(), and ~Uwal().

◆ nodeID

int Uwal::nodeID
protected

◆ PERList

list<PERListElement> Uwal::PERList
protected

PER list (couple of ID of the node and Packet Error Rate associated )

Referenced by command(), getPERfromID(), and isInPERList().

◆ pkt_counter

unsigned int Uwal::pkt_counter
protected

Counter for the pktID to set in TX.

Referenced by recv(), and recvSyncClMsg().

◆ pPacker

packer* Uwal::pPacker
protected

Pointer to the packer of the protocol headers

Referenced by checkRxFrameSet(), command(), fragmentPkt(), reassembleFrames(), recv(), and recvSyncClMsg().

◆ PSDU

size_t Uwal::PSDU
protected

size of the PSDU

Referenced by command(), fragmentPkt(), getPSDU(), reassembleFrames(), and Uwal().

◆ sendDownFrames

std::queue<Packet *> Uwal::sendDownFrames
protected

queue of the frames to send down

Referenced by ALqueueManager(), and fragmentPkt().

◆ sendDownPkts

std::queue<Packet *> Uwal::sendDownPkts
protected

queue of the packet to send down to the modem

Referenced by ALqueueManager(), and recv().

◆ sendUpFrames

std::queue<Packet *> Uwal::sendUpFrames
protected

queue of the frames to send up to the upper protocols

Referenced by ALqueueManager(), and recv().

◆ sendUpFrameSet

std::map<RxFrameSetKey, RxFrameSet> Uwal::sendUpFrameSet
protected

map of the frames to send up

Referenced by checkRxFrameSet(), and reassembleFrames().

◆ sendUpPkts

std::queue<Packet *> Uwal::sendUpPkts
protected

queue of the packets to send up to the upper protocols

Referenced by ALqueueManager(), checkRxFrameSet(), and reassembleFrames().


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