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

91 questions
29
votes
1 answer

How to get the first peer from a torrent-magnet link?

I've been trying to understand the torrent-magnet technology, but I can't seem to figure out how you get connected to the first peer when opening a magnet link. When you get a magnet link like below, it contains no initial peer - only the BitTorrent…
kba
  • 18,696
  • 5
  • 56
  • 84
20
votes
3 answers

Kademlia XOR metric properties purposes

In the Kademlia paper by Petar Maymounkov and David Mazières, it is said that the XOR distance is a valid non-Euclidian metric with limited explanations as to why each of the properties of a valid metric are necessary or interesting, namely: d(x,x)…
Erick
  • 285
  • 2
  • 7
11
votes
2 answers

Adding new nodes to Kademlia, building Kademlia routing tables

I can't quite wrap my brain around the joining process of Kademlia DHTs. I've seen a few tutorials and presentations online, but they all seem to say things the same way and all psedo code etc is the same in most (actual copy/paste). Can somebody…
JSON
  • 1,678
  • 17
  • 26
9
votes
2 answers

How to understand the Kademlia(KAD) protocol

Recently, I've read a document of the Kademlia Protocol, I tried to understand the protocol, but I still have some question: Why a node must find another node when he knows its ID but ip or port? Why he has the ID while he doesn't know the ip or…
rock_cloud
  • 113
  • 1
  • 6
9
votes
1 answer

Highly unbalanced Kademlia routing table

In the Kademlia paper, the last paragraph of section 2.4 states that in order to properly handle highly unbalanced trees... Kademlia nodes keep all valid contacts in a subtree of size at least k nodes, even if this requires splitting buckets in…
offbynull
  • 345
  • 3
  • 12
8
votes
1 answer

DHT: BitTorrent vs kademlia vs clones (python)

I'm in the middle of implementing my own dht for internal cluster. Since it will be used in file-sharing program like bittorrent, "Mainline DHT" was the first thing I was look at. After that I found "entangled" (python, dht using twisted matrix),…
Vadim Fint
  • 805
  • 7
  • 9
8
votes
1 answer

How Distributed Hash Table in IPFS and Bittorrent prevent abuse?

My understanding is that IPFS and Bittorrent Mainline DHT are built on top of a Distributed hash Table (Kademlia). They use the file hash as Kademlia key to find a list of peer that might have this file. 1- What I don't understand is if this is all…
skyde
  • 2,468
  • 3
  • 28
  • 47
7
votes
1 answer

Kademlia routing table and distance metric

Its been the first time I read about Kademlia today, and some points I don't think I got them right. The distance between nodes and keys is the xor of their values. So, if I have key x and node y, the distance between them is x xor y. But why what…
xander
  • 1,329
  • 2
  • 15
  • 24
6
votes
1 answer

Implementing find node on torrent kademlia routing table

I, already, reviewed a number of documents on this topic but there is something not exactly clear. For example bit torrent document (http://www.bittorrent.org/beps/bep_0005.html) states The routing table is subdivided into "buckets" that each…
alex.49.98
  • 549
  • 3
  • 11
5
votes
1 answer

How to realize efficient broadcast in the Kademlia p2p protocol?

I am currently researching about the Kademlia peer to peer protocol and I am curious if someone knows of techniques or approaches to efficiently broadcast an information/a message? There is a paper Effcient Broadcast in Structured P2P Networks,…
Erik
  • 11,034
  • 17
  • 75
  • 120
4
votes
2 answers

What exactly K-Bucket means in Kademlia DHT?

I want to confirm my understanding of buckets in Kademlia DHT. Kademlia has m k-buckets where m is the size of the network in bits and k is the number of key-value pairs stored per bucket. for example, let's say m=4 then we can have 2^4 nodes,…
Nawras
  • 141
  • 12
4
votes
1 answer

Better understanding Kademlia's XOR Integer Metric

I'm trying to better-grasp Kademlia's XOR distance metric so I've written a small dummy program to try and understand better. I'm also not using a 160-bit number as my key here, but rather a sha256 hash of some user identifier. Here's my xor…
aroooo
  • 3,778
  • 3
  • 32
  • 63
4
votes
1 answer

Is there a clearly documented consensus in plain English that describes Maymounkov and Mazieres Kademlia system?

I am struggling with the original paper trying to understand seemingly contradicting paragraphs. One example is where in 2.2 the authors declare that for bit space 160 there will be 160 k buckets, then later go on to say that in fact the buckets are…
Sentinel
  • 3,351
  • 27
  • 38
4
votes
2 answers

How to pull the torrent file from DHT?

I wrote a simple script that finds out example peer IPs for a given info_hash. I can't see this kind of information in BEP-0005: how do I actually pull the torrent file from the DHT?
d33tah
  • 8,728
  • 10
  • 51
  • 128
4
votes
1 answer

How does Kademlia/DHT get the node ID and update the peer leaving the swarm?

I've read the paper-Kademlia: A Peer-to-peer Information System Based on the XOR Metric. but i still have 2 questions. Q1:How does a node get its node id? BEP5 says: Each node has a globally unique identifier known as the "node ID." Node IDs are…
1
2 3 4 5 6 7