Questions tagged [kademlia]

Kademlia is a distributed hash table for p2p networks

Kademila is a distributed hash table for p2p networks. Kademlia works by using node lookups to specify the structure of a network and facilitate information exchange. It was developed in 2002 and the algorithm has been ported to many languages.

Resources

The original Kademlia paper by Petar Maymounkov and David Mazières

106 questions
1
vote
1 answer

Is it possible to receive from one port and send through another in mainline dht?

I'm trying to implement mainline dht. While implementing I found it easier to use multithreading to handle requests and send requests at the same time. But it's impossible for a singular port to both send and receive at the same time. There's two…
raz
  • 29
  • 7
1
vote
1 answer

Bittorrent MDHT responses

What does the 'v' key value correspond to in Bittorrent Mainline DHT (MDHT) responses? Here's an example buncoded response: {'y': b'r', 'r': {'id': b'\x9d\x97\xb5\x8cJ\x8c#\xf4PF\xe3|\xf3\t\xbb#\xdaj\\\xdc'}, 't': b'7/', 'v': b'UT[\xf9'} I…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
1
vote
2 answers

Kadelmia routing table - is bidrectional routing necessary?

Say you have node u which contains node w in its routing table. Is it necessary for node u to be present in node w's routing table?
nz_21
  • 6,140
  • 7
  • 34
  • 80
1
vote
1 answer

Implementation of Kademlia node id

I m trying to implement a DHT using Kademlia paper as a way of understanding better how these systems work. I have read some other articles that referes to this way of implementing a distributed hash table but there is something I can't wrap my head…
SunPaz
  • 145
  • 7
1
vote
1 answer

Understnading of Kadelmia k-bucket split

I redesign our system (P2P application) that was built using "flat model" of k-buckets - each distance has its own k-backet. The distance is length of identifier minus length of shared prefix (XOR). Everything is clear here. Now we want to use…
bw_dev
  • 775
  • 1
  • 7
  • 17
1
vote
2 answers

Is hashinfo equivalent to peer ID in Mainline DHT?

I am working on Mainline DHT and I don't understand one nuance. Here: https://www.bittorrent.org/beps/bep_0005.html writes: "A "distance metric" is used to compare two node IDs or a node ID and an info hash for "closeness." Also writes: "Announce…
Latk12
  • 15
  • 2
1
vote
1 answer

What is the meaning of bucket height in the Kademlia paper?

It said: We start with some definitions. For a k-bucket covering the distance range 2i,2i+1 , define the index of the bucket to be i. Define the depth, h, of a node to be 160 − i, where i is the smallest index of a non-empty bucket. Define node…
Adrian Liu
  • 385
  • 3
  • 13
1
vote
1 answer

Kademlia XOR Distance as an Integer

In the Kademlia paper it mentions using the XOR of the NodeID interpreted as an integer. Let's pretend my NodeID1 is aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d and my NodeID2 is ab4d8d2a5f480a137067da17100271cd176607a1. What's the appropriate way to…
aroooo
  • 4,726
  • 8
  • 47
  • 81
1
vote
1 answer

DHT Routing Table - Why use Buckets and not a map?

Closest question to this I think. One obvious method of structuring a routing table is to simply maintain a literal table. Map(XOR,Node) Kademlia discusses the use of 'Buckets' which are organised by the most significant bit of the XOR. What is the…
Richard
  • 1,070
  • 9
  • 22
1
vote
1 answer

Understanding Kademlia find_node and adding nodes to the routing table

I'm reading through the Kademlia white paper and trying to implement the routing table piece. I'm using a 160bit address space and have an array of 160 k-buckets. From what I understand this implementation would store node ids in the buckets by how…
user3953989
  • 1,844
  • 3
  • 25
  • 56
1
vote
1 answer

How to represent Kademlia distance metric as integer

I'm new in P2P networking and currently I try to understand some basic things specified by Kademlia papers. The main thing that I cannot understand is Kademlia distance metric. All papers define the distance as XOR of two IDs. The ID size is 160…
bw_dev
  • 775
  • 1
  • 7
  • 17
1
vote
1 answer

Using BitTorrent's DHT to perform real-time keyword searches

I have an idea to implement a real-time keyword-based torrent search mechanism using the existing BitTorrent DHT, and I would like to know if it is feasible and realistic. We have a torrent, and we would like to be able to find it from a keyword…
1
vote
0 answers

Where, in the routing table, the peer information is stored?

I mean, node ID's on k-bucket's "have" the IP and port number How RPC get_peers query is answered? Where the peer information about a torrent infohash is stored? Where the metadata come from? I was reading about on…
Garren
  • 13
  • 4
1
vote
1 answer

How to decode Compact node info in java?

I decoded the nodes of find_node response from router.bittorrent.com to string, and sent a find_node request to the decoded "nodes" , but i never reviced find_node response from that "nodes", i doubt the way decode "node" is wrong, this is the…
wang ming
  • 199
  • 2
  • 9
1
vote
1 answer

Kademlia Implementation in Java

I want to setup a Kademlia network to connect peers and build a p2p network. I'm going to distribute processing power of nodes within the network. For network I found this Kademlia Java implemented Setup from git. …