56#define UWVBR_DROP_REASON_UNKNOWN_TYPE \
58#define UWVBR_DROP_REASON_OUT_OF_SEQUENCE \
60#define UWVBR_DROP_REASON_DUPLICATED_PACKET \
63#define HDR_UWVBR(P) (hdr_uwvbr::access(P))
138 virtual void expire(Event *e);
156 virtual void expire(Event *e);
185 virtual void recv(Packet *);
193 virtual void recv(Packet *p, Handler *h);
205 virtual int command(
int argc,
const char *
const *argv);
213 virtual double GetRTT()
const;
219 virtual double GetFTT()
const;
225 virtual double GetPER()
const;
231 virtual double GetTHR()
const;
319 virtual void initPkt(Packet *p);
338 virtual void start();
408 static inline const int
UwVbrModule class is used to manage UWVBR packets, and to collect statistics about them.
int debug_
Flag to enable or disable dirrefent levels of debug.
nsaddr_t dstAddr_
IP of the destination.
double sumftt2
Sum of (FTT^2).
double timer_switch_2_
Period in witch the node tramsmits with a packet every period2_ seconds.
virtual double getTimeBeforeNextPkt()
Returns the amount of time to wait before the next transmission.
double sumbytes
Sum of bytes received.
double rftt
Forward Trip Time seen for last received packet.
int pkts_invalid
Total number of invalid packets received.
double sumdt
Sum of the delays.
int rttsamples
Number of RTT samples.
virtual double GetPER() const
Returns the mean Packet Error Rate.
virtual double GetRTTstd() const
Returns the Round Trip Time Standard Deviation.
int fttsamples
Number of FTT samples.
virtual void start()
Start to send packets.
virtual double GetRTT() const
Returns the mean Round Trip Time.
int PoissonTraffic_
1 if the traffic is generated according to a poissonian distribution.
virtual void initPkt(Packet *p)
Initializes a data packet passed as argument with the default values.
virtual double GetFTTstd() const
Returns the mean Forward Trip Time Standard Deviation.
int pkts_last_reset
for error checking after stats are reset.
double srtt
Smoothed Round Trip Time, calculated as for TCP.
virtual int crLayCommand(ClMessage *m)
bool * sn_check
Used to keep track of the packets already received.
double sumrtt2
Sum of (RTT^2).
virtual double GetTHR() const
Returns the mean Throughput.
int drop_out_of_order_
Flag to enable or disable the check for out of order packets.
UwVbrPeriodSwitcher period_switcher_
Timer which schedules the switch between different sending periods.
double period2_
period between two consecutive packet transmissions (mode 2).
u_int16_t dstPort_
Destination port.
uint32_t esn
Expected serial number.
static int uidcnt_
Unique id of the packet generated.
static const int getVbrHeaderSize()
Returns the size in byte of a hdr_uwvbr packet header.
virtual void updateThroughput(const int &, const double &)
Updates the Throughput.
double sumftt
Sum of FTT samples.
int pkts_ooseq
Total number of packets received out of sequence.
virtual void stop()
Stop to send packets.
UwVbrSendTimer sendTmr_
Timer which schedules packet transmissions.
double timer_switch_1_
Period in witch the node tramsmits with a packet every period1_ seconds.
virtual void incrPktLost(const int &)
Increases the number of packets lost.
virtual void updateRTT(const double &)
Updates the Round Trip Time.
double sumrtt
Sum of RTT samples.
UwVbrModule()
Constructor of UwVbrModule class.
virtual void incrPktInvalid()
Increases by one the number of invalid packets.
virtual void incrPktOoseq()
Increases by one the number of out of sequence packets received.
int pkts_recv
Total number of received packets.
int period_identifier_
Flag used to identify in which one of the period the vbr module is.
int txsn
Sequence number of next new packet to be transmitted.
virtual void updateFTT(const double &)
Updates the Forward Trip Time.
double period1_
period between two consecutive packet transmissions (mode 1).
virtual void sendPkt()
Allocates, initialize and sends a packet.
virtual void incrPktRecv()
Increases by one the number of received packets.
virtual double GetFTT() const
Returns the mean Forward Trip Time.
double sftt
Smoothed Forward Trip Time, calculated as srtt.
double sthr
Smoothed throughput calculation.
int pkts_lost
Total number of lost packets, including packets received out of sequence.
int hrsn
Highest received sequence number.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
virtual void recv(Packet *)
Performs the reception of packets from upper and lower layers.
virtual void resetStats()
Resets all the statistics of the UWVBR module.
virtual void transmit()
Creates and transmits a packet and schedules a new transmission.
virtual ~UwVbrModule()
Destructor of UwVbrModule class.
double lrtime
Time of last packet reception.
virtual void switchPeriod()
Switches between the two different states in which UWVBR can operate.
UwVbrPeriodSwitcher class is used to handle the switch between different period used by a UwVbrModule...
UwVbrPeriodSwitcher(UwVbrModule *m)
virtual void expire(Event *e)
UwVbrSendTimer class is used to handle the scheduling period of UWVBR packets.
virtual void expire(Event *e)
UwVbrSendTimer(UwVbrModule *m)
hdr_uwvbr describes UWVBR packets.
static struct hdr_uwvbr * access(const Packet *p)
float & rftt()
Reference to the rftt_ variable.
bool & rftt_valid()
Reference to the rftt_valid_ variable.
float rftt_
Forward Trip Time of the packet.
u_int16_t & sn()
Reference to the sn_ variable.
static int offset_
Required by the PacketHeaderManager.
u_int16_t sn_
Serial number of the packet.
bool rftt_valid_
Flag used to set the validity of the fft field.
static int & offset()
Reference to the offset_ variable.
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.