Search code examples
offsetntp

What is Clock offset in NTP server


Can someone give a clear explanation regarding the Offset of Network Time Protocol(NTP), Because currently I am Try to build two android application which works as Master and Slave?


Solution

  • This all is explained in detail at ntp.org; for example:

    5.1.1.4. What happens if the Reference Time changes?

    Ideally the reference time is the same everywhere in the world. Once synchronized, there should not be any unexpected changes between the clock of the operating system and the reference clock. Therefore, NTP has no special methods to handle the situation.

    Instead, ntpd's reaction will depend on the offset between the local clock and the reference time.

    For a tiny offset ntpd will adjust the local clock as usual; for small and larger offsets, ntpd will reject the reference time for a while. In the latter case the operation system's clock will continue with the last corrections effective while the new reference time is being rejected. After some time, small offsets (significantly less than a second) will be slewed (adjusted slowly), while larger offsets will cause the clock to be stepped (set anew). Huge offsets are rejected, and ntpd will terminate itself, believing something very strange must have happened.

    Naturally, the algorithm is also applied when ntpd is started for the first time or after reboot.