In article 
<[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] wrote:

> On Dec 1, 3:07 pm, Joseph Gwinn <[EMAIL PROTECTED]> wrote:
> > In article
> > <[EMAIL PROTECTED]>,
> >
> >  [EMAIL PROTECTED] wrote:
> > > Does anybody know of any *practical* samples on how to
> > > implement NTP/SNTP client?. The goal is to provide accurate
> > > time for a program/client running on Windows Vista.
> >
> > > Specifically, what values to include in the the request message,
> > > how to process the reply message, etc.
> >
> > > I am NOT asking how to send/receive UDP datagrams, or where
> > > to find comprehensive descriptions like RFC documents, or how
> > > to build or design user interfaces.
> >
> > > Only a narrow description focused on NTP/SNTP request/reply
> > > datagrams for a simple PC client, preferably in C/C++ source
> > > code.
> >
> > I've done this in an embedded realtime system.  (No, the source code is
> > not available.)  
> >
> > In Appendix A of RFC-1305 you will find the format of the NTPv3
> > request/response packet.  Send this packet to port 123 of the NTP
> > server, and read the reply packet.  It's pretty easy.  
> >
> 
>  I saw this format. From data comm point of view it is very unusual
>  to have the same format for request and reply.
> 
>  Sending/receiving the packet to port 123 is the first thing I tried.
>  This is not an issue. The issue is to use all the  values in
>  request and reply correctly and reliably. And the quickest
>  way is to get as many ***samples*** as possible, the
>  RFC  doc ***alone*** is the slowest way.

Umm.  You might wish to read the rest of RFC-1305.  It really was not 
hard to get times from the server, or to be a server.  If you want to do 
the full NTP, then the easiest solution is to use NTP itself.

In the embedded realtime system I mentioned, we were actually 
implementing the timeserver, to allow ordinary UNIX boxes to use NTP to 
synchronize to our purpose-built time hardware, so all boxes in the 
system were using the same timescale.

Joe Gwinn

_______________________________________________
questions mailing list
questions@lists.ntp.org
https://lists.ntp.org/mailman/listinfo/questions

Reply via email to