TSN is the latest extension of the Ethernet standard, but what does it consist of and how can it be used to synchronise devices on a network?
Ethernet is a widely applied communication standard that makes up the backbone of the internet. It is standardised in IEEE 802.3 and is used for transmitting a plethora of data. It comes with the drawback that it is non-deterministic, i.e., there is no guaranteed reply time for requests over ethernet. For common internet traffic, determinism is not required, but for high-performance software and control processes, it is crucial that data arrives on time.
Several solutions have been made to introduce determinism in ethernet, for example EtherCAT which consists of a closed network with a fixed data frame that is transmitted at a high repetition rate. However, EtherCAT cannot be extended to an open network and does not allow other data than what has been predefined.
TSN is a general solution that allows deterministic communication on open ethernet networks. It requires TSN-enabled hardware but is backwards compatible so ordinary ethernet data can be transmitted on TSN networks.
In order to deliver deterministic communication, a common concept of time is required, which is absent in ordinary ethernet. This involves the ability to synchronise different devices over TSN which is at the core of this post. Synchronisation is standardised 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 where PTP works on level 3 in the OSI model, TSN is a level 2 technology which makes it insensitive to network traffic.
Synchronisation in TSN is based on a master clock that all the other devices refer to. The master clock is automatically selected from the local network on the basis of what clocks are available and their specifications. If the master clock becomes unavailable, a new master is automatically selected to which the other devices will refer.
From the master clock, synchronization packets are 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 adjust the slave clocks when they synchronize with the master clock. In this way, TSN can take difference in cable length into account, as well as difference in response times and other imperfections in the network, in order to achieve a synchronous network.
The quality of synchronisation in TSN is better than 1 µs by default, but it can often be improved, if the network is optimised. That means that TSN is an ideal technique for distributed data acquisition systems with high sampling rates, where large amounts of data is transmitted over the network. This makes TSN suited for, e.g., structural tests, where large units are measured with many strain gauges at sampling rates up to 100s of kHz.
Deterministic communication via TSN lends itself towards using Ethernet in systems controlled by real-time operating systems (RT-OS), such as machine control and hardware in the loop (HIL). Here, strict determinism is required, making ordinary Ethernet unsuited. For more information about this and TSN support in NI’s products, see here.