7 ///////////////////////////////////////////////////////////////
9 ///////////////////////////////////////////////////////////////
10 class stdred
: public inxout
12 typedef inxout baseclass
;
16 enum {keyPIR
= 1, keyStatTimer
= 2};
18 stdred() : evtPIR(this, keyPIR
), evtStatTimer(this, keyStatTimer
)
21 alarmed_late
= FALSE
; // not alarmed
22 alarmed_early
= FALSE
;
32 int ninp
; // number of inputs
33 int max_flow
; // number of Flows
34 int maxbuff_packet
; // max buffer size (packets)
35 int buff_packet
; // buffer fill level (packets)
36 int maxbuff_byte
; // max buffer size (byte)
37 int buff_byte
; // buffer fill level (byte)
38 double slot_per_minpacket
; // the slots for a packet of minimum size
41 event evtPIR
; // Event to call the output with PCR
42 event evtStatTimer
; // Statistics Timer (for providing fairness)
43 uqueue q
; // the queue with the packets
45 int use_red
; // determines whether RED is used or not
56 int red_q_time
; // the time when the queue became empty
65 int sent_bytes
; // probably to short!
70 int StatTimerInterval
; // length of Timer-Interval in slots
71 double TimerIntervalSeconds
; // Timer interval in seconds
73 int alarmed_late
; // alarmed for late phase?
74 int alarmed_early
; // alarmed for elary phase?
76 double TimeSendNextPIR
; // when to send the next packet according to PIR
77 double SlotLength
; // Length of 1 Slot in seconds
78 double PIR
; // PIR of the connection (bit/s)
79 double actual_rate
; // the actual rate
82 inpstruct
*inp_buff
; // buffer for cells arriving in the early slot phase
83 inpstruct
*inp_ptr
; //current position in inp_buff
87 rec_typ
REC(data
*,int);
90 int export(exp_typ
*);
91 int command(char *,tok_typ
*);
93 inline double SlotToTime(int t
){return t
*SlotLength
;};
94 inline int TimeToSlot(double t
){return((int) (t
/SlotLength
));};
95 double uniform(){return my_rand() / 32767.0;}