Question

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)

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

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).

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top