57#define UWCBR_DROP_REASON_UNKNOWN_TYPE \
59#define UWCBR_DROP_REASON_OUT_OF_SEQUENCE \
61#define UWCBR_DROP_REASON_DUPLICATED_PACKET \
64#define HDR_UWCBR(p) (hdr_uwcbr::access(p))
160 virtual void expire(Event *e);
188 virtual void recv(Packet *);
196 virtual void recv(Packet *p, Handler *h);
208 virtual int command(
int argc,
const char *
const *argv);
217 virtual double GetRTT()
const;
224 virtual double GetFTT()
const;
236 virtual double GetPER()
const;
243 virtual double GetTHR()
const;
270 std::cout <<
"UWCBR packets IDs:" << std::endl;
271 std::cout <<
"PT_UWCBR: \t\t" <<
PT_UWCBR << std::endl;
341 virtual void initPkt(Packet *p);
377 virtual void start();
UwCbrModule class is used to manage UWCBR packets and to collect statistics about them.
double sumdt
Sum of the delays.
UwCbrModule()
Constructor of UwCbrModule class.
virtual void incrPktRecv()
Increases by one the number of received packets.
virtual int crLayCommand(ClMessage *m)
virtual void initPkt(Packet *p)
Initializes a data packet passed as argument with the default values.
static int getCbrHeaderSize()
Returns the size in byte of a hdr_uwcbr packet header.
std::string tracefilename
static int uidcnt_
Unique id of the packet generated.
virtual void sendPktLowPriority()
Allocates, initialize and sends a packet with the default priority flag set from tcl.
virtual double getTimeBeforeNextPkt()
Returns the amount of time to wait before the next transmission.
double rftt
Forward Trip Time seen for last received packet.
double sumbytes
Sum of bytes received.
int txsn
Sequence number of the next packet to be transmitted.
int pkts_lost
Total number of lost packets, including packets received out of sequence.
virtual double GetRTTstd() const
Returns the Round Trip Time Standard Deviation.
virtual void stop()
Stop to send packets.
virtual void incrPktInvalid()
Increases by one the number of invalid packets.
uint32_t esn
Expected serial number.
double sumftt2
Sum of (FTT^2).
double sthr
Smoothed throughput calculation.
virtual void incrPktLost(const int &)
Increases the number of packets lost.
uint16_t dstPort_
Destination port.
int pkts_ooseq
Total number of packets received out of sequence.
virtual double GetTHR() const
Returns the mean Throughput.
std::string log_suffix
Possibility to insert a log suffix.
int debug_
Flag to enable several levels of debug.
bool * sn_check
Used to keep track of the packets already received.
double sumftt
Sum of FTT samples.
double srtt
Smoothed Round Trip Time, calculated as for TCP.
uint traffic_type_
Traffic type of the packets.
virtual void printReceivedPacket(Packet *p)
Print to tracefile details about a received packet.
void printIdsPkts() const
Prints the IDs of the packet's headers defined by UWCBR.
char priority_
Priority of the data packets.
virtual double GetTxTime() const
Returns the mean transmission time.
int drop_out_of_order_
Flag to enable or disable the check for out of order packets.
double sftt
Smoothed Forward Trip Time, calculated as srtt.
virtual double GetFTTstd() const
Returns the mean Forward Trip Time Standard Deviation.
virtual void incrPktOoseq()
Increases by one the number of out of sequence packets received.
virtual void updateThroughput(const int &, const double &)
Updates the Throughput.
virtual void updateRTT(const double &)
Updates the Round Trip Time.
int tracefile_enabler_
True if enable tracefile of received packets, default disabled.
nsaddr_t dstAddr_
IP of the destination.
int pkts_recv
Total number of received packets.
UwSendTimer sendTmr_
Timer which schedules packet transmissions.
virtual void start()
Start to send packets.
double lrtime
Time of last packet reception.
virtual void sendPktHighPriority()
Allocates, initialize and sends a packet with the default priority flag set from tcl.
double sumrtt
Sum of RTT samples.
virtual double GetFTT() const
Returns the mean Forward Trip Time.
virtual void recv(Packet *)
Performs the reception of packets from upper and lower layers.
virtual double GetPER() const
Returns the mean Packet Error Rate.
virtual void transmit()
Creates and transmits a packet and schedules a new transmission.
int pktSize_
UWCBR packets payload size.
int hrsn
Highest received sequence number.
int pkts_invalid
Total number of invalid packets received.
double sumtxtimes
Sum of transmission times
double sumrtt2
Sum of (RTT^2).
virtual ~UwCbrModule()
Destructor of UwCbrModule class.
int fttsamples
Number of FTT samples.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
virtual double GetRTT() const
Returns the mean Round Trip Time.
virtual void updateFTT(const double &)
Updates the Forward Trip Time.
int pkts_last_reset
Used for error checking after stats are reset.
int cnt
Used for check if is the first time that tracefile<ip of sink> is opened.
virtual void resetStats()
Resets all the statistics of the UWCBR module.
double period_
Period between two consecutive packet transmissions.
virtual void sendPkt()
Allocates, initialize and sends a packet with the default priority flag set from tcl.
int PoissonTraffic_
1 if the traffic is generated according to a poissonian distribution, 0 otherwise.
int rttsamples
Number of RTT samples.
UwSendTimer class is used to handle the scheduling period of UWCBR packets.
UwSendTimer(UwCbrModule *m)
virtual void expire(Event *e)
hdr_uwcbr describes UWCBR packets.
float & rftt()
Reference to the rftt_ variable.
char priority_
Priority flag: 1 means high priority, 0 normal priority.
uint16_t traffic_type_
Traffic type: (video, audio, image, etc..) meaning left to the user.
static int & offset()
Reference to the offset_ variable.
char & priority()
Reference to the priority_ variable.
bool rftt_valid_
Flag used to set the validity of the fft field.
uint16_t & traffic_type()
Reference to the rftt_ variable.
bool & rftt_valid()
Reference to the rftt_valid_ variable.
float rftt_
Forward Trip Time of the packet.
uint16_t sn_
Serial number of the packet.
uint16_t & sn()
Reference to the sn_ variable.
static struct hdr_uwcbr * access(const Packet *p)
static int offset_
Required by the PacketHeaderManager.
Provides the UWIP packets header description. Definition of the class that define the network layer.
Provides the UWUDP packets header description and the definition of the class UWUDP.