Ethernet for Timing


Ethernet for Timing

Add another entry to the growing list of uses for a converged Ethernet network: time. The same links that carry sensor, control and communication data can also allow connected devices to synchronize their clocks with sub-microsecond precision. Using the IEEE 1588 Precision Timing Protocol (PTP) and the timing hardware built into new switches and network adapters, systems can use the network to deliver the precision timing needed for real-time and sensor processing applications.

From Network Time to Precision Time

Using the network to set and synchronize time is not a new idea – the Network Time Protocol (NTP) is one of the oldest services still used on the Internet. Using a time server, a computer can set its clock to within a few milliseconds of the “true” time of day. This level of precision is good enough for many applications that only need the date and time for administration. But many applications need precision synchronization between modules – for example to coordinate motion controls or fuse data from multiple sensors.

Embedded systems that need synchronization between modules use a variety of approaches. Some distribute “radial” clock and reset signals over a backplane to support digital counters that increment in lockstep. Others synchronize using a periodic pulse such as the 1PPS signal produced by some GPS receivers. Distributing and processing these specialized sync signals can require additional wiring and specialized hardware.

By using IEEE 1588 PTP, distributed embedded systems can achieve sub-microsecond synchronization using their built-in Ethernet interfaces. When all the modules in a system, including the Ethernet switch, feature PTPv2 support in hardware, synchronization error can be as low as a few nanoseconds. This level of performance is good enough for some of the most demanding real-time applications, and is possible with off-the-shelf components.

Implementing PTP

Precision Time Protocol can run in software on any hardware with Ethernet/IP interfaces. Reference implementations for the “ptpd” are freely available for a variety of platforms. By using software alone, on a local-area network (LAN), connected systems can typically be synchronized within a few microseconds. With this approach, most of the sync error arises from the delays as packets are transmitted and then forwarded through the network. To reduce this error, we need support in the network hardware.

Network devices with support for IEEE 1588-2008 (PTPv2) can use “hardware timestamping” to track the time it takes packets to move through network devices. By adjusting for the time spend transiting a network switch, or the adapter on a computer, they can eliminate the error associated with network latency. When combined with suitable drivers, sync within a few nanoseconds becomes possible.