Generic Kademlia protocol implementation.