I am trying to figure an agreement protocol on an unreliable channel. Basically two parties (A and B) have to agree to do something, so it's the two generals' problem.
Since there is no bullet-proof solution, I am trying to do this.
- A continuously sends a message with sequence 1
- When B receives seq 1 it continuously replies with sequence 2
- At this point A receives seq 2 so it starts sending seq 3
My question. When can the two parties conclude that they can take the action ? Obviously I can't set a condition: "do it after receiving 10 messages" since the last sender won't have any certainty that message 10 arrived - back to square one.
How about another idea:
- Keep communicating like this for a predefined amount of time. At the end of that period both parties have an idea about the reliability of the channel. Would that be acceptable ?
I initially posted this in StackOverflow but someone suggested security might be a better place.