]> Pileus Git - ~andy/linux/commitdiff
tcp: Increase timeout for SYN segments
authorAlex Bergmann <alex@linlab.net>
Fri, 31 Aug 2012 02:48:31 +0000 (02:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Aug 2012 19:42:10 +0000 (15:42 -0400)
Commit 9ad7c049 ("tcp: RFC2988bis + taking RTT sample from 3WHS for
the passive open side") changed the initRTO from 3secs to 1sec in
accordance to RFC6298 (former RFC2988bis). This reduced the time till
the last SYN retransmission packet gets sent from 93secs to 31secs.

RFC1122 is stating that the retransmission should be done for at least 3
minutes, but this seems to be quite high.

  "However, the values of R1 and R2 may be different for SYN
  and data segments.  In particular, R2 for a SYN segment MUST
  be set large enough to provide retransmission of the segment
  for at least 3 minutes.  The application can close the
  connection (i.e., give up on the open attempt) sooner, of
  course."

This patch increases the value of TCP_SYN_RETRIES to the value of 6,
providing a retransmission window of 63secs.

The comments for SYN and SYNACK retries have also been updated to
describe the current settings. The same goes for the documentation file
"Documentation/networking/ip-sysctl.txt".

Signed-off-by: Alexander Bergmann <alex@linlab.net>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/ip-sysctl.txt
include/net/tcp.h

index ca447b35b8333106cdd19649d943d80cdb12cc1e..d64e53124b8c0cfd7314a589ba25982f568d6251 100644 (file)
@@ -439,7 +439,9 @@ tcp_stdurg - BOOLEAN
 tcp_synack_retries - INTEGER
        Number of times SYNACKs for a passive TCP connection attempt will
        be retransmitted. Should not be higher than 255. Default value
-       is 5, which corresponds to ~180seconds.
+       is 5, which corresponds to 31seconds till the last retransmission
+       with the current initial RTO of 1second. With this the final timeout
+       for a passive TCP connection will happen after 63seconds.
 
 tcp_syncookies - BOOLEAN
        Only valid when the kernel was compiled with CONFIG_SYNCOOKIES
@@ -478,7 +480,9 @@ tcp_fastopen - INTEGER
 tcp_syn_retries - INTEGER
        Number of times initial SYNs for an active TCP connection attempt
        will be retransmitted. Should not be higher than 255. Default value
-       is 5, which corresponds to ~180seconds.
+       is 6, which corresponds to 63seconds till the last restransmission
+       with the current initial RTO of 1second. With this the final timeout
+       for an active TCP connection attempt will happen after 127seconds.
 
 tcp_timestamps - BOOLEAN
        Enable timestamps as defined in RFC1323.
index 9a0021d16d919a46240d5f502207d95c1a22853c..0fca06f16463e2bdd7eb2ad150745d144e04100f 100644 (file)
@@ -98,11 +98,21 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
                                 * 15 is ~13-30min depending on RTO.
                                 */
 
-#define TCP_SYN_RETRIES         5      /* number of times to retry active opening a
-                                * connection: ~180sec is RFC minimum   */
+#define TCP_SYN_RETRIES         6      /* This is how many retries are done
+                                * when active opening a connection.
+                                * RFC1122 says the minimum retry MUST
+                                * be at least 180secs.  Nevertheless
+                                * this value is corresponding to
+                                * 63secs of retransmission with the
+                                * current initial RTO.
+                                */
 
-#define TCP_SYNACK_RETRIES 5   /* number of times to retry passive opening a
-                                * connection: ~180sec is RFC minimum   */
+#define TCP_SYNACK_RETRIES 5   /* This is how may retries are done
+                                * when passive opening a connection.
+                                * This is corresponding to 31secs of
+                                * retransmission with the current
+                                * initial RTO.
+                                */
 
 #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT
                                  * state, about 60 seconds     */