From owner-freebsd-net@FreeBSD.ORG Sun Nov 21 19:27:50 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCAD916A4CE for ; Sun, 21 Nov 2004 19:27:50 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 158CF43D45 for ; Sun, 21 Nov 2004 19:27:50 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.205] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CVxNE-00058X-00; Sun, 21 Nov 2004 20:27:48 +0100 Received: from [217.83.13.26] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CVxND-0005le-00; Sun, 21 Nov 2004 20:27:48 +0100 From: Max Laier To: freebsd-net@freebsd.org Date: Sun, 21 Nov 2004 20:28:07 +0100 User-Agent: KMail/1.7.1 References: <419EBE2E.9080108@telia.com> In-Reply-To: <419EBE2E.9080108@telia.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1338536.3Tir5yaH6v"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200411212028.15015.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 cc: Pawel Worach Subject: Re: SACK (and PF) wierdness X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2004 19:27:51 -0000 --nextPart1338536.3Tir5yaH6v Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Pawel, On Saturday 20 November 2004 04:46, Pawel Worach wrote: > I bumped into a wierd problem with SACK. > > Basically my setup is. > 192.168.1.10 .-crossover 192.168.1.200 > ftp server fxp0<->wireless ap<-> ~~~ <->laptop wireless ath0 > > I run ftp from the laptop to the server. > This is what happens: > ftp> get zero > local: zero remote: zero > 200 EPRT command successful. > 150 Opening BINARY mode data connection for 'zero'. > 476 KB 299.53 KB/s > 426 Data connection: Operation not permitted. > 487424 bytes received in 00:01 (299.49 KB/s) > > I started to look at tcpdump while this was happening and quickly > noticed that the connection got dropped by PF when SACK kicked in. > > pf: BAD state: TCP 192.168.1.10:20 192.168.1.10:20 192.168.1.200:50640=20 > [lo=3D3604799807 high=3D3604800103 win=3D33304 modulator=3D0 wscale=3D1]= =20 > [lo=3D4089843176 high=3D4089909784 win=3D33304 modulator=3D0 wscale=3D1] > 4:4 FPA seq=3D3604799807 ack=3D4089843176 len=3D296 ackskew=3D0 pkts=3D24= 97:1693=20 > dir=3Dout ,fwd =20 > pf: State failure on: 1 | This is an "off by one" due to the FIN flag - I suppose. 3604799807 + 296 i= s=20 3604800103, but the +1 from the FIN flag brings that out of window and caus= es=20 PF to drop the packet. > Nov 20 04:27:40 darkstar kernel: pf: BAD state: TCP=20 > 192.168.1.10:20 192.168.1.10:20 192.168.1.200:58378 [lo=3D1373010668 > high=3D1373010980 win=3D33304 mod ulator=3D0 wscale=3D1] [lo=3D3742879382 > high=3D3742945990 win=3D33304 modulator=3D0 wscale=3D1 ] 4:4 A seq=3D1373= 010668 > ack=3D3742879382 len=3D1448 ackskew=3D0 pkts=3D1266:851 dir=3Dout,f wd > Nov 20 04:27:40 darkstar kernel: pf: State failure on: 1 = =20 > | Nov 20 04:27:40 darkstar kernel: pf: BAD state: TCP > 192.168.1.10:20 192.168.1.10:20 192.168.1.200:58378 [lo=3D1373010668 > high=3D1373010980 win=3D33304 mod ulator=3D0 wscale=3D1] [lo=3D3742879382 > high=3D3742945990 win=3D33304 modulator=3D0 wscale=3D1 ] 4:4 A seq=3D1373= 010668 > ack=3D3742879382 len=3D1448 ackskew=3D0 pkts=3D1266:851 dir=3Dout,f wd These two make no sense at all (at least to me). seq + len is over the wind= ow=20 by 1136 and I don't have the slightest clue why that would be the case. I a= m=20 also a bit surprised that the two (three) state failures are so close=20 together (04:27:35 and 04:27:40). Really strange. > If I disable sack on the ftp server everything works fine. > > I can reproduce this problem 100%, I have never managed to transfer more > than 3Mb via ftp when SACK is on, with it off I see no problems, 11Mbit > wireless at ~650Kb/s > > Attached are three tcpdumps of the ftp data channel after a 'get > /dev/zero'. (I picked out the smallest ones, dropped after about 400kb of > zeros) They didn't make it to the Mailinglist - I am afraid. Can you upload it=20 somewhere or try to resend it via private mail? I'd be very interested. > related pf.conf rules, on ftp server: > pass out log quick on fxp0 inet proto tcp from fxp0 to any flags S/SA keep > state queue (bulk, fast) > and on client: > pass in log quick inet proto tcp from any port 20 to port >=3D > 1024 flags S/SA keep state > > Any ideas? More info? Not yet. But the "off by one" that triggered the first failure should be=20 tracked. I am not a TCP-expert myself, so I hope somebody can jump in here.= =20 Thanks. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart1338536.3Tir5yaH6v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBoOxOXyyEoT62BG0RAsltAJ9ts0OyMi4FUKA2CEWJ3gCDKN6/DwCeOW1U TRjo5wJBYaJu5wmDPQyHbN4= =zs43 -----END PGP SIGNATURE----- --nextPart1338536.3Tir5yaH6v--