Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

config.h

Go to the documentation of this file.
00001 /*
00002  * Active Router Transport Protocol (ARTP) implementation
00003  * Copyright (c) 2004, Tomas Rebok
00004  * All rights reserved.
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the "BSD License" which is
00008  * distributed with the software in the file LICENSE.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the BSD
00013  * License for more details.
00014  */
00015 
00023 #ifndef ARTP_CONFIG_H
00024 #define ARTP_CONFIG_H   1
00025 
00026 
00032 #define ARTP_VERSION 1
00033 
00034 
00042 #define LINK_IDLE(rto) (2 * (rto))
00043 
00044 
00050 #define INITIAL_WINDOW_SIZE(mss) (3 * (mss))
00051 
00052 
00063 #define CWND_ACK(mss, old_cwnd) ((mss) * (mss)) / (old_cwnd)
00064 
00065 
00070 #define CWND_DOWN_MULTIPLIER 0.7
00071 
00072 
00083 #define CWND_RETRANS(mss, old_cwnd) \
00084     (CWND_DOWN_MULTIPLIER * (old_cwnd) >= INITIAL_WINDOW_SIZE(mss)) \
00085         ? CWND_DOWN_MULTIPLIER * (old_cwnd) \
00086         : INITIAL_WINDOW_SIZE(mss);
00087 
00088 
00099 #define RTO_COMPUTE(srtt, init_resend_time) \
00100         (srtt > 0) ? (4 * (srtt)) : init_resend_time
00101 
00102 
00110 #define LATEST_ACKS_SEND(srtt) ((srtt) / 2.0)
00111 
00112 
00115 #define SRTT_ALPHA 0.875
00116 
00117 
00128 #define SRTT_COMPUTE(rtt, old_srtt) \
00129     ((old_srtt) == 0) ? rtt \
00130                       : (SRTT_ALPHA * (old_srtt)) + ((1 - SRTT_ALPHA) * (rtt));
00131 
00132 
00135 #define TS_DELTA_ALPHA 0.875
00136 
00137 
00154 #define TS_DELTA_COMPUTE(current_time, sent_time, srtt, old_ts_delta) \
00155     ((old_ts_delta) == 0) ? (current_time) - ((sent_time) + (srtt) / 2.0) \
00156                           : (TS_DELTA_ALPHA * (old_ts_delta)) + \
00157                           ((1 - TS_DELTA_ALPHA) * ((current_time) \
00158                                             - ((sent_time) + (srtt) / 2.0)))
00159     
00160 /* NOTE: Instead of smooth computing we can use absolute computing as showed 
00161  * here.
00162  *
00163  * #define TS_DELTA_COMPUTE(current_time, sent_time, srtt, old_ts_delta) \
00164     (current_time) - ((sent_time) + (srtt) / 2.0)
00165  */
00166     
00167 
00169 #define MAX_ARTP_PACKET_SIZE 2048  
00170 
00171 
00175 #define DUPPLE_SEQ_COUNT 100000
00176 
00177     
00179 #define MAX_CONFIG_LINE_LENGTH 1000
00180     
00181 
00182 #endif
00183 
00184 /* vim: set ts=4 : */

Generated on Fri May 21 07:50:24 2004 for Active Router Transport Protocol (ARTP) by doxygen1.2.15