tcp/sack: Don't reduce retransmit threshold as recommended by RFC3517bis
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 9 May 2012 08:48:15 +0000 (16:48 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 9 May 2012 09:51:52 +0000 (17:51 +0800)
- Don't reduce byte threshold in IsLost()
- Don't retransmit if IsLost(tcpcb.snd_una) is true

They cause spurious retransmits.

Add sysctl node net.inet.tcp.rfc3517bis_rxt to enable the RFC3517bis
recommended retransmit threshold reduction.  It is disabled by default.

sys/netinet/tcp_input.c
sys/netinet/tcp_sack.c
sys/netinet/tcp_var.h

index 47aac5c..837ed1e 100644 (file)
@@ -201,6 +201,10 @@ int tcp_do_rfc3517bis = 0;
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3517bis, CTLFLAG_RW,
     &tcp_do_rfc3517bis, 0, "Enable RFC3517 update");
 
+int tcp_rfc3517bis_rxt = 0;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3517bis_rxt, CTLFLAG_RW,
+    &tcp_rfc3517bis_rxt, 0, "Enable RFC3517 retransmit update");
+
 SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
     "TCP Segment Reassembly Queue");
 
@@ -2029,7 +2033,8 @@ fastretransmit:
                                        tp->snd_cwnd += tp->t_maxseg *
                                            (tp->t_dupacks - tp->snd_limited);
                        } else if (tcp_do_rfc3517bis && TCP_DO_SACK(tp)) {
-                               if (tcp_sack_islost(&tp->scb, tp->snd_una))
+                               if (tcp_rfc3517bis_rxt &&
+                                   tcp_sack_islost(&tp->scb, tp->snd_una))
                                        goto fastretransmit;
                                if (tcp_do_limitedtransmit) {
                                        /* outstanding data */
index c545041..53339b3 100644 (file)
@@ -471,7 +471,15 @@ update_lostseq(struct scoreboard *scb, tcp_seq snd_una, u_int maxseg,
        int bytes_sacked = 0;
        int rxtthresh_bytes;
 
-       if (tcp_do_rfc3517bis)
+       /*
+        * XXX
+        * The RFC3517bis recommends to reduce the byte threshold.
+        * However, it will cause extra spurious retransmit if
+        * segments are reordered.  Before certain DupThresh adaptive
+        * algorithm is implemented, we don't reduce the byte
+        * threshold (tcp_rfc3517bis_rxt is off by default).
+        */
+       if (tcp_do_rfc3517bis && tcp_rfc3517bis_rxt)
                rxtthresh_bytes = (rxtthresh - 1) * maxseg;
        else
                rxtthresh_bytes = rxtthresh * maxseg;
index c982949..f15ea56 100644 (file)
@@ -88,6 +88,7 @@ extern int tcp_do_smartsack;
 extern int tcp_do_rescuesack;
 extern int tcp_aggressive_rescuesack;
 extern int tcp_do_rfc3517bis;
+extern int tcp_rfc3517bis_rxt;
 extern int tcp_aggregate_acks;
 extern int tcp_eifel_rtoinc;