[ntp:questions] Re: A few y/n questions about what info I can get from NTP

Richard B. Gilbert rgilbert88 at comcast.net
Thu Jan 20 14:43:47 UTC 2005

Erik Corell wrote:

>Hi, I am doing a research project trying to do clock syncronization
>using ntp, pcap and tsc. Hopefully the outcome will be a very accurate
>and robust difference clock. I am a little bit stuck at the moment,
>having few questions on what ntp can and can not give me.
>Please pick one or two or all to answer.
>*Is there anyway I can access the final ntp time stamp? (The one my
>computer makes when the ntp packet returns)
AFAIK, there is no supported interface for doing so.   The timestamp is 
there and if you wish to risk modifying the code, you can access it.

>*Is it possible to know the exact value of the tsc register at the time
>for the "originate ts" in the NTP packet? If so is it also possible to
>get the exact tsc for when the packet returns?
>*Is the there ANY chance ntpd will reset (or step set what ever its
>called) my clock after sending but before recieving a NTP packet.
Yes, there is a chance.   ntpd will not normally step the clock, it has 
to be way out.    ntpd may make an adjustment to the clock frequency at 
each poll interval.  If there is only one server configured, I'd say 
it's highly unlikely   With two or more servers, it's possible for 
queries and responses to overlap.    Note that four servers is 
considered the minimum for reliable operation.

>*Is 0.5 ms/sec the most the clock rate may be skewed up or down to
>compensate for offset?
Yes!  At least that is the fastest that ntpd will slew the clock.  I 
believe that the limitation is built into the code rather than being a 
limit in the hardware or host O/S.  Do you believe you might need more?  
Why?  I'd say that if you really do need more, something is very wrong 
with your clock hardware.

>*Is the possible to get information about the current clock rate. (Maybe
>in terms of tsc.)?
Try ntptime.  That will display a bunch of clock variables:
sunblok_$ ntptime
ntp_gettime() returns code 0 (OK)
  time c59a3e58.1f7d4000  Thu, Jan 20 2005  9:27:36.123, (.123005),
  maximum error 142103 us, estimated error 5449 us
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset -128.000 us, frequency 11.912 ppm, interval 256 s,     
  maximum error 142103 us, estimated error 5449 us,
  status 0x101 (PLL,PPSSIGNAL),
  time constant 2, precision 1.000 us, tolerance 512 ppm,
  pps frequency 0.000 ppm, stability 0.000 ppm, jitter 1.000 us,
  intervals 10150, jitter exceeded 1515, stability exceeded 4, errors 41.

>*Can an application using pcap get information about leap seconds from
>the NTP packets or is there any other way of letting an application know
>when a leap second has occured?
>Please, please! It would be great to have answer on at least some of the
>Erik Corell

More information about the questions mailing list