Xntpd

From AdminWiki

Jump to: navigation, search

Contents

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
keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0


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
==============================================================================
*LOCAL(0)        LOCAL(0)         3 l   51   64  377     0.00    0.000   10.01
 NTP.MCAST.NET   0.0.0.0         16 -    -   64    0     0.00    0.000 16000.0
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 ;)


Personal tools