Repository navigation
DHT Simulation
Testing distributed systems, and DHT in particular, can be tricky. It may be difficult to analyze and do micro-benchmarking on systems with no single point of control, and sometimes that are not even deployed. You may also want to perform testing on new implemented ideas and algorithm without affecting the stability of your deployed distributed application.
KadOH allows you to deploy a DHT from scratch on your own system.

Starting a DHT simulation will iteratively launch KadOH Bots. A Bot is just node.js KadOH instance which perform random activity on the network. You can even write you own Bot to custom their behavior.
Behind the scene, Bots are iteratively launched following a Poisson Process to incrementally populate the DHT. They are contained in Pool processes that duplicate themselves. Each Pool is a Unix node.js process which contains a fixed maximum number of Bot instances.
A DHT can report and log all its activity on a central logging server. This will allow you to see what is really happening in your DHT. See our page on our Cube logging system and tools.
To run a DHT, just use the bin/dht tool :
./bin/dht udp.config.jsonYou can also overwrite predefined configuration like this :
./bin/dht --config=udp.config.json --size=1000 --activity=0 --starter=false
See below for more information on the options you can specify.
You can write your own configuration file to launch the DHT you want. These files are contained in the bin/config directory.
Here is an example of configuration for a DHT (be aware that JSON files doesn't allow comments):
For a XMPP DHT:
{
// transport type: xmpp or udp
"botType" : "xmpp",
// total size of the DHT
"size" : 100,
// size of each pool
"poolSize" : 30,
// how many peers per seconds are launched
"speed" : 1,
// activity per minutes per bots
// no activity when set to false or 0
"activity" : 50,
// number of values published by the bots on the DHT
"values" : 100,
// when of type xmpp, you have to give the jid and passwords to launch multiple bots
// here for instance the jids "kadoh0@jabber.org" .. "kadoh99@jabber.org"
// with the password "azerty" will be used to connect the bots
// if you remove the `%d', all bots will have the same address but will connect with different resources
"jids" : ["kadoh%d@jabber.org", "azerty"],
// set to true if you want that this DHT launch the bootstraps processes
"starter" : true,
// set to true if you want to log the activity of your DHT on a central logging server
"reporter" : true,
// specify the bootstraps that will be launched (if starter) and used
"bootstraps" : [
["kadohbootstrap0@jabber.org", "kadoh", "azerty"],
["kadohbootstrap1@jabber.org", "kadoh", "azerty"],
["kadohbootstrap2@jabber.org", "kadoh", "azerty"]
]
}For a UDP DHT:
{
"botType" : "udp",
"poolSize" : 50,
"speed" : 3,
"size" : 100,
"activity" : 50,
"values" : 100,
// starting port value of the bots
// this number will be incremented for each bots
// here the attributed ports are in the range [9000, 9050]
"port" : 9000,
"starter" : true,
"reporter" : false,
"bootstraps" : [
"127.0.0.1:3000",
"127.0.0.1:3001",
"127.0.0.1:3002"
]
}