Where does a magnet/torrent client look for the hash/torrent/file?
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.
The client will use DHT and Peer Exchange to look for clients if no trackers are provided.
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.