[bittorrent] Peer and blocks asking behaviour

Adrian Ulrich torrent at blinkenlights.ch
Wed Jul 30 13:45:36 EDT 2008

Hi Michele

> Let's suppose we have multiple unchoked peers. My client is interested  
> in one particular piece.
> When asking for a piece, does the client select a peer that has that  
> particular piece or ask to all the peers that have that piece?


Under 'normal' circumstances it will ask only 1 peer but in endgame-mode
it might ask multiple peers for the same data.

> In case of selecting one particular peer, how is it chosen? Randomly  
> or by the best upload speed?

AFAIK most clients prefer 'good' uploaders.

> In case of the peer selected is non responding, how the client will behave?

It would ask some other peer after $some_timeout

> - a peer ask for all the blocks contained in a piece only to one peer  
> (the first who answer to the piece request?)
> - a peer ask for all the blocks contained in a piece to the peers that  
> have that piece

My client tries to fill pieces with data from a single peer:
This might be slower than asking multiple clients but makes it harder
for an 'evil' peer to corrupt multipile pieces.


More information about the BitTorrent mailing list