File: README

package info (click to toggle)
ntpsec 1.2.3%2Bdfsg1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,960 kB
  • sloc: ansic: 62,004; python: 32,017; sh: 1,553; yacc: 1,293; makefile: 190; javascript: 138
file content (64 lines) | stat: -rw-r--r-- 2,839 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
= PARSE reference clock driver =
by Frank Kardel

This directory contains the files making up the parser for
the parse refclock driver. For reasonably sane clocks this refclock
drivers allows a refclock implementation by just providing a
conversion routine and the appropriate NTP parameters. Refclock
support can run as low as 3k code with the parse refclock driver.

The structure of the parse reference clock driver is as follows:

ntpd contains the contains NTP implementation and calls a reference
clock driver named "generic" which is implemented by refclock_parse.c,
which contains a large number of refclock descriptions.

The kind of clock is selected by the subtype parameter. This parameter
selects the clock type which determines how I/O is done, the tty
parameters and the NTP parameters.

refclock_parse operates on an abstract reference clock that delivers
time stamps and statuses. Offsets and sychronization information is
derived from this data and passed on to refclock_receive of ntpd which
uses that data for syncronisation.

The abstract reference clock is generated by the parse* routines. They
parse the incoming data stream from the clock and convert it to the
appropriate time stamps.  The data is also mapped into the abstract
clock states

POWERUP:: clock has no valid phase and time code information.

NOSYNC:: Time code is not confirmed, phase is probably OK.

SYNC:: Time code and phase are correct.

A clock is trusted for a certain time (type parameter) when it leaves
the SYNC state. This is derived from the observation that quite a few
clocks can still generate good time code information when losing
contact to their synchronisation source. When the clock does not
reagain synchronisation in that trust period it will be deemed
unsynchronised until it regains synchronisation. The same will happen
if ntpd sees the clock unsynchronised at startup.

The upper bit of x specifies that all samples delivered from the clock
should be used to discipline the NTP loopfilter. For clock with
accurate once a second time information this means big improvements
for time keeping.  A prerequisite for passing on the time stamps to
the loopfilter is that the clock is in synchronised state.

Here is how to read the files in this (libparse) directory:

parse.c:: These are the general routines to parse the incoming data
	  stream. Usually these routines should not require
	  modification.

clk_*.c:: These files hold the conversion code for the time stamps and
	  the description how the time code can be parsed and where
	  the time stamps are to be taken.  If you want to add a new
	  clock type, this is the file you need to write in addition
	  to mentioning it in parse_conf.c and setting up the NTP and
	  TTY parameters in refclock_parse.c.

Further information can be found in the various source files.