https://www.youtube.com/playlist?list=PLfTHgzgSsUiRbuCTkkA8O4ADz17jf6aY3
The first three videos are what you want.
Also the specifications of Kademlia, the DHT algorithm used in Bittorrent Mainnet DHT.
http://xlattice.sourceforge.net/components/protocol/kademlia/specs.html
Here's my take on it.
A DHT is a key value store where the key-value pairs are not stored in a central computer but distributed among many forming a network.
When a node joins the network it can query the network for a key and will receive a value associated with that key.
Also each node is assigned a portion of the key-value pairs to store. This is a black-box look at DHTs.
The interesting part is how to implement this without a central server that keeps track of which node stores which keys.
This is done using a decentralised or "P2P" algorithm outlined next.
Each node is assigned an id, which is typically the hash of its ip (and port I think). The nodes organize themselves in a ring, where each
node connects to its successor and predecessor in the id space. That is, node 6 connects to nodes 5 and 7. If let's say, node 5 is not available,
then it connects to the next available node in that direction.
The key-value pairs are distributed such that node with id n stores the pair such that the hash of the key is n. Since the space of a modern
hash function is huge, a node stores the keys that would be assigned to the previous nodes that are not pressent in the network.
In other words, the same space is used for keys and ndoe ids, and a node stores the keys closest to it in this space. This is the distance metric.
Post too long. Click here to view the full text.