MULTIPLE TCP CONNECTIONS Presented by Josh Kaltman and Bob Otting
The Question If multiple TCP connections are opened in parallel, will the total throughput improve? > ?
Relevance Aggressiveness of TCP connections Would be unfair if opening more connections resulted in greater throughput TCP is a dominant transport protocol in the Internet Bandwidth restrictions on a single connection Download accelerators
Background “Fair share” in TCP congestion avoidance From the slides we have discussed TCP friendliness[1]: Competition with other TCP flows Competition with other non-TCP flows [1]: Chapter 16 Slides
Background Shorter RTTs obtain a larger share of bandwidth than those having larger RTTs[1] Combats aggressiveness with additive increase and multiplicative decrease[1] [1]: Chapter 16 Slides
Hypothesis 1. Increasing the number of TCP connections between two machines will not increase the total throughput. Assumptions: No limit on throughput per connection Sufficient memory to sustain the connections and their buffers 2. If the window size is set to an unreasonable value, the resulting negative impact on throughput will remain the same as the number of connections increases.
Requirements for Evaluation We need a way to accomplish each of the following: 1. Open multiple TCP connections in parallel 2. Adjust TCP window sizes 3. Measure the rate of speed for each connection 4. Ideally plot graphs for each of the experiments
Potential Tools Program our own diagnostic tool Use some other existing network diagnostic tool Use Wireshark to measure and graph connections Use a different visualization tool for graphs
Selected Tools iPerf Network performance testing tool Simultaneous TCP connections Can vary window sizes Basic throughput measurement Documentation:
Setup CSE Machine CSE Machine Download and compile iperf on the CSE network Start one machine as a client and the other as a server Run the experiment with varying number of connections, window sizes, and buffer sizes CSE Machine External Endpoint Download and compile iperf on laptop Address reservation Port forwarding Start CSE machine as client and laptop as server
Setup Shell scripting Learned some basic shell scripting and created a script that would test the CSE machines while logged out of SSH
Results CSE Machines: Gamma Beta Window Size: 20kb (default) Date: March 12, 2015
Results CSE Machines: Gamma Beta Window Size: 20kb (default) Date: March 24, 2015
Results CSE Machines: Gamma Beta Date: March 25, Kb5kb10kb20kb50kb100kb200kb 1 Conn Conn Conn Conn A test with each pair of settings was performed 4 times and the mean was taken. All results in Mbits/sec TCP Window Size # Connections
Results Machines: Gamma Laptop (home) Date: March 25, Kb5kb10kb20kb50kb100kb200kb 1 Conn Conn Conn A test with each pair of settings was performed 4 times and the mean was taken. All results in Mbits/sec Could not test more than 5 connections at once, presumably because of security restrictions somewhere between CSE machine and laptop # Connections TCP Window Size
The Question So if multiple TCP connections are opened in parallel, does the total throughput improve? > ? Apparently It Does
Analysis After examining the data, we surprisingly found our hypotheses to be experimentally incorrect. Why might this behavior occur? Some ideas: Limit on the rate an individual socket or connection can transmit TCP streams being split up as they travel through the Internet Don’t necessarily take up a combined “fair share” of bandwidth Stdlinux may be running on a virtual machine iPerf itself could be faulty (unlikely, but possible)
Analysis Per iPerf’s documentation, “If the total aggregate bandwidth is more than what an individual stream gets, something is wrong. Either the TCP window size is too small, or the OS's TCP implementation has bugs, or the network itself has deficiencies.“ We varied the TCP window size a lot, so we don’t believe that this is the issue. There is most likely something interesting happening with the network itself or the OS’s TCP implementation
Future Extensions Set up multiple clients and servers on different ports Try running tests on an isolated network If the unexpected observed behavior is correct, design applications using multiple connections to improve throughput
Concluding Remarks Based on TCP’s congestion control algorithm, we assumed that increasing the number of TCP connections would not improve throughput We used iPerf as a tool for network analysis Throughput was very different for single vs multiple connections Theoretically, we believe our hypotheses are correct Experimentally, we were proven wrong
Thank you. Questions?