Because of a recent change in TCP window scale settings in Linux 2.6.17 kernel and higher, you may have had some problems connecting to certain Web sites. In this tip, I'll show you a workaround for the time-out problem, but first, let me give you the background on this issue.

A typical TCP packet has a window field that allows for a maximum window size of 64 KB. While this was sufficient when the Internet was young and most systems didn't have the power to handle anything greater, it's quite small for today's bandwidth-hungry applications.

As a result, a solution called window scaling was codified back in 1992; this provided an extra TCP option that contains an eight-bit scale factor. The value of this field indicates how much larger the window size should be by shifting the value of the window sizes by a certain number of bits. For instance, if the scale factor is set to 5, the window size would be shifted by 5 bits or multiplied by 32.

The problem is that in 2.6.16 and earlier, the default scale factor was 0, so there was no increase in TCP window sizes. In the 2.6.17 kernel, this was changed to a value of 7. In an ideal world, this wouldn't be a problem. In practice, however, some "broken" routers are rewriting the window scale TCP option -- setting the scale factor to 0 but leaving the actual enabling option in place.

Essentially, all of this means that there are some Web sites that cannot be connected to from a system using kernel 2.6.17 and higher. The kernel developer's stance is that those routers are broken and need to be replaced. In the real world, these routers may continue to operate for years before being fixed or replaced.

One solution is to reset the Linux kernel's window scaling option. While this doesn't fix broken routers, it will allow your system to connect to a remote site if you find you are experiencing the window scaling problem. If you're unsure whether this is the problem you are having, you can test it by executing:

echo 0 > /proc/sys/net/ipv4/tcp_default_win_scale

To make the setting permanent, edit /etc/sysctl.conf and add:

net.ipv4.tcp_default_win_scale = 0

This will disable window scaling completely, which will allow you to reach some sites you couldn't before. Right or wrong, the kernel developers refuse to revert the change, so options are either to disable window scaling on your own and go back to pre-2.6.17 defaults, or contact those sites that can't be reached and try to convince them to find and replace the broken routers.

Open Sourcery This was published in Open Sourcery, check every Monday for more stories

Related links

Comments

1

Mike Freeman - 03/07/07

I'm using Debian x86 Linux and am having this web page timeout issue. I've tried to echo (and subsequently find) the file you've suggested (/proc/sys/net/ipv4/tcp_default_win_scale), but it doesn't seem to exist on my system. In fact, in the /proc/sys/ directory, /net/ doesn't exist. The only place I can find an /ipv4/ directory is in my kernal folder, and the file isn't there, either. Any help would be appreciated, as many necessary web sites for my work are not accessible. Thanks!

» Report offensive content

2

Brandon Singer - 08/05/08

Wonderful. Thanks. On my computer, the option is called tcp_window_scaling instead.

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

2

Brandon Singer - 05/08/08

Wonderful. Thanks. On my computer, the option is called tcp_window_scaling instead. ... more

1

Mike Freeman - 07/03/07

I'm using Debian x86 Linux and am having this web page timeout issue. I've tried to echo (and subsequently find) the ... more

Log in


Sign up | Forgot your password?

  • Staff Shadow chasing in browsers

    The punching and counterpunching continued in the ongoing web browser development bout. Each time one browser closes a feature gap, a new feature appears in one of the others -- how we ever put up with the years of browser stagnation, I'll never know. Read more »

    -- posted by Staff

  • Chris Duckett Safari gets Gears

    Since its release in May last year, Gears has supported only Internet Explorer and Firefox browsers. With the addition of Safari into the Gears fold, it closes the loop of major browsers to support Gears Read more »

    -- posted by Chris Duckett

  • Renai LeMay MyPerfect.com.au has potential

    Victorian Web start-up My Perfect has a strong story and rationale for why it will succeed. But it has to overcome some challenges and design flaws first. Read more »

    -- posted by Renai LeMay

What's on?