Subject: Re: TCP/IP tuning
To: Thomas Miller <tom@insolvencyhelp.org>
From: Johnny Billquist <bqt@update.uu.se>
List: current-users
Date: 03/01/2004 15:49:45
On Mon, 1 Mar 2004, Thomas Miller wrote:

> Hello,
>
> A few quick tests here suggested that doubling the
> receive space might increase throughput by approximately
> three per cent.

Interesting. What ping times do you have?
If increasing receive space improves the data rate, you probably get
buffer full situations, and that in turn most often point to high latency
networks.

Ie. what happens is that sender could send more data, but the flow control
throttles it, since your buffer is full. TCP use a sliding window protocol
to allow a certain number of bytes to be sent without having received an
ACK for the previous ones. The size of this window is what you are
modifying.
In order for it to thottle, the ACKs must be taking some time to get back
to you, which points at high latency.

5 MB is (as others have said) slow, so unless you have high latency, you
should always be able to run at full speed.

It would also be interesting to know exactly how your ISP is limiting you
to 5 MB/s. TCP have a retry algorithm that also very efficiently stops
transmission if several packets in a row is lost. Good "throttling"
routers therefor discards random packets to limit the bandwidth. Stupid
routers throws a whole bunch at once, which kills TCP performance.

> David's interesting suggestion that I try multiple
> concurrent connections resulted in values that I did not
> record but recall as something like 240 KB/sec and 150
> KB/sec -- an overall increase, but the second connection
> was much slower than the first.  Also, the aggregate
> transfer rate of 390 KB/sec remained less than two thirds
> of the 610 KB/sec capability of my "up to 5 Mbps"
> connection.  Notably, 390 KB/sec is 3.19 Mbps, just a
> bit over the "up to 3 Mbps" speed of my ISP's regular,
> non-premium connection.

ftp (and any other protocol using tcp) will have an overhead of something
like 40 bytes/packet. In addition to this, ethernet adds an overhead of 18
bytes/packet, and finally ethernet have a small quiet period between
sending packets. It's a good guesstimate to count 10 bits/byte.
So you're actually getting about 3.9 MB/s.

But it don't really make sense that your two sessions should get so
different rates. Maybe someone else have some good explanation for that.

> I would be grateful to hear from anybody who has additional
> comments or suggestions.  Thanks again to everyone who
> replied.

Well, that's a few more thoughts for you.

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol