Working in the field of traffic analysis, you get to see a rather modest number of good solutions to a given problem, a larger number of decent solutions and – sadly – quite a few less than stellar ideas as well. My favorite pet peeve – and believe me, there’s a slew to choose from, is using FTP as an update mechanism for games, and doing it in a not very thought-out manner.
Say that you have 4000 asset files in a given game. Most of them are pretty small – well under 8KB. You want to support users going from version A, B or C to version D, utilizing the least amount of bandwidth in the process. Logic dictates that it would make a lot of sense to get a checksum of all your local files, send the checksums to the server and have the server return a list of files you need to update, right? A minimum amount of bandwidth is utilized and the user can update from pretty much any version.
Enter FTP. FTP uses one control connection and n data connections, where n equals the number of transferred files and directory listings done over the lifetime of the session. And by ‘connection’, that’s a full-blown TCP stream, three-way handshake and all. Let’s pretend that I have a 100ms latency to the update server and the server or clients themselves incur no extra overhead – that leaves us with:
* One PASV call in the control connection and the response to that one. 200 ms.
* One three-way handshake, add another 300 ms (SYN, SYNACK, ACK) – plus another 100 ms before I start seeing the data from the server.
So the tally: To transfer a given file (be it 0.5 KB, 200 KB or 15 MB), the transfer overhead itself will be 600 ms. ,which could be OK’ish for one large patch file. Let’s say there’s a 200 MB update covering 1500 files – that’s 15 minutes worth of waiting for the transfers to start for a set of files that should take something along the lines of two minutes to actually transfer over a pretty basic broadband connection.
I think World of Warcraft (and others, but they’re a good example) got the right idea from a developer’s perspective – they transfer the patches in sets – going from A to D would require you to go from A to B to C to D – more to download, but people can do such over BitTorrent or any old HTTP mirror rather than the developer’s own site. Game developers, take note. Please.
Tags: bandwidth control, congestion control, deep packet inspection, DPI, file transfers