RFC-2783 describes the PPSAPI application programming interface for external precision time signals, such as the pulse-per-second (PPS) signal generated by some radio clocks and cesium oscillators. The PPSAPI provides a generic capability in the ubiquitous Unix kernel which can be used for a wide variety of measurement applications, including network time synchronization and related experiments. The hardware to do this requires only a serial port and a modem control lead, such as the data carrier detect (DCD) lead, which can be driven by an external source via a level converter/pulse generator such as described on the Pulse-per-second (PPS) Signal Interfacing page. In some systems a parallel port can be used for the same purpose.
The PPSAPI interface defined in RFC-2783 is the only PPS interface supported in NTP Version 4. The PPSAPI is supported in stock FreeBSD and, with the addition of the PPSkit kernel module, in Linux.
The special header file /usr/include/sys/timepps.h implements the PPSAPI using whatever primitives are available in each archeticture and operating system. It obsoletes previous APIs based on the tty_clock and ppsclock line disciplines and streams modules, which are no longer supported.
The PPS Clock Discipline driver (type 22) uses the PPSAPI in conjunction with a local radio clock or remote NTP server as a reference clock. The driver can also use the PPSAPI as an interface directly to the kernel PPS facility as described on the Kernel Model for Precision Timekeeping page.
The PPSAPI interface provides the following functions:
The entire PPS interface functionality is currently provided by inline code in the timepps.h header file. While not all implementations support the full PPSAPI specification, they do support all the functions required for the PPS driver described next. The FreeBSD, Linux and Solaris implementations can be used with the stock kernels provided with those systems; however, the Tru64 and SunOS kernels require additional functions not provided in the stock kernels. Solaris users are cautioned that these functions operate improperly in Solaris versions prior to 2.8 with patch Generic_108528-02. Header files for other systems can be found via the web at nanokernel.tar.gz.