I was asked a question some time ago, it went something like this “Robert, why does it take so long for me to open a file over the network? Its taking over 5 minutes” So I went through the usual troubleshooting steps like asking what is the file?, where is the file?, how big is the file? etc. It quickly dawned on me that he was opening a file somewhere in the region of 150Megabytes so my reply was “I’m sorry but this is normal time you can expect for downloading a file of 150Megabytes over the WAN” the users reply was “Robert we have a 50mbps link at each end surely this should take like 3 seconds?”

Firstly let me explain the difference between Megabytes and Megabits, Megabytes are what you and I refer to as file size’s so you might say to your friend “my flash drive is 2Gigabytes” which is  2048Megabytes or the song you just bought off iTunes is 6Megabytes we are familiar with this and accept it as the standard unit of measuring file size and your home Broadband speed………………WRONG!

Your ISP will give you a broadband connection of say 10Megabits per second (mpbs) which is in fact only 1.25Megabytes per second, this is because bandwidth is measured in Megabits per second and not Megabytes.

There are 8Megabits in 1Megabyte so just divide your current Broadband speed by 8 to get you speed in Megabytes

So to answer the users question downloading 150Megabytes at 50mpbs should download in 24 seconds? right? lets work it out.

50mpbs / 8 to get Megabytes = 6.25Megabytes / 150Megabytes = 24 seconds ………….. WRONG!

We haven’t thought about latency and how that can affect your TCP traffic flow.  When you open up a command prompt and you ping across the WAN to your file server you can see something called the RTT see below example.

Pinging with 32 bytes of data:
Reply from bytes=32 time=32ms TTL=44
Reply from bytes=32 time=32ms TTL=44
Reply from bytes=32 time=32ms TTL=44
Reply from bytes=32 time=32ms TTL=44

Ping statistics for
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 32ms, Maximum = 32ms, Average = 32ms

Highlighted in Red is your RTT or your round time trip this is the time it takes the packet to go to the destination and back again the further away the host the higher the RTT.

How does latency affect download speed? Well we have to think how TCP traffic works when transferring files over the WAN, your default TCP window size is 64KiloBytes this means that for every 64KiloBytes of data sent the receiving end has to send an acknowledgement, so this means in a 150Megabyte file there are 2400 acknowledgements.

So you can now see why latency can affect throughput, you could increase the default TCP window size on both sending and receiving devices, but this is not the answer as if there is any packet loss on your link the you will have to resend any data that gets lost on the way, this is the fundamental reason behind TCP traffic and guaranteed packet transmission.

So what can you do to speed things up? You could bring the 2 countries closer together? or work out a way of making the speed of light faster?

Luckily there are technologies out there and they fall under the category of WAN Acceleration or WAN Optimization. I wont mention any particular company but there are quite a few out there some even optimize UDP traffic.

They use many techniques like De-duplication, Compression, Caching, CIFS, Latency Improvements etc. All of this together can make the connection between 2 offices appear a lot quicker and even reduce the amount of traffic sent over the link by as much as 50%. Both ends of the connection must have an accelerator and usually connecting back to a main bridgehead or control server, in each accelerator there is usually some sort of hard drive perhaps a SSD for faster read/write times which stores all the data previously accessed over the link.

The actual calculation for working out maximum throughput on a WAN link no matter what the bandwidth is as follows.

TCP window size in bits / latency in seconds = throughput in bits per second / 1048576(bits in a megabit) = mbps

So here’s an example to answer the users question. The latency was 145ms at the time.

524288 bits / 0.145 = 3615799 bits per second.

Lets turn that into mbps so:  3615799 / 1048576 = 3.4mbps 

Divide this by 8 to get Megabytes: 3.4mpbs / 8 = 0.425 MBps

So take the: 150Megabytes / 0.425MBps = 352 seconds which is the same as 5+ minutes

This calculation is based on optimal network conditions with zero packet loss and zero jitter.