Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNTFRCRecv.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 00025 #ifndef MN_TFRCRECV_H 00026 #define MN_TFRCRECV_H 00027 00028 #include <sys/types.h> 00029 #include "var_type.h" 00030 #include "MNTimeval.h" 00031 #include "MNRTPPacket.h" 00032 #include "lcrtp/MNLCRTPdefs.h" 00033 00034 #define HIST_SIZE 100000 00035 #define MAX_WEIGHTS 32 00036 00037 00038 class MNTFRCRecv 00039 { 00040 protected: 00041 int _ppl_cur; 00042 int _ppl_hist[HIST_SIZE]; 00043 int _ts_hist[HIST_SIZE]; /* in ms */ 00044 int _seq_hist[HIST_SIZE]; 00045 int _ppl[MAX_WEIGHTS + 1]; 00046 int _num_loss; 00047 int _weights; 00048 int _const_weights; 00049 int _data_per_report; 00050 u_int32 _round; 00051 u_int32 _mode; 00052 int32 _mseq_offs, _high_offs; 00053 int32 _ppl_start, _ppl_end; 00054 int64 _last_report; 00055 float _weight[MAX_WEIGHTS]; 00056 float _new_mult; /* deweighting factor */ 00057 double _rtt_ema; 00058 Timeval _start_time; 00059 Timeval _old_time; 00060 bool _first; 00061 MNMutex _timer_mutex; 00062 /* float mult[MAX_WEIGHTS + 1]; */ 00063 00064 00065 public: 00066 MNTFRCRecv( ); 00067 virtual ~MNTFRCRecv( ); 00068 00069 bool packet_received( tfrc_payload* packet, u_int16 seqnum, u_int32 ts, 00070 size_t length, LCfeedb_tfrc_t* reply ); 00071 private: 00072 void init(); 00073 void init_time( ); 00074 void set_weights(); 00075 void log_loss(int64 arrival); 00076 void fake_history(int ppl_est); 00077 double bitrate_eq(double l, double rtt, double t0); 00078 double lossfraction_eq(double bitrate, double rtt, double t0); 00079 double lossfraction( ); 00080 int update_history(u_int32 mseq, int64 arrival, double rtt, double tzero, double b_act); 00081 int64 get_time(); 00082 }; 00083 00084 #endif /* MN_TFRCRECV_H */

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8