NTP is a suite of algorithms and specifications developed as an Internet protocol to ensure accurate synchronisation of client computers. Network Time Protocol specifies an agreed message structure to pass time from an accurate reference to a time client. This article describes how to configure the NTP server software distribution on a Linux server. It also provides information on how to synchronise time with a stratum 1 public NTP server.
Internet based NTP time server systems fall into two categories: primary and secondary reference servers. Primary reference servers utilise a highly accurate external timing reference, such as GPS or radio clocks, to provide precise time. Secondart reference servers synchronise their time with primary reference servers and therefore offer slightly reduced accuracy. Primarty reference servers are designated stratum 1, while other servers have a higher stratum, ie 2 or above.
The NTP source code is freely downloadable under the GNU public license from the NTP web site at 'ntp.org'. NTP was originally developed for the LINUX operating system, however, a port to Windows NT is also available. Once the source code has been obtained, it should be installed, compiled and configured on the host computer. This process is automated with the installation and configuration scripts supplied in the distribution. Many Linux based operating systems have the NTP package pre-installed. However, it may be prudent to download and install the latest version, which is currently 4.2.4.
The NTP daemon is configured via a configuration file 'ntp.conf'. This configuration file may contain a list of public NTP server references that can be used by the host to synchronise time. Public NTP time servers are specified using the 'server' command, any characters after the '#' symbol are comments:
server time-a.nist.gov # Public NTP server: NIST, Gaithersburg, Maryland server time-c.timefreq.bldrdoc.gov # Public NTP Server: NIST, Boulder, Colorado
When the configuration file is complete the NTP daemon can be started using the 'ntpd start' script. Other scripts are vailable that can be used to control the daemon: 'ntpd stop', 'ntpd restart'. There is also a query script available that shows the current synchronisation status of the daemon: 'ntpq -p'.
The 'restrict' command can be used to control access premissions to the NTP server. There are a number of permutations or the 'restrict' command; a few examples are listed below.
restrict default ignore #Restrict all access to the time server restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap # Only allow local computers access
Multiple commands can be specified to restrict or disallow access to a range of computers.
NTP provides an additional level of security by utilising authentication codes. This is a mechanism where matching key codes can be specified on a client and server which are encrypted and passed between the server and client. This allows a client to confirm the source of a time message. Authetication keywords are specified in the 'ntp.keys' file. They are specified using a key reference, encryption code and authentication key. Additionally, trusted authentication keys can be specified using the 'trusted key' command is the 'ntpd.conf' configuration file.
Setting Up Ntp Server
The Network Time Protocol was originally developed over 25 years ago as a means of synchronizing computers on the Internet. NTP is a suite of applications that provide synchronization of time to an accurate timing reference. Originally developed for LinuxUNIX, NTP has since been rewritten for the Microsoft Windows operating systems. NTP allows a network time client to synchronize to within milliseconds of an accurate external time reference.
Combining an accurate external timing reference with the NTP application provides a highly accurate network timing device. This article describes how to utilize a low-cost GPS receiver in combination with the NTP software distribution to provide an accurate stratum 1 NTP server timing reference.
The NTP source code can be obtained from the NTP website and must be compiled on the local machine. The downloadable NTP tar file extracts to a directory where scripts are available to make compilation and configuration very straight-forward. Many Linux distributions provide pre-installed versions of the software. To set up and install a stratum 1 time server a stable external timing reference is required. The NTP software provides a large number of reference clock drivers that can be utilized to interface with a range of hardware timing references. Hardware timing references can generally be fairly expensive pieces of equipment. However, the popularity of GPS navigation devices has reduced the cost of GPS technology. Low-cost GPS receivers are now readily available from around $100. Many GPS receivers have a RS232 serial communications port, which can easily be connected to a PC. Many low-cost GPS devices use the NMEA protocol, which is a standard GPS protocol for providing location and timing information. The timing information can be utilised by the NTP software as an accurate timing reference to provide a stratum 1 NTP server.
The NTP software needs to be compiled with the NMEA reference clock driver to interface with the GPS receiver. Once compiled the application must be configured to utilize the correct serial port. When correctly installed and configured, the NTP application will provide your network with an accurate, stable timing reference.
Most computers such as Linux and Microsoft Windows servers and network devices such as routers and switches can synchronize time with a NTP server. Any network device that has an integrated NTP client can be configured to synchronize time with the NTP server. Generally, clients only need the IP address of the NTP server for synchronization. With a NTP server, you can synchronize almost any device on your network.
Both David Evans & Dylan Sun are contributors for EditorialToday. The above articles have been edited for relevancy and timeliness. All write-ups, reviews, tips and guides published by EditorialToday.com and its partners or affiliates are for informational purposes only. They should not be used for any legal or any other type of advice. We do not endorse any author, contributor, writer or article posted by our team.
David Evans has sinced written about articles on various topics from Computers and The Internet, Personal Desktop and Computers and The Internet. D. Evans is a specialist technical author whose expertise is Linux NTP Server synchronisation systems to ensure accurate time on computer networks. Please click here for more information on. David Evans's top article generates over 18100 views. to your Favourites.
Dylan Sun has sinced written about articles on various topics from Astrology, Organizational and Gardening. , the leading B2B platform, combining vertical search engine with value added service portal. It has more than 430 000 China quality suppliers and p. Dylan Sun's top article generates over 90500 views. to your Favourites.
30 Rock Goodbye My Friend Want revenge on the playground bully without using violence. Then success is the sweetest revenge and if that means more education on how to excel then sweet is sweeter than sweet