kern/140597 implement Lost Retransmission Detection
Scheffenegger, Richard
rs at netapp.com
Fri Apr 2 18:20:09 UTC 2010
The following reply was made to PR kern/140597; it has been noted by GNATS.
From: "Scheffenegger, Richard" <rs at netapp.com>
To: <bug-followup at freebsd.org>, "Lawrence Stewart" <lastewart at swin.edu.au>
Cc: "Biswas, Anumita" <Anumita.Biswas at 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
More information about the freebsd-net
mailing list