URL: https://www.opennet.me/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID1
Нить номер: 92735
[ Назад ]

Исходное сообщение
"NTP сервер - параметр noise"

Отправлено sysand , 12-Дек-11 10:44 
Привет Всем!

Разбираюсь с работой NTP сервера, ни как не могу найти, что означает, в каких единицах измеряется и на что влияет параметр noise,
с остальными вроде как разобрался, может подскажет кто-нибудь? Заранее благодарен :).


syslog# ntpq -crv -p
assID=0 status=06f4 leap_none, sync_ntp, 15 events, event_peer/strat_chg,
version="ntpd 4.2.4p5-a Thu Sep 29 09:49:48 NOVT 2011 (1)",
processor="i386", system="FreeBSD/7.4-STABLE", leap=00, stratum=2,
precision=-19, rootdelay=62.712, rootdispersion=17.129, peer=5688,
refid=62.117.76.141,
reftime=d28c380e.d70cc67a  Fri, Dec  9 2011 14:32:30.840, poll=9,
clock=d28c39b4.ad9a30e4  Fri, Dec  9 2011 14:39:32.678, state=4,
offset=0.706, frequency=16.108, jitter=0.920, noise=2.064, <----------------  вот этот вот
stability=0.002, tai=0
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+Time2.Stupi.SE  .PPS.            1 u  100  512  377   88.840    1.683   0.443
+ntp1.sp.se      .PPS.            1 u  105  512  377  101.303    0.078  39.397
-ntp1.mmo.netnod .PPS.            1 u   80  512  377  113.795    8.590   0.318
-ptbtime1.ptb.de .PTB.            1 u   79  512  377  124.967    4.796   0.532
-ntp1.inrim.it   .CTD.            1 u   19  512  377  125.603    4.974   0.275
-ntp1.sth.netnod .PPS.            1 u  149  512  377   84.732    3.343   0.438
-ntp-nasa.arc.na .GPS.            1 u  125  512  377  275.700   -2.695   0.394
swisstime2.ee.e .STEP.          16 u    -  512    0    0.000    0.000   0.000
ntp1.vniiftri.r .STEP.          16 u    -  512    0    0.000    0.000   0.000
*ntp2.vniiftri.r .PPS.            1 u  423  512  377   62.712    0.137   0.160
-ntp3.vniiftri.r .PPS.            1 u  483  512  377   76.788   -5.484   5.915
LOCAL(0)        .LOCL.          10 l   54   64  377    0.000    0.000   0.002
syslog#



Содержание

Сообщения в этом обсуждении
"NTP сервер - параметр noise"
Отправлено sysand , 14-Дек-11 13:30 
Ну и по традиции сам себе и отвечу :).
Залез я в исходники , оказывается , что в этой версии пакета NTPD параметр noise, это тоже самое, что и clock jitter:


/usr/src/contrib/ntp/ntpd/ntp_control.c
static struct ctl_var sys_var[] = {
        { 0,            PADDING, "" },          /* 0 */
        { CS_LEAP,      RW, "leap" },           /* 1 */
        ...
        { CS_JITTER,    RO, "jitter" },         /* 13 */
        { CS_ERROR,     RO, "noise" },          /* 14 */  <------ вот и далее по цепочке
        ...
};


в функции
static void ctl_putsys(int varid)
{
        ...
        switch (varid) {
        ...
        case CS_ERROR:
                ctl_putdbl(sys_var[CS_ERROR].text, clock_jitter * 1e3); <------ тут вот превращаемся в clock_jitter
        ...
};

а clock_jitter описана в /usr/src/contrib/ntp/ntpd/ntp_loopfilter.c, вот так

static double clock_offset;     /* offset (s) */
double  clock_jitter;           /* offset jitter (s) */


Измеряется он в долях секунды, вычисляется процедурой  clock discipline, влияет на параметр tau(poll), т.е. если clock jitter растет, то уменьшается интервал опроса (чаще проверяем часы). Сlock jitter имеет экспоненциальную зависимость от параметра offset, что видно из его графиков, быстро взлетает и потом медленно скатывается по экспоненте.

Взято вот отсюда http://www.eecis.udel.edu/~mills/ntp/html/poll.html , там более подробно:

"The poll interval is managed by a heuristic algorithm developed over several years of experimentation. It depends on an exponentially weighted average of clock offset differences, called clock jitter, and a jiggle counter, which is initially set to zero. When a clock update is received and the offset exceeds the clock jitter by a factor of 4, the jiggle counter is increased by the poll exponent; otherwise, it is decreased by twice the poll exponent. If the jiggle counter is greater than an arbitrary threshold of 30, it is reset to 0 and the the poll exponent is increased by 1. If the jiggle counter is less than -30, it is set to 0 and the poll exponent decreased by 1. In effect, the algorithm has a relatively slow reaction to good news, but a relatively fast reaction to bad news."