"Distributed Consensus II" Byzantine general question----verbal agreement __ Distributed

Source: Internet
Author: User

The Byzantine general question was a consensus issue: first presented by Leslie Lamport and two others in 1982, known as the Byzantine generals problem or Byzantine failure. The core description is that the army may have traitors, but to ensure that the offense is consistent, from this extended to the field of computing, developed into a fault-tolerant theory. With the advent and rise of bitcoin, this famous question has come back to the public eye.

A brief informal description of the question of Byzantine generals is as follows:

The Byzantine Empire wanted to attack a formidable enemy and sent 10 troops to surround the enemy. This enemy is no more than the Byzantine Empire, but it is enough to withstand the simultaneous attacks of 5 conventional Byzantine armies. For some reason, these 10 armies cannot be assembled in a single point of breakthrough and must be attacked simultaneously under separate siege states. None of their armies would have any chance of attacking alone, unless at least 6 troops attacked at the same time to attack the enemy. They dispersed in the enemy's four weeks, relying on communications to communicate with each other to negotiate offensive intentions and attack time. The problem with these generals is that they are not sure if they have any traitors, and the traitor may change their offensive intent or time of attack without authorization. In this state, the Byzantine generals were able to find a distributed protocol that would allow them to negotiate remotely and win battles. This is the famous Byzantine general question.

It should be clear that the Byzantine general problem does not take into account whether the communication will be intercepted or unable to convey information, such as the message transmission channel is absolutely no problem. Lamport has shown that it is not possible to attempt to achieve consistency through message delivery on unreliable channels where messages may be lost. So, in the study of Byzantine generals, we have assumed that the channel is not a problem, and in this context, to do consistency and fault tolerance related research.


Byzantine fault-tolerant algorithm

We have understood the Byzantine general problem scene, and have clarified that the solution is based on the message that the Communicator can communicate correctly, that is, the channel is absolutely believable. Next, we will explore the essence of the Byzantine general question.

The Byzantine fault-tolerant algorithm is the solution to achieve consensus consensus in the case of synchronous networks, arbitrary failure models.

The essence of Byzantine general problem

In retrospect, a group of generals wanted to achieve a certain goal (a unanimous attack or a unanimous retreat), but it was impossible to act alone, to cooperate and to reach a consensus; because of the traitor's existence, the generals did not know how to achieve the same thing. Note that the "consistency" here is what the Byzantine general question is about, if the number of traitors had been too much to the point of the problem, this is the "rebellion" of the problem, and, at the same time, our goal is a loyal general to reach an agreement, for these loyal generals, offensive or retreat is OK, As long as they can agree.

But is it possible to solve the problem by "consistency" alone? Consider, if everything is all right, objectively, every loyal general will be able to win as long as he attacks, but they are "consistent" without offense because of the traitor's presence, whereas, on the contrary, the generals should not attack, but they are all "unanimous" in attacking because of the traitor's existence.

It can be found that only "consistency" is insufficient to solve the Byzantine general problem, we also need to propose a "correctness" requirement. This requirement is worth considering, because if there may be an "absolutely right" judgment in terms of objectivity, the judgment may be different for each general, how do we define "correct"? We may simply say that it is true that every loyal general is right to express himself, and that he does not use the message of a traitor that the other general is a traitor to a loyal general.

At this point, we have simplified the issue of the Byzantine general, all loyal generals can let other generals receive their true intentions, and finally act unanimously, and the formal requirement is "consistency" and "correctness."

If you spread the problem, it can be found that algorithms for consistency and correctness do not require that the command must be "attack/retreat" or "1/0", but can be "send message 1/Send message 2/standby" or "x/y/z/w", which means that the Byzantine general problem algorithm can provide inspiration for a variety of distributed systems, such as power systems or network systems.

This, in the final analysis, is a question of consistency and correctness, an algorithm that is directed at a loyal general, because a traitor can make any judgment beyond the agreement. We just have to find an anti-interference algorithm under the interference of a traitor. To solve the problem of the algorithm, we need to materialize the formal requirements.

Verbal Agreement Deduction

The screenshot below is captured from a paper published by Lamport:

The explanation for this algorithm is:

(1) in the first round the general will send the message to all the deputies, and the first aide receives the note as Vi. such as 1 (here is the attack)

(2) in the second round, Li (that is, the first aide) will suspect the general sent the News VI is right or wrong, so he will ask the rest of the aide. So he gets the value of the remaining Lieutenant (N-2). I from 1 to n-1, so each aide will get the rest of the n-2 lieutenant in the hands of VI. In this step, the loyal aide J will directly send his VJ to others. The traitor will send false news.

In n=7,m=2, if the generals are loyal, then in the second round the loyal adjutant could have been able to determine the decision to be made, as they would have received (1 1 1 0 0) plus the general sent 1 1, 1 1 1 0 But this algorithm is recursive all must go to the third round. And if the general is a traitor, then there is a case in the second round that cannot be decided.

The explanation for entering the third round here is that if L1 receives other L2~L6 's VJ, he has to question the accuracy, such as whether L1 would like L2 to send it to himself. Then go to the third round and vote.

(3) in the third round, then (2) after the question. L1 would ask l3,4,5,6 in turn, asking them what they had done in the last round of L2, and then L1 would get the value of L2->l3, L2->L4,L2->L5, l2->l6 in (2) and then combine their l2->l1 values, From the 5 inside, use the majority function to cast a decision to get the message value L2 sent to itself. L3,l4,l5,l6 the confirmation of the message sent to you in the second round in turn.

So L1 completed the second round of confirmation. Then L1 from the first step of the general sent to their own VI and the second round of the 5 values identified in the decision.

The rest of the l2,l3. Wait for the same steps.

If it's still not clear, look at the following process directly:


Here's what needs to be noted: Lamport's two conditions for fault tolerance

IC1: That is, all loyal lieutenants have to obey the same order, that is to agree;

IC2: If the general is loyal, then every loyal aide should act according to the general's meaning.

Here the general is a traitor, so as long as the IC1 conditions can be met.

Step1:c give L1~l6 a R a R a X (A,r represents attack and retreat, because C is a traitor, so you can send the L1-L5 message, here is just an example, can use other values, as long as the last meet the IC1 can)

Step2:l1 For example, L1 will suspect the general sent himself the news, so will ask L2-l6


L2 (R) L3 (A) L4 (R) L5 (A) L6 (X)
A (L1)
L2
R R R R A R
L3 A A A A R A
L4 R R R R A R
L5 A A A A R A
L6 R A R A
A A

STEP3: In fact in the third step L1 will confirm in turn in Step2, l2~l6 to send their own information. For example to confirm L2 will ask L3-l6, in Step2 L2 sent you what

Finally get R, R, R,x (because L6 at this time certainly and lie) and then combine their own R, L1 determine in STEP2 received L2 sent is R, and then confirmed L3-l6. You can draw on your own draft paper.

In fact, because L1-L5 are loyal, they will not lie in the Step2, so just vote L6 can, (a R a R a) is L6 to send L1-L5 information, the final vote is a, a change to the Step2 of L1-L5 received

The rest of the information in the information can not be changed.

Finally, the L1-L5 are 4 A, 2 R. Taking L1 as an example =r a R a A

That is, L1~L5 agreed.


Http://www.blockchainbrother.com/article/7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.