[no subject]

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


I'd like to confirm that:

   - we can replace ntpd (ntpq/ntptime) with chronyd;
   - chronyd can return the requisite pieces of information;
   - it is possible to use a Java-based NTP client to obtain the data we
   seek; and
   - 1PPS signal loss can be detected immediately (e.g., upon querying its
   status).

Additional pointers to information on the NTP UDP messages with respect to
chrony that documents the fields we'd need to extract would be most
appreciated.

Thank you!

--00000000000001a45e05d31ffd13
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi there,</div><div><br></div><div>A Java application=
 uses a ProcessBuilder to execute the ntpq and ntptime commands to determin=
e the following pieces of information:</div><div><ul><li>1PPS lock status</=
li><li>1PPS connection status</li><li>Estimated error</li></ul><div>Calling=
 execve is an expensive operation and I&#39;d like to swap it for a relativ=
ely lightweight UDP call. Java libraries can send/receive NTP messages over=
 UDP, such as <a href=3D"https://commons.apache.org/proper/commons-net/";>Ap=
ache Commons Net</a>, <a href=3D"https://support.ntp.org/bin/view/Support/J=
avaSntpClient">JavaSntpClient</a>, and <a href=3D"https://github.com/zolyfa=
rkas/spf4j/blob/master/spf4j-core/src/main/java/org/spf4j/net/SntpClient.ja=
va">spf4j</a>&#39;s client.</div><div><br></div><div>For example, when 1PPS=
 is not locked, the ntpq command returns:<br></div><div><span> <br></span><=
/div></div><div>
<div style=3D"margin-left:40px"><span style=3D"font-family:monospace">
</span></div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=
=3D"font-family:monospace">=C2=A0=C2=A0=C2=A0=C2=A0 remote=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 refid=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 st t when poll reach=C2=A0=C2=A0 delay=C2=A0=C2=A0 offset=C2=A0 jitt=
er<span></span></span></p><div style=3D"margin-left:40px"><span style=3D"fo=
nt-family:monospace">
</span></div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=
=3D"font-family:monospace">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<span></span></span></p><div style=3D"m=
argin-left:40px"><span style=3D"font-family:monospace">
</span></div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=
=3D"font-family:monospace">*127.127.1.0=C2=A0=C2=A0=C2=A0=C2=A0 .LOCL.=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2 l=C2=A0=C2=A0=
=C2=A0 4=C2=A0=C2=A0 16=C2=A0 377=C2=A0=C2=A0=C2=A0 0.000=C2=A0=C2=A0=C2=A0=
 0.000=C2=A0=C2=A0 0.002<span></span></span></p><div style=3D"margin-left:4=
0px"><span style=3D"font-family:monospace">
</span></div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=
=3D"font-family:monospace">=C2=A0127.127.22.1=C2=A0=C2=A0=C2=A0 .PPS.=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 l=C2=A0=C2=
=A0=C2=A0 -=C2=A0=C2=A0=C2=A0 8=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0 0.000=
=C2=A0=C2=A0=C2=A0 0.000=C2=A0=C2=A0 0.000<span></span></span></p><div styl=
e=3D"margin-left:40px"><span style=3D"font-family:monospace">
</span></div><p class=3D"MsoNormal"><span>=C2=A0</span></p>
<p class=3D"MsoNormal">When 1PPS is locked, it returns (fudged IP):<br></p>
<p class=3D"MsoNormal"><span>=C2=A0</span></p><div style=3D"margin-left:40p=
x"><span style=3D"font-family:monospace">=C2=A0=C2=A0=C2=A0=C2=A0 remote=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 refid=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 st t when poll reach=C2=A0=C2=A0 delay=C2=A0=C2=A0 offse=
t=C2=A0 jitter<span></span></span>
</div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=3D"font=
-family:monospace">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<span></span></span></p><div style=3D"margin-=
left:40px">
</div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=3D"font=
-family:monospace">*192.168.66.196=C2=A0 129.6.15.28=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 2 u=C2=A0=C2=A0 12=C2=A0=C2=A0 16=C2=A0 377=C2=A0=C2=A0=C2=A0 0.2=
38=C2=A0=C2=A0 +0.639=C2=A0=C2=A0 0.027<span></span></span></p><div style=
=3D"margin-left:40px">
</div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=3D"font=
-family:monospace">=C2=A0127.127.1.0=C2=A0=C2=A0=C2=A0=C2=A0 .LOCL.=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2 l=C2=A0 19h=C2=A0=
=C2=A0 16=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0 0.000=C2=A0=C2=A0 +0.000=C2=
=A0=C2=A0 0.000<span></span></span></p><div style=3D"margin-left:40px">
</div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=3D"font=
-family:monospace">o127.127.22.1=C2=A0=C2=A0=C2=A0 .PPS.=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 l=C2=A0=C2=A0=C2=A0 1=C2=
=A0=C2=A0 16=C2=A0 377=C2=A0=C2=A0=C2=A0 0.000=C2=A0=C2=A0 -0.001=C2=A0=C2=
=A0 0.002<span></span></span></p><div style=3D"margin-left:40px">
</div><p class=3D"MsoNormal"><span><br></span></p><p class=3D"MsoNormal"><s=
pan>The output from the commands can be parsed and relayed to the rest of t=
he Java application.<br></span></p><p class=3D"MsoNormal"><span>=C2=A0</spa=
n></p>
<p class=3D"MsoNormal">Similarly, when the 1PPS signal has been lost (e.g.,=
 GPIO cable unplugged), the ntptime command returns:<br></p>
<p class=3D"MsoNormal"><span>=C2=A0</span></p><div style=3D"margin-left:40p=
x"><span style=3D"font-family:monospace">ntp_gettime() returns code 5 (ERRO=
R)<span></span><span></span></span></div><p class=3D"MsoNormal" style=3D"ma=
rgin-left:40px"><span style=3D"font-family:monospace">=C2=A0 maximum error =
206000 us, estimated error 0 us,<span></span></span></p><div style=3D"margi=
n-left:40px">
</div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span style=3D"font=
-family:monospace">=C2=A0 status 0x2007 (PLL,PPSFREQ,PPSTIME,NANO),<span></=
span></span></p><span>=C2=A0</span>
<p class=3D"MsoNormal">Note the lack of <b>PPSSIGNAL</b>, which is present =
when the GPIO port is carrying a signal:<br></p><p class=3D"MsoNormal"><br>=
</p><div style=3D"margin-left:40px"><span style=3D"font-family:monospace">n=
tp_adjtime() returns code 0 (OK)<span></span><br>=C2=A0 maximum error 20600=
0 us, <b>estimated error 1 us</b>,<span></span></span>
</div></div><div><p class=3D"MsoNormal" style=3D"margin-left:40px"><span st=
yle=3D"font-family:monospace">=C2=A0 status 0x2107 (PLL,PPSFREQ,PPSTIME,<b>=
PPSSIGNAL</b>,NANO),<span></span></span></p><br></div><div>When the estimat=
ed error is between 5 and 10 us, we issue a warning. When greater than 10 u=
s, we take other actions. Again, this information is parsed from by reading=
 from standard output, which I&#39;d like to avoid.<br></div><div><br></div=
><div>From the documentation/faq, the chrony daemon looks like it can provi=
de all this information.<br></div><div><br></div><div>I&#39;d like to confi=
rm that:</div><div><ul><li>we can replace ntpd (ntpq/ntptime) with chronyd;=
</li><li>chronyd can return the requisite pieces of information;<br></li><l=
i>it is possible to use a Java-based NTP client to obtain the data we seek;=
 and</li><li>1PPS signal loss can be detected immediately (e.g., upon query=
ing its status).<br></li></ul><div>Additional pointers to information on th=
e NTP UDP messages with respect to chrony that documents the fields we&#39;=
d need to extract would be most appreciated.</div><div><br></div><div>Thank=
 you!<br></div></div></div>

--00000000000001a45e05d31ffd13--

-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/