Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2010 18:20:09 GMT
From:      "Scheffenegger, Richard" <rs@netapp.com>
To:        freebsd-net@FreeBSD.org
Subject:   Re: kern/140597 implement Lost Retransmission Detection
Message-ID:  <201004021820.o32IK9rH064225@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/140597; it has been noted by GNATS.

From: "Scheffenegger, Richard" <rs@netapp.com>
To: <bug-followup@freebsd.org>, "Lawrence Stewart" <lastewart@swin.edu.au>
Cc: "Biswas, Anumita" <Anumita.Biswas@netapp.com>
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.000000000 +0100
 +++ netinet/tcp_output.c        2010-04-02 16:55:14.000000000 +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.000000000 +0100
 +++ netinet/tcp_sack.c  2010-04-02 16:46:42.000000000 +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 <BLOCKED::http://www.netapp.com/>; =20
 Franz-Klein-Gasse 5
 1190 Wien=20
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004021820.o32IK9rH064225>