Get my new weekly sketch in your inbox

Join over 30,000 people learning something new in a moment each Sunday.

The Two Generals Problem: Two Generals fighting for the same side, have set up their camps on the high ground either side of a castle to be attacked and use a messenger running between them to coordinate their attack. The problem is that the messenger has to run right past the hostile castle to relay the Generals' messages and confirmation of receipt of messages and there's no guarantee they'll make it past the castle unharmed.

The two generals problem

This is a fun thought-experiment highlighting the challenges of communicating over an unreliable channel — where your message may or may not get through, and where you won’t know if it has.

The situation is that two armies, either side of a hostile valley, are trying to coordinate an attack, and they want to attack at the same time to be sure to succeed. The trouble is, to coordinate they have to send brave messengers through the hostile valley to the other camp and the messengers may or may not be captured along the way.

To coordinate the attack you have to know that your message got through which you’d know if you received a confirmation. But how would the general sending the confirmation know that their confirmation got through unless they received a confirmation of the confirmation. And on…

Also see: Metcalfe’s Law, idempotence.


You’re welcome to use and share this image and text for non-commercial purposes with attribution. Go wild!
See licence

Buy Me A Coffee