|
Hack your WAN for better performance (with Video)
Tue, 01/26/2010 - 16:27 | by David Siegel
Transmission Control Protocol, or TCP, is your friend....
...except when it's your enemy! Most of the time it's your friend because it's chock full of great features, but the best feature it has is congestion avoidance. Simply put, congestion avoidance was designed to allow a data transfer flow over an IP network to adapt to the size of bandwidth available while minimizing the loss of packets. Packet loss implies loss of efficiency, so TCP also minimizes waste.
Sometimes TCP is not your friend, though, and that has to do with the way the protocol acheives that efficiency. If you want all the gory details of how TCP works I would highly recommend TCP/IP Illustrated by Rich Stevens, although the wikipedia entry linked above offers a reasonable summary. The key thing to understand is that congestion avoidance is acheived through the use of adjusting the size of the TCP window and that because TCP is very chatty the latency between the endpoints is a large factor in how quickly the window can be adjusted. As a result, the maximum data transfer speed is governed by window size, packet size, and round trip latency.
I found a very handy simplified algorithm for calculating TCP throughput over on Brad Hedlund's blog.
Throughput (bps) = TCP Window Size (bits) / Latency (s)
Using the standard windows size on a Windows computer of 64KB (or 524288 bits), let's pick a pair of locations like Seattle, WA and Amsterdam, NL which has an average latency on the Global Crossing network of 163ms (or .163 seconds). With these parameters, the maximum theoretical speed for a TCP protocol between these endpoints is only 3.2Mbps!
While it may be possible to deploy jumbo frames (up to 9000 bytes) throughout your network to improve throughput, in many cases it is beyond your control. Latency, too, is also often beyond your control. Fortunately, window size is a tunable parameter. The fastest way to improve the situation without spending any money is to go into the windows registry and change the window size on every single desktop computer and server in Amsterdam and Seattle, Be careful though, if you jack up the window size too high you could see an overall performance degradation in your servers caused by the increased amount of buffers that are allocated as well as an increase in wasted bandwidth when larger packets that get dropped are re-transmitted. This is not easy to maintain from an IT perspective, though, and it takes valuable time to tune these values to an amount that suits the network architecture.
The better option is to hack the TCP transmissions using a WAN Optimization solution. A WAN Optimization solution also accellerates throughput in other ways through the use of pattern recognition/pattern caching, which I mention in this recent interview with inPerspective.
The equipment deployed at each office or datacenter location in a WAN Optimization solution interacts (interfere's would be more accurate, technically) with the end-to-end TCP conversation between client and server by acknowledging receipt of the packet to the desktop client on behalf of the server the server hasn't even had a chance to respond. This hack makes the server and the client think that they are talking to each other over a low latency connection and so the algorithm cited above becomes invalid (or at least the round trip latency can no longer be used as the proper latency figure in the calculation).
Besides the added benefit of performance on both TCP and UDP connections, when you buy the Managed WAN Optimization service from Global Crossing you get the equipment, installation, configuration, proactive monitoring, server and reporting setup all for an easy monthly rate. Of course, you can alway spend a large sum of Capital to buy your own hardware and then figure out how to set everything up, or you can even spend hours and hours tuning and re-tuning the window size on the computer you support, but if you'd prefer a quick improvement in speed on your large global WAN, let Global Crossing take care of it and you can get on to other things.










