[ntp:hackers] Refclock samples are pushed into the filter even if not sync

Martin Burnicki martin.burnicki at meinberg.de
Fri Jun 3 05:56:21 PDT 2005


Hi all,

I'm running the latest ntp-dev version of ntpd using a DCF77 radio clock 
with serial time string as ref time source.

Recently I've observed that ntpd increments the reach value even if the 
clock claims to be not synchronized, i.e. the time string is received 
once per second, but the status code in the time string is "not sync" 
(see the "#*" characters in the timecode= line below).

In spite of this condition the samples of the unsynchronized clock are 
fed into the filter, and the reach count is incremented, but ntpd 
selects the local clock as sys peer and rejects the radio clock (as 
expected):

# ntpq -p -c as -c "cv 7109"
   remote        refid      st t when poll reach   delay   offset  jitter
========================================================================
*LOCAL(0)     LOCAL(0)      5 l   63   64   17    0.000    0.000   0.004
  GENERIC(0)   .DCFa.        0 l   62   64   37    0.000  1596.16   0.077

ind assID status  conf reach auth condition  last_event cnt
===========================================================
   1  7108  9614   yes   yes  none  sys.peer   reachable  1
   2  7109  9024   yes   yes  none    reject   reachable  2

assID=7109 status=0303 clk_fault, last_clk_fault,
device="Meinberg DCF77 C51 or compatible",
timecode="\x02D:03.06.05;T:5;U:08.21.02;#*  \x03", poll=4, noreply=0,
badformat=0, baddata=0, fudgetime1=0.000, stratum=0, refid=GPSi,
flags=0,
refclock_time="c64a835e.00000000  Fri, Jun  3 2005  7:21:02.000",
refclock_status="NOT SYNCHRONIZED; TIME CODE NOT CONFIRMED; TIME CODE; 
(LEAP INDICATION)",
refclock_format="Meinberg Standard",
refclock_states="*FAULT: 00:04:18 (100.00%); running time: 00:04:18"

(Please ignore the large offset of the DCF77 clock, it's runnning 
unsynchronized for a long time)


AFAIK, the normal behaviour of ntpd should be NOT to shift bits into the 
reach register and discard the time samples in this case, so the reach 
value should stay at 0.

That's also the way it has been working in older versions of ntpd, e.g. 
what is now in ntp-stable.

If the ref time source is another NTP server on the network, the reach 
value for that server also stays at 0 if the server responds but is not 
synchronized.

Is this by design or a bug? Shouldn't ntpd behave the same way whether 
the samples arrive from an unsynchronized refclock or another 
unsynchronized NTP server?


Best regards,

Martin
-- 
Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont
Germany



More information about the hackers mailing list