TSN switching equipment supporting plug and play and delay compensation method based on TSN switching equipment
By predicting packet arrival times and performing delay compensation in TSN switching equipment, the problem of complex traffic planning in TSN networks is solved, enabling plug-and-play and online traffic planning, and improving the versatility and flexibility of the network.
Patent Information
- Application Number
- CN202511160748.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2025-11-18
AI Technical Summary
The traffic planning algorithms in existing TSN networks are complex, which means that they can only be designed offline and cannot be plug-and-play. Furthermore, they need to be redesigned when the network topology changes, which lacks versatility and economy.
By predicting the arrival time of packets at each hop TSN switching device on the forwarding path of time-sensitive traffic, the forwarding delay of the previous hop TSN switching device is compensated, so that the hop-by-hop forwarding delay can be controlled. Adaptive delay unit and TAS mechanism are used for adaptive delay compensation.
It is a plug-and-play TSN switching device that can independently plan traffic, support online identification of sensitive traffic cycles, has a certain degree of congestion tolerance, and can quickly forward urgent transaction traffic.
Smart Images

Figure CN120980036A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data exchange network, in particular to a TSN exchange device supporting plug and play and a delay compensation method based on the same. BACKGROUND
[0002] In the TSN (Time Sensitive Network) specification, TAS (Time Aware Shaper), ATS (Asynchronous Traffic Shaper) and CBS (Credit Based Shaper) can more or less achieve the purpose of reducing congestion and controlling end-to-end forwarding delay to some extent, but only the CQF (Cyclic Queuing and Forwarding) mechanism can guarantee that the forwarding delay is strictly limited within a certain expected range.
[0003] The basis of TSN forwarding is network-wide time synchronization. Under the premise of network-wide time synchronization, the CQF mechanism can effectively achieve end-to-end forwarding delay control for periodic traffic in TSN. The essence of the CQF mechanism is a double-buffer transmission mechanism. Assuming there are two buffers a and b, the input packet enters buffer a, and the packets in buffer a are prohibited from being scheduled for output, while the packets in buffer b are allowed to be scheduled for output. After a period of t, buffer b receives the input from the port, and the packets in buffer b are prohibited from being scheduled for output, while the packets in buffer a are allowed to be scheduled for output. This cycle continues, and the delay of the packet in the device is in the range of [0, t]. When n devices are cascaded to forward packets, the end-to-end delay range is [(n-1) t, n t], thereby achieving end-to-end forwarding delay control.
[0004] Congestion can cause the forwarding delay to be out of control, and the CQF mechanism can avoid congestion. Under the periodic traffic model, through the TAS mechanism of the end device in the network-wide time synchronization, the traffic accessing the TSN can be converted into a network-wide time-synchronized burst form. By controlling the opening time of the TAS gate of the end device, the time when the traffic accesses the device during forwarding can be controlled. Correspondingly, through traffic planning, congestion on the device can be avoided. Under the CQF mechanism with a period of t, the forwarding delay of a single device can be guaranteed to be no more than t, and correspondingly, the forwarding delay range after n hops can be guaranteed to be within [(n-1) t, n t].
[0005] The input traffic gate processing of the PSFP (Per Stream Filtering and Policing) mechanism and the output gate scheduling of the TAS mechanism can implement the CQF forwarding mechanism. The most important deficiency of the CQF mechanism is that the traffic planning algorithm is very complex, which results in that the traffic planning of almost all TSN networks can only be implemented offline.
[0006] Under the CQF mechanism, the burst period of all traffic coupled along the forwarding path in the network, the length of a single burst (all traffic), and the start time of the flow are all constraints for traffic planning. CQF traffic planning is essentially a linear problem-solving process, as illustrated in a simple diagram. Figure 1 As shown. During CQF forwarding or TAS forwarding, the TAS gating list can only be managed based on the output port. The sliding period of the gating list must be compatible with the periods of all flows on the output port. This results in multiple flows outputting from the port, where the forwarding period, starting phase, and even the burst length of each flow become coupled, making the traffic planning algorithm extremely complex.
[0007] Specifically Figure 1 TSN switching devices SW0 and SW1 are linked via link L0. The burst periods for the three flows are period1, period2, and period3, respectively. To ensure scheduling gating is compatible with p1, p2, and p3, according to the TSN specification, a greatest common divisor (GCD) of p1, p2, and p3 must be found as the TAS gating sliding period. Since flow periods vary widely, finding a GCD for these periods is very difficult. A typical example is when video devices are present in the network. The period at which these devices send messages is the same as the video frame rate, such as 24 frames per second (fps), 25 frames per second (fps), or 1100 frames per second (fps). Calculating the GCD between the video frame rate and the control frame rate (e.g., 8000 pps, 500 pps) is extremely difficult.
[0008] In addition to supporting different burst cycles, TSN also offers various methods for sending messages within each burst cycle, such as... Figure 2 The display shows common traffic patterns. TSN traffic planning algorithms are complex, so offline TSN traffic planning is possible. Consequently, TSNs must be custom-designed. When TSN terminal devices such as sensors, transmitters, and servo devices are added, or when the network topology changes, traffic planning within the network must be re-planned. Therefore, current TSN systems have significant shortcomings in terms of versatility and cost-effectiveness. Summary of the Invention
[0009] In view of this, this application provides a plug-and-play TSN switching device and a delay compensation method based thereon. By predicting the arrival time of packets at each hop TSN switching device on the forwarding path of time-sensitive traffic, the forwarding delay of the previous hop TSN switching device is compensated, so as to make the forwarding delay of each hop TSN switching device predictable, thereby achieving the goal of end-to-end controllable forwarding delay.
[0010] This application discloses a latency compensation method based on a plug-and-play TSN switching device, which includes: The end-to-end forwarding path passes through multiple TSN switching devices. On the input channel of the next TSN switching device, the forwarding delay of the previous TSN switching device is compensated to ensure that the forwarding delay between the output channel inlets of any two adjacent TSN switching devices on the forwarding path is fixed, and the actual forwarding delay of the forwarding device is consistent with the expected delay.
[0011] Furthermore, the TSN switching device captures packets to its processor and calculates the traffic cycle by approximation. When capturing packets to the processor, the port identifies the sequence number of the packet to avoid unexpected errors when approximating the traffic cycle due to packet loss when sending captured packets to the processor.
[0012] Furthermore, the compensation for the forwarding delay of the previous TSN switch on the input channel of the next TSN switch includes: Calculate the expected arrival times of all messages sent by the previous TSN switch in each cycle to the output channel of the current TSN switch: After obtaining the expected arrival time of each message to the output channel of the current TSN switching device, messages arriving before the current time wait at the entrance of the output channel of the current TSN switching device until the current network synchronization time exceeds the expected arrival time of the message. When a TSN switching device receives a packet at its port, it requests a pointer from the output packet queue EQ_GROUP based on the packet's expected arrival time and writes the packet into the output packet time table ET_TABLE. The adaptive delay unit mainly consists of the output packet time table ET_TABLE and the output packet queue EQ_GROUP. ET_TABLE is a linear list with a monotonically increasing time index, storing the first pointer of each EQ_GROUP in the output packet queue group. By using a linearly increasing sliding index of the ET_TABLE, if the EQ_GROUP corresponding to the current index is not empty, the head pointer of a linked list of a certain EQ_GROU in the stored output packet queue group is read from the ET_TABLE, and the packet is read out from the EQ_GROUP. This achieves flow-by-flow adaptive delay compensation, and through adaptive delay compensation, the forwarding delay of the TSN switching device can be configured.
[0013] Furthermore, the calculation of the expected arrival time of all messages sent by the previous TSN switching device in each cycle to the output channel of the current TSN switching device includes: Assuming the flow period is P and the flow starts at time t0, then the time to send a message in the nth period is t=n. P+t0; After a TSN switch sends a message, it travels through i hops on the forwarding path. The expected arrival time of the message at the output channel of the current TSN switch is t=i. P+t0+ ; Based on the characteristics of periodic traffic, assuming the start time t0 of the flow is [0, P], after i hops, the expected arrival time of the packet at the current TSN switching device is t = [i, i+1]. P+ ; Assuming jitter performance is satisfied, for periodic traffic, let's assume the expected arrival time of a packet at the current TSN switch is t=i. P+ ;in, It is the sum of the forwarding delays of the first i devices through which the message passes.
[0014] Furthermore, the forwarding delay of each TSN switching device is estimated, and the sum of the forwarding delays of all TSN switching devices on the forwarding path is obtained. This sum is used as the time when all packets sent by the TSN switching device at the beginning of the forwarding path in each cycle arrive at the TSN switching device at the end after several hops.
[0015] Furthermore, the TAS mechanism is used as a gating mechanism on each TSN switching device in the forwarding path; assuming p=P / n, the jitter introduced after the packet is forwarded by the current TSN switching device is compressed to 1 / n.
[0016] Furthermore, a data structure for the flow information table is created, which includes the flow period, or the sliding period of the gating list and the sum of the delays on the forwarding path; starting from time 0, the current time is gradually approximated using a binary search method to complete the calculation of the expected arrival time of the message.
[0017] Furthermore, the maximum forwarding delay of congested traffic on the end-to-end forwarding path does not exceed the predefined forwarding delay of each flow on the output port.
[0018] Furthermore, by calculating the time when the packets corresponding to periodic traffic arrive at the output channel inlet of the TSN switching device, the delay of the packets passing through the adaptive delay unit in the input channel is calculated, so as to achieve different delays for each type of packet.
[0019] This application also discloses a plug-and-play TSN switching device that implements the above-described method, comprising an input channel and an output channel; the input channel includes an adaptive delay unit to compensate for the forwarding delay of the previous TSN switching device on the forwarding path; the delay of the output channel is uncontrollable.
[0020] Due to the adoption of the above technical solution, this application has the following advantages: 1. By achieving predictable message arrival times and delay compensation for each flow, the coupling problem when multiple flows share a single output link is solved, enabling independent traffic planning under various conditions.
[0021] 2. This application solves the problem of complex traffic planning software in current TSNs. It can plan the forwarding routes and device delays of time-sensitive traffic in embedded devices. Combined with online identification of sensitive traffic cycles, it can realize plug-and-play TSN.
[0022] 3. This application has a certain degree of congestion tolerance and can support the forwarding of emergency transaction traffic without affecting the forwarding of periodic traffic. This application treats emergency transaction traffic as periodic traffic that is idle during normal times, and defines its own traffic period and forwarding delay for each emergency transaction. When no emergency transaction occurs, emergency transaction traffic can be forwarded normally as non-time-sensitive background traffic. When an emergency transaction occurs, emergency transaction messages can be forwarded to the destination device quickly. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0024] Figure 1 This is a schematic diagram illustrating the link connection between TSN switching devices in the prior art. Figure 2 A schematic diagram illustrating the method of sending messages during each burst cycle in the existing technology; Figure 3 This is a schematic diagram of the end-to-end forwarding path in an embodiment of this application; Figure 4 This is a schematic diagram illustrating the delay compensation principle of a plug-and-play TSN switching device according to an embodiment of this application. Figure 5 This is a schematic diagram of the adaptive delay unit in an embodiment of this application. Detailed Implementation
[0025] The present application will be further described in conjunction with the accompanying drawings and embodiments. The described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art should fall within the protection scope of the present application.
[0026] See Figure 4This application provides an embodiment of a latency compensation method based on a plug-and-play TSN switching device, which includes: The end-to-end forwarding path passes through multiple TSN switching devices. On the input channel of the next TSN switching device, the forwarding delay of the previous TSN switching device is compensated to ensure that the forwarding delay between the output channel inlets of any two adjacent TSN switching devices on the forwarding path is fixed, and the actual forwarding delay of the forwarding device is consistent with the expected delay.
[0027] Optionally, the traffic cycle can be obtained by capturing packets and performing approximate calculations on the CPU of the TSN switching device. To avoid introducing large errors when approximating the traffic cycle due to packet loss when capturing packets and sending them to the CPU, the sequence number of the packet identified by the port can be added when capturing packets to the CPU.
[0028] Optionally, the compensation for the forwarding delay of the previous TSN switch on the input channel of the next TSN switch includes: Calculate the expected arrival times of all messages sent by the previous TSN switch in each cycle to the output channel of the current TSN switch: After obtaining the expected arrival time of each message to the output channel of the current TSN switching device, messages arriving before the current time wait at the entrance of the output channel of the current TSN switching device until the current network synchronization time exceeds the expected arrival time of the message. In actual TSN switching equipment, different flows have different periods, and the delay that needs to be compensated on the TSN switching equipment after each flow goes through its respective forwarding path also varies. This results in a complete lack of correlation between the order in which incoming packets arrive at a port and the order in which they should enter the output channel. A packet that arrives earlier on a port may need to be forwarded through the output channel later. Adaptive delay units can solve this problem. A schematic diagram of an adaptive delay unit is shown below. Figure 5 As shown, the adaptive delay unit mainly consists of a message output timetable (ET_TABLE) and an output message queue (EQ_GROUP). The message output timetable is a linear list with a monotonically increasing time index, storing the head pointer of each queue in the output message queue group. When a message enters the port of the TSN switching device, a pointer is requested from the output message queue EQ_GROUP according to the expected arrival time of the message, and the message is written into the corresponding entry in the output message timetable ET_TABLE.
[0029] By using a linearly increasing sliding index of the ET_TABLE (which allows reading packets stored in the output packet queue EQ_GROUP), if the EQ_GROUP corresponding to the current index is not empty, the head pointer of the linked list of a certain EQ_GROU in the output packet queue group is read from the ET_TABLE, and the packet is read out from the EQ_GROUP. This achieves flow-by-flow adaptive delay compensation, and through adaptive delay compensation, the forwarding delay of the TSN switching device can be configured.
[0030] Optionally, calculating the expected arrival time of all messages sent by the previous TSN switching device in each cycle to the output channel of the current TSN switching device includes: Assuming the flow period is P and the flow starts at time t0, then the time to send a message in the nth period is t=n. P+t0; After a TSN switch sends a message, it travels through i hops on the forwarding path. The expected arrival time of the message at the output channel of the current TSN switch is t=i. P+t0+ ; In practical use, t0 is usually unknown; based on the characteristics of periodic traffic, assuming the start time t0 of the flow is [0, P], after i hops, the expected arrival time of the packet at the current TSN switching device is t = [i, i+1]. P+ ; Assuming jitter performance is satisfied, for periodic traffic, let's assume the expected arrival time of a packet at the current TSN switch is t=i. P+ ;in, It is the sum of the forwarding delays of the first i devices through which the message passes.
[0031] From the expression t=[i, i+1] P+ As can be seen, forwarding introduces significant jitter. Typically, the value of P is quite large, and the absolute value of the jitter introduced by the index may far exceed the acceptable range. To address this issue, TAS (Transport Switching Assist) is used as a gating mechanism on the input device of the forwarding path. Assuming p = P / n, the jitter introduced after forwarding through this TSN switching device is compressed to 1 / n, which can greatly improve jitter performance.
[0032] The sum of the forwarding delays of all TSN switching devices on the forwarding path is the time when all packets sent by the TSN switching device at the beginning of the forwarding path in each cycle arrive at the TSN switching device at the end after several hops.
[0033] For example, see Figure 3 The end-to-end forwarding path passes through forwarding SW1, SW2...SWi-1 and SWi. The expected forwarding delays for each device are d1, d2...di-1 and di, respectively. Therefore, the end-to-end delay is the sum of d1 to di.
[0034] The premise is that the forwarding delay of each TSN switching device is predictable, and the timing of input and output packets can be obtained through pre-configuration when traffic flows through each device. In fact, this application adopts a delay compensation mechanism, in which each TSN switching device compensates for the forwarding delay of the previous device, so as to achieve the goal of matching the actual forwarding delay of the device with the expected delay.
[0035] Optionally, the TAS mechanism is used as a gating mechanism on each TSN switching device in the forwarding path; assuming p=P / n, the jitter introduced after the packet is forwarded by the current TSN switching device is compressed to 1 / n.
[0036] Optionally, based on the calculation logic of the expected message arrival time, a flow information table (STRAM_CHACTOR_TABLE) data structure can be created to calculate and obtain the expected arrival time of the message. The data structure of STRAM_CHACTOR_TABLE is shown in Table 1.
[0037] Table 1 shows the data structure of the STRAEAM_CHARATOR_TABLE.
[0038] To simplify the process, after creation, a binary search method is used to gradually approximate the current time starting from time 0, thus completing the calculation of the expected arrival time of the message.
[0039] Optionally, a certain degree of congestion is allowed, as long as the maximum forwarding delay of congested traffic on the forwarding path does not exceed the predefined forwarding delay of each flow on the output port. Therefore, various traffic burst models can be supported.
[0040] Optionally, by calculating the time when the packets corresponding to periodic traffic arrive at the output channel inlet of the TSN switching device, the delay of the packets passing through the adaptive delay unit in the input channel is calculated, so as to achieve different delays for each type of packet.
[0041] This application also provides an embodiment of a plug-and-play TSN switching device that implements the method described in the above embodiments. The device comprises an input channel and an output channel. The input channel includes an adaptive delay unit to compensate for the forwarding delay of the previous TSN switching device on the forwarding path. The output channel's delay is uncontrollable due to scheduling and buffering. On the input channel of the next-hop TSN switching device, by compensating for the forwarding delay of the output from the previous TSN switching device, the forwarding delay between the output channel inlets of the two TSN switching devices is determined.
[0042] This application does not predict the forwarding delay of a single TSN switch, but rather the forwarding delay between the ingress points of the output channels of two consecutive TSN switches along the forwarding path. By calculating the time it takes for periodic traffic to arrive at the ingress point of the TSN switch's output channel, the specific delay of a packet passing through an adaptive delay line on the input channel is calculated, thus allowing for different delays for specific packets. The adaptive delay unit can be an adaptive delay line.
[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and not to limit them. Although this application has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of this application. Any modifications or equivalent substitutions that do not depart from the spirit and scope of this application should be covered within the protection scope of the claims of this application.
Claims
1. A delay compensation method based on a plug-and-play TSN switching device, characterized in that, include: The end-to-end forwarding path passes through multiple TSN switching devices. On the input channel of the next TSN switching device, the forwarding delay of the previous TSN switching device is compensated to ensure that the forwarding delay between the output channel inlets of any two adjacent TSN switching devices on the forwarding path is fixed, and the actual forwarding delay of the forwarding device is consistent with the expected delay.
2. The method according to claim 1, characterized in that, TSN switching devices capture packets and send them to their processors to approximate the flow period. When capturing packets to the processor, a port identification sequence number is added to the packet to avoid unexpected errors when approximating the flow period due to packet loss during packet transmission to the processor.
3. The method according to claim 1, characterized in that, The compensation for the forwarding delay of the previous TSN switch on the input channel of the next TSN switch includes: Calculate the expected arrival times of all messages sent by the previous TSN switch in each cycle to the output channel of the current TSN switch: After obtaining the expected arrival time of each message to the output channel of the current TSN switching device, messages arriving before the current time wait at the entrance of the output channel of the current TSN switching device until the current network synchronization time exceeds the expected arrival time of the message. When a TSN switching device receives a packet at its port, it requests a pointer from the output packet queue EQ_GROUP based on the packet's expected arrival time and writes the packet into the output packet time table ET_TABLE. The adaptive delay unit mainly consists of the output packet time table ET_TABLE and the output packet queue EQ_GROUP. ET_TABLE is a linear list with a monotonically increasing time index, storing the first pointer of each EQ_GROUP in the output packet queue group. By using a linearly increasing sliding index of the ET_TABLE, if the EQ_GROUP corresponding to the current index is not empty, the head pointer of a linked list of a certain EQ_GROU in the stored output packet queue group is read from the ET_TABLE, and the packet is read out from the EQ_GROUP. This achieves flow-by-flow adaptive delay compensation, and through adaptive delay compensation, the forwarding delay of the TSN switching device can be configured.
4. The method according to claim 3, characterized in that, The calculation of the expected arrival time of all messages sent by the previous TSN switching device in each cycle to the output channel of the current TSN switching device includes: Assuming the flow period is P and the flow starts at time t0, then the time to send a message in the nth period is t=n. P+t0; After a TSN switch sends a message, it travels through i hops on the forwarding path. The expected arrival time of the message at the output channel of the current TSN switch is t=i. P+t0+ ; Based on the characteristics of periodic traffic, assuming the start time t0 of the flow is [0, P], after i hops, the expected arrival time of the packet at the current TSN switching device is t = [i, i+1]. P+ ; Assuming jitter performance is satisfied, for periodic traffic, let's assume the expected arrival time of a packet at the current TSN switch is t=i. P+ ;in, It is the sum of the forwarding delays of the first i devices through which the message passes.
5. The method according to claim 4, characterized in that, Estimate the forwarding delay of each TSN switch, and sum the forwarding delays of all TSN switches on the forwarding path. This sum is used as the time when all packets sent by the TSN switch at the beginning of the forwarding path in each cycle arrive at the TSN switch at the end after several hops.
6. The method according to claim 4, characterized in that, The TAS mechanism is used as a gating mechanism on each TSN switching device in the forwarding path; assuming p=P / n, the jitter introduced after the packet is forwarded by the current TSN switching device is compressed to 1 / n.
7. The method according to claim 4, characterized in that, Create a data structure for the flow information table of the flow. The data structure includes the flow period, or the sliding period of the gating list and the sum of the delays on the forwarding path. Starting from time 0, use a binary search method to gradually approximate the current time and complete the calculation of the expected arrival time of the packet.
8. The method according to claim 1, characterized in that, The maximum forwarding delay of congested traffic on the end-to-end forwarding path shall not exceed the forwarding delay of each flow on the predefined output port.
9. The method according to claim 3 or 4, characterized in that, By calculating the time when the packets corresponding to periodic traffic arrive at the output channel inlet of the TSN switching device, and calculating the delay of the packets passing through the adaptive delay unit in the input channel, different delays can be applied to each type of packet.
10. A plug-and-play TSN switching device, implementing the method according to any one of claims 1-9, characterized in that, It consists of an input channel and an output channel; the input channel includes an adaptive delay unit to compensate for the forwarding delay of the previous TSN switching device on the forwarding path; the delay of the output channel is uncontrollable.