DHT路由表-为什么要使用存储桶而不是映射? [英] DHT Routing Table - Why use Buckets and not a map?

查看:224
本文介绍了DHT路由表-为什么要使用存储桶而不是映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为最接近的问题。

构造路由表的一种显而易见的方法是简单地维护
a文字表。 Map(XOR,Node)

One obvious method of structuring a routing table is to simply maintain a literal table. Map(XOR,Node)

Kademlia讨论了 Bucket的用法,这些桶由XOR的最高有效位组织。 存储桶的实际用途是什么?
当我们只需将实际 XOR用作地图中的键时,为什么会搞混最长前缀?

Kademlia discusses the use of 'Buckets' which are organised by the most significant bit of the XOR. What is the actual purpose of 'buckets'? Why mess around with 'longest prefix' when we can simply hold the 'actual' XOR as a key in a map?

显然,地图可能会大2 ^ 160,但是我们可以使用一些试探法来限制地图的大小,而不是实施一些任意的存储桶概念?
在任何情况下(无论是否有存储桶),在搜索接近我们被要求查找的nodeId的节点ID时,我们仍然必须遍历表中的所有节点并对每个节点进行XOR?

Obviously the map could potentially be 2^160 large, but we could use some heuristics to limit the size of the map, rather than implementing some arbitrary bucket concept? In any case (buckets or not) when searching for a nodeId close to the one we've been asked to find, we still have to iterate through all nodes in the table and do an XOR on each?

我想念什么?

推荐答案


一个构造路由表的一种明显方法是简单地维护文字表。 Map(XOR,Node)

One obvious method of structuring a routing table is to simply maintain a literal table. Map(XOR,Node)

我读到的键是 xor xor 是什么? xor 有两个参数:

I read the key is xor but the xor of what? xor takes two argument:

distance = xor(hash, peerid)




存储桶的实际用途是什么?

What is the actual purpose of 'buckets'?

k-bukcets允许加快以下python代码的速度:

k-bukcets allow to speed the following python code:

nsmallest(k, peers, key=functools.partial(operator.xor, hash))

这是找到与给定哈希最接近的对等点。

That is find the closest peers to a given hash.


为什么我们可以在最长前缀周围乱七八糟只需将实际 XOR用作地图中的键?

Why mess around with 'longest prefix' when we can simply hold the 'actual' XOR as a key in a map?

就像我说的,上面您不能存储xor的xor值每个可能的哈希值。

Like I said, above you can not store the xor value of every possible hash.


当搜索接近我们被要求查找的nodeId时,我们仍然必须遍历所有

when searching for a nodeId close to the one we've been asked to find, we still have to iterate through all nodes in the table and do an XOR on each?

带有k-bucket的东西不需要遍历整个地图找到最接近的对等体,因为对等体又名散列。 peerid 是按前缀组织的,并且您知道最近的对等方与给定的哈希共享相同的前缀。

That the thing with k-buckets you don't need to iterate over the whole map to find the closest peers, because peers hash aka. peerid are organized by prefix and you know that the nearest peers share the same prefix as the given hash.


为什么要使用存储桶而不是地图?

Why use Buckets and not a map?

您可以改用地图的k-bucket。

You can use a map instead of k-bucket.

这篇关于DHT路由表-为什么要使用存储桶而不是映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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