JoshuaKissoon / Kademlia

A Java implementation of Kademlia Routing Protocol and DHT
MIT License
193 stars 73 forks source link

Handle splitting of k-buckets #5

Closed JoshuaKissoon closed 10 years ago

JoshuaKissoon commented 10 years ago

As defined on page 59 of the paper - when u learns of a new contact, it attempts to insert the contact in the appropriate k-bucket. if that bucket is not full the new contact is simply inserted. Otherwise, if the k-bucket's range includes u's own node ID, then the bucket is split into 2 new buckets, the old contents divided between the two, and the insertion attempt is repeated.

Right now we have initially setup 160 K-Buckets, but this is not the way it should be done.

JoshuaKissoon commented 10 years ago

That method stated in the paper is an improvement to save some space; but the complexity of the code for that isn't worth it. It's better we keep things the way they currently are with 160 K-Buckets and keep the code simpler. The extra space used is at max 160 * size(Bucket Class) < 5KB