DESERT 4.0.0
UwVbrModule Class Reference

#include <uwvbr-module.h>

Inheritance diagram for UwVbrModule:
Inheritance graph
Collaboration diagram for UwVbrModule:
Collaboration graph

Public Member Functions

 UwVbrModule ()
 
virtual ~UwVbrModule ()
 
virtual void recv (Packet *)
 
virtual void recv (Packet *p, Handler *h)
 
virtual int command (int argc, const char *const *argv)
 
virtual int crLayCommand (ClMessage *m)
 
virtual double GetRTT () const
 
virtual double GetFTT () const
 
virtual double GetPER () const
 
virtual double GetTHR () const
 
virtual double GetRTTstd () const
 
virtual double GetFTTstd () const
 
virtual void resetStats ()
 

Protected Member Functions

virtual void initPkt (Packet *p)
 
virtual void sendPkt ()
 
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 switchPeriod ()
 

Static Protected Member Functions

static const int getVbrHeaderSize ()
 

Protected Attributes

u_int16_t dstPort_
 
nsaddr_t dstAddr_
 
bool * sn_check
 
int PoissonTraffic_
 
int debug_
 
int drop_out_of_order_
 
int txsn
 
int hrsn
 
int pkts_recv
 
int pkts_ooseq
 
int pkts_lost
 
int pkts_invalid
 
int pkts_last_reset
 
double rftt
 
double srtt
 
double sftt
 
double lrtime
 
double sthr
 
int period_identifier_
 
double period1_
 
double period2_
 
double timer_switch_1_
 
double timer_switch_2_
 
UwVbrSendTimer sendTmr_
 
UwVbrPeriodSwitcher period_switcher_
 
int pktSize_
 
double sumrtt
 
double sumrtt2
 
int rttsamples
 
double sumftt
 
double sumftt2
 
int fttsamples
 
double sumbytes
 
double sumdt
 
uint32_t esn
 

Static Protected Attributes

static int uidcnt_ = 0
 

Friends

class UwVbrSendTimer
 
class UwVbrPeriodSwitcher
 

Detailed Description

UwVbrModule class is used to manage UWVBR packets, and to collect statistics about them.

Constructor & Destructor Documentation

◆ UwVbrModule()

UwVbrModule::UwVbrModule ( )

◆ ~UwVbrModule()

UwVbrModule::~UwVbrModule ( )
virtual

Destructor of UwVbrModule class.

Member Function Documentation

◆ command()

int UwVbrModule::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.

References GetFTT(), GetFTTstd(), GetPER(), GetRTT(), GetRTTstd(), GetTHR(), getVbrHeaderSize(), hrsn, pkts_last_reset, pkts_recv, resetStats(), sendPkt(), start(), stop(), and txsn.

Here is the call graph for this function:

◆ crLayCommand()

int UwVbrModule::crLayCommand ( ClMessage *  m)
virtual

◆ GetFTT()

double UwVbrModule::GetFTT ( ) const
virtual

Returns the mean Forward Trip Time.

Returns
Forward Trip Time.

References fttsamples, and sumftt.

Referenced by command().

◆ GetFTTstd()

double UwVbrModule::GetFTTstd ( ) const
virtual

Returns the mean Forward Trip Time Standard Deviation.

Returns
Forward Trip Time Standard Deviation.

References fttsamples, sumftt, and sumftt2.

Referenced by command().

◆ GetPER()

double UwVbrModule::GetPER ( ) const
virtual

Returns the mean Packet Error Rate.

Returns
Packet Error Rate.

References drop_out_of_order_, esn, pkts_lost, and pkts_recv.

Referenced by command().

◆ GetRTT()

double UwVbrModule::GetRTT ( ) const
virtual

Returns the mean Round Trip Time.

Returns
Round Trip Time.

References rttsamples, and sumrtt.

Referenced by command().

◆ GetRTTstd()

double UwVbrModule::GetRTTstd ( ) const
virtual

Returns the Round Trip Time Standard Deviation.

Returns
Round Trip Time Standard Deviation.

References rttsamples, sumrtt, and sumrtt2.

Referenced by command().

◆ GetTHR()

double UwVbrModule::GetTHR ( ) const
virtual

Returns the mean Throughput.

Returns
Throughput.

References sumbytes, and sumdt.

Referenced by command().

◆ getTimeBeforeNextPkt()

double UwVbrModule::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_

References period1_, period2_, period_identifier_, and PoissonTraffic_.

Referenced by start(), and transmit().

◆ getVbrHeaderSize()

static const int UwVbrModule::getVbrHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_uwvbr packet header.

Returns
The size of a hdr_uwvbr packet header.

Referenced by command().

◆ incrPktInvalid()

void UwVbrModule::incrPktInvalid ( )
protectedvirtual

Increases by one the number of invalid packets.

References pkts_invalid.

Referenced by recv().

◆ incrPktLost()

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

Increases the number of packets lost.

Parameters
intNumber of packets lost.

References pkts_lost.

Referenced by recv().

◆ incrPktOoseq()

void UwVbrModule::incrPktOoseq ( )
protectedvirtual

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

References pkts_ooseq.

Referenced by recv().

◆ incrPktRecv()

void UwVbrModule::incrPktRecv ( )
protectedvirtual

Increases by one the number of received packets.

References pkts_recv.

Referenced by recv().

◆ initPkt()

void UwVbrModule::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.

References hdr_uwip::access(), hdr_uwudp::access(), hdr_uwip::daddr(), hdr_uwudp::dport(), dstAddr_, dstPort_, pktSize_, PT_UWVBR, hdr_uwvbr::rftt(), rftt, hdr_uwvbr::rftt_valid(), hdr_uwvbr::sn(), txsn, and uidcnt_.

Referenced by sendPkt().

Here is the call graph for this function:

◆ recv() [1/2]

void UwVbrModule::recv ( Packet *  p)
virtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

References debug_, drop_out_of_order_, esn, hrsn, incrPktInvalid(), incrPktLost(), incrPktOoseq(), incrPktRecv(), lrtime, pkts_last_reset, pkts_lost, pkts_recv, PT_UWVBR, hdr_uwvbr::rftt(), rftt, hdr_uwvbr::rftt_valid(), hdr_uwvbr::sn(), sn_check, updateFTT(), updateRTT(), and updateThroughput().

Referenced by recv().

Here is the call graph for this function:

◆ recv() [2/2]

void UwVbrModule::recv ( Packet *  p,
Handler *  h 
)
virtual

Performs the reception of packets from upper and lower layers.

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

References recv().

Here is the call graph for this function:

◆ resetStats()

void UwVbrModule::resetStats ( )
virtual

Resets all the statistics of the UWVBR module.

References fttsamples, pkts_last_reset, pkts_lost, pkts_ooseq, pkts_recv, rftt, rttsamples, sftt, srtt, sthr, sumbytes, sumdt, sumftt, sumftt2, sumrtt, and sumrtt2.

Referenced by command().

◆ sendPkt()

void UwVbrModule::sendPkt ( )
protectedvirtual

Allocates, initialize and sends a packet.

See also
UwVbrModule::initPkt()

References debug_, initPkt(), and hdr_uwvbr::sn().

Referenced by command(), and transmit().

Here is the call graph for this function:

◆ start()

void UwVbrModule::start ( )
protectedvirtual

Start to send packets.

References getTimeBeforeNextPkt(), period_switcher_, sendTmr_, and timer_switch_1_.

Referenced by command().

Here is the call graph for this function:

◆ stop()

void UwVbrModule::stop ( )
protectedvirtual

Stop to send packets.

References sendTmr_.

Referenced by command().

◆ switchPeriod()

void UwVbrModule::switchPeriod ( )
protectedvirtual

Switches between the two different states in which UWVBR can operate.

References period_identifier_, period_switcher_, timer_switch_1_, and timer_switch_2_.

◆ transmit()

void UwVbrModule::transmit ( )
protectedvirtual

Creates and transmits a packet and schedules a new transmission.

See also
UwVbrModule::sendPkt()

References getTimeBeforeNextPkt(), sendPkt(), and sendTmr_.

Here is the call graph for this function:

◆ updateFTT()

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

Updates the Forward Trip Time.

Parameters
doubleNew Forward Trip Time entry.

References fttsamples, sumftt, and sumftt2.

Referenced by recv().

◆ updateRTT()

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

Updates the Round Trip Time.

Parameters
doubleNew Round Trip Time entry.

References rttsamples, sumrtt, and sumrtt2.

Referenced by recv().

◆ updateThroughput()

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

Updates the Throughput.

Parameters
intBytes of the payload of the last packet received.
doubleDelay Time between the last two receipts.

References debug_, sumbytes, and sumdt.

Referenced by recv().

Friends And Related Symbol Documentation

◆ UwVbrPeriodSwitcher

friend class UwVbrPeriodSwitcher
friend

◆ UwVbrSendTimer

friend class UwVbrSendTimer
friend

Member Data Documentation

◆ debug_

int UwVbrModule::debug_
protected

Flag to enable or disable dirrefent levels of debug.

Referenced by recv(), sendPkt(), updateThroughput(), and UwVbrModule().

◆ drop_out_of_order_

int UwVbrModule::drop_out_of_order_
protected

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

Referenced by GetPER(), recv(), and UwVbrModule().

◆ dstAddr_

nsaddr_t UwVbrModule::dstAddr_
protected

IP of the destination.

Referenced by initPkt(), and UwVbrModule().

◆ dstPort_

u_int16_t UwVbrModule::dstPort_
protected

Destination port.

Referenced by initPkt(), and UwVbrModule().

◆ esn

uint32_t UwVbrModule::esn
protected

Expected serial number.

Referenced by GetPER(), and recv().

◆ fttsamples

int UwVbrModule::fttsamples
protected

Number of FTT samples.

Referenced by GetFTT(), GetFTTstd(), resetStats(), and updateFTT().

◆ hrsn

int UwVbrModule::hrsn
protected

Highest received sequence number.

Referenced by command(), and recv().

◆ lrtime

double UwVbrModule::lrtime
protected

Time of last packet reception.

Referenced by recv().

◆ period1_

double UwVbrModule::period1_
protected

period between two consecutive packet transmissions (mode 1).

Referenced by getTimeBeforeNextPkt(), and UwVbrModule().

◆ period2_

double UwVbrModule::period2_
protected

period between two consecutive packet transmissions (mode 2).

Referenced by getTimeBeforeNextPkt(), and UwVbrModule().

◆ period_identifier_

int UwVbrModule::period_identifier_
protected

Flag used to identify in which one of the period the vbr module is.

Referenced by getTimeBeforeNextPkt(), and switchPeriod().

◆ period_switcher_

UwVbrPeriodSwitcher UwVbrModule::period_switcher_
protected

Timer which schedules the switch between different sending periods.

Referenced by start(), and switchPeriod().

◆ pkts_invalid

int UwVbrModule::pkts_invalid
protected

Total number of invalid packets received.

Referenced by incrPktInvalid().

◆ pkts_last_reset

int UwVbrModule::pkts_last_reset
protected

for error checking after stats are reset. Set to pkts_lost+pkts_recv each time resetStats is called.

Referenced by command(), recv(), and resetStats().

◆ pkts_lost

int UwVbrModule::pkts_lost
protected

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

Referenced by GetPER(), incrPktLost(), recv(), and resetStats().

◆ pkts_ooseq

int UwVbrModule::pkts_ooseq
protected

Total number of packets received out of sequence.

Referenced by incrPktOoseq(), and resetStats().

◆ pkts_recv

int UwVbrModule::pkts_recv
protected

Total number of received packets. Packet out of sequence are not counted here.

Referenced by command(), GetPER(), incrPktRecv(), recv(), and resetStats().

◆ pktSize_

int UwVbrModule::pktSize_
protected

Packet size.

Referenced by initPkt(), and UwVbrModule().

◆ PoissonTraffic_

int UwVbrModule::PoissonTraffic_
protected

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

Referenced by getTimeBeforeNextPkt(), and UwVbrModule().

◆ rftt

double UwVbrModule::rftt
protected

Forward Trip Time seen for last received packet.

Referenced by initPkt(), recv(), and resetStats().

◆ rttsamples

int UwVbrModule::rttsamples
protected

Number of RTT samples.

Referenced by GetRTT(), GetRTTstd(), resetStats(), and updateRTT().

◆ sendTmr_

UwVbrSendTimer UwVbrModule::sendTmr_
protected

Timer which schedules packet transmissions.

Referenced by start(), stop(), and transmit().

◆ sftt

double UwVbrModule::sftt
protected

Smoothed Forward Trip Time, calculated as srtt.

Referenced by resetStats().

◆ sn_check

bool* UwVbrModule::sn_check
protected

Used to keep track of the packets already received.

Referenced by recv(), and UwVbrModule().

◆ srtt

double UwVbrModule::srtt
protected

Smoothed Round Trip Time, calculated as for TCP.

Referenced by resetStats().

◆ sthr

double UwVbrModule::sthr
protected

Smoothed throughput calculation.

Referenced by resetStats().

◆ sumbytes

double UwVbrModule::sumbytes
protected

Sum of bytes received.

Referenced by GetTHR(), resetStats(), and updateThroughput().

◆ sumdt

double UwVbrModule::sumdt
protected

Sum of the delays.

Referenced by GetTHR(), resetStats(), and updateThroughput().

◆ sumftt

double UwVbrModule::sumftt
protected

Sum of FTT samples.

Referenced by GetFTT(), GetFTTstd(), resetStats(), and updateFTT().

◆ sumftt2

double UwVbrModule::sumftt2
protected

Sum of (FTT^2).

Referenced by GetFTTstd(), resetStats(), and updateFTT().

◆ sumrtt

double UwVbrModule::sumrtt
protected

Sum of RTT samples.

Referenced by GetRTT(), GetRTTstd(), resetStats(), and updateRTT().

◆ sumrtt2

double UwVbrModule::sumrtt2
protected

Sum of (RTT^2).

Referenced by GetRTTstd(), resetStats(), and updateRTT().

◆ timer_switch_1_

double UwVbrModule::timer_switch_1_
protected

Period in witch the node tramsmits with a packet every period1_ seconds.

Referenced by start(), switchPeriod(), and UwVbrModule().

◆ timer_switch_2_

double UwVbrModule::timer_switch_2_
protected

Period in witch the node tramsmits with a packet every period2_ seconds.

Referenced by switchPeriod(), and UwVbrModule().

◆ txsn

int UwVbrModule::txsn
protected

Sequence number of next new packet to be transmitted.

Referenced by command(), and initPkt().

◆ uidcnt_

int UwVbrModule::uidcnt_ = 0
staticprotected

Unique id of the packet generated.

Referenced by initPkt().


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