kitsunet-js icon indicating copy to clipboard operation
kitsunet-js copied to clipboard

Implement discovery mechanisms

Open dryajov opened this issue 6 years ago • 0 comments

Implement a discovery mechanisms that allows finding peers tracking specific slices.

The DHT and the query based discovery should complement each other. Ideally, the DHT should work for all cases, but in practice and specially in connectivity constrained environment such as browsers it often falls short, in addition to the high traffic overhead it generates (Kademlia issues sequential queries, so for each lookup). An alternative mechanism such as the one described here, can supplement the DHT in cases where it fails. All in all, it isn't clear weather this is going to be enough and additional, more centralized solutions such as a Rendezvous server would be required.

  • [ ] It should be possible to locate nodes providing a particular slices using the DHT

    • peers announce slices that they track over the DHT and interested peers issue queries to locate those peers
  • [ ] implement a low overhead gossip based alternative to the DHT mechanisms that allows issuing queries to the network to locate peers tracking specific slices

    • There are two ways to do this
      • The simplest one is using existing pubsub implementations, floodsub, gossipsub, randomsub (poorman's gossip query). Where a globally known topic is used to issue queries that anyone that is subscribed the topic should eventually receive. The query contains the requested slice and a ephemeral topic that the issuer is listening on for responses, after some number of responses X, the issuer unsubscribes from the ephemeral topic, thus stopping to process anymore responses.
      • A more suitable solution should be written specifically for use cases like this. Instead of publishing on topics, peers will pull data from a topic, essentially creating a request/response mechanism. Anyone can subscribe to a topic and respond to requests, and responses are routed to any peer that issued a query with the same signature, after a number of responses, requestors stop processing responses, by either unsubscribing from topic/announcing to mesh that they are finished, etc... (TBD)

dryajov avatar Mar 13 '19 05:03 dryajov