PDA

View Full Version : Unreliable TCP/IP


robkampen
2006-09-03, 03:19 PM CDT
Anyone ever have their TCP/IP sessions stop working part way through?
Symptoms:
download of email will stop after about 20Kb - only from earthlink
download of zap2it database up date stops after about 5Kb
certain web sites e.g. www.suntrust.com, www.cingular.com will not load
trying to get downloads via firefox e.g. plugins just hang....
looking at a tcpdump shows that the data just appears to stop coming - the last packet is acknowledged but no further packets arrive...
there are no errors apparent on the interface, ifconfig shows all normal
e.g.
$ sudo ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:13:8F:6C:6C:67
inet addr:192.168.231.231 Bcast:192.168.231.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:263032 errors:0 dropped:0 overruns:0 frame:0
TX packets:245427 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:100225583 (95.5 MiB) TX bytes:24190587 (23.0 MiB)
Interrupt:217 Base address:0x6000

ethtool confirms the link is operating at 100Mb/sec full duplex
e.g.
$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes

funny thing is, other machines on my home LAN are working fine, so therefore router is not the problem.
No firewall, SE Linux disabled.
Anyone have some words of wisdom?

jcliburn
2006-09-03, 06:44 PM CDT
This smacks of a TCP window scaling issue. Execute this command, then retry your stalled connections.

sysctl -w net.ipv4.tcp_window_scaling = 0

robkampen
2006-09-04, 08:41 AM CDT
You're my hero!!!
Totally fixed the problem.
I've been around the PC and software industry most of my life and never come across this before - live and learn I guess.
Now my question is how did it get like this?
How do I prevent this in the future?
Guess I'll start investigating this parameter and try to learn some more about it.
THANKS for your help - you will not believe how much time and effort I've wasted on this.

jcliburn
2006-09-04, 08:52 AM CDT
TCP window scaling was changed in the 2.6.17 kernel to comply more fully with RFC 1323.

The problem isn't with your machine; it's with the middleboxes and servers at the far end -- they can't handle it. You should report it to them so they can fix their systems.

http://kerneltrap.org/node/6723 has details.

teixint
2006-09-06, 07:51 PM CDT
Ummmh! I think emotion+cache tricked me... I answer you before going beyond the homepage...

After executing your command (without spaces before and after = ) I got this:
net.ipv4.tcp_window_scaling = 0

but the problem continues after rebooting network... and system...

In fact, in the meanwhile I was tring the inverse process of my last post: I took the ip gived dinamically under fedora, and I set it to windows statically. What happened? I could browse all the web but not this particular site (and yes, I went beyond the homepage... it's a dinamic site...).

Have suggestions? Maybe it was not the same problem that for robkampen. I'm going to have a look around...

RedFedora
2007-11-29, 07:14 AM CST
I think if you put that command in your rc.local file, it'll fix the problem across boot-ups.

djberriman
2007-11-29, 11:00 AM CST
Putting net.ipv4.tcp_window_scaling=0 into /etc/sysctl.conf and rebooting worked for me

djberriman
2007-11-29, 11:00 AM CST
PS. Windows Vista users will also experience this problem as it has tcp windows scaling turned on by default too.

robkampen
2007-11-29, 01:08 PM CST
Just as an update, I've found that an update to the firmware in my Linksys RV016 router has fixed the problem. I've since commented out the directive in my sysctl.conf in the hopes of benefiting from the ability to dynamically scale the TCP packet size. I'm sure there will still be some old routers that don't deal with it but the majority of the problem is likely to be at the edges of the network in the small and cheap home routers, so keep an eye on the vendors firmware updates.