TSN is the latest extension of the Ethernet standard, but what does it consist of, and how can it be used to synchronize devices on a network?
Introduction to TSN
Ethernet is a widely used communication standard that forms the backbone of the internet. It is standardized in IEEE 802.3 and is used to communicate a wide range of data. However, it has the disadvantage of not being deterministic. This means that there is no guaranteed response time for requests over Ethernet. For ordinary internet traffic, determinism is not a requirement, but for high-performance software and control processes, it is crucial that data arrives on time.
Various solutions have been developed to introduce determinism, including EtherCAT, which is a closed network with a fixed data frame transmitted at a high repetition rate. However, EtherCAT cannot be expanded into an open network and does not allow data other than what has been predefined.
TSN is a general solution that enables deterministic communication on open Ethernet networks. It requires hardware that supports TSN, but it is backward compatible, so standard Ethernet data can be transmitted over TSN-enabled networks.
Synchronization
To deliver deterministic communication, a shared concept of time is required, which is absent in standard Ethernet. This involves being able to synchronize different devices via TSN, which is the core of this post. Synchronization is standardized in TSN under IEEE 802.1AS, which is an extension of an earlier standard, IEEE 1588, also known as Precision Time Protocol (PTP). Therefore, TSN is compatible with PTP—but while PTP operates at layer 3 in the OSI model, TSN is a layer 2 technology, meaning it is unaffected by network traffic.
Synchronization in TSN is based on a master clock, which all other devices reference. The master clock is selected automatically on the local network based on which clocks are available and their specifications. If the master clock becomes unavailable, a new master is automatically selected, which the other devices then reference.
Based on the master clock, synchronization packets are then sent to the other devices on the network. These packets measure the distance from the master to all slaves, and this information is used to correct the slaves’ clocks when they are synchronized to the master clock. In this way, TSN can account for different cable lengths, different response times, and other imperfections in the network to achieve a synchronized network.
Why TSN?
The synchronization accuracy in TSN is less than 1 µs as standard, but it can often be improved by optimizing the network. This means that TSN is an ideal technique for distributed data acquisition systems with high sampling rates, where large amounts of data are transported over the network. This makes TSN suitable for, for example, structural testing, where large specimens are measured with many strain gauges at sampling rates that can exceed 100 kHz.
Deterministic communication via TSN makes it possible to use Ethernet in systems controlled by real-time operating systems (RTOS), such as machine control and hardware-in-the-loop (HIL). These applications require strict determinism, which makes standard Ethernet unsuitable. To read more about this, and how NI’s products support TSN, see here.