Kademlia路由表和距离度量 [英] Kademlia routing table and distance metric

查看:177
本文介绍了Kademlia路由表和距离度量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我今天第一次阅读有关Kademlia的信息,有些观点我认为我做对了.

Its been the first time I read about Kademlia today, and some points I don't think I got them right.

节点和键之间的距离是其值的异或.

The distance between nodes and keys is the xor of their values.

因此,如果我有键x和节点y,则它们之间的距离是x x或y.

So, if I have key x and node y, the distance between them is x xor y.

但是为什么要存储我知道的节点并按前缀长度对其排序呢?似乎并没有直接与节点ID的xor关联来找到离我最近的节点?

But why what is the point to bucket the nodes I know about and order them by the prefix length ? That doesn't seem to be connected directly with the xor of node IDs to find closests nodes to me ?

当我请求一个值时,我在离我最近的存储桶中的节点中进行搜索,即与我共享前缀最大的节点,即160个存储桶中的前几个存储桶?

When I get a request for a value I search in the nodes in the closests buckets to me, that is the nodes which have the largest shared prefix with me, ie the first few buckets of the 160 buckets ?

或者,我检查所有存储桶中我知道的所有节点,然后计算要查找的密钥与这些节点ID之间的异或,然后根据异或结果将我的请求发送至前k个匹配项密钥ID?

or instead I check all nodes I know about in all the buckets and I calculate the xor between the key I am looking for, and those nodes IDs, and then send my request to the top k matches based on the xoring results with the key ID ?

抱歉,我对DHT有点陌生,并且发现在线解释不清楚.

Sorry I am a bit new to DHTs, and found the explanations online a bit not clear.

推荐答案

我想我明白了.公用前缀相同存储桶的确确实与xor值直接相关,因此确实对其进行了排序.我发现这些幻灯片非常有用: http://heim.ifi.uio .no/michawe/teaching/p2p-ws08/p2p-5-6.pdf

I think I got it. The common prefix same bucket thing is indeed directly related to the xor values, so its indeed sorting them. I found those slides pretty helpful: http://heim.ifi.uio.no/michawe/teaching/p2p-ws08/p2p-5-6.pdf

这篇关于Kademlia路由表和距离度量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆