Using Slow Internet Connections Efficiently

Support knowledgebase (cg_slowinternet)
Applies to

SuSE Linux: Versions up to (including) 7.3

Symptom

You are connected to the Internet through modem, ISDN or a slow dedicated line (in this context, slow means less than 512 kbit/s downstream). You often use interactive services like irc, Unix talk or ssh/telnet to run a remote login. Unfortunately, the connection "toughens" becoming virtually unusable when you start to download voluminous data via ftp. The same thing occurs when you try to view web pages with your web browser.

The following can be observed e.g. if you test the round trip time (abbreviated RTT) with a "ping" to a fast computer in the Internet and start a download at the same time:


konstriktor:~>ping sdb.suse.de
PING sdb.suse.de (213.95.15.204): 56 data bytes
64 bytes from 213.95.15.204: icmp_seq=0 ttl=247 time=35.767 ms
64 bytes from 213.95.15.204: icmp_seq=1 ttl=247 time=39.488 ms
64 bytes from 213.95.15.204: icmp_seq=2 ttl=247 time=37.377 ms
[...]
64 bytes from 213.95.15.204: icmp_seq=6 ttl=247 time=612.773 ms
64 bytes from 213.95.15.204: icmp_seq=7 ttl=247 time=1188.041 ms
64 bytes from 213.95.15.204: icmp_seq=8 ttl=247 time=1568.059 ms
64 bytes from 213.95.15.204: icmp_seq=9 ttl=247 time=2148.153 ms
64 bytes from 213.95.15.204: icmp_seq=10 ttl=247 time=2138.407 ms

In the example above, only one voluminous download has been started on the computer. As you can see, the connection has an average round trip time (RTT) of approximately 35 ms. when the line is free.

However, as soon as the download begins, the round trip time (RTT) of a "ping" packet exceeds 2s. Interactive applications are barely operable through such an overloaded line.

Background

The TCP/IP protocol used by Linux to connect to the Internet allows the remote host "in advance" to send a certain volume of data without authentication. An authentication is usually required for all incoming data on a TCP/IP connection. However, the remote host is always allowed to send a free amount of data without authentication, which is also important to achieve a good transfer rate on broadband connections. This option is officially designated as TCP window size. The window's size is approximately 32 kbyte, the biggest size being 64 kbyte.

Unfortunately, the problem of a narrow band connection is that most packets stack in a buffer in the last router before the "thin line" just before your computer. A lot of FTP and Web servers have very wide band connections so that the data are not delayed in transit but only on the last line section just before your computer.

Idea

There should be a possibility to ask the remote host not to send so many data without confirmation. In this way, the buffer of the router before the last line section just before your computer would not become so overloaded and the round trip time of a ping would not exceed a certain value.

Solution

An option informs the remote host that only a small TCP window is available. Do not use this option if you have more than 1 Mbit/s downstream; otherwise the download performance might decrease, especially when downloading from the USA or other overseas countries.

It must be distinguished between two cases:

ISDN, modem, PPPoE (ADSL) connection with PPPD

The default route whose window size we want to modify will be set only after setting up the connection. That is why you have to edit your PPP configuration in order to set this option.

If the file /etc/ppp/ip-up.local is not on your system yet, generate it as root user with an editor of your choice and insert the following:

 #! /bin/sh
# the default gateway is contained in parameter $5 when this
# script is called up.
route del default
route add default gw $5 window 8000

Once edited, make the file executable with the command chmod 755 /etc/ppp/ip-up.local. By way of this command, the script will be automatically executed during the dial-up.

Please note that the modification above disables the default route for a short time. If you have modified /etc/ppp/ip-up in order to, for example, fetch e-mails automatically, you should postpone it after the execution of ip-up.local.

Please refer to the section Result of this article for an explanation of the numerical value 8000.

Direct ethernet connection (not PPPoE)

If you have an ethernet connection e.g. to an SDSL router, edit the file /etc/route.conf. The file will currently look similar to this in your system:


62.146.142.32    0.0.0.0         255.255.255.224  NONE
default          62.146.142.33   0.0.0.0          eth0

Append the "window option" to the default route as shown below:

62.146.142.32    0.0.0.0         255.255.255.224  NONE
default          62.146.142.33   0.0.0.0          eth0 window 8000

In order to activate this option, it is necessary to pass this option to the command route. Therefore, it is easier to relocate the respective commands with the rcroute restart command.

Result

Those remote hosts reachable via the default router are now allowed to send a maximum of ~8 kbyte data without authentication. On a 128 kbit/s connection, this corresponds to a maximum of 0.5 sec. round trip time. If you have a simple ISDN connection (64 kbit/s) or a modem connection, you can also try 4000 instead of 8000. Do not set a value below 2000; otherwise you would come dangerously close to the packet size (no point in this).

If you have a complicated local routing, use the "small window" for external slow connections only and not for local or fast connections.


See also:
o Internet Connection: Some Web Sites Cannot Be Viewed
o ADSL Gateway for Private Networks

Keywords: SDSL, INTERNET, NETWORK, ADSL, ISDN, MODEM, SLOW

Categories: Internet

SDB-cg_slowinternet, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 06. Mär 2002
SuSE Linux AG - Last generated: 11. Mär 2002 by ip (sdb_gen 1.40.0)