BTtorrent_Dht_Kad
2017-04-06 23:28:11 0 举报
BTtorrent_Dht_Kad是一种分布式哈希表(DHT)协议,它被广泛应用于P2P文件共享网络中。该协议通过将文件分割成小块并使用哈希函数将其映射到其他节点上,从而实现了高效的文件传输和共享。 在BTtorrent_Dht_Kad中,每个节点都有一个唯一的标识符,称为公钥。当一个节点想要下载某个文件时,它会向网络中的其他节点发送请求,并使用这些节点的公钥来构建一个DHT树。然后,该节点会根据DHT树中的信息找到存储有所需文件块的其他节点,并将这些文件块下载到本地。 总之,BTtorrent_Dht_Kad是一种高效、可靠的P2P文件共享协议,它能够实现快速的文件传输和共享。
作者其他创作
大纲/内容
KNodeBase
- cfa- table : KHashmirBase
+ ping()+ findNode()+ inPing()
KItem
+ t : time()+ k+ v
KBucket
+ l :list(KNodeBase)+ index : dict(num:KNodeBase)+ invalid : dict(num:KNodeBase)+ min : int+ max :int+ lastAccessed : time
+ touch+ getNodeWithInt(num) : return KNodeBase
Node
+ fails : int+ lastSeen : time+ invalid : bool+ id : string+ host : string+ port : string+ age : time
+ initWithDict(dict) :self
KStore
+ d : dict()+ q : list()
Torrent
- _dht : UTKhashmir
KTable
- node : KNodeBase- buckets : list
- _bucketIndexForInt(num)- _splitBucket(a)+ bucketForInt(num)+ findNodes()+ findCloseNodes()+ replaceStaleNode()+ insertNode()+ invalidateNode()
UTKhashmir
+ cur_token : sha+ last_token : sha+ tcache : Cache
+ addContact()+ getPeersAndAnnounce+ announcePeer()+ getPeers()+ get_token()expire_cached_tokens()
Rerequester
+ attribute1:type = defaultValue+ attribute2:type- attribute3:type
+ operation1(params):returnType- operation2(params)- operation3()
DHTRerequester
- dht : UTKhashmir
KHashmirBase
+ table : KTable+ host : string+ port : + ddir : string+ store : KStore+ pingcache : dict()+ socket+ udp+ last : time
- _loadRoutingTable(nodes)- _dumpRoutingTable()+ findNode(id)+ insertNode(n)+ checkOldNode+ findCloseNodes()+ SendPing()+ refreshTable()+ Node() : return KNodeBase
0 条评论
下一页
为你推荐
查看更多