Discovery Protocols -- how does IPFS detect neighbors?

From @pocketmax on Tue Sep 29 2015 04:13:37 GMT+0000 (UTC)

How does IPFS detect neighboring devices to pull content from?

Copied from original issue:

From @jbenet on Tue Sep 29 2015 06:50:02 GMT+0000 (UTC)

IPFS uses a set of discovery protocols to achieve this. These are pluggable, configurable, optional, and so on. For example, go-ipfs ships with:

  • Bootstrap Lists to start with an initial set of peers. (configurable)
  • mDNS to discover peers in local area networks.
  • DHT random walk to learn about more peers in the network

More will come

What if the new client is behind a censorship regimes firewall that blocks all known bootstrap nodes? For a host to discover a DHT without using mDNS or known bootstrap nodes, some kind of time-varying bootstrap node discovery protocol is needed. Given the current timestamp a publicly known hashing function would map to a small IP range (this range would change say every 5 seconds and is designed to contain highly stable IPFS peers). The client will probe every IP in this range to discover bootstrap nodes. Hopefully the firewall is not agile enought to block all these IPs.