Homework 1 forum

Sending rumors one by one

 
Picture of Dorian Ros
Sending rumors one by one
by Dorian Ros - Tuesday, 13 October 2020, 13:47
 

Hi,

I had a question regarding the way we need to send missing rumors to a peer, especially what the "one by one" means.

Does the sender need to wait for the acknowledgement of a rumor before sending the next one and if so, if no acknowledgement comes, what is the procedure ?

Or does it simply mean sending N packets, N being the number of missing rumors, and assume that they were correctly received ?

Thanks in advance.

Cheers!

Picture of Clément Luc Irénée Blaudeau
Re: Sending rumors one by one
by Clément Luc Irénée Blaudeau - Tuesday, 13 October 2020, 14:22
 
On the same idea, can we bypass this problem by only sending the first missing packet, and relying on the status reply mechanism to deal with the other missing packets ?
For example, let's say A knows of (C,5) but B only knows (C,2). When receiving status from B, A could just send back the message 2 of C, which makes B know (C,3) and trigger a status send to A as an acknowledgement. The status sent to A will trigger the send of message 3 of C, and a status in return, and so on.
Is that correct or should we implement a specific behaviour for nodes catching up ? Combined with the resend timeouts mechanisms and random rumors it seems a bit of a mess.
Picture of Pasindu Nivanthaka Tennage
Re: Sending rumors one by one
by Pasindu Nivanthaka Tennage - Wednesday, 14 October 2020, 12:00
 

Hello

The messages are sent one by one; meaning that it does not wait for the status messages.

More clearly, assume A finds that B is missing messages 3, 4, and 5. In this case A will send them one by one in a loop (and before sending the second rumor, A does not wait for a status reply).

Hope this is clear now

Picture of Dorian Ros
Re: Sending rumors one by one
by Dorian Ros - Wednesday, 14 October 2020, 12:13
 

Perfectly clear. Thank you!

Picture of Clément Luc Irénée Blaudeau
Re: Sending rumors one by one
by Clément Luc Irénée Blaudeau - Wednesday, 14 October 2020, 12:16
 

But if A does so, B will receive messages 3 then 4 and then 5, which will trigger the send of status of B 3 times. For the first two times, B will still lack messages (4,5 and then only 5), which will make A send 4,5, then 5.

So A will send 3,4,5 then 4,5 then 5 right ?

If we want to prevent this behavior we would need to remember for each node if we are in a `synchronizing` process with it, and as we can be synchronizing with several nodes at a time, it makes things really complex ?

I may be missing something obvious, but to me, the more stateless nodes are, the easier it is to ensure correctness in all cases.

Thank you for your help !

Picture of Clément Luc Irénée Blaudeau
Re: Sending rumors one by one
by Clément Luc Irénée Blaudeau - Monday, 19 October 2020, 19:04
 

Can  someone help me there ? :)

Picture of Utku Görkem Ertürk
Re: Sending rumors one by one
by Utku Görkem Ertürk - Tuesday, 20 October 2020, 11:09
 

I am wondering the same thing.

Picture of Pasindu Nivanthaka Tennage
Re: Sending rumors one by one
by Pasindu Nivanthaka Tennage - Tuesday, 20 October 2020, 14:00
 

Hello,

I totally agree with your point, but I still continue my previous answer; node A will send rumors without waiting for the corresponding status messages.

I agree that this would cause a significant waste of messages depending on the timings, as you have pointed out. But for this homework, we have decided to continue with our original handout explanation.

Ultimately this is a question about efficiency / performance rather than correctness. So here we are expecting only the correctness (and I accept this is not very efficient)

Hope this helps

Picture of Clément Luc Irénée Blaudeau
Re: Sending rumors one by one
by Clément Luc Irénée Blaudeau - Tuesday, 20 October 2020, 14:32
 

Thank you for your answer. I'll implement it as so.

But just out of curiosity, what would be wrong in having the following behaviour:

When receiving a status from a peer B that lacks messages (say it lacks (A,4), (A,5) and (C,7)), send only one of the messages that the peer could accept (either (A,4) or (C,7), as B will not accept (A,5)). It will trigger B to send back a status message, which triggers the sending of another missing message, and so on until it gets all missing messages. That the way I implemented it before our discussion, and it seemed coherent with the handout phrasing : "which causes R to send the missing messages back ​ (one at a time);". The stateless part came from the fact that A and B only answer messages, they don't have to store the fact that they are in a synchronizing state. (But, as you pointed out, if we are okay we resending messages then it is also stateless)

Thanks !

Picture of Shufan Wang
Re: Sending rumors one by one
by Shufan Wang - Tuesday, 20 October 2020, 20:34
 
Hello,

I have implemented the logic of sending other known rumors in the way that the sender will send the next rumor after it receives the status acknowledgement packet for the former one (as mentioned before). It seems that this implementation also pass the tests, so I am wondering should I change the logic or it is also OK.

Thank you very much!
Picture of Pasindu Nivanthaka Tennage
Re: Sending rumors one by one
by Pasindu Nivanthaka Tennage - Friday, 23 October 2020, 15:40
 

Hello,

One at a time means that "a node does not compress multiple messages inside a single message", in the HW1 context.

What you say is logically correct and sound. My only concern is, if you deviate from my suggestion,  there is a chance that some tests will fail, because we implemented all the tests by assuming the behavior I mentioned. So I would suggest you to do in the way I proposed.


Regards