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

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. or 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.

Leave a Comment