3

根据这个 DefCon 演讲Crawling BitTorrent DHTs for Fun,即使所有其他 Torrent 站点及其备份都被对手关闭,BitTorrent DHT 节点也可以在一夜之间从头开始构建一个 torrent 站点。

在 kademlia 中,peer 从 torrent 站点学习 infohash,为每个 torrent 索引磁力链接。对等点发出get_peers请求以获取当前正在下载和播种种子的对等点列表。节点 ID最接近 infohash的 dht 节点将元数据返回给查询节点。

无论如何,我需要 infohash 来查询同行。那么,如果一个人没有 infohash,如何在一夜之间建立一个 torrent 网站呢?我认为唯一可能的方法是详尽的密钥搜索。必须随机生成160-bitinfohash 并开始查询对等点,但这需要很长时间。

kademlia 中是否存在任何现有的远程过程调用get_infohash,例如或get_metadata允许 dht 节点查询相邻节点的 infohash,因为这是直接从 dht 节点学习 infohash 的唯一方法。

4

1 回答 1

2

它被称为DHT Infohash Indexing。该BitTorrent 增强提案BEP正在考虑标准化。此扩展使 DHT 节点能够检索其他节点当前存储在其存储中的信息哈希样本。

来自作者, BEP 51

通过被动观察get_peers查询,DHT 索引已经成为可能并在实践中完成。但这种方法效率低下,有利于拥有大量唯一 IP 地址的索引器。它还鼓励不良行为,例如欺骗节点 ID 和试图污染其他节点的路由表。

有了这个扩展,单个节点应该能够在几个小时内调查整个 DHT,而不必采取不合规的行为。

由于它不能直接用于搜索特定的种子,因此一般客户端不会真正使用此 RPC,他们只需要支持回复即可。相反,预期用途是网络中的一些专门索引器将其用作构建块来创建和管理可用种子的数据库,然后通过其他方式将其提供给最终用户,例如作为 Web 服务或通过种子源。

Message Format

Request:

{
    "a":
    {
        "id": <20 byte id of sending node (string)>,
        "target": <20 byte ID for nodes>,
    },
    "t": <transaction-id (string)>,
    "y": "q",
    "q": "sample_infohashes"
}

Response:

{
    "r":
    {
        "id": <20 byte id of sending node (string)>,
        "interval": <the subset refresh interval in seconds (integer)>,
        "nodes": <nodes close to 'target'>,
        "num": <number of infohashes in storage (integer)>,
        "samples": <subset of stored infohashes, N × 20 bytes (string)>
    },
    "t": <transaction-id (string)>,
    "y": "r"
}

像往常一样,其他字段可能由其他 BEP 定义。

于 2017-12-25T15:18:02.613 回答