Commit graph

34 commits

Author SHA1 Message Date
Miroslav Lichvar
d06ae4a60e sourcestats: add function to get minsamples 2022-02-10 16:38:50 +01:00
Miroslav Lichvar
72f7d09f58 sourcestats: add function to correct accumulated offsets
This will be needed to follow server time corrections in order to
better estimate frequency.
2021-11-16 10:23:20 +01:00
Miroslav Lichvar
f8610d69f0 sources: improve handling of dump files and their format
Check for write errors when saving dump files. Don't save files with no
samples. Add more sanity checks for loaded data.

Extend the file format to include an identifier, the reachability
register, leap status, name, and authentication flag. Avoid loading
unauthenticated data after switching authentication on. Change format
and order of some fields to simplify parsing. Drop fields that were kept
only for compatibility.

The dump files now contain all information needed to perform the source
selection and update the reference.

There is no support kept for the old file format. Loading of old dump
files will fail after upgrading to new version.
2021-02-04 17:44:27 +01:00
Miroslav Lichvar
f74eb67567 sourcestats: move stratum to sources
The stratum value is not needed in sourcestats. Keep it in the source
itself.
2021-02-04 17:43:29 +01:00
Miroslav Lichvar
ff9301567e sourcestats: move leap status to sources 2020-03-12 12:09:50 +01:00
Miroslav Lichvar
cca2ef4649 sourcestats: provide frequency SD in tracking data 2018-08-17 17:40:06 +02:00
Miroslav Lichvar
6bef8aa0e9 use common structure for NTP samples
Define a structure for NTP samples and use it to pass samples from
the ntp_core and refclock code to sources and sourcestats.
2018-08-03 17:21:02 +02:00
Miroslav Lichvar
05078e4252 sourcestats: track leap status
This moves the leap status of the last sample from the source instance
to the sourcestats instance in order to make them both accumulate the
same data.
2018-08-03 17:21:02 +02:00
Miroslav Lichvar
51fe80ad95 sourcestats: move maxdelaydevratio test to ntp_core
Instead of giving NTP-specific data to sourcestats in order to perform
the test, provide a function to get all data needed for the test in
ntp_core. While at it, improve the naming of variables.
2017-08-28 14:27:14 +02:00
Miroslav Lichvar
b06d74ab73 sourcestats: add fixed asymmetry
Rework the code to allow the jitter asymmetry to be specified.
2017-08-23 14:33:23 +02:00
Miroslav Lichvar
d0964ffa83 sourcestats: add fixed minimum delay
If the minimum delay is known (in a static network configuration), it
can replace the measured minimum from the register. This should improve
the stability of corrections for asymmetric jitter, sample weighting and
maxdelay* tests.
2017-08-23 14:14:06 +02:00
Miroslav Lichvar
535ca64bba cmdmon: add ntpdata command 2016-11-25 17:33:43 +01:00
Miroslav Lichvar
d0dfa1de9e adopt struct timespec
Replace struct timeval with struct timespec as the main data type for
timestamps. This will allow the NTP code to work with timestamps in
nanosecond resolution.
2016-08-19 12:53:09 +02:00
Miroslav Lichvar
6688f40325 sources: allow setting minsamples and maxsamples for each source
The minsamples and maxsamples directives now set the default value,
which can be overriden for individual sources in the server/peer/pool
and refclock directives.
2014-12-03 16:27:51 +01:00
Miroslav Lichvar
42dd5caa1b ntp: don't replace source instance when changing address
Add new functions to change source's reference ID/address and reset the
instance. Use that instead of destroying and creating a new instance
when the NTP address is changed.
2014-12-01 18:40:47 +01:00
Miroslav Lichvar
8f06245428 sources: allow selection of unreachable sources
Reachability is no longer a requirement for selection. An unreachable
source can remain selected if its newest sample is not older than the
oldest sample from all reachable sources.

This is useful to prevent reselection when an accurate source uses a
very short polling interval (e.g. refclock) and is occasionally
unreachable for short periods of time.
2014-10-20 12:19:36 +02:00
Miroslav Lichvar
2c033989b6 Update comments referencing RFC 1305 2014-10-14 16:52:22 +02:00
Miroslav Lichvar
a0d5abef88 sourcestats: remove tracking of skew change
This is not used since commit 7a6ee1d.
2014-09-19 10:07:03 +02:00
Miroslav Lichvar
13d734c8d2 sourcestats: reset SST instance thoroughly when dropping samples 2014-06-02 16:46:53 +02:00
Miroslav Lichvar
c903c5f72b sourcestats: remove forgotten declaration 2014-06-02 16:46:53 +02:00
Miroslav Lichvar
22e5ed44c2 Modify SST_GetSelectionData to return only necessary data 2013-06-12 16:06:33 +02:00
Miroslav Lichvar
2b9fe764d5 Drop unused SST_GetReferenceData() 2013-06-03 16:03:07 +02:00
Miroslav Lichvar
91279a0f28 Store reference IDs in uint32_t 2011-06-13 15:34:16 +02:00
Miroslav Lichvar
c5587b60b2 Set reference time to last sample instead of time on update
This is done mainly to fix reported root dispersion to include max clock
error after selecting another source without new sample.
2011-04-11 17:52:04 +02:00
Miroslav Lichvar
e8c5d15690 Remove CVS headers 2011-01-28 12:56:09 +01:00
Miroslav Lichvar
98f79404d6 Allow selecting source only when last regression was successful 2010-12-15 17:48:30 +01:00
Miroslav Lichvar
b977c95be4 Add test for ratio of increase in delay to stddev
Require that the ratio of the increase in delay from the minimum one in
the stats data register to the standard deviation of the offsets in the
register is less than maxdelaydevratio or the difference between
measured offset and predicted offset is larger than the increase in
delay. In the allowed delay increase is included also skew and maximum
clock frequency error.

maxdelaydevratio is 10.0 by default.
2010-12-07 16:47:57 +01:00
Miroslav Lichvar
7a6ee1d729 Base poll adjustment on number of sourcestats samples
Instead of following skew changes, adjust polling interval so that the
number of measurements used in the regression algorithm remains close to
a target value. It can be configured with a new polltarget option
(6 by default).
2010-10-13 16:49:28 +02:00
Miroslav Lichvar
e78e65ef22 Refactor file logging 2010-04-13 15:16:41 +02:00
Miroslav Lichvar
0f70959d8e Add dispersion notification handlers 2010-02-16 18:51:37 +01:00
Miroslav Lichvar
b32432c232 Move estimated offset and error to sourcestats report
And print the estimated offset in sourcestats output.
2009-12-14 10:34:33 +01:00
Miroslav Lichvar
0f9892fe7a Fix printing refclocks and IPv6 sources in statistics log 2009-11-30 17:18:28 +01:00
Miroslav Lichvar
8e23110aec Update COPYING and FSF address 2009-10-28 17:53:33 +01:00
Richard P. Curnow
8884034104 Equivalent to V1.19.99.1
This is a verbatim copy of the files at that stage of the repository that was
built from the CVS import.  It allows future development to see a bit of recent
history, but without carrying around the baggage going back to 1997.  If that
is really required, git grafts can be used.
2006-01-19 21:34:28 +00:00