Two Generals' Problem

Two Generals' Problem

In computing, the Two Generals' Problem is a thought experiment meant to illustrate the pitfalls and design challenges of attempting to coordinate an action by communicating over an unreliable link. It is related to the more general Byzantine Generals' Problem (though published long before that later generalization) and appears often in introductory classes about computer networking (particularly with regard to the Transmission Control Protocol), though it can also apply to other types of communication. It is also an important concept in epistemic logic, and the importance of common knowledge. Some authors refer to this as the Two Armies Problem or the Coordinated Attack Problem.[1][2]

Contents

Definition

Two armies, each led by a general, are preparing to attack a fortified city. The armies are encamped near the city, each on its own hill. A valley separates the two hills, and the only way for the two generals to communicate is by sending messengers through the valley. Unfortunately, the valley is occupied by the city's defenders and there's a chance that any given messenger sent through the valley will be captured. Note that while the two generals have agreed that they will attack, they haven't agreed upon a time for attack before taking up their positions on their respective hills.

Positions of the armies. Army A is split into two parts A1 and A2, army B is intact.

The two generals must have their armies attack the city at the same time in order to succeed. They must thus communicate with each other to decide on a time to attack and to agree to attack at that time, and each general must know that the other general knows that they have agreed to the attack plan. Because acknowledgement of message receipt can be lost as easily as the original message, a potentially infinite series of messages is required to come to consensus.

The thought experiment involves considering how they might go about coming to consensus. In its simplest form one general (referred to as the "first general" below) is known to be the leader, decides on the time of attack, and must communicate this time to the other general. The requirement that causes the "problem" is that both generals must attack at the agreed-upon time to succeed. Having a solitary general attack is considered a disastrous failure. The problem is to come up with algorithms that the generals can use, including sending messages and processing received messages, that can allow them to correctly conclude:

Yes, we will both attack at the agreed-upon time.

Note that it is quite simple for the generals to come to an agreement on the time to attack. One successful message with a successful acknowledgement suffices for that. The subtlety of the Two Generals' Problem is in the impossibility of designing algorithms for the generals to use to safely agree to the above statement.

Illustrating the problem

The first general may start by sending a message "Let us attack at 0900 on August 4." However, once dispatched, the first general has no idea whether or not the messenger got through. Any amount of uncertainty may lead the first general to hesitate to attack, since if the second general does not also attack at that time, the city's garrison will repel the advance, leading to the destruction of that attacking general's forces.

Knowing this, the second general may send a confirmation back to the first: "I received your message and will attack at 0900 on August 4." However, what if the confirmation messenger were captured? The second general, knowing that the first will hesitate without the confirmation, may himself hesitate.

A solution might seem to be to have the first general send a second confirmation: "I received your confirmation of the planned attack at 0900 on August 4." However, what if that messenger were captured? It quickly becomes evident that no matter how many rounds of confirmation are made, there is no way to guarantee the second requirement that both generals agree the message was delivered and that the enemy did not alter any of the messages.

Proof

For deterministic protocols with a fixed number of messages

Suppose there is any fixed-length sequence of messages, some successfully delivered and some not, that suffice to meet the requirement of shared certainty for both generals to attack. In that case there must be some minimal non-empty subset of the successfully delivered messages that suffices (at least one message with the time/plan must be delivered). Consider the last such message that was successfully delivered in such a minimal sequence. If that last message had not been successfully delivered then the requirement wouldn't have been met, and one general at least (presumably the receiver) would decide not to attack. From the viewpoint of the sender of that last message, however, the sequence of messages sent and delivered is exactly the same as it would have been, had that message been delivered. Therefore the general sending that last message will still decide to attack (since the protocol is deterministic). We've now constructed a circumstance where the purported protocol leads one general to attack and the other not to attack - contradicting the assumption that the protocol was a solution to the problem.

For nondeterministic and variable-length protocols

Such a protocol can be modeled as a labeled finite forest, where each node represents a run of the protocol up to a specified point. The roots are labeled with the possible starting messages, and the children of a node N are labeled with the possible next messages after N. Leaf nodes represent runs in which the protocol terminates after sending the message the node is labeled with. The empty forest represents the protocol that terminates before sending any message.

Let P be a protocol that solves the Two Generals' problem. Then, by a similar argument to the one used for fixed-length protocols above, P' must also solve the Two Generals' problem, where P' is obtained from P by removing all leaf nodes. Since P is finite, it follows that the protocol represented by the empty forest solves the Two Generals' problem. But clearly it does not, contradicting the existence of P.

Engineering approaches

A pragmatic approach to dealing with the Two Generals' Problem is to use schemes that accept the uncertainty of the communications channel and not attempt to eliminate it, but rather mitigate it to an acceptable degree. For example, the first general could send 100 messengers, anticipating that the probability of all being captured is low. With this approach the first general will attack no matter what, and the second general will attack if any message is received. Alternatively the first general could send a stream of messages and the second general could send acknowledgments to each, with each general feeling more comfortable with every message received. As seen in the proof, however, neither can be certain that the attack will be coordinated. There's no algorithm that they can use (e.g. attack if more than four messages are received) which will be certain to prevent one from attacking without the other. Also, the first general can send a marking on each message saying it is message 1, 2, 3 ... of n. This method will allow the second general to know how reliable the channel is and send an appropriate number of messages back to ensure a high probability of at least one message being received. If the channel can be made to be reliable, then one message will suffice and additional messages do not help. The last is as likely to get lost as the first.

History

The Two Generals' Problem and its impossibility proof was first published by E. A. Akkoyunlu, K. Ekanadham, and R. V. Huber in 1975 in "Some Constraints and Trade-offs in the Design of Network Communications",[3] where it is described starting on page 73 in the context of communication between two groups of gangsters.

This problem was given the name the Two Generals Paradox by Jim Gray[4] in 1978 in "Notes on Data Base Operating Systems"[5] starting on page 465. This reference is widely given as a source for the definition of the problem and the impossibility proof, though both were published previously as above.

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • History of Confederate States Army Generals — The General Officers of the Confederate States of America were the senior military leaders of the Confederate States Army (CSA), serving during the American Civil War between 1861 and 1865. They were often former officers from the United States… …   Wikipedia

  • Byzantine fault tolerance — is a sub field of error tolerance research inspired by the Byzantine Generals Problem, which is a generalized version of the Two Generals Problem.The object of Byzantine fault tolerance is to be able to defend against a Byzantine failure , in… …   Wikipedia

  • Common knowledge (logic) — For common knowledge in general, see Common knowledge. Common knowledge is a special kind of knowledge for a group of agents. There is common knowledge of p in a group of agents G when all the agents in G know p, they all know that they know p,… …   Wikipedia

  • Atomic commit — An atomic commit is an operation where a set of distinct changes is applied as a single operation. If the atomic commit succeeds, it means that all the changes have been applied. If there is a failure before the atomic commit can be completed,… …   Wikipedia

  • Shays' Rebellion — was an armed uprising in Central and Western Massachusetts from 1786 to 1787. The rebels, led by Daniel Shays and known as Shaysites (Regulators), were mostly poor farmers angered by crushing debt and taxes. Failure to repay such debts often… …   Wikipedia

  • ancient Greek civilization — ▪ historical region, Eurasia Introduction       the period following Mycenaean civilization, which ended in about 1200 BC, to the death of Alexander the Great, in 323 BC. It was a period of political, philosophical, artistic, and scientific… …   Universalium

  • Germany — /jerr meuh nee/, n. a republic in central Europe: after World War II divided into four zones, British, French, U.S., and Soviet, and in 1949 into East Germany and West Germany; East and West Germany were reunited in 1990. 84,068,216; 137,852 sq.… …   Universalium

  • France — /frans, frahns/; Fr. /frddahonns/, n. 1. Anatole /ann nann tawl /, (Jacques Anatole Thibault), 1844 1924, French novelist and essayist: Nobel prize 1921. 2. a republic in W Europe. 58,470,421; 212,736 sq. mi. (550,985 sq. km). Cap.: Paris. 3.… …   Universalium

  • Military Affairs — ▪ 2009 Introduction        Russia and Georgia fought a short, intense war in 2008, fueling global fears of a new Cold War. On August 7 Georgia launched an aerial bombardment and ground attacks against its breakaway province of South Ossetia.… …   Universalium

  • pre-Columbian civilizations — Introduction       the aboriginal American Indian (Mesoamerican Indian) cultures that evolved in Meso America (part of Mexico and Central America) and the Andean region (western South America) prior to Spanish exploration and conquest in the 16th …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”