So guys, going forward, the following slide shows that whenever any node of a ring topology receives
a message which is specified on the left hand side, then what is the action that particular node is
supposed to take?
For example, if some particular node of the ring topology receives a message put forward from the previous
node of the ring topology, then a node is supposed to perform action as per the following algorithm.
Now this algorithm is very much self-explanatory.
We have already discussed the functionality of put request in detail.
Now, whenever a node receives put forward message, the node computes the hash function on the key
and matches the value returned by the hash function with its node number.
If the value matches, then the node also checks whether the node was the originator of the put request
or it may happen that the user might have issued the put request on the node itself.
In that case, a node has to simply save the value of K in its local hash table.
However, if the node was not the originator but the hash function matches with the node ID, then in
that particular case a node has to send what ex message to the originator?
And this message has to be sent over TCP connection.
And if the value of the hash function do not matches with the current node ID, then the node simply
forwards the put forward message to its successor node in the ring topology over UDP connection.
So you can always come back and refer to this table whenever it is not clear to you that what logic
you need to implement when a node is supposed to receive a particular message type.
So just go through this table and understand how you will going to implement a logic for particular
type of message received by your node.