0

I am building a Chord DHT in Go (however the language part isn't important).

And I am trying to figure out the response behavior between nodes. If I want to send a successor request message to Node C, but it has to go to Node A -> Node B first, then arriving at Node C. What is the best way for Node C to respond to the original Node.

I have come up with the distinct methods, but dont know which one is more idomatic for DHTs.

  1. When each node makes a request, it waits for the response on the original TCP connection, this makes it so the response takes the reverse path it originally took
  2. Make the request then forget about it, when Node C recieves the request it sends the response directly back to the original node, indicated by the sender (IPAddress) field in the request message.
  3. Send the response to the sender NodeID just as it were any other message, so it would be routed around the Chord ring.

I cant figure out which is the best method to use.

John-Alan
  • 171
  • 7

1 Answers1

0

The only reason you use routing in Chord, is to find resources. That's why you shouldn't just know the accessor and predecessor but also additional nodes in distances of 2^n. This way you can achieve a lookup performance of O(log N). You can read the Wikipedia article about Chord for details.

So you should attach to the message you are sending to Node C the source-node's address, so that C can respond directly. This will have a much better performance over all.

peter
  • 14,348
  • 9
  • 62
  • 96
  • Thanks, I do understand the need for the finger table. Is C replying directly the common idomatic method for DHTs. If I wanted to keep things pseudonomnous, would there be a large performance penalty if the message took the reverse path, ie each node waitied for the response on its open TCP connection (Method #1). – John-Alan Mar 16 '14 at 15:11
  • As far as I've learned it, direct replies are the way to go. If you look at deploying chord in a data center or any other local network you might argue that there isn't a high penalty for taking the same path back, but this changes drastically when cord is deployed over the internet across multiple data centers. – peter Mar 16 '14 at 16:35