tcp performance

Brian Candler B.Candler at pobox.com
Tue Dec 27 05:27:05 PST 2005


On Tue, Dec 27, 2005 at 07:56:51PM +0900, Zongsheng Zhang wrote:
> Hi, *,
> 
> For testing throughput of a TCP connection, the following topology is used:
>      Host-A ---GB Ethernet--- Dummynet ---GB Ethernet--- Host-B
> 
> Host-A/B use FreeBSD v6.0. Sysctl parameters of Host-A/B are:
> kern.ipc.nmbclusters=32768
> net.inet.tcp.inflight.enable=0
> net.inet.tcp.sendspace=2097152  # 2M
> net.inet.tcp.recvspace=2097152  # 2M
> 
> When RTT in Dummynet is set to 0ms, the throughput (A--B) is about
> 900Mbps. The buffer size is enough to fill a link bandwidth=800Mbps, and
> RTT=20ms. However, if RTT is set to 20ms, the throughput is only about
> 500Mbps.

I don't understand what you mean by "the throughput is about 900Mbps... the
buffer size is enough to fill a link bandwidth=800Mbps". What buffer size?
What have you actually measured, and how have you measured it?

By "RTT is set to 20ms" do you mean "dummynet delay is set to 20ms in one
direction only", or "dummynet delay is set to 10ms both ways", or something
else?

Assuming you're not using jumbo frames, a single datagram contains 1460
bytes of payload, 40 bytes of IP header, 16 bytes of ethernet header and
FCS, and a little bit of framing (I'm not sure exactly how much)

So 2097152 bytes will take 1436.4 frames, giving a total of at least
    (2097152/1460) * 1516 * 8 = 17,420,725 bits

The actual time to transmit this much data at 1,000,000,000 bits per second
is 17.4 ms. If your dummynet delay is more than this, then you will not be
able to keep the send pipeline full.

Put another way: your delay.bandwidth product is 

    0.02 secs * 1000000000 bits/sec * 1/8 bytes per bit * (1460/1516)
    = 2,407,651 bytes

so I would expect your sendspace needs to be at least that to keep the
pipeline full.

This is a very simplistic analysis, someone else please feel free to
substitute a more thorough one :-)

Regards,

Brian.


More information about the freebsd-net mailing list