[ntp:questions] possible bug when using gps + pps combined source all alone

Nickolay Orekhov nowhere at mail.ru
Mon Feb 11 10:11:14 UTC 2013


Hello, all!

I have device with gps and I want to use combined time source. NMEA + PPS
or TSIP + PPS.
Here's my sampe config:

server 127.127.8.2 mode 138 prefer maxpoll 3 true
fudge 127.127.8.2 refid TSIP time1 0.08 stratum 8

This is the only one time source in the system.
I've got a problem. Sometimes my peer is marked as falseticker and stays
out of sync forever.
According to the code that happens when first step is not very precise. In
fact if it gives sys_offset < 0.4.
I think that's not very good policy: only one GPS error during start can
stall the system forever!

Here( ntp_proto.c:2467):
/*
 * If we get this far, the peer can stay on the
 * island, but does not yet have the immunity
 * idol.
 */
peer->new_status = CTL_PST_SEL_SANE;
It is marked as falseticker in initialization.

Here (ntp_proto.c:2585):
#ifdef REFCLOCK
/*
 * Eligible PPS peers must survive the intersection
 * algorithm. Use the first one found, but don't
 * include any of them in the cluster population.
 */
if (peer->flags & FLAG_PPS) {
if (typepps == NULL)
typepps = peer;
continue;
}
#endif /* REFCLOCK */
Our peer marked with FLAG_PPS so it will skip the rest of the clustering
algorithm.

Here ( ntp_proto.c:2795) our peer can be selected but because sys_offset is
big
it is skipped forever:
#ifdef REFCLOCK
/*
 * If a PPS driver is lit and the combined offset is less than
 * 0.4 s, select the driver as the PPS peer and use its offset
 * and jitter. However, if this is the atom driver, use it only
 * if there is a prefer peer or there are no survivors and none
 * are required.
 */
if (typepps != NULL && fabs(sys_offset) < 0.4 &&
    (typepps->refclktype != REFCLK_ATOM_PPS ||
    (typepps->refclktype == REFCLK_ATOM_PPS && (sys_prefer !=
    NULL || (typesystem == NULL && sys_minsane == 0))))) {

Again: only one GPS error during startup can cause the whole system  to be
out of sync until reboot.
Please, could you comment on this. If it's a bug or may be there's
something I don't see in the code?

Of course If i add another source or if i divide this source into two
everything works fine.

Regards, Nickolay


More information about the questions mailing list