I want to confirm my understanding of buckets in Kademlia DHT.
Kademlia has m k-buckets where m is the size of the network in bits and k is the number of key-value pairs stored per bucket.
for example, let's say m=4
then we can have 2^4
nodes, namely from 0 to 15.
+========+
| NodeId |
+========+
| 0000 |
+--------+
| 0001 |
+--------+
| 0010 |
+--------+
| 0011 |
+--------+
| 0100 |
+--------+
| 0101 |
+--------+
| 0110 |
+--------+
| 0111 |
+--------+
| 1000 |
+--------+
| 1001 |
+--------+
| 1010 |
+--------+
| 1011 |
+--------+
| 1100 |
+--------+
| 1101 |
+--------+
| 1110 |
+--------+
| 1111 |
+--------+
Each node has the routing table of the 0-bit match, 1st-bit match and 2nd-bit match and so on, this is m
buckets. Furthermore, for each bucket, it will store k
representatives instead of a single NodeId.
So, if we say k=2, the routing Table for node 0101 would be something like:
┌──────────────────────┐
│ 0101 │
├──────────────────────┤
| |
| +==================+ |
| | xxxx | |
| +==================+ |
| | 1001, <value> | |
| +------------------+ |
| | 1010, <value> | |
| +------------------+ |
| |
| +==================+ |
| | 0xxx | |
| +==================+ |
| | 0000, <value> | |
| +------------------+ |
| | 0111, <value> | |
| +------------------+ |
| |
| +==================+ |
| | 01xx | |
| +==================+ |
| | 0110, <value> | |
| +------------------+ |
| | 0111, <value> | |
| +------------------+ |
| . |
| . |
| . |
└──────────────────────┘
Is my assumption correct?