8

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
  • Unless you have a question about programming your own tracker or patching someone else's, this is not on-topic for SO and would be better suited to SuperUser. Nov 16, 2017 at 13:49
  • I am trying to implement my own java based tracker, client etc. so I need information which fields I need in tracker and how client know which peers have pieces that it is interested for. I guess it should ask a tracker but I don't know how. Nov 16, 2017 at 13:52

2 Answers 2

2

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.

2
  • To make the answer even more helpful @Encombe, could you include what is a "swarm"? What is the exact difference between keep track on which pieces or files a peer has. (you said it doesn't) and a list of peers active on that swarm and then send that peer a peer list with other peers active on that swarm. ?
    – Basj
    Jan 13, 2018 at 17:41
  • @encombe link is broken
    – user541396
    Mar 24, 2023 at 6:07
-2

In official documentation there is bep for UDP tracker protocol here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.