12

In short:

Wikipedia mentions a required "availability search" to find peers (and the actual file):

Note that, although a particular file is indicated, an availability search for it must still be carried out by the client application.

Where does the client look? Does a magnet link require a tracker URI or is that up to the client's network?

More info:

A certain magnet URI/URN from tpb looks like this:

magnet:?xt=urn:btih:e9b785fc2d70811a72df5a76bb34bd2eaf9df956&dn=Dances+with+Wolves+1990+20th+Anniversary+Extended+Cut+720p+BRRip&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80

It contains 4 tr query params with (I suppose) tracker locations that contain some sort of hash index. However, Wikipedia doesn't mention the tr param, so I assume it's not mandatory.

Where does a client start looking for the file if no tracker URI's are included? And if there are? I can imagine a torrent client (like uTorrent) itself having an enormous index of file hashes.

Rudie
  • 739
  • 1
  • 9
  • 19
  • 2
    Kudos for asking so nicely, just a small correction though: The Wikipedia does [mention](http://en.wikipedia.org/wiki/Magnet_URI_scheme#Address_tracker_.28tr.29) the `tr` parameter (at least at the time I was viewing it's article) – Saxtus Feb 22 '13 at 19:15
  • My bad. I only saw the params part under "Technical description". It's not mentioned there. It says "without a need for DHT support". Wouldn't a client just always use DHT and/or PeX even when a tracker was proved? (If not, why not?) – Rudie Feb 22 '13 at 21:52

2 Answers2

8

The client will use DHT and Peer Exchange to look for clients if no trackers are provided.

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
  • 1
    Would the above magnet URI work if I removed the `tr` params? My uTorrent client would look via DHT and PeX? Would it use (or even find) trackers from other peers (because others did get the full magnet URI, including trackers)? – Rudie Feb 22 '13 at 21:46
  • 1
    @Rudie: It *should* work. How **well** it *will* work depends on the client, your network, how common the file is within the swarm, ... – Oliver Salzburg Feb 22 '13 at 21:53
  • Would it look for trackers or skip the whole tracker approach if an initial tracker wasn't provider? (Would a peer ever share the tracker URL with another peer?) I'm sorry for being annoying and redundant, but I just have to know =) – Rudie Feb 22 '13 at 21:56
  • Also (sorry!), Wikipedia says "identifies a file", yet a torrent can contain many many files. Is the whole package the file mentioned, or does every actual file have its own magnet hash? – Rudie Feb 22 '13 at 22:01
  • 1
    @Rudie: To my understanding, clients do not trade *trackers*. They only trade other *clients*. A quick test I just performed seemed to confirm this. I'm assuming the "file" mentioned on Wikipedia relates to the data container that describes the torrent contents. – Oliver Salzburg Feb 22 '13 at 22:07
4

If trackers are listed, the client will query them first. If none are listed, DHT is used to query other clients for copies of the file, and then PEX kicks in to find more copies once the first has been found. Even if trackers are found, the client may still leverage DHT to find additional peers.

The trackerless approach is analogous to the Gnutella(2) network if you were familiar with its operation.

BowlesCR
  • 2,697
  • 12
  • 19
  • DHT and PeX would work very well together, wouldn't they? Why first DHT and then PeX? (Does the DHT result contain PeX trackers or something??) The principle is the same, isn't it? Ask from peers in the client's network? – Rudie Feb 22 '13 at 21:48
  • 1
    Sorry to dig this back from the dead. DHT finds a seed/peer even when you have none for a given torrent. PEX communicates with _existing_ peers to find more. – BowlesCR Aug 12 '13 at 15:42