Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Problem in NTP Synchronization: (5 Items)
   
Problem in NTP Synchronization  
Hi

   I have client and server model in my LAN.I have two systems (10.105.178.153 -> ntpd server) and (10.105.178.152->ntpd
 client).The time difference between these two machines was 88 sec.After running ntpd -d on both machines started 
synchronization. Now the offset is going negative( -300 sec) means time of client is ahead than server by 6 mins.
According to my understanding it should stop when offset becomes 0.
(.153 -> QNX 6.4 AND  .152 ->QNX 6.3.2)

10.105.178.153 machines ntp conf file

# Example for the Internet server
#server server1_name_or_ip
#server server2_name_or_ip

# Example for a stand alone server

server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 7

driftfile /etc/ntp/ntp.drift

10.105.178.152 machines ntp conf file

# Example for the Internet server
#server server1_name_or_ip
#server server2_name_or_ip

# Example for a stand alone server

server 10.105.178.153

#server 127.127.1.0
#fudge 127.127.1.0 stratum 8

driftfile /etc/ntp/ntp.drift


Please let me know solution.Thanks in advance.

Re: Problem in NTP Synchronization  
Your configuration looks fine. So I think you need to pay attention to and do the following:

1) It needs time (generally around a few minutes) for ntpd to "warm" up. This is because ntpd needs to gather enough 
samples from the time resources in order to make decision on , e.g, if the time resoures are of good quality. So, make 
sure if the 6min difference is still there after you make sure the server and the client are in ntp-working state. The 
how-to is the following. 

2) On your client box, you may run ntpdate -d your_server (or simply ntpq -p your_server) to check if the server is 
ready to sync to. The ntpdate with -d option will do only the check and will not really adjust your system time. You may
 run ntpdate -d 127.0.0.1 to check if the client's ntpd is in normal working state. 

3) Most of the cases, if the larger the time difference between your server and client, the longer time for your client 
costs to sync with your server. So in practics, people run "ntpdate" first to sync with the servers and then run ntpd. 
If you look into initial config files on such as *BSD or Linux, you may see a rc.d script that parses /etc/ntp.conf and 
run ntpdate to sync with servers there.

4) no matter how good quality the outside time resources are, you have to have a relatively good quality (I mean clock) 
client box. So on your client side, you'd better have your "local clock" be one of the time resources. You'd better put 
its stradum a lower value, say, 12 for example, so the client ntpd would put more emphasis on higher stradum resources 
(say your server, it is of 7 as you defined) than on itself. 
RE: Problem in NTP Synchronization  
Another thing to watch for.   I've no experience with the QNX ntpd but
from past experience with ntpds deriving from ntp.org, ntpd rejects time
servers that appear to be misbehaving and not providing a stable time.
In particular Windows machines (or perhaps just Microsoft time servers)
tend to fail in this regard since Windows will (or would) reset its time
based on its CMOS clock whenever the difference exceeded a minute.   The
result was that ntpd would see the error jump periodically by a minute
and henceforth ignore the server.  My understanding is that Windows time
servers were primarily intended to support Kerberos which only required
synchronisation within a few minutes. 

Re: Problem in NTP Synchronization  
Hi Weijie,

    I still did not get the answer for my question.ntpd was running on my client machine atleast for 10 hours.
Initially Server time was ahead than my client machine by 88 secs.
    server time was 12:11:38
    client time was  12:10:10
After 10 hours I saw the time on my client machine

  It was 300 secs ahead than my server machine within LAN.

According to my understanding ntpd should stop adjusting the clock when offset becomes zero on client machine.
Please let me know the concept behind the ntpd.

Thanks,
-Rahul
Re: Problem in NTP Synchronization  
Hello,

could you analyze / post output of ntpdc -c dmpeers ?

You could be able to read the status of synchronization from it.

Regards, PKY

> Hi Weijie,
> 
>     I still did not get the answer for my question.ntpd was running on my 
> client machine atleast for 10 hours.
> Initially Server time was ahead than my client machine by 88 secs.
>     server time was 12:11:38
>     client time was  12:10:10
> After 10 hours I saw the time on my client machine
> 
>   It was 300 secs ahead than my server machine within LAN.
> 
> According to my understanding ntpd should stop adjusting the clock when offset
>  becomes zero on client machine.
> Please let me know the concept behind the ntpd.
> 
> Thanks,
> -Rahul