Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A DHT simply defines <code>put(key,value)</code> and <code>get(key)</code> operations and the core of the various DHT algorithms revolve around how to locate the nodes responsible for a specific key.</p> <p>What those nodes do on an incoming <code>put</code> request for a value already stored largely depends on the purpose and implementation of the DHT network, not on the algorithm itself.</p> <p>E.g. a node might opt to timestamp all incoming values and return lists with multiple separate timestamped issues. Or it might return lists that also include the source address for each value. Or they might just overwrite the stored value.</p> <p>If you have some relation between the key and a signature within the value or the source ID or something like that you can put enough intelligence into the nodes to verify the data cryptographically and thus allow them to keep a single canonical value for each key by replacing the old data.</p> <p>In the case of bittorrent's DHT you wouldn't want that. Many different bittorrent peers announce their presence to a single key from different source addresses. Therefore the nodes actually store unique <code>&lt;key,IP,port&gt;</code> tuples where <code>&lt;IP,port&gt;</code> can be considered the value. Which means it'll return lists of IPs and ports on each lookup. And since a DHT will have multiple nodes responsible for one key you will actually have <strong><em>K</em></strong> (bucket size) nodes responding with varying lists.</p> <p>TL;DR: It's implementation-dependent</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload