How PEX protocol (Magnetic links) finds it first IP?
Asked Answered
C

1

22

I'm trying to understand how can a magnetic link work, as I've read they use DHT and PEX to get the peers, but if I'm a new node in the network how can I find peers with only the hash of the file?! Doesn't it always require a link to a known host?

Thanks

Corelli answered 12/6, 2012 at 15:24 Comment(2)
The Pex tag is for Microsoft's white-box testing tool, not Peer Exchange. Retagged.Sarmentum
One note!: magnet links (as found on the pirate bay) usually have embedded tracker urls in them. When using these types of links, you can just ask the tracker for peersKarykaryl
E
27

The bittorrent DHT can be bootstrapped in many ways. It just needs the IP and Port of any other reachable DHT node out there.

Current clients generally use several of the following strategies:

  • bootstrap from a cache of long-lived nodes from a previous session
  • use a DNS A/AAAA record mapping to a known node (e.g. router.bittorrent.com or dht.transmissionbt.com) with a known port
  • use a node embedded in a .torrent file
  • retrieve the DHT port from a bittorrent client over a bittorrent connection established through other means, e.g. a conventional tracker.
  • multicast neighbor discovery via LSD
  • cross-chatter from the IPv4 to the IPv6 DHTs and vice versa (if needed)

Other ways such as user-configurable bootstrap lists, DNS SRV records round-robin mapping to live nodes or - should everything else fail - adding the IP of your friend(s) manually work.

Once a node has joined the network the first strategy mentioned above will kick in and it is unlikely that it will have to bootstrap again.

So while most implementations rely on a single/few points of entry into the network for convenience, the protocol itself is flexible enough to decentralize the points of entry too.

Just for emphasis: Any node in the DHT can be used to join the network. Dedicated bootstrap nodes are an implementation detail, not part of the protocol, and could be replaced by other discovery mechanisms if necessary.

Exhume answered 18/6, 2012 at 19:29 Comment(6)
ok I get it, but if you are a new node, and want to enter the network, there is no way that you can do that without asking for a peer, and the usual way is using a server for that, so you will always need one, or you will make the access to the network harderCorelli
Yes, the usual way is to use a server at the moment. But your conclusion that you "always need one" is incorrect. Other ways are possible. The whole point of my answer was that you do not need "one central server", just that it's a convenient way to do things.Exhume
yes i got it, but for it to work every time a server is the proper choice, otherwise the node that is given can be offlineCorelli
a server is just one access point to the dht network but like the8472 there are lots of 'entrances' to the dht networkSima
The point @Exhume emphasised that any node can be the entry point makes the DHT network fundamentally different from the conventional tracker mechanism. A tracker is a centralized server, if you shut it down you end the swarm, while a DHT network has no "central" node.Ermina
Given that bittorrent is so popular, would "try a bunch of IPv4 addresses at random" be a viable method of bootstrapping?Pauperize

© 2022 - 2024 — McMap. All rights reserved.