Re: [ntp:questions] Query NTP status on windows7

2016-09-20 Thread Brian Inglis

On 2016-09-20 04:49, sneha b wrote:


Is there a way to find out whether the sync was successful or not.
In vxworks we have ipsntp_query_time, is there something similar to this so
that I can use it programmatically and return success/failure.


NTP does not sync time (except perhaps at startup), it disciplines time within
128ms limits, normally within ms to us, so it depends on the configuration and
setup of your reference clocks, servers and daemons, availability and quality
of your network connections and timing sources, and your requirements:
are offsets of a few us required, or are a few ms okay; how much variance and
error is acceptable over what period of time, or during your critical times?

e.g.

$ ntpq -p -c rv
 remote   refid  st t when poll reach   delay   offset  jitter
==
oGPS_NMEA(0) .GPS.0 l9   16  3770.0000.002   0.002
+... .GPS.1 s   11   16  3761.1790.206   1.977
+utcnist2.colora .NIST.   1 u   43   64  377   64.8692.672  97.821
-montpelier.ilan .GPS.1 u2   64  377   71.7859.453  86.028
-tick.ucla.edu   .GPS.1 u   48   64  337   71.6499.634  69.159
...
associd=0 status=0419 leap_none, sync_uhf_radio, 1 event, leap_armed,
...
precision=-20, rootdelay=0.000, rootdisp=0.372, refid=GPS,
...
mintc=3, offset=0.002, frequency=-5.532, sys_jitter=0.002,
clk_jitter=0.000, clk_wander=0.001, ...

where:
polltime between source queries (s in ntpq, log2 s in conf)
reach   whether the source responded in the last 8 polls (bits in octal)
delay   time between sending query and receiving response (ms in ntpq)
offset  source time + delay/2 - system time (ms in ntpq)
jitter  variation in offset (ms in ntpq)
precision   time to read the system clock (log2 s)
drift   system clock estimated *frequency* drift (PPM, us/s)
wander  variation in frequency drift (PPM, us/s)
dispdispersion - offset maximum error

--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Query NTP status on windows7

2016-09-20 Thread Charles Elliott
First of all, please, you should never ask a question about computers
without

stating what your platform is, O/S and version, CPU, and memory size.  When 

asking a question about NTPD, you should state what version you are using.

 

Second, people can help more if you tell them what you are trying to do, 

what your goal is.

 

Third, it would help if you would identify yourself, name and organization, 

or at least organization type.  I, for one, am opposed to giving advice to 

terrorists.

 

All that being said, I used the ntpq program, which is in the ntp/bin
directory,  

for something similar to what you want.  The documentation for ntpq is in 

ntp/doc/HTML/ntpq.html.  I was working in Java, so I used the ProcessBuilder


class to start ntpq and pipe its output back to my program.  I issued the 

host command to ntpq to set the IP address of the queried computer.  Then 

I repeatedly issued the peers command and parsed the output, which is:

 

ntpq> peers

 remote   refid  st t when poll reach   delay   offset
jitter


==

FreeNAS 192.168.1.1003 u   14   1670.257   -0.353
0.310

+209.51.161.238  .CDMA.   1 u   13   167   16.4991.689
0.480

-time-c.nist.gov .ACTS.   1 u   13   165   87.567   34.167
0.714

-time-d.nist.gov .ACTS.   1 u   13   165   86.541   34.231
0.596

-bonehed.lcs.mit .CDMA.   1 u9   167   24.8621.969
1.437

-timelord.w1nr.n 200.98.196.212   2 u9   167   13.593   -0.543
2.816

+ntp1.conectiv.c .IRIG.   1 u   13   167   22.165   -0.793
0.598

-lookingglass.ed 74.104.167.114   2 u7   167   16.441   -1.988
0.996

*time.falk.us.GPS.1 u8   167   24.969   -0.128
0.698

 

The first column is the tally code.  The '*' is the server synced to, '+'
are sync 

candidates, and '-' means discarded by the cluster algorithm.  Space ' ' 

means designated no select, in my case.

 

An easier way, according to the documentation, is to issue the rv 0 command
to ntpq, 

where 0 stands for system variables, and rv means readvar or read variables.
A 

typical return is:

 

ntpq> rv 0

associd=0 status=0615 leap_none, sync_ntp, 1 event, clock_sync,

version="ntpd 4.2.8p8@1.3265-o Jun 18 15:51:19.34 (UTC+01:00) 2016  (1)",

processor="x86-SSE2", system="Windows", leap=00, stratum=2,

precision=-22, rootdelay=12.119, rootdisp=2.987, refid=209.51.161.238,

reftime=db8be1e9.5be1a5a3  Tue, Sep 20 2016 12:27:21.358,

clock=db8be1eb.c0fab301  Tue, Sep 20 2016 12:27:23.753, peer=37206, tc=5,

mintc=3, offset=0.132622, frequency=-15.726, sys_jitter=0.382788,

clk_jitter=0.754, clk_wander=0.021, tai=36, leapsec=20150701,

expire=20161228 

 

According to the documentation "clock_sync" means the system is synchronized


and "refid" is the peer synced to, but I have never personally used these 

for this purpose.  The status word is described in decode.html and 

might possibly be useful to you.

 

Charles Elliott

 

-Original Message-
From: questions
[mailto:questions-bounces+elliott.ch=comcast@lists.ntp.org] On Behalf Of
sneha b
Sent: Tuesday, September 20, 2016 6:49 AM
To: questions@lists.ntp.org
Subject: [ntp:questions] Query NTP status on windows7

 

Hi,

 

Is there a way to find out whether the sync was successful or not.

In vxworks we have ipsntp_query_time, is there something similar to this so
that I can use it programmatically and return success/failure.

 

Thanks

___

questions mailing list

 <mailto:questions@lists.ntp.org> questions@lists.ntp.org

 <http://lists.ntp.org/listinfo/questions>
http://lists.ntp.org/listinfo/questions

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


[ntp:questions] Query NTP status on windows7

2016-09-20 Thread sneha b
Hi,

Is there a way to find out whether the sync was successful or not.
In vxworks we have ipsntp_query_time, is there something similar to this so
that I can use it programmatically and return success/failure.

Thanks
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions