compile with g++ (manually change the GCC flag in Makefiles (src and test) to g++ src/dht.c contains the code for dht include/dht.h contains the structure that is stored in the dht -- this has to be modified according to the value you need to store in DHT. === DHT LAYER == ----------------- a. The algorithm used by the DHT layer on top of chimera to maintain objects, a semi-centralized algorithm, works like this: a. each root node will periodically check if the members have changed, and if so, sends all the members in its new replicaset the values that it is the root of. b. each non-root node sends a DHT_REPORT_TO_ROOT message to to the random point that the objects was stored on -- effectively sending a message to the root, periodically. c. if a non-root node gets this report message, that means he is the new root. hence, it takes over the responsibility d. if a root node gets an update from a node not in its replicaset, that means this is some old guy and should be asked to get rid of his value. e. if a root doesn't get DHT_REPLICATION number of reports in one round of report message exchange, then that means its not the new root and may be there are more than one root for that particular key. So, this root node makes itself a non-root and sends a report message to the put point in the DHT. Note: replica-set in the above algorithm means, r nodes in the leafset that are numerically closest to the key of the node. Not r/2 left and r/2 right leafset nodes. b. One rule of thumb to be followed all the time: never ever claim a lock in the dht layer and then send out any application-level message; this might very well lead to a deadlock if the message comes back to you, especially under churn this is more likely so, all the dht code never does a send while holding a lock. instead, uses a temporary queue to build up out going messages and send them out after releasing the lock.