FreeBSD 7 TCP syncache fix: request for testers

From: Mike Silbersack <silby_at_silby.com>
Date: Tue, 10 Jul 2007 00:20:49 -0500 (CDT)
I've found one of the causes of the network instability of FreeBSD 7; the 
tcp syncache fails to retransmit SYN-ACK packets.  This causes interesting 
problems when packet loss is experienced during connection setup.  The 
symptoms that I have witnessed are twofold:

1.  If the third part of the 3WHS is lost, the client will believe that 
the connection is in the ESTABLISHED state, while the server will still 
have the connection in the syncache.
2.  Subsequently, the above syncache entry will stay stuck in the syncache 
forever.  If you attempt to re-use that same 4-tuple, the syncache will 
ack the new SYN with the old sequence number.

Anyway, the attached patch simplifies the syncache structure a bit and 
makes it retransmit properly.  I'd appreciate testing from anyone who has 
experienced TCP problems with FreeBSD 7, as well as anyone who is pushing 
significant traffic through FreeBSD 7.

I'm not interested in FreeBSD 6 testers, since the FreeBSD 6 syncache has 
a different structure and is not affected by this bug.

FWIW, here's how to prove the existence of the bug.  Install nemesis from 
ports, then use it to send SYN packets at your FreeBSD 7 machine.  As of 
now, you should see only one SYN-ACK reply, and you should also notice 
that the sysctl net.inet.tcp.syncache.count goes up, but does not come 
back down.

Once you have applied the patch, you should see the behavior demonstrated 
below:

>From your client machine:  (nemesis will pick an IP to spoof, change that 
if you wish.)
nemesis tcp -y 80 -D 10.1.1.6

TCP Packet Injected

On your FreeBSD 7 machine:

patrocles# tcpdump -n port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on nve0, link-type EN10MB (Ethernet), capture size 96 bytes
23:49:02.075118 IP 133.120.85.92.48922 > 10.1.1.6.80: S 1519649939:1519649939(0) win 4096
23:49:02.075165 IP 10.1.1.6.80 > 133.120.85.92.48922: S 269601671:269601671(0) ack 1519649940 win 65535 <mss 1460>
23:49:05.164195 IP 10.1.1.6.80 > 133.120.85.92.48922: S 269601671:269601671(0) ack 1519649940 win 65535 <mss 1460>
23:49:11.264245 IP 10.1.1.6.80 > 133.120.85.92.48922: S 269601671:269601671(0) ack 1519649940 win 65535 <mss 1460>
23:49:23.364342 IP 10.1.1.6.80 > 133.120.85.92.48922: S 269601671:269601671(0) ack 1519649940 win 65535 <mss 1460>

Thanks,

Mike "Silby" Silbersack
Received on Tue Jul 10 2007 - 03:47:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:14 UTC