Re: kern/140597 implement Lost Retransmission Detection
The following reply was made to PR kern/140597; it has been noted by GNATS. From: "Scheffenegger, Richard" To: , "Lawrence Stewart" Cc: "Biswas, Anumita" Subject: Re: kern/140597 implement Lost Retransmission Detection Date: Wed, 21 Apr 2010 02:16:01 +0100 I found a small oversight (bug) in my earlier simple fix. If we had sent out multiple holes already, all of which get (partially) lost in the retransmission again, the original simple patch would only work for the very first hole. So, subsequent holes would not get re-sent, unless another ACK (SACK) would be received - however, seeing more SACKs becomes less likely the more loss is expirienced. This is a updated patch diff, which accounts for that case as well - but at the cost of O(n) time, instead of O(c). (Just check all holes from the hint backwards to the head, if any already fully resent hole needs to be reset, instead of only the first one - which might go away during subsequent processing in the original patch). diff -u netinet.orig/tcp_output.c netinet/tcp_output.c --- netinet.orig/tcp_output.c 2009-10-25 02:10:29.0 +0100 +++ netinet/tcp_output.c2010-04-02 16:55:14.0 +0200 @@ -953,6 +953,10 @@ } else { th->th_seq =3D htonl(p->rxmit); p->rxmit +=3D len; + /* lost again detection */ + if (SEQ_GEQ(p->rxmit, p->end)) { + p->rxmit =3D tp->snd_nxt; + } tp->sackhint.sack_bytes_rexmit +=3D len; } th->th_ack =3D htonl(tp->rcv_nxt); diff -u netinet.orig/tcp_sack.c netinet.simple_mod/tcp_sack.c --- netinet.orig/tcp_sack.c 2009-10-25 02:10:29.0 +0100 +++ netinet/tcp_sack.c 2010-04-21 00:48:23.0 +0200 @@ -508,7 +508,9 @@ if (SEQ_GEQ(sblkp->end, cur->end)) { /* Move end of hole backward. */ cur->end =3D sblkp->start; - cur->rxmit =3D SEQ_MIN(cur->rxmit, cur->end); + if (SEQ_GEQ(cur->rxmit, cur->end)) { + cur->rxmit =3D tp->snd_nxt; + } } else { /* * ACKs some data in middle of a hole; need @@ -524,8 +526,9 @@ - temp->start); } cur->end =3D sblkp->start; - cur->rxmit =3D = SEQ_MIN(cur->rxmit, - cur->end); + if (SEQ_GEQ(cur->rxmit, cur->end)) { + cur->rxmit =3D tp->snd_nxt; + } } } } @@ -540,6 +543,15 @@ else sblkp--; } + /* retransmission lost again - then restart */ + if ((temp =3D tp->sackhint.nexthole) !=3D NULL) { + do { + if (SEQ_GT(tp->snd_fack, temp->rxmit)) { + temp->rxmit =3D temp->start; + tp->sackhint.nexthole =3D temp; + } + } while ((temp =3D TAILQ_PREV(temp, sackhole_head, scblink)) !=3D NULL); + } } /* Richard Scheffenegger =20 ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
Re: kern/140597 implement Lost Retransmission Detection
The following reply was made to PR kern/140597; it has been noted by GNATS. From: "Scheffenegger, Richard" To: , "Lawrence Stewart" Cc: "Biswas, Anumita" Subject: Re: kern/140597 implement Lost Retransmission Detection Date: Fri, 2 Apr 2010 18:48:04 +0100 As discussed earlier, here is a simple fix. Caveat: Doesn't work at the end of a session or when cwnd is very small (<4 segments). Also, during heavy reordering, some spurious re-retransmissions might occur (but that would only affect very few re-retransmitted segments, as holes would still close with each additional received SACK, reducing the chance of spurious re-transmissions).=20 Benefit: during LAN burst drop events, TCP will not revert to retransmission timeouts in order to recover. In a LAN, the RTO is typically many orders of magnitude larger than the RTT. Not relying on RTO whenever possible can help keep throughput up.. Simple Patch: -- diff -u netinet.orig/tcp_output.c netinet/tcp_output.c --- netinet.orig/tcp_output.c 2009-10-25 02:10:29.0 +0100 +++ netinet/tcp_output.c2010-04-02 16:55:14.0 +0200 @@ -953,6 +953,10 @@ } else { th->th_seq =3D htonl(p->rxmit); p->rxmit +=3D len; + /* lost again detection */ + if (SEQ_GEQ(p->rxmit, p->end)) { + p->rxmit =3D tp->snd_nxt; + } tp->sackhint.sack_bytes_rexmit +=3D len; } th->th_ack =3D htonl(tp->rcv_nxt); diff -u netinet.orig/tcp_sack.c netinet/tcp_sack.c --- netinet.orig/tcp_sack.c 2009-10-25 02:10:29.0 +0100 +++ netinet/tcp_sack.c 2010-04-02 16:46:42.0 +0200 @@ -460,6 +460,13 @@ /* We must have at least one SACK hole in scoreboard. */ KASSERT(!TAILQ_EMPTY(&tp->snd_holes), ("SACK scoreboard must not be empty")); + /* lost again - then restart */ + if ((temp =3D TAILQ_FIRST(&tp->snd_holes)) !=3D NULL) { + if (SEQ_GT(tp->snd_fack, temp->rxmit)) { + temp->rxmit =3D temp->start; + tp->sackhint.nexthole =3D temp; + } + } cur =3D TAILQ_LAST(&tp->snd_holes, sackhole_head); /* Last SACK hole. */ /* * Since the incoming sack blocks are sorted, we can process them @@ -508,7 +515,9 @@ if (SEQ_GEQ(sblkp->end, cur->end)) { /* Move end of hole backward. */ cur->end =3D sblkp->start; - cur->rxmit =3D SEQ_MIN(cur->rxmit, cur->end); + if (SEQ_GEQ(cur->rxmit, cur->end)) { + cur->rxmit =3D tp->snd_nxt; + } } else { /* * ACKs some data in middle of a hole; need @@ -524,8 +533,9 @@ - temp->start); } cur->end =3D sblkp->start; - cur->rxmit =3D = SEQ_MIN(cur->rxmit, - cur->end); + if (SEQ_GEQ(cur->rxmit, cur->end)) { + cur->rxmit =3D tp->snd_nxt; + } } } } -- Richard Scheffenegger Field Escalation Engineer NetApp Global Support=20 NetApp +43 1 3676811 3146 Office (2143 3146 - internal) +43 676 654 3146 Mobile www.netapp.com http://www.netapp.com/> =20 Franz-Klein-Gasse 5 1190 Wien=20 ___ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"