- A DHT can be viewed as a dictionary service distributed over a network: it provides access to a common shared key->value data-store, distributed over participating nodes with great performance and scalability.
- From a user perspective, a DHT essentially provides a map interface, with two main operations:
put(key, value)
andget(key)
. Get will retrieve values stored at a certain key while put (often called announce) will store a value on the network. Note that many values can be stored under the same key. - There are many algorithms to implement DHT. For this project, you are required to implement at least Chord protocol. You are also required to implement an application of DHT or implement another protocol. Finally, you should write a report for about one page.
More info in Wiki: DHT.
- Use Go to implement a Chord DHT with basic functions.
- Use this DHT to implement an easy application, or implement another protocol.
- Learn GoLang.
- Implement Chord protocol.
- Implement an application of DHT or implement another protocol.
GitHub repository for test: DHT-2021
- 70% for the Chord Test (60 + 10).
- 60% + 10%: 60% for basic test and 10% for advance test.
- Basic test: naive test without "force quit".
- Advance test: "Force quit" will be tested. There will be some more complex tests.
- 20% for the application/second protocol.
- 10% for a short report and code review.
Unluckily, DHT tests cannot run successfully under Windows. So if you want to run tests by yourself, it is recommended to run tests under a Linux virtual machine, or employ a remote server.
If you want to debug tests by yourself, you can still use GoLand under virtual machine, or use Delve (a GoLang debugger) + GoLand if you employed a remote server.
Contact TA if you find any bug in the test program, or if you have some test ideas, or if you think the tests are too hard and you want TA to make it easier.
The current test procedure is:
- There are 5 rounds of test in total.
- In each round,
- 20 nodes join the network. Then sleep for 10 seconds.
- Put 150 key-value pairs, query for 120 pairs, and then delete 75 pairs. There is no sleep time between contiguous two operations.
- 10 nodes quit from the network. Then sleep for 10 seconds.
- (The same as 2.) Put 150 key-value pairs, query for 120 pairs, and then delete 75 pairs. There is no sleep time between contiguous two operations.
The advance test consists of "Force-Quit Test" and "Quit & Stabilize Test".
The current test procedure is:
- In the beginning, 50 nodes join the network.
- Then put 500 key-value pairs.
- It follows by 9 rounds of force quit. In each round,
- 5 nodes force-quit from the network. There is 500ms of sleep time between each force-quit operation.
- Query for all key-value pairs.
The current test procedure is:
- In the beginning, 50 nodes join the network.
- Then put 500 key-value pairs.
- Next, every node will quit from the network:
- One node quits.
- After the node quitting from the network, there is 80ms of sleep time. And then 20 key-value pairs will be queried for.
- Clone this repository using
git clone https://github.com/xmhuangzhen/DHT-2021.git
. - Set the environment variables
GOROOT
andGOPATH
correctly. - Under
GOPATH
, rungo get -u -v github.com/fatih/color
in shell to install the color package. - Replace
$GOPATH/src/main/userdef.go
with your ownuserdef.go
. Do not modify$GOPATH/src/main/interface.go
. - Copy your Chord package(s) into
$GOPATH/src
directory. - Under
GOPATH
, rungo build main
to generate the executablemain
. Then use./main -test basic
or./main -test advance
or./main -test all
to run the corresponding test. (Or you can usego run main -test [testName]
to run tests directly without generating the executablemain
.) (Or you can use GoLand to run the tests.)
Please refer to this guide.
- Learn Go A tour of Go Go package docs Books about Go
- DHT models Chord Pastry Kademlia
- Related project framework Dixie CMU MIT