Translate

Image of Beginning Google Maps API 3
Image of Linux Kernel Development (3rd Edition)
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)
Image of Operating System Concepts

Precision Time Protocol

Most Linux users are familiar with the Network Time Protocol (NTP) but few are aware of Precision Time Protocol (PTP) which is another protocol that can be used to synchronize clocks throughout a computer network.

PTP is defined in IEEE 1588-2008 (Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems). PTP is designed for computing systems requiring time accuracies beyond those attainable using NTP, i.e. high time precision systems. By the way, NTP is documented in RFC 5905.

PTP is an on-the-wire protocol and typically includes hardware support in the servers, clients and switches to capture timestamps from special Ethernet frames. Not all NICs support PTP. In fact, currently the majority of network controller do not have such support. A example of modern networking chips that have PTP support is the Intel 82574L Gigabit Ethernet controller.

Support for PTP was introduced in Linux version 2.6.30. A driver framework and user space API for clock control is available. Starting with version 3.5 of the Linux kernel, you can query the time stamping capabilities of a network interface using the ETHTOOL_GET_TS_INFO ioctl. Using ethtool version 3.4 and later, you can check a NIC’s time stamping capabilities and associated PTP hardware clock.

Here is what ethtool outputs for an Intel Corporation 82572EI Gigabit Ethernet Controller on Fedora 19:

# ethtool -T p2p1
Time stamping parameters for p2p1:
Capabilities:
	software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
	software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
	software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
PTP Hardware Clock: none
Hardware Transmit Timestamp Modes: none
Hardware Receive Filter Modes: none

For further information about Linux support for PTP, have a look at the Linux PTP Project.

Comments are closed.