more retransmits (wait longer than routed!); close FIN_WAIT_2's
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 17 Sep 1985 14:23:02 +0000 (06:23 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 17 Sep 1985 14:23:02 +0000 (06:23 -0800)
if user has closed and is inactive; fix comments

SCCS-vsn: sys/netinet/tcp_timer.c 6.8
SCCS-vsn: sys/netinet/tcp_timer.h 6.4

usr/src/sys/netinet/tcp_timer.c
usr/src/sys/netinet/tcp_timer.h

index 524d67f..aa2e62a 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)tcp_timer.c 6.7 (Berkeley) %G%
+ *     @(#)tcp_timer.c 6.8 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -108,7 +108,7 @@ tcp_canceltimers(tp)
 }
 
 float  tcp_backoff[TCP_MAXRXTSHIFT] =
 }
 
 float  tcp_backoff[TCP_MAXRXTSHIFT] =
-    { 1.0, 1.2, 1.4, 1.7, 2.0, 3.0, 5.0, 8.0, 16.0, 32.0 };
+    { 1.0, 1.2, 1.4, 1.7, 2.0, 3.0, 5.0, 8.0, 16.0, 32.0, 32.0, 32.0 };
 int    tcpexprexmtbackoff = 0;
 /*
  * TCP timer processing.
 int    tcpexprexmtbackoff = 0;
 /*
  * TCP timer processing.
@@ -122,11 +122,17 @@ tcp_timers(tp, timer)
        switch (timer) {
 
        /*
        switch (timer) {
 
        /*
-        * 2 MSL timeout in shutdown went off.  Delete connection
-        * control block.
+        * 2 MSL timeout in shutdown went off.  If we're closed but
+        * still waiting for peer to close and connection has been idle
+        * too long, or if 2MSL time is up from TIME_WAIT, delete connection
+        * control block.  Otherwise, check again in a bit.
         */
        case TCPT_2MSL:
         */
        case TCPT_2MSL:
-               tp = tcp_close(tp);
+               if (tp->t_state != TCPS_TIME_WAIT &&
+                   tp->t_idle <= TCPTV_MAXIDLE)
+                       tp->t_timer[TCPT_2MSL] = TCPTV_KEEP;
+               else
+                       tp = tcp_close(tp);
                break;
 
        /*
                break;
 
        /*
@@ -144,7 +150,7 @@ tcp_timers(tp, timer)
                 * If losing, let the lower level know
                 * and try for a better route.
                 */
                 * If losing, let the lower level know
                 * and try for a better route.
                 */
-               if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 2)
+               if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 3)
                        in_rtchange(tp->t_inpcb);
                TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
                    (int)tp->t_srtt, TCPTV_MIN, TCPTV_MAX);
                        in_rtchange(tp->t_inpcb);
                TCPT_RANGESET(tp->t_timer[TCPT_REXMT],
                    (int)tp->t_srtt, TCPTV_MIN, TCPTV_MAX);
index fba83c1..baa5d30 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)tcp_timer.h 6.3 (Berkeley) %G%
+ *     @(#)tcp_timer.h 6.4 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
  * then the retransmit timer is cleared (if there are no more
  * outstanding segments) or reset to the base value (if there
  * are more ACKs expected).  Whenever the retransmit timer goes off,
  * then the retransmit timer is cleared (if there are no more
  * outstanding segments) or reset to the base value (if there
  * are more ACKs expected).  Whenever the retransmit timer goes off,
- * we retransmit all unacknowledged segments, and do an exponential
- * backoff on the retransmit timer.
+ * we retransmit one unacknowledged segment, and do a backoff
+ * on the retransmit timer.
  *
  * The TCPT_PERSIST timer is used to keep window size information
  * flowing even if the window goes shut.  If all previous transmissions
  * have been acknowledged (so that there are no retransmissions in progress),
  *
  * The TCPT_PERSIST timer is used to keep window size information
  * flowing even if the window goes shut.  If all previous transmissions
  * have been acknowledged (so that there are no retransmissions in progress),
- * and the window is shut, then we start the TCPT_PERSIST timer, and at
- * intervals send a single byte into the peers window to force him to update
- * our window information.  We do this at most as often as TCPT_PERSMIN
- * time intervals, but no more frequently than the current estimate of
- * round-trip packet time.  The TCPT_PERSIST timer is cleared whenever
- * we receive a window update from the peer.
+ * and the window is too small to bother sending anything, then we start
+ * the TCPT_PERSIST timer.  When it expires, if the window is nonzero,
+ * we go to transmit state.  Otherwise, at intervals send a single byte
+ * into the peer's window to force him to update our window information.
+ * We do this at most as often as TCPT_PERSMIN time intervals,
+ * but no more frequently than the current estimate of round-trip
+ * packet time.  The TCPT_PERSIST timer is cleared whenever we receive
+ * a window update from the peer.
  *
  * The TCPT_KEEP timer is used to keep connections alive.  If an
  * connection is idle (no segments received) for TCPTV_KEEP amount of time,
  *
  * The TCPT_KEEP timer is used to keep connections alive.  If an
  * connection is idle (no segments received) for TCPTV_KEEP amount of time,
@@ -53,7 +55,7 @@
 /*
  * Time constants.
  */
 /*
  * Time constants.
  */
-#define        TCPTV_MSL       ( 30*PR_SLOWHZ)         /* max seg lifetime */
+#define        TCPTV_MSL       ( 15*PR_SLOWHZ)         /* max seg lifetime */
 #define        TCPTV_SRTTBASE  0                       /* base roundtrip time;
                                                   if 0, no idea yet */
 #define        TCPTV_KEEP      ( 45*PR_SLOWHZ)         /* keep alive - 45 secs */
 #define        TCPTV_SRTTBASE  0                       /* base roundtrip time;
                                                   if 0, no idea yet */
 #define        TCPTV_KEEP      ( 45*PR_SLOWHZ)         /* keep alive - 45 secs */
@@ -67,7 +69,7 @@
 
 #define        TCP_LINGERTIME  120                     /* linger at most 2 minutes */
 
 
 #define        TCP_LINGERTIME  120                     /* linger at most 2 minutes */
 
-#define        TCP_MAXRXTSHIFT 10                      /* maximum retransmits */
+#define        TCP_MAXRXTSHIFT 12                      /* maximum retransmits */
 
 #ifdef TCPTIMERS
 char *tcptimers[] =
 
 #ifdef TCPTIMERS
 char *tcptimers[] =