If you have your own server, why not consider joining the pool.ntp.org project to help provide accurate time to many client machines?
What is NTP?
NTP, or Network Time Protocol, is a method for computers to obtain the current time accurately in order to keep their clocks correct. Even when set accurately, the clock on most computers will eventually drift until it is no longer accurate – often made worse when the computer is being heavily loaded.
NTP allows a client to ask a time server to tell it the current time. The “main” timeservers have accurate timekeeping equipment connected (GPS receivers are common) to give them the correct time. Other timeservers simply keep in sync with several main servers, and accept requests from client machines.
What is the pool.ntp.org project?
The pool.ntp.org project is a big virtual cluster of timeservers striving to provide reliable easy to use NTP service for millions of clients without putting a strain on the big popular timeservers.
The “pool” contains a number of servers, often operated by volunteers, using DNS to automatically spread clients between available servers. This allows client machines to simply use a hostname like uk.pool.ntp.org which will resolve to a suitable server.
The pool is now enormously popular, being used by millions of systems around the world. It’s the default “time server” for most of the major Linux distributions. At the time of writing there are 1,419 servers taking part in the pool.
How to join the pool
Configure NTP
Firstly, be aware that joining the pool is a relatively long-term commitment; it’s easy enough to remove your machine from the pool, but due to the way NTP clients operate it may take weeks before the inbound NTP traffic fully stops, and if your machine isn’t answering requests during that time, it may interfere with clients ability to obtain an accurate time.
You’ll need a reasonable server with a permanent, reliable Internet connection and a static IP address; ideally a server hosted in a datacentre somewhere.
Running an NTP server doesn’t require massive CPU power or bandwidth (NTP packets are small UDP packets, generally 76 bytes). To give you an idea what to expect: my NTP server is currently answering requests at an average rate of 22 requests per second. At that rate, you can expect to transfer approximately 4GB per month, which is hardly a lot of bandwidth.
Firstly, you’ll need to install ntpd if you don’t already have it installed. I use Debian, and was able to install it quickly and easily with:
apt-get install ntp
You’ll need to edit /etc/ntp.conf to add several good servers. Look at the stratum 2 servers list and pick some geographically close to you. I would recommend 4-5 good servers, perhaps 6-7. For each server, add a line to ntp.conf like:
server server.name.here
Most servers are listed as OpenAccess, which means that anyone may use them; if the server has “Yes” in the Notify column then you’re asked to notify the owner of the server that you wish to peer with them – this is not a requirement but should be followed. If a server is listed as RestrictedAccess you should not use it until you’ve contacted the server owner and gained their approval.
Once you have ntp.conf filled out correctly, start NTP (for Debian/Ubuntu, /etc/init.d/ntp start ought to do it), you can use the ntpq command to list the servers your server is going to peer with:
davidp@lyla:~$ ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
-130.88.200.6 193.62.22.66 2 u 336 1024 377 6.717 1.061 0.475
85.118.152.252 .INIT. 16 u - 1024 0 0.000 0.000 0.000
*130.159.196.118 193.62.22.90 2 u 99 1024 377 11.576 -0.224 0.056
+89.234.6.27 193.190.230.65 2 u 120 1024 377 2.431 -0.463 0.120
-82.133.58.132 192.36.134.25 2 u 230 1024 377 29.544 -1.482 0.482
208.254.3.166 .INIT. 16 u - 1024 0 0.000 0.000 0.000
-62.84.188.34 140.203.16.5 2 u 270 1024 377 1.149 2.152 0.299
-129.215.160.240 129.215.64.241 3 u 189 1024 377 11.263 0.804 0.080
+129.215.42.240 129.215.64.245 3 u 180 1024 377 11.351 -0.940 0.257
x76.236.165.241 LOCAL(1) 11 u 176 1024 377 201.579 322884. 253.239
List your server
Read the instructions on the How do I join pool.ntp.org page, then login to the server management page and request that your server be added.
You will not see traffic immediately; the pool.ntp.org system will monitor your server for a while and ensure that it seems reliable. Once your server has reached an “availability score” of 5 or more, it will be included in the DNS. You can expect this to take a few hours at least.
If you liked that post, then try these...
SMART monitoring drives on 3ware cards
Logitech QuickCam Messenger under Linux