AAD | Advisor | Autobuf v2.0 | Multicast Beacon | BIMA | Iperf | NextINet | Tools | Web100 | All Projects
|
About: - DAST - NLANR - FAQ - Staff - Contact DAST
End User Tools and Projects
End User Support
Documents
WebCT Courses
Events
News
Reports & Statistics
|
Automatic TCP Window Tuning and ApplicationsWhat is "Automatic TCP Window Tuning"?The TCP window size is by far the most important parameter to adjust for achieving maximum bandwidth across high-performance networks. Properly setting the TCP window size can often more than double the achieved bandwidth.With TCP, each segment header contains a field called "advertised window" specifying how many additional bytes of data the receiver is prepared to accept. We think of "advertised window" as specifying the receiver's current available buffer size. An important fact about TCP is that the sender is not allowed to send more bytes than the advertised window. This is TCP's flow control mechanism. To maximize the performance, the sender should set it's send buffer size and the receiver should set its receive buffer size to no less than the capacity of the TCP pipe. Usually this number is the product of bandwidth and round-trip-time (bandwidth-delay product). The default values of socket buffer size differ widely between implementations. Older Berkeley-derived implementations would default the TCP send and receive buffers to 4KB, but newer systems use larger values (up to 64KB). We try to set the TCP socket buffers to an optimal value by detecting the bandwidth-delay product at connection setup time. Thus, even if the default socket buffer size is small, we can still achieve a high data transfer rate. For those connections with a low bandwidth-delay product, the socket buffer size will remain small in order to conserve memory usage.
The approachInspired by various related works [1, 2, and 3], we implemented a basic Automatic Buffer Tuning scheme using Internet Control Message Protocol (ICMP). With our specific goal that the code can be easily embedded in a TCP application, we specified the following requirements:
Since we set TCP buffer size to the same as the available bandwidth-delay product, the problem is essentially to acquire available bandwidth and RTT with minimum cost of time and traffic and at least a coarse-grained accuracy. We follow the following steps to achieve this:
We estimated the accuracy of this implementation using Iperf 1.1.1 TCP tuning (manually). The result shows that in almost all cases the TCP buffer sizes from above calculations fall within 20 percent of the optimal TCP socket buffer sizes achieved by manual tuning with Iperf.
Demonstration of Automatic TCP Window Tuning with NcFTPTo demonstrate the potential performance enhancement that automatic TCP window tuning can offer, we incorporated a simple implementation into the NcFTP client (http://www.ncftp.com/download). We transferred a "big" file (20MB) from North Carolina to NCSA at Champaign, IL. The following logs show the difference having auto window tuning enabled or disabled in the NcFTP client. The yellow lines in the following graphs denote transfer rate of our modified NcFTP client, while the white lines denote transfer rate of original NcFTP client. Each horizontal block is roughly 2 seconds; each vertical block represents roughly 80 Kilobytes-per-second transfer rate. (Click on images for a larger view.)
From the above graph, it's interesting to note:
Beyond FTPTwo important C source files for measurement of optimal socket buffer size - 'bwdelay.h' and 'bwdelay.c' - can be plugged into applications running over TCP. The application programmer can call function bwdelay() to acquire the knowledge of bandwidth-delay product of a TCP connection, and set the socket buffer size that he wants to optimize accordingly. FTP is just one of the important applications that can benefit from automatic socket buffer tuning. The overhead added to the network traffic is kept to a minimum. With the current implementation we applied only about 15KB of additional network traffic only at connection setup time. For session oriented and bulk data transfer applications such as FTP, this overhead is negligible. The time required for the measurement is usually much less than a second, and no more than 2 seconds for high loss-rate networks, again only at connection setup time.
Source Code Download, Installation and UsageHere is our Auto Tuning Enabled FTP Client and Server.Who Might Use This Feature?You want to enable this feature when:
Who Should NOT Use This Feature?This is not an automatic negotiation of TCP window size with FTP server (yet). Enabling automatic TCP window tuning from client side won't help much if:
Future DirectionsAt this time automatic window tuning can be enabled on executable ncftp only. Other executables such as ncftpget and ncftpput are disabled from this feature.Automatic TCP window size negotiation with FTP server is very attractive because either server or client TCP buffer size can become a bottleneck. Automatic negotiation will most likely improve performance by coordinating the client and server.
Reference:
|
Contact DAST
Last reviewed:
December 31, 1969
NLANR ||
Applications Support ||
Engineering Support ||
Measurement and Network Analysis