Home|New chat|History|Refresh|Prev chat
Chat: how DHT let P2P route requests (2)
You:
how DHT let P2P route requests
Tutor:
Definition: A Distributed Hash Table (DHT) enables a peer‑to‑peer network to locate the node responsible for a given key by routing the request through a small number of hops using a structured overlay.
Key points
- Each node owns a portion of the identifier space (e.g., a range of hash values).
- Keys (e.g., file IDs) are hashed to the same identifier space; the node whose ID is the closest successor (or predecessor) to the key stores the value.
- Routing tables (finger tables in Chord, k‑buckets in Kademlia, leaf sets in Pastry) contain a logarithmic number of entries, pointing to nodes at exponentially increasing distances.
- To find a key, the requester forwards the query to the neighbor whose ID is closest to the target, reducing the distance each hop; typical lookup cost is O(log N) hops.
- The overlay is self‑organizing: nodes join/leave, update routing tables, and replicate data to maintain availability.
Memory hook: “DHT = hash‑map on steroids – like a phone book where each entry knows a few “next‑door” contacts that let you jump across the city in O(log N) steps.”