views:

161

answers:

5

Can the BitTorrent protocol specify wanting the first 3% or first 5% of the file first? If not, would adding such support be an improvement to the protocol?

Update: so i guess, if it is part of the protocol, why the many clients out there do not use it? After 10 minutes, 10% of the file is done, but usually you cannot even preview 1% of the content... (depends on luck)

+2  A: 

Azureus has an option to get the first and last blocks of a file, first. But it's not 100% reliable since you can't control which peer will start to send data, frist.

See here for the protocol spec, specifically:

request:

The request message is fixed length, and is used to request a block. The payload contains the following information:

So yes, you can ask for a specific block (even a part of it). That should make it possible to request exactly the first 3% or 5% of a file, independent of the block size.

Aaron Digulla
so it is actually part of the protocol?
Michelle Lee
Yes, it is. See my edit for details.
Aaron Digulla
+1  A: 

Yes, this is supported by the torrent protocol, ktorrent for example uses it to provide preview chunks for different file types (e.g. mp3, avi or even pdf).

none
+2  A: 

The Bittorrent protocol is designed around scarcity: the rarest chunks are distributed first, to decrease the likeliness of no longer having all chunks in the swarm of peers. Because that would make it impossible to get the entire file.

Wim Leers
i see... what if there are hundreds of seeders? in that case the scarcity isn't that's crucial?
Michelle Lee
It is: what if many peers exit the swarm at once (seeders or not)? By downloading the rarest chunks first, the chances of not having all chunks in the swarm are reduced to the smallest possible minimum.
Wim Leers
+1  A: 

After 10 minutes, 10% of the file is done, but usually you cannot even preview 1% of the content... (depends on luck)

This is because the client doesn't download the file in order (so that the transfer is more efficient when you've got lot's of peers, each one has a different part of the file)

Adrian Mester
+2  A: 

BitTorrent's purpose as a protocol is not for streaming media, its purpose is to make a best effort at keeping all data of interest reliably available at all times. Using it for media streaming purposes is actually counterproductive to BitTorrent's goal.

If it's not obvious to you why this is the case, I suggest picking up Computer Networks by Tanenbaum before you go any further.

Not Sure