Keep track of the number of samples through the srtt filter so that we
know better when to cache values in the route, rather than relying on a heuristic involving sequence numbers that broke when tcp_sendspace was increased to 16k.
This commit is contained in:
parent
a5da5e632f
commit
fc97827135
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* From: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94
|
||||
* $Id: tcp_input.c,v 1.24 1995/05/11 01:41:06 davidg Exp $
|
||||
* $Id: tcp_input.c,v 1.25 1995/05/30 08:09:55 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef TUBA_INCLUDE
|
||||
@ -1814,6 +1814,7 @@ tcp_xmit_timer(tp, rtt)
|
||||
register short delta;
|
||||
|
||||
tcpstat.tcps_rttupdated++;
|
||||
tp->t_rttupdated++;
|
||||
if (tp->t_srtt != 0) {
|
||||
/*
|
||||
* srtt is stored as fixed point with 3 bits after the
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* From: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94
|
||||
* $Id: tcp_input.c,v 1.24 1995/05/11 01:41:06 davidg Exp $
|
||||
* $Id: tcp_input.c,v 1.25 1995/05/30 08:09:55 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef TUBA_INCLUDE
|
||||
@ -1814,6 +1814,7 @@ tcp_xmit_timer(tp, rtt)
|
||||
register short delta;
|
||||
|
||||
tcpstat.tcps_rttupdated++;
|
||||
tp->t_rttupdated++;
|
||||
if (tp->t_srtt != 0) {
|
||||
/*
|
||||
* srtt is stored as fixed point with 3 bits after the
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: tcp_subr.c,v 1.11 1995/05/30 08:09:58 rgrimes Exp $
|
||||
* $Id: tcp_subr.c,v 1.12 1995/06/19 16:45:33 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -303,18 +303,17 @@ tcp_close(tp)
|
||||
register struct rtentry *rt;
|
||||
|
||||
/*
|
||||
* If we sent enough data to get some meaningful characteristics,
|
||||
* save them in the routing entry. 'Enough' is arbitrarily
|
||||
* defined as the sendpipesize (default 4K) * 16. This would
|
||||
* give us 16 rtt samples assuming we only get one sample per
|
||||
* window (the usual case on a long haul net). 16 samples is
|
||||
* enough for the srtt filter to converge to within 5% of the correct
|
||||
* value; fewer samples and we could save a very bogus rtt.
|
||||
* If we got enough samples through the srtt filter,
|
||||
* save the rtt and rttvar in the routing entry.
|
||||
* 'Enough' is arbitrarily defined as the 16 samples.
|
||||
* 16 samples is enough for the srtt filter to converge
|
||||
* to within 5% of the correct value; fewer samples and
|
||||
* we could save a very bogus rtt.
|
||||
*
|
||||
* Don't update the default route's characteristics and don't
|
||||
* update anything that the user "locked".
|
||||
*/
|
||||
if (SEQ_LT(tp->iss + so->so_snd.sb_hiwat * 16, tp->snd_max) &&
|
||||
if (tp->t_rttupdated >= 16 &&
|
||||
(rt = inp->inp_route.ro_rt) &&
|
||||
((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
|
||||
register u_long i = 0;
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93
|
||||
* $Id: tcp_subr.c,v 1.11 1995/05/30 08:09:58 rgrimes Exp $
|
||||
* $Id: tcp_subr.c,v 1.12 1995/06/19 16:45:33 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -303,18 +303,17 @@ tcp_close(tp)
|
||||
register struct rtentry *rt;
|
||||
|
||||
/*
|
||||
* If we sent enough data to get some meaningful characteristics,
|
||||
* save them in the routing entry. 'Enough' is arbitrarily
|
||||
* defined as the sendpipesize (default 4K) * 16. This would
|
||||
* give us 16 rtt samples assuming we only get one sample per
|
||||
* window (the usual case on a long haul net). 16 samples is
|
||||
* enough for the srtt filter to converge to within 5% of the correct
|
||||
* value; fewer samples and we could save a very bogus rtt.
|
||||
* If we got enough samples through the srtt filter,
|
||||
* save the rtt and rttvar in the routing entry.
|
||||
* 'Enough' is arbitrarily defined as the 16 samples.
|
||||
* 16 samples is enough for the srtt filter to converge
|
||||
* to within 5% of the correct value; fewer samples and
|
||||
* we could save a very bogus rtt.
|
||||
*
|
||||
* Don't update the default route's characteristics and don't
|
||||
* update anything that the user "locked".
|
||||
*/
|
||||
if (SEQ_LT(tp->iss + so->so_snd.sb_hiwat * 16, tp->snd_max) &&
|
||||
if (tp->t_rttupdated >= 16 &&
|
||||
(rt = inp->inp_route.ro_rt) &&
|
||||
((struct sockaddr_in *)rt_key(rt))->sin_addr.s_addr != INADDR_ANY) {
|
||||
register u_long i = 0;
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_var.h 8.3 (Berkeley) 4/10/94
|
||||
* $Id: tcp_var.h,v 1.11 1995/04/09 01:29:29 davidg Exp $
|
||||
* $Id: tcp_var.h,v 1.12 1995/06/19 16:45:33 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_TCP_VAR_H_
|
||||
@ -139,6 +139,8 @@ struct tcpcb {
|
||||
|
||||
/* TUBA stuff */
|
||||
caddr_t t_tuba_pcb; /* next level down pcb for TCP over z */
|
||||
/* More RTT stuff */
|
||||
u_long t_rttupdated; /* number of times rtt sampled */
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user