DESERT 3.6.0
Loading...
Searching...
No Matches
UwCbrModule Class Reference

#include <uwcbr-module.h>

Inheritance diagram for UwCbrModule:
Collaboration diagram for UwCbrModule:

Public Member Functions

 UwCbrModule ()
 
virtual ~UwCbrModule ()=default
 
virtual void recv (Packet *) override
 
virtual void recv (Packet *p, Handler *h) override
 
virtual int command (int argc, const char *const *argv) override
 
virtual double GetRTT () const
 
virtual double GetFTT () const
 
virtual double GetTxTime () const
 
virtual double GetPER () const
 
virtual double GetTHR () const
 
virtual double GetRTTstd () const
 
virtual double GetFTTstd () const
 
virtual void resetStats ()
 
void printIdsPkts () const
 

Protected Member Functions

virtual void initPkt (Packet *p)
 
virtual void sendPkt ()
 
virtual void sendPktLowPriority ()
 
virtual void sendPktHighPriority ()
 
virtual void transmit ()
 
virtual void start ()
 
virtual void stop ()
 
virtual void updateRTT (const double &)
 
virtual void updateFTT (const double &)
 
virtual void updateThroughput (const int &, const double &)
 
virtual void incrPktLost (const int &)
 
virtual void incrPktRecv ()
 
virtual void incrPktOoseq ()
 
virtual void incrPktInvalid ()
 
virtual double getTimeBeforeNextPkt ()
 
virtual void printReceivedPacket (Packet *p)
 

Static Protected Member Functions

static int getCbrHeaderSize ()
 

Protected Attributes

uint16_t dstPort_
 
std::string log_suffix
 
nsaddr_t dstAddr_
 
char priority_
 
std::ofstream tracefile
 
std::string tracefilename
 
bool * sn_check
 
int PoissonTraffic_
 
int debug_
 
int drop_out_of_order_
 
uint traffic_type_
 
UwSendTimer sendTmr_
 
int txsn
 
int hrsn
 
int pkts_recv
 
int pkts_ooseq
 
int pkts_lost
 
int pkts_invalid
 
int pkts_last_reset
 
int cnt
 
double rftt
 
double srtt
 
double sftt
 
double lrtime
 
double sthr
 
double period_
 
int pktSize_
 
double sumrtt
 
double sumrtt2
 
int rttsamples
 
double sumftt
 
double sumftt2
 
int fttsamples
 
double sumtxtimes = 0
 
double sumbytes
 
double sumdt
 
uint32_t esn
 
int tracefile_enabler_
 

Static Protected Attributes

static int uidcnt_ = 0
 

Friends

class UwSendTimer
 

Detailed Description

UwCbrModule class is used to manage UWCBR packets and to collect statistics about them.

Definition at line 161 of file uwcbr-module.h.

Constructor & Destructor Documentation

◆ UwCbrModule()

UwCbrModule::UwCbrModule ( )

Constructor of UwCbrModule class.

Definition at line 92 of file uwcbr-module.cpp.

◆ ~UwCbrModule()

virtual UwCbrModule::~UwCbrModule ( )
virtualdefault

Destructor of UwCbrModule class.

Member Function Documentation

◆ command()

int UwCbrModule::command ( int  argc,
const char *const *  argv 
)
overridevirtual

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 in UwTrackerModule, UwROVModule, UwROVCtrModule, UwSCROVCtrModule, UwSCFTrackerModule, and UwSCTrackerModule.

Definition at line 144 of file uwcbr-module.cpp.

◆ getCbrHeaderSize()

static int UwCbrModule::getCbrHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_uwcbr packet header.

Returns
The size of a hdr_uwcbr packet header.

Definition at line 444 of file uwcbr-module.h.

◆ GetFTT()

double UwCbrModule::GetFTT ( ) const
virtual

Returns the mean Forward Trip Time.

Returns
Forward Trip Time.

Definition at line 442 of file uwcbr-module.cpp.

◆ GetFTTstd()

double UwCbrModule::GetFTTstd ( ) const
virtual

Returns the mean Forward Trip Time Standard Deviation.

Returns
Forward Trip Time Standard Deviation.

Definition at line 466 of file uwcbr-module.cpp.

◆ GetPER()

double UwCbrModule::GetPER ( ) const
virtual

Returns the mean Packet Error Rate.

Returns
Packet Error Rate.

Definition at line 479 of file uwcbr-module.cpp.

◆ GetRTT()

double UwCbrModule::GetRTT ( ) const
virtual

Returns the mean Round Trip Time.

Returns
Round Trip Time.

Definition at line 436 of file uwcbr-module.cpp.

◆ GetRTTstd()

double UwCbrModule::GetRTTstd ( ) const
virtual

Returns the Round Trip Time Standard Deviation.

Returns
Round Trip Time Standard Deviation.

Definition at line 454 of file uwcbr-module.cpp.

◆ GetTHR()

double UwCbrModule::GetTHR ( ) const
virtual

Returns the mean Throughput.

Returns
Throughput.

Definition at line 493 of file uwcbr-module.cpp.

◆ getTimeBeforeNextPkt()

double UwCbrModule::getTimeBeforeNextPkt ( )
protectedvirtual

Returns the amount of time to wait before the next transmission.

It depends on the PoissonTraffic_ flag.

Returns
double Value to use as delay for the next transmission.
See also
PoissonTraffic_

Definition at line 567 of file uwcbr-module.cpp.

◆ GetTxTime()

double UwCbrModule::GetTxTime ( ) const
virtual

Returns the mean transmission time.

Returns
transmission time.

Definition at line 448 of file uwcbr-module.cpp.

◆ incrPktInvalid()

void UwCbrModule::incrPktInvalid ( )
protectedvirtual

Increases by one the number of invalid packets.

Definition at line 540 of file uwcbr-module.cpp.

◆ incrPktLost()

void UwCbrModule::incrPktLost ( const int &  npkts)
protectedvirtual

Increases the number of packets lost.

Parameters
int&Number of packets lost.

Definition at line 522 of file uwcbr-module.cpp.

◆ incrPktOoseq()

void UwCbrModule::incrPktOoseq ( )
protectedvirtual

Increases by one the number of out of sequence packets received.

Definition at line 534 of file uwcbr-module.cpp.

◆ incrPktRecv()

void UwCbrModule::incrPktRecv ( )
protectedvirtual

Increases by one the number of received packets.

Definition at line 528 of file uwcbr-module.cpp.

◆ initPkt()

void UwCbrModule::initPkt ( Packet *  p)
protectedvirtual

Initializes a data packet passed as argument with the default values.

Parameters
Packet*Pointer to a packet already allocated to fill with the right values.

Reimplemented in UwTrackerModule, UwROVModule, UwROVCtrModule, and UwSCFTrackerModule.

Definition at line 244 of file uwcbr-module.cpp.

◆ printIdsPkts()

void UwCbrModule::printIdsPkts ( ) const
inline

Prints the IDs of the packet's headers defined by UWCBR.

Definition at line 261 of file uwcbr-module.h.

◆ printReceivedPacket()

void UwCbrModule::printReceivedPacket ( Packet *  p)
protectedvirtual

Print to tracefile details about a received packet.

Parameters
Packet*Pointer to the received packet

Reimplemented in UwTrackerModule.

Definition at line 584 of file uwcbr-module.cpp.

◆ recv() [1/2]

void UwCbrModule::recv ( Packet *  p)
overridevirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

Reimplemented in UwROVModule, UwROVCtrModule, UwSCROVCtrModule, and UwSCTrackerModule.

Definition at line 350 of file uwcbr-module.cpp.

◆ recv() [2/2]

void UwCbrModule::recv ( Packet *  p,
Handler *  h 
)
overridevirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.
Handler*Handler.

Reimplemented in UwROVModule, and UwROVCtrModule.

Definition at line 344 of file uwcbr-module.cpp.

◆ resetStats()

void UwCbrModule::resetStats ( )
virtual

Resets all the statistics of the UWCBR module.

Definition at line 546 of file uwcbr-module.cpp.

◆ sendPkt()

void UwCbrModule::sendPkt ( )
protectedvirtual

Allocates, initialize and sends a packet with the default priority flag set from tcl.

See also
UwCbrModule::initPkt()

Reimplemented in UwSCFTrackerModule, and UwTrackerModule.

Definition at line 278 of file uwcbr-module.cpp.

◆ sendPktHighPriority()

void UwCbrModule::sendPktHighPriority ( )
protectedvirtual

Allocates, initialize and sends a packet with the default priority flag set from tcl.

See also
UwCbrModule::initPkt()

Definition at line 313 of file uwcbr-module.cpp.

◆ sendPktLowPriority()

void UwCbrModule::sendPktLowPriority ( )
protectedvirtual

Allocates, initialize and sends a packet with the default priority flag set from tcl.

See also
UwCbrModule::initPkt()

Definition at line 295 of file uwcbr-module.cpp.

◆ start()

void UwCbrModule::start ( )
protectedvirtual

Start to send packets.

Reimplemented in UwTrackerModule, UwROVCtrModule, and UwSCFTrackerModule.

Definition at line 272 of file uwcbr-module.cpp.

◆ stop()

void UwCbrModule::stop ( )
protectedvirtual

Stop to send packets.

Reimplemented in UwTrackerModule, and UwSCFTrackerModule.

Definition at line 338 of file uwcbr-module.cpp.

◆ transmit()

void UwCbrModule::transmit ( )
protectedvirtual

Creates and transmits a packet and schedules a new transmission.

See also
UwCbrModule::sendPkt()

Reimplemented in UwROVCtrModule.

Definition at line 331 of file uwcbr-module.cpp.

◆ updateFTT()

void UwCbrModule::updateFTT ( const double &  ftt)
protectedvirtual

Updates the Forward Trip Time.

Parameters
double&New Forward Trip Time entry.

Definition at line 507 of file uwcbr-module.cpp.

◆ updateRTT()

void UwCbrModule::updateRTT ( const double &  rtt)
protectedvirtual

Updates the Round Trip Time.

Parameters
double&New Round Trip Time entry.

Definition at line 499 of file uwcbr-module.cpp.

◆ updateThroughput()

void UwCbrModule::updateThroughput ( const int &  bytes,
const double &  dt 
)
protectedvirtual

Updates the Throughput.

Parameters
int&Bytes of the payload of the last packet received.
double&Delay Time between the last two receipts.

Definition at line 515 of file uwcbr-module.cpp.

Friends And Related Symbol Documentation

◆ UwSendTimer

friend class UwSendTimer
friend

Definition at line 163 of file uwcbr-module.h.

Member Data Documentation

◆ cnt

int UwCbrModule::cnt
protected

Used for check if is the first time that tracefile<ip of sink> is opened.

Definition at line 299 of file uwcbr-module.h.

◆ debug_

int UwCbrModule::debug_
protected

Flag to enable several levels of debug.

Definition at line 281 of file uwcbr-module.h.

◆ drop_out_of_order_

int UwCbrModule::drop_out_of_order_
protected

Flag to enable or disable the check for out of order packets.

Definition at line 282 of file uwcbr-module.h.

◆ dstAddr_

nsaddr_t UwCbrModule::dstAddr_
protected

IP of the destination.

Definition at line 272 of file uwcbr-module.h.

◆ dstPort_

uint16_t UwCbrModule::dstPort_
protected

Destination port.

Definition at line 270 of file uwcbr-module.h.

◆ esn

uint32_t UwCbrModule::esn
protected

Expected serial number.

Definition at line 324 of file uwcbr-module.h.

◆ fttsamples

int UwCbrModule::fttsamples
protected

Number of FTT samples.

Definition at line 318 of file uwcbr-module.h.

◆ hrsn

int UwCbrModule::hrsn
protected

Highest received sequence number.

Definition at line 289 of file uwcbr-module.h.

◆ log_suffix

std::string UwCbrModule::log_suffix
protected

Possibility to insert a log suffix.

Definition at line 271 of file uwcbr-module.h.

◆ lrtime

double UwCbrModule::lrtime
protected

Time of last packet reception.

Definition at line 305 of file uwcbr-module.h.

◆ period_

double UwCbrModule::period_
protected

Period between two consecutive packet transmissions.

Definition at line 308 of file uwcbr-module.h.

◆ pkts_invalid

int UwCbrModule::pkts_invalid
protected

Total number of invalid packets received.

Definition at line 295 of file uwcbr-module.h.

◆ pkts_last_reset

int UwCbrModule::pkts_last_reset
protected

Used for error checking after stats are reset.

Set to pkts_lost+pkts_recv each time resetStats is called.

Definition at line 296 of file uwcbr-module.h.

◆ pkts_lost

int UwCbrModule::pkts_lost
protected

Total number of lost packets, including packets received out of sequence.

Definition at line 293 of file uwcbr-module.h.

◆ pkts_ooseq

int UwCbrModule::pkts_ooseq
protected

Total number of packets received out of sequence.

Definition at line 292 of file uwcbr-module.h.

◆ pkts_recv

int UwCbrModule::pkts_recv
protected

Total number of received packets.

Packet out of sequence are not counted here.

Definition at line 290 of file uwcbr-module.h.

◆ pktSize_

int UwCbrModule::pktSize_
protected

UWCBR packets payload size.

Definition at line 309 of file uwcbr-module.h.

◆ PoissonTraffic_

int UwCbrModule::PoissonTraffic_
protected

1 if the traffic is generated according to a poissonian distribution, 0 otherwise.

Definition at line 279 of file uwcbr-module.h.

◆ priority_

char UwCbrModule::priority_
protected

Priority of the data packets.

Definition at line 273 of file uwcbr-module.h.

◆ rftt

double UwCbrModule::rftt
protected

Forward Trip Time seen for last received packet.

Definition at line 302 of file uwcbr-module.h.

◆ rttsamples

int UwCbrModule::rttsamples
protected

Number of RTT samples.

Definition at line 314 of file uwcbr-module.h.

◆ sendTmr_

UwSendTimer UwCbrModule::sendTmr_
protected

Timer which schedules packet transmissions.

Definition at line 286 of file uwcbr-module.h.

◆ sftt

double UwCbrModule::sftt
protected

Smoothed Forward Trip Time, calculated as srtt.

Definition at line 304 of file uwcbr-module.h.

◆ sn_check

bool* UwCbrModule::sn_check
protected

Used to keep track of the packets already received.

Definition at line 277 of file uwcbr-module.h.

◆ srtt

double UwCbrModule::srtt
protected

Smoothed Round Trip Time, calculated as for TCP.

Definition at line 303 of file uwcbr-module.h.

◆ sthr

double UwCbrModule::sthr
protected

Smoothed throughput calculation.

Definition at line 306 of file uwcbr-module.h.

◆ sumbytes

double UwCbrModule::sumbytes
protected

Sum of bytes received.

Definition at line 321 of file uwcbr-module.h.

◆ sumdt

double UwCbrModule::sumdt
protected

Sum of the delays.

Definition at line 322 of file uwcbr-module.h.

◆ sumftt

double UwCbrModule::sumftt
protected

Sum of FTT samples.

Definition at line 316 of file uwcbr-module.h.

◆ sumftt2

double UwCbrModule::sumftt2
protected

Sum of (FTT^2).

Definition at line 317 of file uwcbr-module.h.

◆ sumrtt

double UwCbrModule::sumrtt
protected

Sum of RTT samples.

Definition at line 312 of file uwcbr-module.h.

◆ sumrtt2

double UwCbrModule::sumrtt2
protected

Sum of (RTT^2).

Definition at line 313 of file uwcbr-module.h.

◆ sumtxtimes

double UwCbrModule::sumtxtimes = 0
protected

Sum of transmission times

Definition at line 319 of file uwcbr-module.h.

◆ tracefile

std::ofstream UwCbrModule::tracefile
protected

Definition at line 274 of file uwcbr-module.h.

◆ tracefile_enabler_

int UwCbrModule::tracefile_enabler_
protected

True if enable tracefile of received packets, default disabled.

Definition at line 326 of file uwcbr-module.h.

◆ tracefilename

std::string UwCbrModule::tracefilename
protected

Definition at line 275 of file uwcbr-module.h.

◆ traffic_type_

uint UwCbrModule::traffic_type_
protected

Traffic type of the packets.

Definition at line 284 of file uwcbr-module.h.

◆ txsn

int UwCbrModule::txsn
protected

Sequence number of the next packet to be transmitted.

Definition at line 288 of file uwcbr-module.h.

◆ uidcnt_

int UwCbrModule::uidcnt_ = 0
staticprotected

Unique id of the packet generated.

Definition at line 268 of file uwcbr-module.h.


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