Why is distributing random pieces of a file faster than a contiguous transfer?

Why is it said that BitTorrent is faster, partly, because it transfers random pieces of a file instead of transferring it from start to finish in a contiguous/linear fashion?


EDIT: But why do they have to be 'random'? Why not a more predictable 'semi-contiguous' transfer in which one peer gives you the first half, and the second peer the other half? This would theoretically reduce overhead.


Regarding the edit asking why they have to be random: Let's say that torrents were changed to only download the first block that the downloader doesn't already have, thus guaranteeing a contiguous transfer.

I then share a 100MB file. 10 people connect and each downloads 50MB before I go offline.

These people are then screwed, because they all have the first half of the file, while only I have the second half. Until I make it available again, they can't complete the download.

Instead, with the blocks being transferred in a random order as is actually the case, each of these 10 people has a different set of blocks, so they can trade among themselves in order to complete their downloads without needing me to be around.

Even better, though, because each of them has a different set of blocks, each of them can download from all of the others to fill in the gaps in their copy. Your edit alluded to the idea of starting from a random point in the file and downloading contiguously from that point, but that would increase the amount of overlap from one downloader's copy to the next (if Alice starts at the beginning of the file and Bob starts 10% into it, then there's 40% of the file that they both have and only 10% unique to each of them that they can trade without me reconnecting to make the rest available). Downloading in a random order maximizes the uniqueness of each downloader's set of blocks held, thus maximizing the ability of downloaders to start trading among themselves and maximizing the odds of it being possible for them to assemble a complete copy if no seeds are available.

A single contiguous download may (or may not, depending on conditions) be better for you, but downloading in random order is better for the network as a whole.


The key is that you are getting the file from several sources (peers) at the same time rather than from one source.

If you have a file that's split into 10 parts and takes 100 seconds to download from 1 server then theoretically you can get the file from 10 peers in 10 seconds (plus some overheads) as each peer can deliver it's part in 10 seconds. In practice it will take longer as each peer won't be perfect, and you'll probably hit your bandwidth limit (but you get the idea).

As you have to reassemble the file anyway you don't have to fetch the pieces in order. So if you only have 5 peers with each delivering 2 parts these can be random parts of the file.