Linux – Puzzling TCP performance over 3G / UMTS

3glinuxtcpudpvpn

I'm using 3G as my primary internet connection, and TCP over this thing is getting more puzzling every day. For example:

  1. Downloading from kernel.org is crazy fast:

    $wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.8.tar.bz2
    

    increases to ~500kB/s after a few secs !

  2. Some servers are incredibly slow, for instance www.graphic-pc.com:
    Same thing, downloading a big file with wget it starts at ~30kB/s for a split second, then collapses to 5-10k or even worse.

  3. Web browsing is decent but somewhat unreliable. Randomly, a page will take really long to load or even fail to load, but a reload can succeed almost immediately.

  4. Now, by chance i started playing with OpenVPN over UDP on top of the 3G connection, and OMG suddenly everything's extremely fast !
    Same www.graphic-pc.com now shoots at 100-200kB/s !


  • What's going on here ???
  • How come it is so much better with the VPN than without ??
  • And why does graphic-pc.com crawl when kernel.org flies ?
    Something to do with my tcp stack (or the server), or some buggy router in between ??

Notes:

Setup is laptop running Ubuntu Lucid and a Huawei 3G dongle (So direct pppd
connection).

I can reproduce this pretty much any time during the day and I'm not
moving, so it's clearly not cell environment or internet congestion.
(although kernel.org without VPN sometimes does worse in the evening,
60kB or so – but still 500kB with VPN !)

For 2) wireshark shows retransmitted packets, dup ack's, even out of order
sometimes.

I've tried playing with different /proc/sys/net/ipv4 parameters (tcp_rmem,
window_scaling, tcp_congestion…) doesn't seem to make a
difference.


Update:
Tried under windows 7 (no VPN) with some interesting results:

tcp settings  :  default          tcp_optimizer
kernel.org    :  10 kB/s          20 kB/s
graphic-pc.com:   8 kB/s          70 kB/s !

tcp_optimizer turned on ctcp among other things. Have to check what os graphic-pc.com is running, my bet is linux's tcp_westwood and ms ctcp don't mix well here…

Best Answer

Problem solved:
Tested with another file type (.zip) on graphic-pc.com. Guess what, at the same time it's fast for this file and slow for the other one (which btw is .mp3). So that's clearly the ISP doing deep packet inspection and throttling.

As for the strange results under windows, i tested again today and now it's exactly the same as linux. Also, the throttling is dynamic and changes during the day. I guess i was really unlucky and both rebooted and ran tcp_optimizer right when the throttling changed ...

Still curious about the real impact of 3G on TCP performance as there's a number of papers on the subject, but as far as this is concerned it's just traffic shaping crap, nothing wrong with 3G !

Related Question