|
DESERT 4.0.0
|
#include <uwcbr-module.h>


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 |
UwCbrModule class is used to manage UWCBR packets and to collect statistics about them.
| UwCbrModule::UwCbrModule | ( | ) |
Constructor of UwCbrModule class.
References debug_, drop_out_of_order_, dstAddr_, dstPort_, period_, pktSize_, PoissonTraffic_, sn_check, tracefile_enabler_, and traffic_type_.
|
virtualdefault |
Destructor of UwCbrModule class.
|
overridevirtual |
TCL command interpreter. It implements the following OTcl methods:
| argc | Number of arguments in argv. |
| argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
Reimplemented in CoolAddon, UwTrackerModule, UwROVModule, UwROVCtrModule, UwSCROVCtrModule, UwSCFTrackerModule, and UwSCTrackerModule.
References getCbrHeaderSize(), GetFTT(), GetFTTstd(), GetPER(), GetRTT(), GetRTTstd(), GetTHR(), GetTxTime(), hrsn, log_suffix, pkts_last_reset, pkts_recv, printIdsPkts(), priority_, resetStats(), sendPkt(), sendPktHighPriority(), sendPktLowPriority(), start(), stop(), tracefile, tracefile_enabler_, tracefilename, and txsn.
Referenced by CoolAddon::command(), UwTrackerModule::command(), UwROVModule::command(), and UwROVCtrModule::command().

|
inlinestaticprotected |
|
virtual |
Returns the mean Forward Trip Time.
References fttsamples, and sumftt.
Referenced by command().
|
virtual |
Returns the mean Forward Trip Time Standard Deviation.
References fttsamples, sumftt, and sumftt2.
Referenced by command().
|
virtual |
Returns the mean Packet Error Rate.
References drop_out_of_order_, esn, pkts_lost, and pkts_recv.
Referenced by command().
|
virtual |
Returns the mean Round Trip Time.
References rttsamples, and sumrtt.
Referenced by command().
|
virtual |
Returns the Round Trip Time Standard Deviation.
References rttsamples, sumrtt, and sumrtt2.
Referenced by command().
|
virtual |
|
protectedvirtual |
Returns the amount of time to wait before the next transmission. It depends on the PoissonTraffic_ flag.
References period_, and PoissonTraffic_.
Referenced by start(), and transmit().
|
virtual |
Returns the mean transmission time.
References fttsamples, and sumtxtimes.
Referenced by command().
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Increases by one the number of out of sequence packets received.
References pkts_ooseq.
Referenced by recv().
|
protectedvirtual |
|
protectedvirtual |
Initializes a data packet passed as argument with the default values.
| Packet* | Pointer to a packet already allocated to fill with the right values. |
Reimplemented in UwTrackerModule, UwROVModule, UwROVCtrModule, and UwSCFTrackerModule.
References hdr_uwip::access(), hdr_uwudp::access(), hdr_uwip::daddr(), hdr_uwudp::dport(), dstAddr_, dstPort_, pktSize_, hdr_uwcbr::priority(), priority_, PT_UWCBR, hdr_uwcbr::rftt(), rftt, hdr_uwcbr::rftt_valid(), hdr_uwcbr::sn(), hdr_uwcbr::traffic_type(), traffic_type_, txsn, and uidcnt_.
Referenced by UwTrackerModule::initPkt(), UwROVModule::initPkt(), UwROVCtrModule::initPkt(), sendPkt(), sendPktHighPriority(), sendPktLowPriority(), and CoolAddon::sendTHRWarning().

|
inline |
|
protectedvirtual |
Print to tracefile details about a received packet
| Packet* | Pointer to the received packet |
Reimplemented in UwTrackerModule.
References hdr_uwip::access(), hdr_uwip::daddr(), hdr_uwip::saddr(), hdr_uwcbr::sn(), tracefile, and tracefile_enabler_.
Referenced by recv().

|
overridevirtual |
Performs the reception of packets from upper and lower layers.
| Packet* | Pointer to the packet will be received. |
Reimplemented in UwROVModule, UwROVCtrModule, UwSCROVCtrModule, UwSCTrackerModule, and CoolAddon.
References drop_out_of_order_, esn, hrsn, incrPktInvalid(), incrPktLost(), incrPktOoseq(), incrPktRecv(), lrtime, pkts_last_reset, pkts_lost, pkts_recv, printReceivedPacket(), PT_UWCBR, hdr_uwcbr::rftt(), rftt, hdr_uwcbr::rftt_valid(), hdr_uwcbr::sn(), sn_check, tracefile_enabler_, updateFTT(), updateRTT(), and updateThroughput().
Referenced by UwROVModule::recv(), UwROVCtrModule::recv(), UwSCTrackerModule::recv(), CoolAddon::recv(), and recv().

|
overridevirtual |
Performs the reception of packets from upper and lower layers.
| Packet* | Pointer to the packet will be received. |
| Handler* | Handler. |
Reimplemented in UwROVModule, and UwROVCtrModule.
References recv().

|
virtual |
Resets all the statistics of the UWCBR 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().
|
protectedvirtual |
Allocates, initialize and sends a packet with the default priority flag set from tcl.
Reimplemented in UwSCFTrackerModule, and UwTrackerModule.
References initPkt(), and hdr_uwcbr::sn().
Referenced by command(), UwROVModule::recv(), UwROVModule::sendAck(), UwTrackerModule::sendPkt(), transmit(), and UwROVCtrModule::transmit().

|
protectedvirtual |
Allocates, initialize and sends a packet with the default priority flag set from tcl.
References initPkt(), hdr_uwcbr::priority(), and hdr_uwcbr::sn().
Referenced by command(), UwROVModule::recv(), and UwROVModule::sendAck().

|
protectedvirtual |
Allocates, initialize and sends a packet with the default priority flag set from tcl.
References initPkt(), hdr_uwcbr::priority(), and hdr_uwcbr::sn().
Referenced by command().

|
protectedvirtual |
Start to send packets.
Reimplemented in CoolAddon, UwTrackerModule, UwROVCtrModule, and UwSCFTrackerModule.
References getTimeBeforeNextPkt(), and sendTmr_.
Referenced by command(), CoolAddon::start(), and UwTrackerModule::start().

|
protectedvirtual |
Stop to send packets.
Reimplemented in CoolAddon, UwTrackerModule, and UwSCFTrackerModule.
References sendTmr_.
Referenced by command(), CoolAddon::stop(), and UwTrackerModule::stop().
|
protectedvirtual |
Creates and transmits a packet and schedules a new transmission.
Reimplemented in UwROVCtrModule.
References getTimeBeforeNextPkt(), sendPkt(), and sendTmr_.

|
protectedvirtual |
Updates the Forward Trip Time.
| double& | New Forward Trip Time entry. |
References fttsamples, sumftt, and sumftt2.
Referenced by recv().
|
protectedvirtual |
Updates the Round Trip Time.
| double& | New Round Trip Time entry. |
References rttsamples, sumrtt, and sumrtt2.
Referenced by recv().
|
protectedvirtual |
|
friend |
|
protected |
Used for check if is the first time that tracefile<ip of sink> is opened.
|
protected |
Flag to enable several levels of debug.
Referenced by UwTrackerModule::initPkt(), UwROVModule::initPkt(), UwROVCtrModule::initPkt(), UwROVModule::recv(), UwROVCtrModule::recv(), UwSCROVCtrModule::recv(), UwSCTrackerModule::recv(), UwSCROVCtrModule::recvSyncClMsg(), UwROVModule::sendAck(), UwROVCtrModule::transmit(), UwSCFTrackerModule::updateMineRemove(), UwSCFTrackerModule::updateTrackPosition(), and UwCbrModule().
|
protected |
Flag to enable or disable the check for out of order packets.
Referenced by GetPER(), recv(), and UwCbrModule().
|
protected |
IP of the destination.
Referenced by initPkt(), and UwCbrModule().
|
protected |
Destination port.
Referenced by initPkt(), and UwCbrModule().
|
protected |
Number of FTT samples.
Referenced by GetFTT(), GetFTTstd(), GetTxTime(), resetStats(), and updateFTT().
|
protected |
|
protected |
Possibility to insert a log suffix
Referenced by command().
|
protected |
Time of last packet reception.
Referenced by recv().
|
protected |
Period between two consecutive packet transmissions.
Referenced by getTimeBeforeNextPkt(), UwROVCtrModule::transmit(), and UwCbrModule().
|
protected |
Total number of invalid packets received.
Referenced by incrPktInvalid().
|
protected |
Used for error checking after stats are reset. Set to pkts_lost+pkts_recv each time resetStats is called.
Referenced by command(), recv(), and resetStats().
|
protected |
Total number of lost packets, including packets received out of sequence.
Referenced by GetPER(), incrPktLost(), recv(), and resetStats().
|
protected |
Total number of packets received out of sequence.
Referenced by incrPktOoseq(), and resetStats().
|
protected |
Total number of received packets. Packet out of sequence are not counted here.
Referenced by command(), GetPER(), incrPktRecv(), recv(), and resetStats().
|
protected |
UWCBR packets payload size.
Referenced by initPkt(), and UwCbrModule().
|
protected |
1 if the traffic is generated according to a poissonian distribution, 0 otherwise.
Referenced by getTimeBeforeNextPkt(), and UwCbrModule().
|
protected |
Priority of the data packets.
Referenced by command(), initPkt(), UwROVModule::initPkt(), and UwROVModule::recv().
|
protected |
Forward Trip Time seen for last received packet.
Referenced by initPkt(), recv(), and resetStats().
|
protected |
Number of RTT samples.
Referenced by GetRTT(), GetRTTstd(), UwROVCtrModule::initPkt(), resetStats(), UwROVCtrModule::transmit(), and updateRTT().
|
protected |
Timer which schedules packet transmissions.
Referenced by UwROVCtrModule::recv(), UwROVCtrModule::reset_retx(), start(), stop(), transmit(), UwROVCtrModule::transmit(), and UwSCFTrackerModule::updateMineRemove().
|
protected |
Smoothed Forward Trip Time, calculated as srtt.
Referenced by resetStats().
|
protected |
Used to keep track of the packets already received.
Referenced by recv(), and UwCbrModule().
|
protected |
Smoothed Round Trip Time, calculated as for TCP.
Referenced by resetStats().
|
protected |
Smoothed throughput calculation.
Referenced by resetStats().
|
protected |
Sum of bytes received.
Referenced by GetTHR(), resetStats(), and updateThroughput().
|
protected |
Sum of the delays.
Referenced by GetTHR(), resetStats(), and updateThroughput().
|
protected |
Sum of FTT samples.
Referenced by GetFTT(), GetFTTstd(), resetStats(), and updateFTT().
|
protected |
Sum of (FTT^2).
Referenced by GetFTTstd(), resetStats(), and updateFTT().
|
protected |
Sum of RTT samples.
Referenced by GetRTT(), GetRTTstd(), UwROVCtrModule::initPkt(), resetStats(), UwROVCtrModule::transmit(), and updateRTT().
|
protected |
Sum of (RTT^2).
Referenced by GetRTTstd(), resetStats(), and updateRTT().
|
protected |
Sum of transmission times
Referenced by GetTxTime().
|
protected |
Referenced by command(), UwTrackerModule::printReceivedPacket(), and printReceivedPacket().
|
protected |
True if enable tracefile of received packets, default disabled.
Referenced by command(), UwTrackerModule::printReceivedPacket(), printReceivedPacket(), recv(), and UwCbrModule().
|
protected |
Referenced by command().
|
protected |
Traffic type of the packets.
Referenced by initPkt(), and UwCbrModule().
|
protected |
|
staticprotected |
Unique id of the packet generated.
Referenced by initPkt().