Here is what I've managed to find about significance of k-bucket value on Kademlia network behavior:
Based on Improving Community Management Performance with Two-Level Hierarchical DHT Overlays paper:
- Low k means more fragmented network
- High k means lower number of hops during lookup, but higher maintenance traffic
The value of k (referring to bucket size, a Kademlia-specific parameter) has a major impact for the operation of the Kademlia DHT. On the first hand, the value should not be set too low; otherwise the network could become fragmented, complicating or even preventing the routing of messages between some peers. On the second hand, the value should not be set too high or a significant amount of unnecessary load from maintenance traffic would be inflicted on the network.
What should be the exact amount (tested on networks with size 100 and 500):
The measurements indicated that k values of 1
and 2 were insufficient to prevent the fragmentation of the
network. The chosen k value of 3 was enough to achieve a
consistent network structure in both of the network sizes.
With the k value of 4 and larger, the nodes’ knowledge of
the network develops further, but at the cost of increased
maintenance traffic. Even though the average hop count
decreases, the larger routing table induces more KeepAlive
messaging.
The "maintanance traffic" is amount of KeepAlive messages being sent. KeepAlive messages are being sent to all devices in k-buckets to ensure that connections are alive. If we didn't send them, we could one day end up with no connections, unable to participate in network. Although in this paper, they are sending several such messages per minute, I'm not sure that that much is in real life necessary.
The other use-case of k-buckets was in paper linked in this question: Kademlia: A Peer-to-peer Information System Based on the XOR Metric. I ommitted it at first, as I thought it was an original Kademlia paper. Although authors here are the same, it turns out it's content is different and they are actually talking about significance of k-buckets:
- They promote being in network longer (the more stable node you are, the more significance in network you have)
- They prevent DoS attacks. Flooding network with new nodes won't be destructive, since old nodes will still take place in k-buckets
A second benefit of k-buckets is that they provide resistance to certain DoS attacks. One cannot flush nodes’ routing state by flooding the system with new nodes. Kademlia nodes will only insert the new nodes in the k-buckets when old nodes leave the system
So I guess it's the second factor when choosing k
value: higher k means your network is easier to hijack due to Sybil/Eclipse attack