1823081 Members
3318 Online
109645 Solutions
New Discussion юеВ

drift file

 
SOLVED
Go to solution
himacs
Super Advisor

drift file

Hi Gurus,

Please tell me why ntp.drift file used..

I did some digging in itrc, but didn't get good answer


regards
himacs
8 REPLIES 8
Andrew Rutter
Honored Contributor

Re: drift file

hi,

ntp drift file is used to help syncronize the machines

see here

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN4/0206____.HTM

Andy
Matti_Kurkela
Honored Contributor
Solution

Re: drift file

The xntpd daemon compares the local system clock to configured NTP timesources and calculates the drift rate of the local system clock. For example: "the system clock is slow by about 0.3 seconds per day".

The ntp.drift file is used to store this drift rate information for two purposes:

- when a system is rebooted, the xntpd does not need to start the comparision from scratch if it has the previous drift rate available

- if a system is rebooted with no access to the network, xntpd can use the known drift rate to minimize the system clock error until connection to NTP timesources can be re-established.

MK
MK
Suraj K Sankari
Honored Contributor

Re: drift file

HI,
See the below things which i got from google friend.

1.The driftfile entry in /etc/inet/ntp.conf tells xntpd the name of the file where it can find and store the clock drift, also known as frequency error, of the system clock. If the file exists at startup, it is read and the value is used to initialize xntpd's internal value of the frequency error. The file is updated once every hour by xntpd. It usually takes a day or so after the daemon is started to compute a good estimate of the clock drift. Once the initial value is computed, it will change only by relatively small amounts during the course of continued operation. Because xntpd needs a good estimate to synchronize closely to its server, there should always be a driftfile entry in /etc/inet/ntp.conf.

2.etc/ntp.drift contains what it needs to know if it loses contact with all your servers and needs to "go it alone

3.Make a fake ntp.drift file containing a value which would correct for your drift rate (about -10.0), plus a value big enough to bring it back in line within a week: -(20 * 60) * 1e6 / (86400 * 7) = -1984

Since this number is too large (greater than 500 ppm), I suspect that you'll have to settle for using -500 in ntp.drift, and allow up to four weeks for your clock to be approximately correct of slightly slow.

Suraj
himacs
Super Advisor

Re: drift file

Hi All,

/etc/ntp.drift file lists below value.

more /etc/ntp.drift
-6.232 0

As i understood drift file shows the frequency error or time difference between server and client.

NOw my Q is whats the value -6.232 0


regards
himacs
Raj D.
Honored Contributor

Re: drift file

himacs,

/etc/ntp.drift contains the frequency error of the clock. Clock hardware are not very accurate . This is simply because the frequency that makes time increase is never exactly right. , there would be some frequency error , even .001% frequency error could cause 1 sec delay.



Frequency Discipline :
The ntpd behavior at startup depends on whether the frequency file, usually ntp.drift, exists. This file contains the latest estimate of clock frequency error. When the ntpd is started and the file does not exist, the ntpd enters a special mode designed to quickly adapt to the particular system clock oscillator time and frequency error. This takes approximately 15 minutes, after which the time and frequency are set to nominal values and the ntpd enters normal mode, where the time and frequency are continuously tracked relative to the server. After one hour the frequency file is created and the current frequency offset written to it. When the ntpd is started and the file does exist, the ntpd frequency is initialized from the file and enters normal mode immediately. After that the current frequency offset is written to the file at hourly intervals.


From the ntp time source (/etc/ntp.conf) and drift file ntp.drift , ntpd adjust the server time accordingly. In you case latest estimate of clock frequency error is -6.232 .

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Michael Steele_2
Honored Contributor

Re: drift file

Re: "....Clock hardware are not very accurate . This is simply because the frequency that makes time increase is never exactly right. , ..."

You know there isn't a true comment in either of these statements? Please refer to atomic clocks and the CONSTANT delay of cesium. When you've done this, please refer to quartz watch crystals and their CONSTANT frequency vibration. Better yet, the Discovery channel has a very good episode on the "How Things Work" show.

As for the drift file, LATENTCY INCREASES OVER NETWORKS. The offset between the correct and incorrect times are know as 'drift'. And its just there to store the last offset, or drift, from the last syncing.
Support Fatherhood - Stop Family Law
Matti_Kurkela
Honored Contributor

Re: drift file

Michael, do you know *any* generally-available Unix system with an internal cesium clock? Or even any currently-available HP-UX hardware with a calibrated, temperature-stabilized ("ovenized") quartz crystal oscillator in the Real-Time Clock?

I've understood that most built-in real time clocks in generally-available computers are based on regular non-ovenized crystal oscillators, which are somewhat sensitive to temperature - so the drift rate of the real time clock may depend on, among other things, the load level of the system (different load -> different in-chassis temperature -> slightly different RTC frequency).

Raj's statement would have technically needed a qualification ("Clock hardware in normal servers are not very accurate...") but because this group deals with HP-UX system administration and are clearly talking about a basic case of Unix xntpd, the omission would be within the limits of reasonable.

> As for the drift file, LATENTCY INCREASES OVER NETWORKS. The offset between the correct and incorrect times are know as 'drift'. And its just there to store the last offset, or drift, from the last syncing.

NTP does not simply sync to the timesource with the least latency. It collects time and latency information over time and builds error estimates for each timesource, *including* the local system clock.

According to the documentation of NTP, the drift file is *not* related to the network latency in any way. It is simply the frequency error (or the time error rate, which amounts to the same thing) of the local system clock, as determined using the best available idea of the correct time.

Xntpd client-side works by measuring the latency to configured network timesources (using the possibly-inaccurate local clock) and compensates for it, if the latency is deterministic. When the time information gained from network timesources is good enough, it is used to measure the accuracy of the local clock.

Because xntpd typically has no access to any absolutely correct time, this becomes an iterative process: a better estimate of local system clock error leads to more accurate measurements of network latency, which will in turn improve the quality of time information received from the network. With that, the error of the local clock can be measured more accurately, closing the cycle.

The drift file is used to store the known frequency error of the local system clock, so that this iterative process (which can take days) can be shortened after the xntpd is restarted.

MK
MK
Michael Steele_2
Honored Contributor

Re: drift file

Dude, even PCs sync up to NIST. You know, those guys with atomic clocks spread out through out the country for computers to sync up with.

Support Fatherhood - Stop Family Law