How to configure TSN endpoint

Revision as of 18:35, 27 October 2023 by Registered User (→‎TSN 802.1Qbv)
Applicable for Unknown MPU

"STM32MP25" is not in the list (STM32MP13x, STM32MP15x, STM32MP25x) of allowed values for the "Has applicability specified for" property.


1. Purpose[edit source]

This article describes how to configure TSN (Time-Sensitive Networking) endpoint
This article provides different steps to execute TSN scenario endpoint:

  • Need synchronization across the network. TSN requires precise time synchronization to ensure that time-critical data is delivered on time and in the correct order.
  • TSN 802.1Qav
  • TSN 802.1Qbv

The choice between 802.1Qav and 802.1Qbv depends on the specific requirements of the application. 802.1Qav is typically used in applications where bandwidth requirements are variable and unpredictable, while 802.1Qbv is typically used in applications where bandwidth requirements are fixed and predictable.

2. IEEE 802.1AS-Rev or gPTP synchronization[edit source]

PTP is a protocol that enables the synchronization of clocks in a network. It uses a master-slave architecture, where one device acts as the master clock and the other devices act as slave clocks. The master clock sends synchronization messages to the slave clocks, which adjust their clocks to match the master clock.

Testing using ptp4l tool from linuxptp project

To check the ptp clock adjustment with PTP protocol, a PTP slave (client) and a PTP master (server) applications are needed to run on separate devices. Open source application package linuxptp can be used as slave and as well as master. Hence TX timestamp generation can be delayed (especially with low speed links) the ptp4l “tx_timestamp_timeout” parameter need to be set for ptp4l to work.

create file /etc/gPTP.cfg with content as below:

 [global]
 gmCapable		1
 priority1		248
 priority2		248
 logAnnounceInterval	0
 logSyncInterval		-3
 syncReceiptTimeout	3
 neighborPropDelayThresh	800
 min_neighbor_prop_delay	-20000000
 assume_two_step		1
 path_trace_enabled	1
 follow_up_info		1
 transportSpecific	0x1
 ptp_dst_mac		01:80:C2:00:00:0E
 network_transport	L2
 delay_mechanism		P2P
Warning white.png Warning
Be careful if you are using PHY which managed “low power mode” (i.e EEE)

Most of the time this feature is not compatible with TSN. To be considered “asCapable” the maximum acceptable value for neighborPropDelayThresh is 800ns


PTP synchro between two boards:

  ptp4l -i end0 -p /dev/ptp0 -m -f /etc/gPTP.cfg
Warning white.png Warning
if several Ethernet instances, ptp0 is not necessarily affected to end0, to verify which instance is affected to ptp0:

ls -l /sys/class/ptp/ptp0


3. TSN 802.1Qav[edit source]

In TSN 802.1Qav or CBS (Credit-Based Shaper), each device is assigned a credit value that determines the amount of data it can transmit. The credit value is based on the bandwidth requirements of the device and the available bandwidth in the network. Devices with higher bandwidth requirements are assigned more credits, while devices with lower bandwidth requirements are assigned fewer credits.

As data is transmitted across the network, the credit values are decremented. When a device runs out of credits, it can no longer transmit data until it receives more credits. This ensures that time-critical traffic is given priority over other traffic, as devices with higher bandwidth requirements are able to transmit more data.

4. TSN 802.1Qbv[edit source]

802.1Qbv (Time-Aware Shaper) is a traffic scheduling technique that uses time-based scheduling to ensure that time-critical traffic is given priority over other traffic. It assigns time slots to each device based on its priority level.

5. References[edit source]