views:

29

answers:

1

How are the data chunks handled within the bittorrent protocol?

When a client wants to download e.g. a linux distribution does the tracker return a list of peers which a client then connects to and requests chunks from each peer or does the tracker return a list of peers and info of which peer has what data?

Where is the data chunks managed or handled e.g. I need chunk 5 , 6, 10 and peer 2 has chunk 5, 7, 8. where is the data controlled or managed? Does the client request chunks from the other peers then the peer checks if it has the chunk and then sends it or how does the data flow work?

Thanks

+2  A: 

The tracker provides the list of peers, then the peers connect and swap lists of chunks.

The peers exchange a BITFIELD message immediately after the initial handshake. The BITFIELD contains 1s for pieces the peer has and 0s for those it doesn’t have. When a peer receives the BITFIELD, if all the bits are set to 1, then the remote peer is a seed. This way peers can identify seeds easily.

(from http://web.archive.org/web/20041119150847/http://mnl.cs.stonybrook.edu/home/karthik/BitTorrent/Robustness_of_BT.doc)

Colin Pickard