Author: andre
Date: Fri Jul  5 14:58:24 2013
New Revision: 252789
URL: http://svnweb.freebsd.org/changeset/base/252789

Log:
  MFC r242266:
  
   Increase the initial CWND to 10 segments as defined in IETF TCPM
   draft-ietf-tcpm-initcwnd-05. It explains why the increased initial
   window improves the overall performance of many web services without
   risking congestion collapse.
  
   As long as it remains a draft it is placed under a sysctl marking it
   as experimental:
    net.inet.tcp.experimental.initcwnd10 = 1
   When it becomes an official RFC soon the sysctl will be changed to
   the RFC number and moved to net.inet.tcp.
  
   This implementation differs from the RFC draft in that it is a bit
   more conservative in the case of packet loss on SYN or SYN|ACK because
   we haven't reduced the default RTO to 1 second yet.  Also the restart
   window isn't yet increased as allowed.  Both will be adjusted with
   upcoming changes.
  
   Is is enabled by default.  In Linux it is enabled since kernel 3.0.

Modified:
  stable/9/sys/netinet/tcp_input.c
  stable/9/sys/netinet/tcp_var.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/tcp_input.c
==============================================================================
--- stable/9/sys/netinet/tcp_input.c    Fri Jul  5 14:50:06 2013        
(r252788)
+++ stable/9/sys/netinet/tcp_input.c    Fri Jul  5 14:58:24 2013        
(r252789)
@@ -158,6 +158,14 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
     &VNET_NAME(tcp_do_rfc3390), 0,
     "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)");
 
+SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0,
+    "Experimental TCP extensions");
+
+VNET_DEFINE(int, tcp_do_initcwnd10) = 1;
+SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW,
+    &VNET_NAME(tcp_do_initcwnd10), 0,
+    "Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)");
+
 VNET_DEFINE(int, tcp_do_rfc3465) = 1;
 SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW,
     &VNET_NAME(tcp_do_rfc3465), 0,
@@ -341,6 +349,7 @@ cc_conn_init(struct tcpcb *tp)
         *
         * RFC5681 Section 3.1 specifies the default conservative values.
         * RFC3390 specifies slightly more aggressive values.
+        * Draft-ietf-tcpm-initcwnd-05 increases it to ten segments.
         *
         * If a SYN or SYN/ACK was lost and retransmitted, we have to
         * reduce the initial CWND to one segment as congestion is likely
@@ -348,6 +357,9 @@ cc_conn_init(struct tcpcb *tp)
         */
        if (tp->snd_cwnd == 1)
                tp->snd_cwnd = tp->t_maxseg;            /* SYN(-ACK) lost */
+       else if (V_tcp_do_initcwnd10)
+               tp->snd_cwnd = min(10 * tp->t_maxseg,
+                   max(2 * tp->t_maxseg, 14600));
        else if (V_tcp_do_rfc3390)
                tp->snd_cwnd = min(4 * tp->t_maxseg,
                    max(2 * tp->t_maxseg, 4380));

Modified: stable/9/sys/netinet/tcp_var.h
==============================================================================
--- stable/9/sys/netinet/tcp_var.h      Fri Jul  5 14:50:06 2013        
(r252788)
+++ stable/9/sys/netinet/tcp_var.h      Fri Jul  5 14:58:24 2013        
(r252789)
@@ -622,6 +622,7 @@ VNET_DECLARE(int, tcp_mssdflt);     /* XXX *
 VNET_DECLARE(int, tcp_minmss);
 VNET_DECLARE(int, tcp_delack_enabled);
 VNET_DECLARE(int, tcp_do_rfc3390);
+VNET_DECLARE(int, tcp_do_initcwnd10);
 VNET_DECLARE(int, path_mtu_discovery);
 VNET_DECLARE(int, tcp_do_rfc3465);
 VNET_DECLARE(int, tcp_abc_l_var);
@@ -632,6 +633,7 @@ VNET_DECLARE(int, tcp_abc_l_var);
 #define        V_tcp_minmss            VNET(tcp_minmss)
 #define        V_tcp_delack_enabled    VNET(tcp_delack_enabled)
 #define        V_tcp_do_rfc3390        VNET(tcp_do_rfc3390)
+#define        V_tcp_do_initcwnd10     VNET(tcp_do_initcwnd10)
 #define        V_path_mtu_discovery    VNET(path_mtu_discovery)
 #define        V_tcp_do_rfc3465        VNET(tcp_do_rfc3465)
 #define        V_tcp_abc_l_var         VNET(tcp_abc_l_var)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to