net.inet.tcp.slowstart_flightsize in 8-STABLE

Maxim Dounin mdounin at mdounin.ru
Tue Jul 13 14:01:06 UTC 2010


Hello!

On Wed, May 12, 2010 at 04:47:02PM +0400, Igor Sysoev wrote:

> It seems that net.inet.tcp.slowstart_flightsize does not work in 8-STABLE.
> For a long time I used slowstart_flightsize=2 on FreeBSD 4, 6, and 7 hosts.
> However, FreeBSD-8 always starts with the single packet.
> I saw this on different versions of 8-STABLE since 8 Oct 2009 till
> 04 Apr 2010.

Finally I had some time to look into it (sorry for long delay).

1. Slow start isn't used on recent FreeBSD versions for initial snd_cwnd 
calculations as long as you have rfc3390 support switched on (default since
Jan 06 23:29:46 2004, at least in 7.*).  It effectively sets initial 
snd_cwnd to 3*MSS on common networks and shouldn't cause any problems.  
Slowstart_flightsize only affects connection restarts.

2. Due to bug in syncache code (patch below) all accepted connections has
their snd_cwnd reset to 1*MSS (since r171639, 7.0+ AFAIR).

3. Support for rfc3465 introduced in r187289 uncovered (2) as 
ACK to SYN/ACK no longer causes snd_cwnd increase by MSS (actually, this 
increase shouldn't happen as it's explicitly forbidden by rfc 3390, but 
it's another issue).  Snd_cwnd remains really small (1*MSS + 1) and this 
causes really bad interaction with delayed acks on other side.

As a workaround to delayed acks interaction problems you may disable 
rfc3465 by setting net.inet.tcp.rfc3465 to 0.  Correct fix would be to apply
the patch below.

To Andre Oppermann: could you please take a look at the patch and 
commit it if found appropriate?

# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1279028684 -14400
# Node ID 93699203f408fa8e22c971769bde9c26bd14d410
# Parent  e2cf8c51a6294a0d09d5628d96c6ab3ab626957e
Fix cwnd resetting problem introduced in r171639.

Sc_rxmits counts timer engagements, not actual retransmits, and value 1
corresponds to no retransmits.  Revert check to correct one as present
before r171639.

diff --git a/netinet/tcp_syncache.c b/netinet/tcp_syncache.c
--- a/netinet/tcp_syncache.c
+++ b/netinet/tcp_syncache.c
@@ -804,8 +804,10 @@ syncache_socket(struct syncache *sc, str
 
 	/*
 	 * If the SYN,ACK was retransmitted, reset cwnd to 1 segment.
+	 * Note that sc_rxmits counts timer engagements, not actual
+	 * retransmits.
 	 */
-	if (sc->sc_rxmits)
+	if (sc->sc_rxmits > 1)
 		tp->snd_cwnd = tp->t_maxseg;
 	tcp_timer_activate(tp, TT_KEEP, tcp_keepinit);
 

Maxim Dounin


More information about the freebsd-net mailing list