opt_name = "maxsources";
else if (data.params.min_stratum != SRC_DEFAULT_MINSTRATUM)
opt_name = "minstratum";
+ else if (data.params.offset != 0.0)
+ opt_name = "offset";
else if (data.params.poll_target != SRC_DEFAULT_POLLTARGET)
opt_name = "polltarget";
else if (data.params.version != NTP_VERSION)
src->params.max_delay = SRC_DEFAULT_MAXDELAY;
src->params.max_delay_ratio = SRC_DEFAULT_MAXDELAYRATIO;
src->params.max_delay_dev_ratio = SRC_DEFAULT_MAXDELAYDEVRATIO;
+ src->params.offset = 0.0;
hostname = line;
line = CPS_SplitWord(line);
} else if (!strcasecmp(cmd, "minstratum")) {
if (sscanf(line, "%d%n", &src->params.min_stratum, &n) != 1)
return 0;
+ } else if (!strcasecmp(cmd, "offset")) {
+ if (sscanf(line, "%lf%n", &src->params.offset, &n) != 1)
+ return 0;
} else if (!strcasecmp(cmd, "port")) {
if (sscanf(line, "%hu%n", &src->port, &n) != 1)
return 0;
minimum delay amongst the previous measurements to the standard deviation of
the previous measurements that is greater than the specified ratio, it will be
rejected. The default is 10.0.
+*offset* _offset_:::
+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
+known asymmetry in network delay or timestamping errors. For example, if
+packets sent to the source were on average delayed by 100 microseconds more
+than packets sent from the source back, the correction would be -0.00005 (-50
+microseconds). The default is 0.0.
*minsamples* _samples_:::
Set the minimum number of samples kept for this source. This overrides the
<<minsamples,*minsamples*>> directive.
double max_delay_dev_ratio; /* Maximum ratio of increase in delay / stddev */
+ double offset_correction; /* Correction applied to measured offset
+ (e.g. for asymmetry in network delay) */
+
int do_auth; /* Flag indicating whether we
authenticate packets we send to
this machine (if it's serving us or
result->max_delay = params->max_delay;
result->max_delay_ratio = params->max_delay_ratio;
result->max_delay_dev_ratio = params->max_delay_dev_ratio;
+ result->offset_correction = params->offset;
result->auto_offline = params->auto_offline;
result->poll_target = params->poll_target;
/* Calculate offset. Following the NTP definition, this is negative
if we are fast of the remote source. */
UTI_DiffTimevalsToDouble(&offset, &remote_average, &local_average);
-
+
+ /* Apply configured correction */
+ offset += inst->offset_correction;
+
/* We treat the time of the sample as being midway through the local
measurement period. An analysis assuming constant relative
frequency and zero network delay shows this is the only possible
double max_delay;
double max_delay_ratio;
double max_delay_dev_ratio;
+ double offset;
} SourceParameters;
#define SRC_DEFAULT_PORT 123