最新的bittorrent DHT实施建议是什么? [英] What are the most recent bittorrent DHT implementation recommendations?

查看:136
本文介绍了最新的bittorrent DHT实施建议是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力实现另一个bittorrent客户端,目前正与DHT进行斗争.它是根据此规范 http://www.bittorrent.org/beps/bep_0005.html ,但开始调试它时,我注意到网络上其他节点的响应有所不同.

I'm working on implementing yet another bittorrent client and at this time struggling with DHT. It is implemented accordingly to this specification http://www.bittorrent.org/beps/bep_0005.html but starting debugging it I noticed that other nodes' responses on the network vary.

例如,应该使用find_node返回目标节点信息或8个最近的节点.大多数节点会回复最近的34个节点,通常只有34个节点中的1-3个能够成功回复随后的ping请求.

For example, find_node is supposed to return either target node info or 8 closest nodes. Most of the nodes reply with 34 closest nodes and usually only 1 - 3 nodes from those 34 successfully reply to the consequent ping request.

是否有另一个建议更好的实施文件?可能已经证明使用15分钟间隔将节点状态更改为可疑状态效率不高,我必须使用10或其他数字吗?在哪里可以找到最新的建议?

Is there another document with better implementation recommendation? May be it is already proved that using 15 minutes interval to change the nodes state to questionable is not efficient and I have to use 10 or other number? Where can I find the best up to date suggestions?

还有另一件事.诸如router.bittorrent.com之类的Bootstrap节点会回复最近的节点,通常"nodes" BDictionary属性缓冲区的长度不能被6整除(紧凑的节点信息:IP为4,端口为2).现在,我只是切断了最接近的可分割为6个长度的缓冲区,但是这很奇怪.有人知道为什么会发生这种情况吗?

There is another strange thing. Bootstrap nodes like router.bittorrent.com reply with even more closest nodes and usually the "nodes" BDictionary property buffer length is not divisible to 6 (compact node info: 4 for IP and 2 for port). For now, I simply cut off the buffer at the closest divisible to 6 length but all that is strange. Does anybody know why that might happen?

推荐答案

规范说(强调我的意思):

the spec says (emphasis mine):

当节点接收到find_node查询时,它应该以键"nodes"和包含[...]

When a node receives a find_node query, it should respond with a key "nodes" and value of a string containing the compact node info for [...]

进一步:

节点的联系信息被编码为 26字节字符串.也称为紧凑型节点信息" (按网络字节顺序排列),该20字节的节点ID具有紧凑的IP地址/端口信息,并连接到末尾.

Contact information for nodes is encoded as a 26-byte string. Also known as "Compact node info" the 20-byte Node ID in network byte order has the compact IP-address/port info concatenated to the end.


另外,您应该阅读原始的Kademlia论文,因为bittorrent BEP建立在其中描述的概念之上,并且省略了对这些概念的更深入的解释.


Additionally you should read the original Kademlia paper since the bittorrent BEP builds on the concepts described therein and omits deeper explanations of those concepts.

您现在可能还想阅读一些扩展,这些扩展或多或少实际上是大多数实现的事实上的标准 http://libtorrent.org/dht_extensions.html

You might also want to read for a few few extensions that are more or less de-facto standard for most implementations now http://libtorrent.org/dht_extensions.html

并阅读其他与DHT相关的 BEP ,其中一些已被广泛采用和修改/clarify BEP-5指定的行为,但通常以向后兼容的方式进行.

And read the other DHT-related BEPs, some are fairly widely adopted and modify/clarify BEP-5-specified behavior, but generally in a backward-compatible way.

例如,find_node应该返回目标节点信息或8个最近的节点

For example, find_node is supposed to return either target node info or 8 closest nodes

节点将返回可变数量的条目.可以大于8.或更少.

Nodes will return a variable amount of entries. Could be more than 8. Or fewer.

这篇关于最新的bittorrent DHT实施建议是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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