Linux – Limited HTTP traffic

ethernetlinuxnetworkingwireless-networking

I'm experiencing a weird limited connectivity scenario with my Linux network stack.
The problem is that whenever I try to download something, I can only get the first 5.5KB of the requested resource, both with my ethernet card (Realtek 8139), and through my wireless card (IPW2200).
For example:

  • wget google.it => I will get a full 'index.html' page (as it's 4.9KB)
  • wget google.it/intl/it_it/images/logo.gif => I will get the first 5.5KB of the image and wget will hang, undefinitely waiting for the remaining part of the image
  • capture of HTTP conversation to www.polito.it (6) (as you can see in this capture, no further requests are going out, even if the page is missing some elements)

Environment&tools:

  • I try seeing the pages through both Firefox and command-line Links, both from my local installation and from Live CDs
  • on Windows both network cards are working perfectly without any issue (I'm writing from the dual-booted Windows right now)
  • this problem is happening on every Linux distro I have tried (each with different kernels): ArchLinux, Live ArchLinux 2007.08, grml 2008, grml 2009.10

Here is my Linux configuration:

  • the kernel is detecting the card (module 8139too or ipw2200) and assign to it a good IRQ
  • the DHCP server (at 192.168.1.1) is correctly assigning the IP 192.168.1.2 to my network interface. Example of ethernet one:

    eth0 Link encap:Ethernet HWaddr 00:c0:9f:be:77:da
    inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::2c0:9fff:febe:77da/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:478 errors:0 dropped:0 overruns:0 frame:0
    TX packets:322 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:163064 (159.2 KiB) TX bytes:40610 (39.6 KiB)
    Interrupt:16 Base address:0xc000

  • the MTU is set to 1500, but even with smaller values the problem is still there (I tried values of 1492, 1454, 1000, 500)

  • the DNS resolution is working good
  • the pings to other hosts on the network/internet are ok:

    PING www.l.google.com (74.125.43.104) 56(84) bytes of data.
    64 bytes from bw-in-f104.1e100.net (74.125.43.104): icmp_seq=1 ttl=50 time=52.1 ms
    64 bytes from bw-in-f104.1e100.net (74.125.43.104): icmp_seq=2 ttl=50 time=50.9 ms

  • there is no timeout/full receive buffers/unhandled IRQs messages indicated by the kernel

I have no other ideas about why this is happening…
Apart fom this, this issue is reproducible and for any web-page, it stops loading after a give amount.

Best Answer

I found out the problem: my gateway is not properly handling the TCP Window Scaling. Therefore, I instructed my Linux kernel not to use this functionality and now the connection is working smoothly.

For your info, here is my patch into the network configuration. In /etc/sysctl.conf I added the following lines:

net.ipv4.tcp_window_scaling=0
net.ipv4.tcp_ecn=0

And this was the identification of my router: "Alice Gate 2 Plus Wi-Fi" with firmware version "AGIA_1.2.0"