Introduction Kad

From EMule Wiki
(Difference between revisions)
Jump to: navigation, search
Line 17: Line 17:
 
== bootstrap ==
 
== bootstrap ==
 
You need to know first some clients to get into the network. This can be down by downloading a nodes.dat files or (simpler) starting a download via the servers and then boostrap kad with the clients found there.
 
You need to know first some clients to get into the network. This can be down by downloading a nodes.dat files or (simpler) starting a download via the servers and then boostrap kad with the clients found there.
 +
 +
THe kad id is stored in preferencesKad.dat on first kad startup.
  
 
== search ==
 
== search ==
Line 26: Line 28:
 
{{stub}}
 
{{stub}}
 
All lookups and searches are done form the local client. No searches are ofloaded to other clients.
 
All lookups and searches are done form the local client. No searches are ofloaded to other clients.
 +
 +
 +
All lookups are key/value lookup.
 +
-Sources (key=hash of file, value = location of source... KeyID, SourceID, then the data. Sources use IP&PORT.. )
 +
-Namesearch (key=hash of first keywokrd, value = full filename)
 +
 +
 +
 +
You get a contact. You take his ID and XOR it with your ID. This creates a 128 bit "distance".. Lets assume that the tree is level 0 with 10 contacts (Bin is full) and we add this new contact. We then split this level 0 tree with 1 bin into a level 1 tree with two bins. All the contacts that started with a "1" goes the the left bin and all the contacts with a "0" goes the the right bin.. Lets say the left bin fills up and needs to split.. We now have a skewed level 2 tree with 3 bins. All the contacts with the second bit set to "1" goes to the left bin and the ones with "0" go to the right bin. Therefore, the left most contacts in the tree are farthest from you and the right most contacts are closest to you.. The right side of the tree will fill up a lot faster because these people are more aware of your presence..
 +
 +
 +
 +
  
  
Line 31: Line 46:
  
 
*[http://en.wikipedia.org/wiki/Distributed_hash_table Distributed hash table]
 
*[http://en.wikipedia.org/wiki/Distributed_hash_table Distributed hash table]
*[http://www.cs.rice.edu/Conferences/IPTPS02/109.pdf] Kademlia: A Peer-to-peer Information System (pdf)
+
*[http://www.cs.rice.edu/Conferences/IPTPS02/109.pdf  Kademlia: A Peer-to-peer Information System (pdf) based on the XOR Metric]
Based on the XOR Metric
+
*[http://forum.emule-project.net/index.php?showtopic=30537] Kad forum topic
  
  
 
[[category:Howto]]
 
[[category:Howto]]

Revision as of 10:05, 11 May 2007

The Kad network, short for kademilia is a a peer-to-peer network which implements the Kademlia P2P overlay protocol. The majority of users on the Kad Network are also connected to servers on the eDonkey network, and Kad Network clients typically query known nodes on the eDonkey network in order to find an initial node on the Kad network.

Contents

Overview

The kad network uses UDP to

  • find sources for ed2k hashes,
  • search for ed2k hashes based on keywords in the file name
  • find comments and ratings on files (hashes)
  • provide buddy services for firewalled (low ID) nodes.
  • store locations, comments and (keywords out of) filenames.

Note that kad is not used to actually transfer the file in the ed2l network.

Kad gui

There is a KAd screen in the officiel client. This is mainly used for debug purposes. All al user should see is that the peers turn from yellow (unknown) to green (4 succes connects). If all peers in kad go red(ish) something is likely worng with the udp communication

bootstrap

You need to know first some clients to get into the network. This can be down by downloading a nodes.dat files or (simpler) starting a download via the servers and then boostrap kad with the clients found there.

THe kad id is stored in preferencesKad.dat on first kad startup.

search

Kad uses the hash of the first word you look for as key where to look in the kad network. SO in general is is better to look for "Moviename the" than "the Moviename".

internal working

All lookups and searches are done form the local client. No searches are ofloaded to other clients.


All lookups are key/value lookup. -Sources (key=hash of file, value = location of source... KeyID, SourceID, then the data. Sources use IP&PORT.. ) -Namesearch (key=hash of first keywokrd, value = full filename)


You get a contact. You take his ID and XOR it with your ID. This creates a 128 bit "distance".. Lets assume that the tree is level 0 with 10 contacts (Bin is full) and we add this new contact. We then split this level 0 tree with 1 bin into a level 1 tree with two bins. All the contacts that started with a "1" goes the the left bin and all the contacts with a "0" goes the the right bin.. Lets say the left bin fills up and needs to split.. We now have a skewed level 2 tree with 3 bins. All the contacts with the second bit set to "1" goes to the left bin and the ones with "0" go to the right bin. Therefore, the left most contacts in the tree are farthest from you and the right most contacts are closest to you.. The right side of the tree will fill up a lot faster because these people are more aware of your presence..




external links

Personal tools