How bittorrent tracker works?

Viewed 4183

I read official documetation here and wikipedia article about bittorrent client here but couldn't find how tracker exactly work. As per my understanding tracker should know which peer have which piece of some file. For example client 1 have 5 pieces of file 1 and 10 pieces of file 2. In official documentation I see tracker have fields like peer_id ip port uploaded downloaded left and event but I don't see where is the information about which file we are tracking. For example if I ask tracker hey I need pieces for linux.torrent file, how tracker would answer me?

2 Answers

A trackers job is, when a peer announces to a specific swarm (identified by the info_hash),to register that peer as active on that swarm and then send that peer a peer list with other peers active on that swarm.

A tracker does NOT keep track on which pieces or files a peer has.

I recommend you to read the inoffical protocol specification: https://wiki.theory.org/index.php/BitTorrentSpecification
it's bit easier do comprehend than the terse and dense BEP-3.

In official documentation there is bep for UDP tracker protocol here

Related