This can be a confusing algorithm, no doubt about it.

Why are there m+1 iterations? Because Lamport proved that his algorithm was correct after m+1 iterations. If there are m faulty processes and the algorithm were only to go through m iterations, it would be possible to have an incorrect result.

The proof of this is something you need to get from the original paper – this blog post is about implementation.

I only have one specific example in this article, it follow the heading “A More Complicated Example.” The examples before it could be for an instance in which the maximum number of faulty processes was 2 and the the total number of processes is 7, but I didn’t work that part out completely.

The example in “A More Complicated Example” is a very specific example of the message flow that occurs when n is 7 and m is 2.

- Mark

]]>and in your first example. you pick m=1 and you did 3 iterations ?

In the first round, the message from general to all soldiers. In second round each soldier sent 6 messages including himself . and then last round where you told that each will send 36 messages.

can you explain me why 3 iterations because it should have 2 iterations according to rule m+1 ?

thanks ]]>

The lack of examples for N > 4 and an apparent counter-example I came up with where I was able to reach agreement with N = 6 and F = 2 with a simple majority algorithm were leaving me perplexed as to why one would need 3F + 1 nodes to reach agreement.

This part, in particular: “a subversive source process with one collaborator can cause half the processes to choose to attack, while half the processes elect to retreat, leading to maximum confusion” was mind-opening. I had forgotten to test a faulty commander with N = 6 and M = 2 and considering that case I can indeed reach a non-agreement state using the simple majority algorithm. In fact, I can also reach such a non-agreement state with N = 7 (due to even N – 2, we can have half of the N – 2 saying 0 and the other half saying 1).

From what I figure, in order to being able to get a majority for that case, Lamport’s algorithm has the side-effect of not being able to obtain agreement in N = 6, M = 2 with non-faulty commander where the simple majority algorithm works.

Thank you once again for your detailed analysis and explanation :)

]]>The field is moving so quickly that research articles and wikis are probably more important than books at this point. The bitcoin protocol is built using well-known cryptographic primitives so the specific advance was more related to the distributed na…

]]>thanks for the opportunity to discuss the algorithm here. Your analysis help me a lot understanding what Lamport meant. What Swinn says, though, is in my opinion correct.

What we see in your tree as leaves in Figure 5 — OM(0) — are the messages sent already by everyone. So everyone is possesing these. Now Lamport says “let v_j be the value Lieutenant i received from Lieutenant j”, and then “Lieutenant i uses the value majority (v_1, … , v_{n-1} )”.

Thus, the messages {0, 132, 0}, {0, 142, 0}, {0, 152, 0}, {X, 162, X}, and {X,172, X} were sent by Lieutenant 2, which itself reveived it from Lieutenant 4, 5, 6, 7! So we need to apply the mayority function on this messages, to know, what node 2 will decide.

Really interesting =)

Hope to get an answer if I might be wrong.

Best regards

aureliano

>as far as I can tell from the original algorithm,

Good luck actually taking the original algorithm description and putting it into practice! I find it to be a bit elusive.

However, I do believe my implementation is faithful to the spirit and the letter of the original paper.

- Mark

]]>