ip_conntrack_tcp_be_liberal vs. large downloads?
Hi,
I'm using a netfilter configuration that makes extensive use of connection tracking, on Linux 2.6.8 and Linux 2.6.11.4 (SUSE Linux 9.2 and 9.3 kernels). Part of this configuration is to allow ESTABLISHED+RELATED, drop INVALID and so on - pretty standard stuff as found on various sites (I can dump the configuration if really needed).
My observation is that larger downloads (30 MB to 150 MB) stall after some point, which may be sooner or later. I seldom get the download beyond 15 or 20 MB, at transfer rates between 80 and 300 kB/s. tcpdump shows that the server (HTTP) still sends a few packages which the kernel doesn't ACK any more.
Setting sysctl net.ipv4.netfilter.ip_conntrack_tcp_be_liberal=1 seems to work around this. Older documentation appears to hint this switches the treatment of out-of-window packets, ...be_liberal=0 treats all of them invalid, ...be_liberal=1 only RST packets.
According to the documentation I'd found, it seems ...be_liberal=0 is the way to go on firewalls, but if that breaks larger transfers, that's no good.
Incidentally, all upstream servers I've observed this trouble with have been running Microsoft IIS, namely download.fujitsu-siemens.com and intel's "Premier" service download servers -- which makes matters worse as IIS doesn't support ranges, so the download needs to start over, rather than resume up where it stalled.
So I'm wondering
A) what the bug is
- is the Windows TCP/IP stack on the server goofing up the sequencing or window scaling?
- is the Linux stack under the HTTP client losing track, for instance, as numbers wrap, a certain time has elapsed since setup of connection?
- can such happen as window sizes grow the longer transfers last
B) how to best debug this
I know tcpdump to some extent although I'm not really acquainted with the sequence number and window tracking code, so directions will be appreciated.
I can also test newer kernels if needed - only if there'd been some bug, I might have assumed that SUSE rolled a patch into one of their update kernels.
Thanks in advance.
Signature · 1 line
Matthias Andree
Hi Matthias,
Quoted 11 lines · Matthias Andree
I'm using a netfilter configuration that makes extensive use of connection tracking, on Linux 2.6.8 and Linux 2.6.11.4 (SUSE Linux 9.2 and 9.3 kernels). Part of this configuration is to allow ESTABLISHED+RELATED, drop INVALID and so on - pretty standard stuff as found on various sites (I can dump the configuration if really needed).
My observation is that larger downloads (30 MB to 150 MB) stall after some point, which may be sooner or later. I seldom get the download beyond 15 or 20 MB, at transfer rates between 80 and 300 kB/s. tcpdump shows that the server (HTTP) still sends a few packages which the kernel doesn't ACK any more.
[...]
Quoted 3 lines
I can also test newer kernels if needed - only if there'd been some bug, I might have assumed that SUSE rolled a patch into one of their update kernels.
Please try newer kernels - I smell SACKing lost packets and ACKing out of window segments here, which is fixed (i.e. supported) in recent kernels.
Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary
Quoted 6 lines · Jozsef Kadlecsik
Quoted 3 lines
I can also test newer kernels if needed - only if there'd been some bug, I might have assumed that SUSE rolled a patch into one of their update kernels.
Please try newer kernels - I smell SACKing lost packets and ACKing out of window segments here, which is fixed (i.e. supported) in recent kernels.
Maybe, although turning SACK of didn't help (of course if the other side is doing it, my turning it off cannot help :)
OK, so we'll put this on hold and I'll try 2.6.13-ckN (whichever is current) or 2.6.14.rc2 first and report back. No-one waste time now until I've confirmed the problem fixed.
Thank you.
Signature · 1 line
Matthias Andree
Quoted 11 lines · Matthias Andree
Quoted 6 lines · Jozsef Kadlecsik
Quoted 3 lines
I can also test newer kernels if needed - only if there'd been some bug, I might have assumed that SUSE rolled a patch into one of their update kernels.
Please try newer kernels - I smell SACKing lost packets and ACKing out of window segments here, which is fixed (i.e. supported) in recent kernels.
Maybe, although turning SACK of didn't help (of course if the other side is doing it, my turning it off cannot help :)
if you prevent SACKPERM tcp option to be set up in any direction (e.g. by replacing it with noop options), then you could reliably turn it off. Maybe it's time for an iptables TCPOPTSSTRIP target ;)
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie