CS6963 Distributed Systems

Intro Quiz

First, write your name and UnID on the paper. Then give a few sentences solving the following problem.

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.

Armies A1 and A2 need to communicate but their messengers may be captured by army B. While the two generals have agreed that they will attack, they haven't agreed upon a time for attack. It is required that the two generals have their armies attack the city at the same time in order to succeed, else the lone attacker army will die trying. 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.

Describe a protocol that solves this problem. That is, after the running the protocol, both generals must conclude: "Yes, we will both attack at the agreed-upon time," for a common time.