conf: add mindelay and asymmetry options to NTP sources
This commit is contained in:
parent
b06d74ab73
commit
8ccda538d3
4 changed files with 30 additions and 6 deletions
|
@ -64,6 +64,8 @@ CPS_ParseNTPSourceAdd(char *line, CPS_NTP_Source *src)
|
||||||
src->params.max_delay = SRC_DEFAULT_MAXDELAY;
|
src->params.max_delay = SRC_DEFAULT_MAXDELAY;
|
||||||
src->params.max_delay_ratio = SRC_DEFAULT_MAXDELAYRATIO;
|
src->params.max_delay_ratio = SRC_DEFAULT_MAXDELAYRATIO;
|
||||||
src->params.max_delay_dev_ratio = SRC_DEFAULT_MAXDELAYDEVRATIO;
|
src->params.max_delay_dev_ratio = SRC_DEFAULT_MAXDELAYDEVRATIO;
|
||||||
|
src->params.min_delay = 0.0;
|
||||||
|
src->params.asymmetry = SRC_DEFAULT_ASYMMETRY;
|
||||||
src->params.offset = 0.0;
|
src->params.offset = 0.0;
|
||||||
|
|
||||||
hostname = line;
|
hostname = line;
|
||||||
|
@ -98,6 +100,9 @@ CPS_ParseNTPSourceAdd(char *line, CPS_NTP_Source *src)
|
||||||
if (sscanf(line, "%"SCNu32"%n", &src->params.authkey, &n) != 1 ||
|
if (sscanf(line, "%"SCNu32"%n", &src->params.authkey, &n) != 1 ||
|
||||||
src->params.authkey == INACTIVE_AUTHKEY)
|
src->params.authkey == INACTIVE_AUTHKEY)
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (!strcasecmp(cmd, "asymmetry")) {
|
||||||
|
if (sscanf(line, "%lf%n", &src->params.asymmetry, &n) != 1)
|
||||||
|
return 0;
|
||||||
} else if (!strcasecmp(cmd, "maxdelay")) {
|
} else if (!strcasecmp(cmd, "maxdelay")) {
|
||||||
if (sscanf(line, "%lf%n", &src->params.max_delay, &n) != 1)
|
if (sscanf(line, "%lf%n", &src->params.max_delay, &n) != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -116,6 +121,9 @@ CPS_ParseNTPSourceAdd(char *line, CPS_NTP_Source *src)
|
||||||
} else if (!strcasecmp(cmd, "maxsources")) {
|
} else if (!strcasecmp(cmd, "maxsources")) {
|
||||||
if (sscanf(line, "%d%n", &src->params.max_sources, &n) != 1)
|
if (sscanf(line, "%d%n", &src->params.max_sources, &n) != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (!strcasecmp(cmd, "mindelay")) {
|
||||||
|
if (sscanf(line, "%lf%n", &src->params.min_delay, &n) != 1)
|
||||||
|
return 0;
|
||||||
} else if (!strcasecmp(cmd, "minpoll")) {
|
} else if (!strcasecmp(cmd, "minpoll")) {
|
||||||
if (sscanf(line, "%d%n", &src->params.minpoll, &n) != 1)
|
if (sscanf(line, "%d%n", &src->params.minpoll, &n) != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -122,6 +122,19 @@ If a measurement has a ratio of the increase in the round-trip delay from the
|
||||||
minimum delay amongst the previous measurements to the standard deviation of
|
minimum delay amongst the previous measurements to the standard deviation of
|
||||||
the previous measurements that is greater than the specified ratio, it will be
|
the previous measurements that is greater than the specified ratio, it will be
|
||||||
rejected. The default is 10.0.
|
rejected. The default is 10.0.
|
||||||
|
*mindelay* _delay_:::
|
||||||
|
This options specifies a fixed minimum round-trip delay to be used instead of
|
||||||
|
the minimum amongst the previous measurements. This can be useful in networks
|
||||||
|
with static configuration to improve the stability of corrections for
|
||||||
|
asymmetric jitter, weighting of the measurements, and the *maxdelayratio* and
|
||||||
|
*maxdelaydevratio* tests. The value should be set accurately in order to have a
|
||||||
|
positive effect on the synchronisation.
|
||||||
|
*asymmetry* _ratio_:::
|
||||||
|
This options specifies the asymmetry of the network jitter on the path to the
|
||||||
|
source, which is used to correct the measured offset according to the delay.
|
||||||
|
The asymmetry can be between -0.5 and +0.5. A negative value means the delay of
|
||||||
|
packets sent to the source is more variable than the delay of packets sent from
|
||||||
|
the source back. By default, *chronyd* estimates the asymmetry automatically.
|
||||||
*offset* _offset_:::
|
*offset* _offset_:::
|
||||||
This option specifies a correction (in seconds) which will be applied to
|
This option specifies a correction (in seconds) which will be applied to
|
||||||
offsets measured with this source. It's particularly useful to compensate for a
|
offsets measured with this source. It's particularly useful to compensate for a
|
||||||
|
@ -1664,11 +1677,11 @@ from the example line above):
|
||||||
to be discarded. The number of runs for the data that is being retained is
|
to be discarded. The number of runs for the data that is being retained is
|
||||||
tabulated. Values of approximately half the number of samples are expected.
|
tabulated. Values of approximately half the number of samples are expected.
|
||||||
[8]
|
[8]
|
||||||
. The estimated asymmetry of network jitter on the path to the source which was
|
. The estimated or configured asymmetry of network jitter on the path to the
|
||||||
used to correct the measured offsets. The asymmetry can be between -0.5 and
|
source which was used to correct the measured offsets. The asymmetry can be
|
||||||
0.5. A negative value means the delay of packets sent to the source is
|
between -0.5 and +0.5. A negative value means the delay of packets sent to
|
||||||
more variable than the delay of packets sent from the source back. [0.00,
|
the source is more variable than the delay of packets sent from the source
|
||||||
i.e. no correction for asymmetry]
|
back. [0.00, i.e. no correction for asymmetry]
|
||||||
+
|
+
|
||||||
*tracking*:::
|
*tracking*:::
|
||||||
This option logs changes to the estimate of the system's gain or loss rate, and
|
This option logs changes to the estimate of the system's gain or loss rate, and
|
||||||
|
|
|
@ -586,7 +586,7 @@ NCR_GetInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourcePar
|
||||||
SRC_NTP, params->sel_options,
|
SRC_NTP, params->sel_options,
|
||||||
&result->remote_addr.ip_addr,
|
&result->remote_addr.ip_addr,
|
||||||
params->min_samples, params->max_samples,
|
params->min_samples, params->max_samples,
|
||||||
0.0, 1.0);
|
params->min_delay, params->asymmetry);
|
||||||
|
|
||||||
result->rx_timeout_id = 0;
|
result->rx_timeout_id = 0;
|
||||||
result->tx_timeout_id = 0;
|
result->tx_timeout_id = 0;
|
||||||
|
|
|
@ -48,6 +48,8 @@ typedef struct {
|
||||||
double max_delay;
|
double max_delay;
|
||||||
double max_delay_ratio;
|
double max_delay_ratio;
|
||||||
double max_delay_dev_ratio;
|
double max_delay_dev_ratio;
|
||||||
|
double min_delay;
|
||||||
|
double asymmetry;
|
||||||
double offset;
|
double offset;
|
||||||
} SourceParameters;
|
} SourceParameters;
|
||||||
|
|
||||||
|
@ -63,6 +65,7 @@ typedef struct {
|
||||||
#define SRC_DEFAULT_MAXSOURCES 4
|
#define SRC_DEFAULT_MAXSOURCES 4
|
||||||
#define SRC_DEFAULT_MINSAMPLES (-1)
|
#define SRC_DEFAULT_MINSAMPLES (-1)
|
||||||
#define SRC_DEFAULT_MAXSAMPLES (-1)
|
#define SRC_DEFAULT_MAXSAMPLES (-1)
|
||||||
|
#define SRC_DEFAULT_ASYMMETRY 1.0
|
||||||
#define INACTIVE_AUTHKEY 0
|
#define INACTIVE_AUTHKEY 0
|
||||||
|
|
||||||
/* Flags for source selection */
|
/* Flags for source selection */
|
||||||
|
|
Loading…
Reference in a new issue