Networking

How Does Latency Effect Throughput?

Why a single TCP stream can't beat its window size divided by RTT. The math worked out from a 69ms ping, then checked against a tcpspray test.

Tony Mattke · 2009.05.07 · 2 min read

One of the questions I get asked several times a week by my clients is as such. While most people never associate latency with the amount of data they can send across a single TCP stream, engineers need to understand this concept.

Luckily, someone has done most of the leg work for us. Many years ago, a college forwarded me a thesis paper written by Jesper Dangaard Brouer from Copenhagen University in Denmark. While this paper mainly focuses on issues concerning ADSL, he does analyze our exact question on page 21. (28 on the pdf)

Throughput = Window Size / RTT

This very simple formula is the key to your single stream transmission rates. Your throughput on a single stream TCP connection is limited to the WindowSize divided by your RTT or latency. So lets try this out…

bash
ping 6.6.7.4
PING 6.6.7.4 (6.6.7.4) 56(84) bytes of data.
64 bytes from 6.6.7.4: icmp_seq=1 ttl=51 time=69.0 ms
64 bytes from 6.6.7.4: icmp_seq=2 ttl=51 time=69.6 ms
64 bytes from 6.6.7.4: icmp_seq=3 ttl=51 time=67.1 ms
64 bytes from 6.6.7.4: icmp_seq=4 ttl=51 time=69.1 ms
64 bytes from 6.6.7.4: icmp_seq=5 ttl=51 time=69.2 ms
--- 6.6.7.4 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 67.113/<b>68.848</b>/69.687/0.954 ms

That shows our connections average RTT is 69ms. And you should by now know that your TCP Window size for Ethernet is 65,535 bytes. When we plug this data into our formula, it shows..

65535 / 69 = 949.78 kBytes/s

Or about 7.4mbit per second. Lets go ahead and see what kind of data we can come up with by running our own test.

bash
tcpspray -n 2000 6.6.7.4
Transmitted 8048000 bytes in 8.400634 seconds (902.094 kbytes/s. <b>7216.748</b> kbits/s)

Thats pretty close, 7.2 mbit per second. Now, these results wont always come out as perfect, but it will give you a good idea of what to expect. Just remember, QOS will affect your results, so please disable it while testing. If you have any questions, please feel free to leave a comment. Thanks you!

note: ip address changed to protect public networks

Related Posts

Networking · 2 min read

Testing TCP Connectivity on Cisco Devices

2009.08.23

Ever thought you might be having some Layer 4 connectivity issues? Pings as you should know are ICMP transmissions and ICMP is a Layer 3 protocol (commonly used to send error messages).

Networking · 2 min read

More BGP Tricks

2010.05.16

At times, the ‘rules of BGP’ don’t fit the needs of our productions networks. When we get into today’s production networks how often do book configurations apply? I’ll tell you one thing.

Networking · 3 min read

Policy Based Routing

2010.04.05

Policy based routing is the process of altering a packets path based on criteria other than the destination address, commonly referred to as ‘policy routing’.

Comments

6 archived comments from Disqus 2010–2023
shane
Do you mean 7.4 kbit per second?… 949.78 kBytes = 949.78 * 8 -> kbits
Tony
No, my statement was correct. The formula outputs the maximum theoretical throughput in bytes.
Farhan Fiaz Alvi
949.78 kBytes * 8 = ~7598 kbits = 7.6 mbits… you do get kbits in your calculation but 7 thousands of them…
matt

Your math is in error. Rounding 949 KBytes to 1000 KBytes gives the following: 1000 KB * 8 bits/Byte = 1000 * 8 Kbits = 8000 Kb

1000 K = 1 M so that 8000 Kbits = 8 Mbits Thus the authors statement 7.4 (or above 8) Mb/s

Nick
man 1024 K = 1M…. so you might want to check your math!
Hilko

65535 bytes = 524 280 bits 69 ms = 0.069 seconds

524 280 bits / 0.069 seconds = 7598260.869565217 bps = 7.24626624 Mbps