[ntp:hackers] unprivileged ntpd prototype

Danny Mayer mayer at ntp.org
Tue Nov 3 04:56:34 UTC 2009


Dave Hart wrote:
> http://davehart.net/moo/ntp-4.2.5p239-RC-unpriv.tar.gz
> 
> That's a snapshot from my ntp-dev-unpriv repo today.  I worked out the
> last kinks in synthesizing a system clock for ntpd to use when not
> modifying the real OS clock, and so far it's looking pretty
> encouraging.  I'm running it on 4 machines peering with each other
> over port 1234, each also clients of the same set of normal port 123
> servers on the LAN.  One of the four machines has the "real" ntpd
> stopped and the kernel frequency reset to 0 to give a more realistic
> thrashing to the synthetic clock.
> 
> To run on a non-default port, either include "interface port 1234" or
> similar in ntp,conf or use --port 1234 on the ntpd command line.

Is this supposed to mean use on an outgoing port 1234?

  To
> use the synthetic clock, use ntpd --no-adjust-clock.  You may want to
> use -l ntp.log or similar as well.  To refer to a server or peer in
> ntp.conf using a non-default port:
> 
> server 1.2.3.4 port 1234

Are you saying that this server 1.2.3.4 is listening on port 1234 or did
you mean to send it from port 1234. If the latter the syntax is totally
misleading. If the former then it's a protocol violation.

> 
> ntpdc is unchanged.  ntpq understands address:port for the server in
> this branch:
> 
> ntpq -crv -p localhost:1234
> 
> There are two additional variables displayed by "rv" with --no-adjust-clock:
> 
> hart at psp-fb2> ./ntpq -crv localhost:1234
> associd=0 status=0615 leap_none, sync_ntp, 1 event, clock_sync,
> version="ntpd 4.2.5p239-RC at 1.2091-o Sun Nov  1 15:44:08 UTC 2009 (2)",
> processor="i386", system="FreeBSD/6.4-STABLE", leap=00, stratum=3,
> precision=-19, rootdelay=1.778, rootdisp=48.114, refid=149.20.54.85,
> reftime=ce985653.35721a61  Sun, Nov  1 2009 18:47:47.208,
> clock=ce98578a.a8d80e7d  Sun, Nov  1 2009 18:52:58.659, peer=22751,
> tc=7, mintc=3, offset=0.790, frequency=80.279, sys_jitter=1.029,
> clk_jitter=0.670, clk_wander=0.017, synth_phase=814.523,
> synth_freq=80.226
> hart at psp-fb2>
> 
> synth_phase is the time offset between the OS clock and the synthetic
> clock at the last frequency adjustment, usually every other second.
> synth_freq is the frequency offset between the system clock and the
> synthetic clock being applied at the moment.  This is a much more
> volatile number than frequency= as it includes frequency trimming to
> eliminate time offset.  The sample output above is from the machine
> with no ntpd controlling the OS clock, and the kernel frequency reset
> to 0.  The 80PPM frequency matches what the "normal" ntpd measures
> when it is running to within a PPM.  The synth_phase number climbs by
> a handful of seconds per day consistent with 80PPM.
> 
> A side benefit of playing around with this code is you will be testing
> something close to the latest RC of ntp-dev.  A caveat:  This code is
> unlikely to be integrated until after 4.2.6 is released.
> 
> I would like to provide  a mechanism for the ntpd controlling the
> system clock to notify any other ntpd running with --no-adjust-clock
> when the OS clock has been stepped.  On Windows, a named event will
> likely fit the bill.  Any suggestions for a cheap, simple way on unix?
>  This would allow the --no-adjust-clock ntpds to avoid a frequency
> spike correcting the step.  I also believe it will prove handy to be
> able to use more than one local port, e.g. both 123 and 1234, to enjoy
> more configuration flexibility when operating some ntpd on an
> alternate port.
> 
> There are interesting possibilities opened up for testing several
> configurations side-by-side in otherwise identical conditions by
> running them each as unprivileged test ntpds on the same host, each
> using a different UDP port, with or without a ntpd controlling the OS
> clock.
> 
> Please give it a whirl and be heard.
> 
> Cheers,
> Dave Hart
> _______________________________________________
> hackers mailing list
> hackers at lists.ntp.org
> https://lists.ntp.org/mailman/listinfo/hackers
> 
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the hackers mailing list