Xntpd

From pressy's brainbackup
Jump to: navigation, search

xntpd - Network Time Protocol Daemon

Sun systems use a combination of an oscillator and a 64-bit counter to keep track of time. A specific number of oscillations cause an interrupt that, if processed, causes the counter to increment. A SPARC CPU generates by default 100 interrupts per second, they must be processed by the kernel. However, if the system has a high load or higher priority tasks, not all interrupts get processed; so the clock will fall slightly behind... A very common way to keep all systems synchronized is the "Network Time Protocol".

Solaris xntpd is a complete implementation of the Network Time Protocol (NTP) version 3 standard, as defined by RFC 1305.


Server Configuration

You will find a predefined startup script at /etc/rc2.d/S74xntpd, which starts the xntpd process in either the client or the server mode, depending on the contents of the /etc/inet/ntp.conf file.


Local NTP

edit your /etc/inet/ntp.conf:

server 127.127.1.0 prefer
broadcast 224.0.1.1 ttl 4
enable auth monitor
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable
keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0

creat the ntp.drift file, as specified in the ntp.conf, and start the ntp-server

# touch /var/ntp/ntp.drift
# /etc/init.d/xntpd start

External NTP Reference Servers

edit your /etc/inet/ntp.conf:

server time-server-1
server time-server-2
server time-server-3
broadcast 224.0.1.1 ttl 4
enable auth monitor
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable


By default, all NTP messages are sent to the syslog utility.


Determining NTP Peers

you can use the ntpq utility to identify NTP peers on the network:

# ntpq
ntpq> peers
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
 NTP.MCAST.NET   0.0.0.0         16 -    -   64    0     0.00    0.000 16000.0
*alpha.dorn.at   clock.via.net    2 u  587 1024  377    13.44   -2.639    8.65
+h2348.serverkom 192.53.103.108   2 u  615 1024  377    25.21   -3.287    8.61
+time3.apple.com 17.254.0.49      2 u  645 1024  377   186.17   -5.556    8.58
ntpq> exit

Client Configuration

edit your /etc/inet/ntp.conf and add:

multicastclient 224.0.1.1

start your xntpd:

# /etc/init.d/xntpd start

32 bit vs. 64 bit counter

The 32-bit time counter would reach its limit in the year 2038. The time counter was started at 0 at midnight, January 1, 1970. The 64-bit counter will reach its limit in about 290 million years. That should be enough, even for a sun-server ;)