Better selection of initial retransmit timeout when no cached
RTT information is available. Submitted by: kbracey@art.acorn.co.uk (Kevin Bracey) (slightly modified by me)
This commit is contained in:
parent
bd71bd2513
commit
51fb392203
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
|
||||
* $Id: tcp_subr.c,v 1.28 1996/03/27 18:23:16 wollman Exp $
|
||||
* $Id: tcp_subr.c,v 1.29 1996/06/05 16:57:37 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -266,15 +266,13 @@ tcp_newtcpcb(inp)
|
||||
tp->t_inpcb = inp;
|
||||
/*
|
||||
* Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
|
||||
* rtt estimate. Set rttvar so that srtt + 2 * rttvar gives
|
||||
* rtt estimate. Set rttvar so that srtt + 4 * rttvar gives
|
||||
* reasonable initial retransmit time.
|
||||
*/
|
||||
tp->t_srtt = TCPTV_SRTTBASE;
|
||||
tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << TCP_RTTVAR_SHIFT;
|
||||
tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
|
||||
tp->t_rttmin = TCPTV_MIN;
|
||||
TCPT_RANGESET(tp->t_rxtcur,
|
||||
((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
|
||||
TCPTV_MIN, TCPTV_REXMTMAX);
|
||||
tp->t_rxtcur = TCPTV_RTOBASE;
|
||||
tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
|
||||
tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
|
||||
inp->inp_ip.ip_ttl = ip_defttl;
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93
|
||||
* $Id: tcp_timer.h,v 1.7 1995/11/14 20:34:45 phk Exp $
|
||||
* $Id: tcp_timer.h,v 1.8 1996/01/30 22:58:29 mpp Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_TCP_TIMER_H_
|
||||
@ -90,6 +90,7 @@
|
||||
#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */
|
||||
#define TCPTV_SRTTBASE 0 /* base roundtrip time;
|
||||
if 0, no idea yet */
|
||||
#define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */
|
||||
#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */
|
||||
|
||||
#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
|
||||
* $Id: tcp_subr.c,v 1.28 1996/03/27 18:23:16 wollman Exp $
|
||||
* $Id: tcp_subr.c,v 1.29 1996/06/05 16:57:37 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -266,15 +266,13 @@ tcp_newtcpcb(inp)
|
||||
tp->t_inpcb = inp;
|
||||
/*
|
||||
* Init srtt to TCPTV_SRTTBASE (0), so we can tell that we have no
|
||||
* rtt estimate. Set rttvar so that srtt + 2 * rttvar gives
|
||||
* rtt estimate. Set rttvar so that srtt + 4 * rttvar gives
|
||||
* reasonable initial retransmit time.
|
||||
*/
|
||||
tp->t_srtt = TCPTV_SRTTBASE;
|
||||
tp->t_rttvar = tcp_rttdflt * PR_SLOWHZ << TCP_RTTVAR_SHIFT;
|
||||
tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
|
||||
tp->t_rttmin = TCPTV_MIN;
|
||||
TCPT_RANGESET(tp->t_rxtcur,
|
||||
((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
|
||||
TCPTV_MIN, TCPTV_REXMTMAX);
|
||||
tp->t_rxtcur = TCPTV_RTOBASE;
|
||||
tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
|
||||
tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
|
||||
inp->inp_ip.ip_ttl = ip_defttl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user