From b3138e3529496d02bc6dab91eb89e01c80ec63a1 Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Sat, 4 Jun 2022 16:22:01 +0200 Subject: [PATCH] NTP Cluster algorithm paragraph --- selected/time.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/selected/time.md b/selected/time.md index 3b24b22..b0e2b68 100644 --- a/selected/time.md +++ b/selected/time.md @@ -207,12 +207,22 @@ The estimates we get from the clock filters of each peer can be in contradiction The algorithm is based on the observation that for a non-faulty peer, the time offset error at the time of measurement is bounded by half the round-trip delay to the reference clock. This bound then increases with the age of the sample, due to the accumulated dispersion. -The true offset thus lies in the correctness interval $[\theta - \lambda_r, \theta + \lambda_r]$ ($\lambda_r$ being the accumulated distance to the root). Two peers whose correctness intervals do not intersect can not possibly agree on the time, and one of them must be wrong. The algorithm tries to find the maximum number of candidates whose correctness intervals share a common intersection, and discards the other candidates. +The true offset thus lies in the correctness interval $[\theta - \lambda_r, \theta + \lambda_r]$ ($\lambda_r$ being the accumulated distance to the root). Two peers whose correctness intervals do not intersect can not possibly agree on the time, and one of them must be wrong. The algorithm tries to find the biggest majority of candidates whose correctness intervals share a common intersection, and discards the other candidates. -Links: [Clock Select Algorithm](https://www.eecis.udel.edu/~mills/ntp/html/select.html), [RFC5905 - section 11](https://datatracker.ietf.org/doc/html/rfc5905#section-11.2.1), [Marzullo and Owicki, 1983](https://dl.acm.org/doi/pdf/10.1145/800221.806730) +Links: [Clock Select Algorithm](https://www.eecis.udel.edu/~mills/ntp/html/select.html), [RFC5905 - section 11.2.1](https://datatracker.ietf.org/doc/html/rfc5905#section-11.2.1), [Marzullo and Owicki, 1983](https://dl.acm.org/doi/pdf/10.1145/800221.806730) ### Cluster Algorithm +Once falsetickers have been eliminated, truechimers are placed in a survivor list, that is pruned by the cluster algorithm in a series of rounds. + +For each candidate, it compute the selection jitter, which is the root mean square of offset differences between this candidate and all other peers. Candidates are ranked by their selection jitter and the candidate with the greatest one is pruned from the survivor list. + +The cluster algorithm continues until a specified minimum of survivors remain, or until the maximum selection jitter is less than the minimum peer jitter (in which case removing the outlier wouldn't improve the accuracy of the selection). + +To get some grasp of _why_ it is designed that way, imagine all samples are coming from the same "idealized" peer, and that we select one "most likely accurate" sample. Then as we already saw in the clock filter algorithm, we can compute the jitter of that idealized peer. The selection jitter is essentially a measure of the jitter implied by the decision to consider that sample the most accurate. Now to understand the termination condition, remember that each sample is produced by a peer that itself exhibits some jitter. There is no point in trying to get a better jitter from the combination of all samples, than the minimum peer jitter. + +Links: [Cluster Algorithm](https://www.eecis.udel.edu/~mills/ntp/html/cluster.html), [RFC5905 - section 11.2.2](https://datatracker.ietf.org/doc/html/rfc5905#section-11.2.2) + ### Clock Discipline ### Clock Adjust