# [ntp:questions] NTP vs chrony comparison (Was: oscillations in ntp clock synchronization)

Richard B. Gilbert rgilbert88 at comcast.net
Fri Jan 25 01:30:48 UTC 2008

```Unruh wrote:
> "David L. Mills" <mills at udel.edu> writes:
>
>
>>Unruh,
>
>
>>The NTP discipline is basically a type-II feedback control system. Your
>>training should recall exactly how such a loop works and how it responds
>>to a 50-ms step. Eleven seconds after NTP comes up the mitigation
>>algorithms present that transient to the loop and what happens
>>afterwards conforms to the equations of control theory. Discussion about
>>what happens at any time after that is a matter of mathematics and ntpd
>>does conform to the mathematics as confirmed by observation and simulation.
>
>
> Of course it conforms the equations of control theory. That is NOT the
> issue. You need to measure the offset and the drift rate and compensate for
> them. That is the issue. The question here is now to do that. You use the
> immediate offset value to control a feedback loop with a very long time
> constant. The question is whether or not using the past 10 or 20, or even
> adaptively changing how many of the past values to use in making those
> estimates of the drift and of correcting the offset.
>
>
>
>>If you have problems with the loop time constant, tough. It was chosen
>>as a compromise for LANs and WANs. You are invited to justify a
>>different time constant, but it has to work an a bumpy road to Malaysia.
>
>
> I certainly have trouble with the time constant. It is long. I means that
> ntp responds very slowly to changes. I understand why it was chosen. But it
> is also true that building the system for a bumpy road to Malaysia requires
> a different car than on the streets of New York.
>
> Anyway, the question is not whether or not the design of ntp is reasonable,
> it is. The question is whether or not it is "best". On the streets of
> Vancouver, it is definitely not "best".

<snip>

You are certainly at liberty to write your own version that does it your
way.  The startup performance of ntpd seems a little clumsy to me and I
think that I could do it better by hand if I had knobs to tweak.  OTOH I
see it in ONE setting on ONE network and ntpd really has to work on the
streets of New York, Vancouver, and "Podunk".

I use a GPS timing receiver as a reference clock and what I see when
ntpd starts up is that it makes a "mad dash" for zero offset, overshoots
and then "rings" for a while.  It gets where it's going eventually and I
normally run the machine 24x7 except during power outrages that last
longer than my UPS battery so it's not a big issue for me.

If I had the knobs to control it I would "tap the brakes" gently as it
approached zero offset with the objective of reaching zero offset and
the correct frequency simultaneously.  But I don't have the math I'd
need to tamper with the code intelligently nor do I have the experience
to make it work under all the conditions likely to be encountered.

Dave and his crew DO have that knowledge and experience and I'm glad
that they are willing to share it with us.

```