A cryptographic desk clock: agreement protocols
This post is part of a series:
- Part I: protocol for a cryptographic desk clock
- Part II: time reference
- Part III: agreement protocols (this page)
- … sometime in the future … client implementation
Say you have three imperfect clock measurements. They do not tell exactly the same time. Maybe they are drifting apart or, to make things worse, maybe one is totally broken. Here we look at this basic problem: given several clock measurements, how do you establish the time? We’ll go through three fundamental works on fault-tolerant agreement protocols.
Agreement #
Establishing a notion of agreement on discrete variables is easy. For example, we can vote to decide where a group should go for dinner (a quorum-based technique). Or we can say we trust a message when at least a certain threshold of parties trust it (and say so with cryptographic signatures). This works nicely. We can build very robust systems with this approach, à la triple modular redundancy. Commercial planes autonomously land hundreds of people safely thanks to this.
Establishing agreement on continuous variables is a bit harder. After all, what are outliers? Five-sigma deviation from the mean? Why not $42 \sigma$? And how do you take into account the measurement confidence? Or the sensor accuracy?
Never go to sea with two chronometers; take one or three.
Marzullo 1983 #
Keith Marzullo proposed a synchronization algorithm based on interval intersection. Marzullo’s algorithm provides accurate time synchronization, but does not really deal with faulty clocks. This is the basic idea:
NTP uses Marzullo’s algorithm as inspiration.
Lamport 1987 #
In 1987, Leslie Lamport wrote the absolutely delightful Synchronizing Time Servers.
Its main advantage is that it can simultaneously deal with faulty clocks
and give similar times to nodes that are relatively close:

Lamport noticed there was something off with Marzullo’s approach. He explains with astonishing clarity that two nodes that receive slightly different views of the same clocks may end up with very different results. This picture shows it:
In the context of distributed systems, this is important. You’d expect “close” nodes to have a “similar” view of the time. Technically, the problem is that Marzullo’s agreement function is not “Lipschitz continuous”.
Lamport’s solution is essentially to throw away the outliers and average the midpoints. In precise terms:
Drawback: Lamport could not give an “optimal” solution for this. (Lamport’s honesty about this is telling, and rarely seen in other authors.)
Schmid and Schossmaier 1999 #
Fast forward 12 years: Schmid and Schossmaier resolved Lamport’s concern in their paper How to Reconcile Fault-Tolerant Interval Intersection with the Lipschitz Condition.
They define a very simple agreement function that is Lipschitz continuous, and that takes into account all available information:
This is a comparison of the Schmid-Schossmaier and Lamport functions, showing Lipschitz continuity in action: