Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What should the poll be for the shared memory driver (type 28)?

27 views
Skip to first unread message

David Taylor

unread,
Jun 17, 2013, 10:24:42 AM6/17/13
to
What should the poll be for the shared memory driver (type 28)? This
Web page:

http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver28.html

suggests that the driver internally has a poll interval of 1 second,
another document I've seen suggests setting:

server 127.127.28.1 minpoll 1 prefer

and yet in the ntpq -p billboard the poll is shown as 8 seconds.
Loopstats are reported at 8 second intervals, and the poll interval is
shown as 3 (i.e. 8 seconds).

I'm confused! What should be the correct setting in the ntp.conf file?

BTW: this comes about from Folkert van Heusden who is using a user-mode
program to make NTP on a Raspberry Pi more precise, i.e. providing PPS
support without having to modify the kernel. See:

http://www.febo.com/pipermail/time-nuts/2013-June/077484.html
--
Thanks,
David
Web: http://www.satsignal.eu

David Lord

unread,
Jun 17, 2013, 12:12:25 PM6/17/13
to
David Taylor wrote:
> What should the poll be for the shared memory driver (type 28)? This
> Web page:
>
> http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver28.html
>
> suggests that the driver internally has a poll interval of 1 second,
> another document I've seen suggests setting:
>
> server 127.127.28.1 minpoll 1 prefer
>
> and yet in the ntpq -p billboard the poll is shown as 8 seconds.
> Loopstats are reported at 8 second intervals, and the poll interval is
> shown as 3 (i.e. 8 seconds).
>
> I'm confused! What should be the correct setting in the ntp.conf file?

I've used type-28 + radioclkd2 for many years with MSF and for a
while with DCF. I've never set minpoll/maxpoll but it has always
defaulted to 6, ie 64 sec. DCF has a phase shift second marker
but is too distant for that to useful. When DCF reception was
good the timekeeping was better than from msf (+/- 0.1 ms vs 1ms).

As you mentioned above, type 28 refclock pages indicate the driver
is polled by ntp at 1 second intervals (as from ntpd-4.2.5p138).


David

Steve Kostecke

unread,
Jun 17, 2013, 12:36:49 PM6/17/13
to
On 2013-06-17, David Taylor <david-...@blueyonder.co.uk.invalid> wrote:

> another document I've seen suggests setting:
>
> server 127.127.28.1 minpoll 1 prefer
>
> and yet in the ntpq -p billboard the poll is shown as 8 seconds.
> Loopstats are reported at 8 second intervals, and the poll interval is
> shown as 3 (i.e. 8 seconds).

grepping the source tree is very informative...

According to ./ntpd/ntp_peer.c:

/*
* It is an error to set minpoll less than NTP_MINPOLL or to
* set maxpoll greater than NTP_MAXPOLL. However, minpoll is
* clamped not greater than NTP_MAXPOLL and maxpoll is clamped
* not less than NTP_MINPOLL without complaint. Finally,
* minpoll is clamped not greater than maxpoll.
*/

And in ./include/ntp.h we find:

:#define NTP_MINPOLL 3 /* log2 min poll interval (8 s) */

--
Steve Kostecke <kost...@ntp.org>
NTP Public Services Project - http://support.ntp.org/

David Taylor

unread,
Jun 17, 2013, 2:02:09 PM6/17/13
to
On 17/06/2013 17:36, Steve Kostecke wrote:
[]
> grepping the source tree is very informative...
>
> According to ./ntpd/ntp_peer.c:
>
> /*
> * It is an error to set minpoll less than NTP_MINPOLL or to
> * set maxpoll greater than NTP_MAXPOLL. However, minpoll is
> * clamped not greater than NTP_MAXPOLL and maxpoll is clamped
> * not less than NTP_MINPOLL without complaint. Finally,
> * minpoll is clamped not greater than maxpoll.
> */
>
> And in ./include/ntp.h we find:
>
> :#define NTP_MINPOLL 3 /* log2 min poll interval (8 s) */

Thanks, Steve. My knowledge of the source tree is even more limited
than my knowledge of "C"! In refclock_shm.c, it does say that the
"peek" routine is called every second, so if the type 28 driver has an
internal poll of one second, does it matter what min/max poll is set in
the ntp.conf file? Does it even need to be set at all?

I'll try setting it to 4, as a test, and see whether anything changes.

Sorry if I'm asking very basic questions, but if I'm going to write a
small Web page about this I would rather the contents be accurate and,
if possible, best practice.
--
Cheers,
David
Web: http://www.satsignal.eu

David Taylor

unread,
Jun 17, 2013, 2:11:47 PM6/17/13
to
On 17/06/2013 17:12, David Lord wrote:
[]
> I've used type-28 + radioclkd2 for many years with MSF and for a
> while with DCF. I've never set minpoll/maxpoll but it has always
> defaulted to 6, ie 64 sec. DCF has a phase shift second marker
> but is too distant for that to useful. When DCF reception was
> good the timekeeping was better than from msf (+/- 0.1 ms vs 1ms).
>
> As you mentioned above, type 28 refclock pages indicate the driver
> is polled by ntp at 1 second intervals (as from ntpd-4.2.5p138).
>
>
> David

Thanks, David. I'm trying a poll of 4 now (16 seconds) as that will
match the normal PPS/kernel method (and reduce the size of the log
file). Will watch the jitter and see whether it changes. The
GPS-derived PPS signal should be within 0.1 us, making the PC the
limiting factor.

Steve Kostecke

unread,
Jun 17, 2013, 6:05:40 PM6/17/13
to
On 2013-06-17, David Taylor <david-...@blueyonder.co.uk> wrote:

> On 17/06/2013 17:36, Steve Kostecke wrote: []
>
>> grepping the source tree is very informative...

[snip: relevant quotes from the NTP Reference Implementation source]

> Thanks, Steve. My knowledge of the source tree is even more limited
> than my knowledge of "C"!

I have no intimate familiarity with the source tree and had to search
for the items I quoted.

> In refclock_shm.c, it does say that the
> "peek" routine is called every second, so if the type 28 driver has an
> internal poll of one second, does it matter what min/max poll is set
> in the ntp.conf file? Does it even need to be set at all?

> Sorry if I'm asking very basic questions, but if I'm going to write a
> small Web page about this I would rather the contents be accurate and,
> if possible, best practice.

Contributing (i.e. embedding and not merely linking) this
article/topic/page to the Community Supported Documentation at
http://support.ntp.org/support is the best way to make this information
useful to the NTP Community.

Harlan Stenn

unread,
Jun 17, 2013, 7:00:23 PM6/17/13
to
Yes, absolutely.

It does more good to get NTP-related eyeballs at ntp.org than at
3rd-party sites.

H

David Taylor

unread,
Jun 18, 2013, 2:39:30 AM6/18/13
to
On 17/06/2013 23:05, Steve Kostecke wrote:
[]
> Contributing (i.e. embedding and not merely linking) this
> article/topic/page to the Community Supported Documentation at
> http://support.ntp.org/support is the best way to make this information
> useful to the NTP Community.

I've added a link to: http://support.ntp.org/bin/view/Support/ConfiguringNTP

If someone wants to rewrite my existing Web information in the format
required there, they are welcome, although they will need to keep track
of any changes. I find the editor not easy to use, and prefer to have
master copies on my information on my own Web server, and on multiple
hard disks here.

Miroslav Lichvar

unread,
Jun 18, 2013, 3:41:17 AM6/18/13
to
On Mon, Jun 17, 2013 at 07:02:09PM +0100, David Taylor wrote:
> Thanks, Steve. My knowledge of the source tree is even more limited
> than my knowledge of "C"! In refclock_shm.c, it does say that the
> "peek" routine is called every second, so if the type 28 driver has
> an internal poll of one second, does it matter what min/max poll is
> set in the ntp.conf file? Does it even need to be set at all?

IIRC, the one second interval is used only to collect the SHM samples
and store them in a buffer. In the minpoll/maxpoll interval the
collected samples are processed in a median filter and one final
sample is used to update the clock. This improves the jitter.

> I'll try setting it to 4, as a test, and see whether anything changes.

The difference with NTP sources is that changing the poll interval
affects also the jitter as there will be a different number of samples
in the filter.

--
Miroslav Lichvar

David Taylor

unread,
Jun 18, 2013, 5:07:47 AM6/18/13
to
On 18/06/2013 08:41, Miroslav Lichvar wrote:
[]
> IIRC, the one second interval is used only to collect the SHM samples
> and store them in a buffer. In the minpoll/maxpoll interval the
> collected samples are processed in a median filter and one final
> sample is used to update the clock. This improves the jitter.

Yes, that makes sense.

>> I'll try setting it to 4, as a test, and see whether anything changes.
>
> The difference with NTP sources is that changing the poll interval
> affects also the jitter as there will be a different number of samples
> in the filter.

I've put a couple of graphs here:

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html#user-mode

which show a drop of RMS offset from around 5 microseconds to 4
microseconds and a drop in averaged jitter from just below 7 to just
above 5 microseconds, when the minpoll was changed from 3 to 4.
0 new messages