As I know any local DHT keeps only some of nodes - if the network is small/very small then all nodes, otherwise only some of them (nearest?).

So, when I checked different Golang implementations of DHT (Bittorrent, Node Discovery Protocol and similar) - some of them have functions listing nodes, but as I understand, just from local DHT (which does not guarantee that it will contain all the nodes).

Does DHT (DHT algorithms, PEX extension, etc) allow to list ALL nodes? Something as to list all nodes of the network? My intuition on the DHT algorithms is - they don't support such functionality, but I am not sure (I don't know DHT very well).

  • 1
    $\begingroup$ are you asking whether a DHT keeps a list of nodes in its "routing" table (as in the data structure maintained by a dht which is necessary to send messages to other nodes), or whether it is possible to design a protocol that allows to query all nodes in a DHT? $\endgroup$
    – Effie
    Dec 10, 2021 at 18:59
  • $\begingroup$ I don't understand what you mean by "Does DHT allow..?" - this might depend on which DHT data structure you use. There are more than one. $\endgroup$
    – D.W.
    Dec 10, 2021 at 21:27
  • $\begingroup$ @Effie yes, this too. If there is not such a ready-to-use protocol then is it possible (and how to do it) to design such one. Because IMHO DHTs keep only closest nodes and also they enter DHT on get content requests IMHO... $\endgroup$
    – RandomB
    Dec 11, 2021 at 14:32
  • $\begingroup$ i don't think there is a common solution for every dht that exists. you have to take each DHT algorithm into consideration and figure out how this can be done. However, yes, usually each DHT node only keeps a portion of nodes in its "routing" table. But, if you have a content key, you can find a node that is responsible for this content, even if it is not in the routing table. You need to query other nodes in the process. I would assume that this one can be adapted to querieng node names. Or you could recursively ask your neighbors for their neighbors and then their neighbors, and so on. $\endgroup$
    – Effie
    Dec 11, 2021 at 15:10
  • $\begingroup$ This can definitelly be done, and there may be several ways to do this. If the question is whether this can be done without communication with other nodes, I would go with - likely a no, unless local structure is actually keeping every node. Also, the fact that the number of local contacts is smaller than all nodes is not a characteristic of a DHT, you can save any number of contacts, from a couple, to all nodes. $\endgroup$
    – Effie
    Dec 11, 2021 at 15:13


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.