[LinuxPPS] ntpd configuration with local clock and pps

Harun Alasar harunalasar at gmail.com
Fri May 15 17:12:58 CEST 2009


Hello everyone,

I am trying to configure ntpd to work on a machine with no network
connection but only a pps source. I want ntpd to use LOCAL-CLOCK and ATOM
drivers.  I patched the kernel for pps and it seems to work fine. I
configured ntpd with the configuration file below:

server  127.127.1.0
fudge   127.127.1.0 time1       0.0
fudge   127.127.1.0 time2       0.0
fudge   127.127.1.0 stratum     13
fudge   127.127.1.0 refid       LOCL

server  127.127.22.0 minpoll 4 maxpoll 10
fudge   127.127.22.0 time1      0.000000
fudge   127.127.22.0 stratum    0
fudge   127.127.22.0 refid      PPS0
fudge   127.127.22.0 flag2 0
fudge   127.127.22.0 flag3 1


I also added some printfs to ntpd source(only refclock_atom.c) for debugging
and verified that ntpd can open the device and fetch data from it. But ntpq>
associations command says that pps source is rejected by ntpd. What could be
the reason for that ? Thank you.

ntpq>associations   says the following:

ind   assId   status   conf   reach   auth   condition   last_event   cnt
1     64907   9614   yes     yes     none   sys.peer   reachable   1
2     64908  8000   yes     yes     none    reject


ntpd debugging messages are as follows:
lines containing TIMESTAMP are the tv_sec part of the timespec structure
returned from time_pps_fetch call

root@(none):~# ./ntpd -D 2
ntpd 4.2.4p6 at 1.1549-o Thu Dec 11 11:46:29 UTC 2008 (6)
addto_syslog: set_process_priority: Leave priority alone: priority_done is
<2>
addto_syslog: precision = 11.000 usec
create_sockets(123)
addto_syslog: ntp_io: estimated max descriptors: 1024, initial socket
boundary: 16
addto_syslog: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
addto_syslog: no IPv6 interfaces found
addto_syslog: no IPv6 interfaces found
create_interface(10.0.0.160#123)
addto_syslog: Listening on interface #1 eth0, 10.0.0.160#123 Enabled
created interface #1: fd=17, bfd=-1, name=eth0, flags=0x19, scope=0,
ifindex=0, sin=10.0.0.160, bcast=10.0.0.255,, mask=255.255.255.0, Enabled:
create_interface(10.0.0.161#123)
addto_syslog: Listening on interface #2 eth1, 10.0.0.161#123 Enabled
created interface #2: fd=18, bfd=-1, name=eth1, flags=0x19, scope=0,
ifindex=0, sin=10.0.0.161, bcast=10.0.0.255,, mask=255.255.255.0, Enabled:
create_interface(127.0.0.1#123)
addto_syslog: Listening on interface #3 lo, 127.0.0.1#123 Enabled
created interface #3: fd=19, bfd=-1, name=lo, flags=0x5, scope=0, ifindex=0,
sin=127.0.0.1, mask=255.0.0.0, Enabled:
create_sockets: Total interfaces = 4
local_clock: time 0 offset 0.000000 freq 0.000 state 0
addto_syslog: kernel time sync status 0040
getnetnum given 127.127.1.0, got 127.127.1.0 (t_UNK/0)
peer_crypto_clear: at 0 next 0 assoc ID 64907
key_expire: at 0
peer_clear: at 0 next 1 assoc ID 64907 refid INIT
newpeer: 127.0.0.1->127.127.1.0 mode 3 vers 4 poll 6 10 flags 0x1021 0x1 ttl
0 key 00000000
getnetnum given 127.127.1.0, got 127.127.1.0 (t_REF/1)
getnetnum given 127.127.1.0, got 127.127.1.0 (t_REF/1)
getnetnum given 127.127.1.0, got 127.127.1.0 (t_REF/1)
getnetnum given 127.127.1.0, got 127.127.1.0 (t_REF/1)
getnetnum given 127.127.22.0, got 127.127.22.0 (t_UNK/0)
peer_crypto_clear: at 0 next 0 assoc ID 64908
key_expire: at 0
peer_clear: at 0 next 2 assoc ID 64908 refid INIT
PPS DEVICE NAME : /dev/pps0 FILE_DESC: 4
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
newpeer: 127.0.0.1->127.127.22.0 mode 3 vers 4 poll 4 10 flags 0x1021 0x1
ttl 0 key 00000000
getnetnum given 127.127.22.0, got 127.127.22.0 (t_REF/1)
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
getnetnum given 127.127.22.0, got 127.127.22.0 (t_REF/1)
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
getnetnum given 127.127.22.0, got 127.127.22.0 (t_REF/1)
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
getnetnum given 127.127.22.0, got 127.127.22.0 (t_REF/1)
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
refclock_ppsapi: fd 4 capability 0x1133 version 1 mode 0x1101
getnetnum given 127.127.22.0, got 127.127.22.0 (t_REF/1)
addto_syslog: refclock_atom: time_pps_kcbind failed: Operation not supported
local_clock: time 0 offset 0.000000 freq 0.000 state 1
report_event: system event 'event_restart' (0x01) status 'sync_alarm,
sync_unspec, 1 event, event_unspec' (0xc010)
TIMESTAMP : 1242105283
refclock_transmit: at 1 127.127.1.0
refclock_receive: at 1 127.127.1.0
peer LOCAL(0) event 'event_reach' (0x84) status 'unreach, conf, 1 event,
event_reach' (0x8014)
refclock_sample: n 1 offset 0.000000 disp 0.010000 jitter 0.000015
clock_filter: n 1 off 0.000000 del 0.000000 dsp 7.937508 jit 0.000015, age 0
poll_update: at 1 127.127.1.0 flags 1021 poll 6 burst 0 last 1 next 64
auth_agekeys: at 1 keys 1 expired 0
timer: refresh ts 0
timer: interface update
addto_syslog: no IPv6 interfaces found
addto_syslog: no IPv6 interfaces found
TIMESTAMP : 1242105284
atom_timer: 2 0.495329 0.000000
refclock_transmit: at 2 127.127.22.0
poll_update: at 2 127.127.22.0 flags 1021 poll 4 burst 0 last 2 next 18
TIMESTAMP : 1242105285
atom_timer: 3 0.494995 0.000000
TIMESTAMP : 1242105286
atom_timer: 4 0.494564 0.000000
TIMESTAMP : 1242105287
atom_timer: 5 0.494294 0.000000
TIMESTAMP : 1242105288
atom_timer: 6 0.493824 0.000000
TIMESTAMP : 1242105289
atom_timer: 7 0.493515 0.000000
TIMESTAMP : 1242105290
TIMESTAMP : 1242105291
atom_timer: 9 0.492599 0.000000
TIMESTAMP : 1242105292
atom_timer: 10 0.492166 0.000000
TIMESTAMP : 1242105293
atom_timer: 11 0.491796 0.000000
TIMESTAMP : 1242105294
atom_timer: 12 0.491488 0.000000
TIMESTAMP : 1242105295
atom_timer: 13 0.491100 0.000000
TIMESTAMP : 1242105296
atom_timer: 14 0.490702 0.000000
TIMESTAMP : 1242105297
TIMESTAMP : 1242105298
atom_timer: 16 0.489729 0.000000
TIMESTAMP : 1242105299
atom_timer: 17 0.489519 0.000000
TIMESTAMP : 1242105300
atom_timer: 18 0.489085 0.000000
refclock_transmit: at 18 127.127.22.0
poll_update: at 18 127.127.22.0 flags 1021 poll 4 burst 0 last 18 next 33
TIMESTAMP : 1242105301
atom_timer: 19 0.488703 0.000000
TIMESTAMP : 1242105302
atom_timer: 20 0.488317 0.000000
TIMESTAMP : 1242105303
atom_timer: 21 0.488047 0.000000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ml.enneenne.com/pipermail/linuxpps/attachments/20090515/03508af6/attachment.htm 


More information about the LinuxPPS mailing list