简体   繁体   English

K-Bucket 在 Kademlia DHT 中究竟意味着什么?

[英]What exactly K-Bucket means in Kademlia DHT?

I want to confirm my understanding of buckets in Kademlia DHT.我想确认我对 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. Kademlia 有m 个 k-bucket ,其中m是以比特为单位的网络大小, k是每个存储桶存储的键值对的数量。 for example, let's say m=4 then we can have 2^4 nodes, namely from 0 to 15.例如,假设m=4那么我们可以有2^4节点,即从 0 到 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.每个节点都有0位匹配、1位匹配、2位匹配等的路由表,这是m桶。 Furthermore, for each bucket, it will store k representatives instead of a single NodeId.此外,对于每个桶,它将存储k代表而不是单个 NodeId。 So, if we say k=2, the routing Table for node 0101 would be something like:因此,如果我们说 k=2,则节点 0101 的路由表将类似于:

┌──────────────────────┐
│         0101         │
├──────────────────────┤
|                      |
| +==================+ |
| |       xxxx       | |
| +==================+ |
| |   1001, <value>  | |
| +------------------+ |
| |   1010, <value>  | |
| +------------------+ |
|                      |
| +==================+ |
| |       0xxx       | |
| +==================+ |
| |   0000, <value>  | |
| +------------------+ |
| |   0111, <value>  | |
| +------------------+ |
|                      |
| +==================+ |
| |       01xx       | |
| +==================+ |
| |   0110, <value>  | |
| +------------------+ |
| |   0111, <value>  | |
| +------------------+ |
|          .           |
|          .           |
|          .           |
└──────────────────────┘

Is my assumption correct?我的假设正确吗?

k is the number of entries in a bucket. k是桶中的条目数。 Their node IDs are expected to be randomly distributed within the ID-range the bucket covers, which means doubling the number of entries per bucket would only increase its resolution by one bit on average, ie it does not scale well.他们的节点 ID 预计会在桶覆盖的 ID 范围内随机分布,这意味着将每个桶的条目数量加倍只会将其分辨率平均提高一位,即它不能很好地扩展。 That's why we have a structured routing table with multiple buckets with different scope each.这就是为什么我们有一个结构化路由表,其中包含多个具有不同范围的存储桶。 It increases local resolution around the node's own node ID.它增加了节点自己的节点 ID 周围的本地分辨率。

Implementing the full kademlia algorithm requires a dynamic routing table layout .实现完整的 kademlia 算法需要动态路由表布局 Therefore m is not fixed.因此m不是固定的。 The fixed size layout was only used in the simplified pre-print version of the paper as part of a theoretical proof.固定尺寸布局仅在论文的简化预印版中用作理论证明的一部分。

Every node in Kademlia store a list of other nodes. Kademlia 中的每个节点都存储了其他节点的列表。 This list is based on bit-differences and is loosely termed as buckets.该列表基于位差,被松散地称为桶。 Now, 'k' is a system wide replication parameter.现在,'k' 是系统范围的复制参数。 This means that for every list, there are k entries inside for that 'bucket'.这意味着对于每个列表,该“存储桶”内部都有 k 个条目。 This is my understanding.这是我的理解。 This is the link to the paper. 是论文的链接。 Hope this helps..:)希望这可以帮助..:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM