Method for testing end-to-end time delay of TSN network based on AS protocol
By using a TSN network end-to-end latency testing method based on the AS protocol, the switch dwell time is calculated using master-slave clocks and a specific frame format. This solves the problem of low accuracy in end-to-end latency testing in traditional methods and achieves high-precision latency testing at the nanosecond level.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional network latency testing methods cannot effectively capture end-to-end latency characteristics on critical paths in high-load, multi-node TSN networks, resulting in low test accuracy.
The end-to-end latency test method for TSN networks based on the AS protocol is adopted. By setting master and slave clocks, allocating Req frames and Resp frames in the TSN network, and obtaining time information by combining the Follow_Up, Pdelay_Resp and Pdelay_Resp_Follow_Up frames of the AS protocol, the internal dwell time of the switch is calculated, and the total end-to-end latency is calculated.
It achieves end-to-end latency testing accuracy at the nanosecond level, improves the accuracy of TSN network system performance evaluation, and solves the problem of end-to-end latency calculation in complex network environments.
Smart Images

Figure CN121864650A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of computer network communication methods, and particularly relates to a test method for end-to-end latency of TSN network based on AS protocol. Background Technology
[0002] With the rapid development of industrial automation and real-time systems, Time-Sensitive Networking (TSN) provides low-latency, high-bandwidth, and highly reliable communication capabilities, and has been widely used in industrial control, communication systems, and other fields. In high-load, multi-node TSN networks, traditional network latency testing methods often focus on the data link layer latency between nodes, failing to effectively capture the end-to-end latency characteristics on the critical path, resulting in low accuracy in end-to-end latency testing of network systems.
[0003] In view of this, the present invention is hereby proposed. Summary of the Invention
[0004] The present invention provides a test method for end-to-end latency of TSN networks based on the AS protocol, which solves the problem that traditional methods cannot effectively capture the end-to-end latency characteristics on the critical path, resulting in low accuracy of end-to-end latency testing of network systems. The technical solution of this invention has many beneficial effects, as described below: A test method for end-to-end latency of a TSN network based on the AS protocol is provided. This method is applicable to data interaction between end systems and TSN switches in an airborne avionics system based on the AS protocol in a TSN network. The end systems include a first TSN end system and a second TSN end system. The TSN switch includes n ports and m ports. The test method includes... Step 1: In the TSN network, set the first TSN end system as the master clock and interact with the TSN switch via fiber optic cable. Set the n port of the TSN switch connected to the first TSN end system as the slave clock and the m port of the TSN switch connected to the second TSN end system as the master clock. Step 2: Assign a test protocol for TSN network latency, the test protocol including Req frames and Resp frames; Step 3: Calculate the transmission delay and reception delay from the first TSN end system to port n using the Req frame and Resp frame of port n; Step 4: Obtain time information from the Follow_Up, Pdelay_Resp, and Pdelay_Resp_Follow_Up frames of the AS protocol in the airborne avionics system, calculate the dwell time Tr inside the switch TSN using the time information, and record the dwell time Tr in the Req frame; Step 5: Calculate the transmission delay and reception delay from port m to the second TSN end system using the Req and Resp frames at the second TSN end system, and calculate the total transmission delay from the first TSN end system to the second TSN end system. ; Step 6: Calculate the reception delay Trdelay from the first TSN end system to the second TSN end system in the TSN network, and calculate the average delay Tdelay from the first TSN end system to the second TSN end system in the TSN network.
[0005] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects: By analyzing in detail the link latency and dwell time between devices based on the AS protocol in the network path, and combining the high-precision AS synchronization mechanism unique to TSN networks, this paper provides end-to-end latency testing capabilities at the ns level for TSN networks in complex network configurations, providing strong support for TSN network system performance evaluation. At the same time, by calculating the total receive latency Trdelay, the total transmit latency Tsdelay, and the total end-to-end latency Tdelay, the paper solves the problem of end-to-end latency calculation in complex transmission scenarios in TSN networks, and improves the testing accuracy of end-to-end latency in TSN networks. Attached Figure Description
[0006] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0007] Figure 1 This is a network topology diagram of the present invention; Figure 2 It is in Req frame format; Figure 3 It is in Resp frame format; Figure 4 This is a schematic diagram of the AS protocol. Detailed Implementation
[0008] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0009] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this invention, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0010] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0011] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that aspects can be practiced without these specific details. To enable those skilled in the art to better understand the invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of that feature. In the description of the invention, unless otherwise stated, "a plurality of" means two or more.
[0012] like Figures 1 to 4The test method for end-to-end latency of a TSN network based on the AS protocol, as shown, is applicable to data interaction between the (protocol) end system and the TSN switch in an airborne avionics system based on the AS protocol in a TSN network. It provides a nanosecond-level test method for end-to-end latency in complex TSN network environments. Preferably, a TSN network end-to-end latency test system is constructed using two TSN end systems and one TSN switch. The end systems include a first TSN end system (TSN end system 1) and a second TSN end system (TSN end system 2). The TSN switch includes n ports and m ports. The test method includes... Step 1: In the TSN network, set the first TSN end system as the master clock (i.e., the global master clock GM), and the second TSN end system as the slave clock (Slave clock node). Data exchange is performed between them and the TSN switch via fiber optic cables. The n-port of the TSN switch connected to the first TSN end system is set as the slave clock. The m-port of the TSN switch connected to the second TSN end system is set as the master clock (Master clock node). Figure 1 As shown, the TSN network performs time synchronization; Step 2: Test protocol for allocating TSN network latency. The test protocol includes Req frames and Resp frames. The test protocol operation steps are as follows: (1) In order to realize the time synchronization process of the TSN network, specifically, the first TSN end system (GM) sends the internally generated master clock frame (including SYNC, Follow_Up, Pdelay_Resp and Pdelay_Resp_Follow_Up frames) to the n port of the TSN switch; The second TSN end system receives the master clock frame from port m and sends slave clock frames to port m of the TSN switch. The slave clock frames include Pdelay_Req, Pdelay_Resp and Pdelay_Resp_Follow_Up frames. (2) The Req frame records the first timestamps (corresponding to t11, t11, and t41 in Table 1) of the slave nodes of the second TSN end system when they receive Pdelay_Req and Pdelay_Resp. The Req frame will be used as a data frame composed of slave nodes in the TSN network and sent to the TSN switch and the nodes of the second TSN end system. According to the design requirements of the end-to-end delay of the TSN network, the Req frame contains the number of topology nodes, local time 1, local time 2, the number of switch layers, and the internal dwell time of the switch. The frame format is as follows: Figure 2 As shown; The topology node count records the number of slave nodes traversed by the TSN network at this stage, with a length of 1 byte; Local Time 1 is the arrival timestamp of the Pdelay_Req frame read from the slave node, with a length of 10 bytes; Local Time 2 is the arrival timestamp of the Pdelay_Resp frame read from the slave node, with a length of 10 bytes; Switch layer count is the number of switches traversed in the network, with a length of 1 byte; Switch internal dwell time is the dwell time of the data frame within the switch, with a length of 10 bytes. See Table 1. Table 1 Req Frame Parameter Definitions
[0013] (3) The Resp frame records the second timestamp (corresponding to t12, etc. in Table 2) extracted from the Pdelay_Resp and Pdelay_Resp_Follow_Up frames in the slave nodes of the first TSN end system. The Resp frame is used as a data frame composed of slave nodes in the TSN network and sent to the n port of the switch and the slave nodes of the second TSN end system. According to the design requirements of the end-to-end delay of the TSN network, the Resp frame contains the number of topology nodes, the timestamp extracted from Pdelay_Resp, and the second timestamp extracted from Pdelay_Resp_Follow_Up. The frame format is as follows: Figure 3 As shown; the number of topology nodes records the number of slave nodes that the TSN network has passed through at this stage, with a length of 1 byte; the timestamp extracted from Pdelay_Resp is the time information read from the Pdelay_Resp message after receiving it, with a length of 10 bytes; the timestamp extracted from Pdelay_Resp_Follow_Up is the time information read from the Pdelay_Resp_Follow_Up message after receiving it, with a length of 10 bytes; Table 2 Resp frame parameter definitions
[0014] Step 3: Calculate the transmit and receive delays from the first TSN end system to port n using the Req and Resp frames from port n. Figure 2 As shown, the steps are as follows: (1) Port n records the timestamp using the local time 1 in the Req frame. The timestamp is recorded using the local time 2 in the Req frame. The n port reads the timestamp from the timestamp extracted from Pdelay_Resp in the Resp frame. The timestamp is read from the timestamp extracted from Pdelay_Resp_Follow_Up in the Resp frame. ; (2) Calculate the transmission delay Tsdelay1 from the first TSN end system to port n of the TSN switch. ; (4) Calculate the receive delay Tsdelay2 from the first TSN end system to the n port of the TSN switch.
[0015] Step 4: Obtain time information from the Follow_Up, Pdelay_Resp, and Pdelay_Resp_Follow_Up frames of the AS protocol in the airborne avionics system. Calculate the dwell time within the TSN of the switch using the time information and record the dwell time in the Req frame. The steps are as follows: (1) Obtain the actual dwell time through the Follow_Up frame of the TSN switch; (2) When the Master end of the first TSN end system sends the first Pdelay_Resp_Follow_Up, it sends a timestamp. Send the timestamp when sending the second Pdelay_Resp_Follow_Up. ; (3) When the Slave end of the second TSN end system receives the first Pdelay_Resp, it records the timestamp. Record the timestamp when receiving the second Pdelay_Resp. ; (4) Calculate the dwell time offset Tr:
[0016] (5) Record the dwell time in the Req frame.
[0017] Step 5: Calculate the transmission and reception delay from port m to the second TSN end system using the Req and Resp frames at the second TSN end system. The steps are as follows: (1) The second TSN terminal system records the timestamp using the local time 1 in the Req frame. The timestamp is recorded using the local time 2 in the Req frame. The second TSN terminal system reads the timestamp from the timestamp extracted from Pdelay_Resp in the Resp frame. The timestamp is read from the timestamp extracted from Pdelay_Resp_Follow_Up in the Resp frame. ; (2) Calculate the transmission delay Tsdelay2 from port m of the TSN switch to the second TSN terminal system:
[0018] (4) Calculate the receive delay Trdelay2 from port m of the TSN switch to the second TSN end system. ; Step 6: According to and Calculate the total transmission delay from end system 1 to end system 2 in the TSN network. The steps are as follows: By sending delay Duration of stay and transmission delay The total transmission delay Tsdelay between the first TSN end system and the second TSN end system is obtained as follows:
[0019] Step 7: Based on the reception delay Reception delay Calculate the receive delay from end system 1 to end system 2 in the TSN network. The steps are as follows: Receive delay Duration of stay and reception delay Calculate the total reception delay Trdelay between the first TSN end system and the second TSN end system:
[0020] Step 8: Calculate the average latency from end system 1 to end system 2 in the TSN network. The steps are as follows: The end-to-end delay Tdelay of the TSN network is calculated from the total receive delay Trdelay and the total transmit delay Tsdelay: By calculating the total reception delay Trdelay, the total transmission delay Tsdelay, and the end-to-end total delay Tdelay, the problem of calculating end-to-end delay in complex transmission scenarios in TSN networks is solved, and the testing accuracy of end-to-end delay in TSN networks is improved.
[0021] The product provided by this invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the invention claims.
Claims
1. A test method for end-to-end latency of a TSN network based on the AS protocol, applicable to data interaction between an end system and a TSN switch in an airborne avionics system based on the AS protocol TSN network, wherein the end system includes a first TSN end system and a second TSN end system, and the TSN switch includes n ports and m ports, characterized in that, The test method includes, Step 1: In the TSN network, set the first TSN end system as the master clock and interact with the TSN switch via fiber optic cable. Set the n port of the TSN switch connected to the first TSN end system as the slave clock and the m port of the TSN switch connected to the second TSN end system as the master clock. Step 2: Assign a test protocol for TSN network latency, the test protocol including Req frames and Resp frames; Step 3: Calculate the transmission delay and reception delay from the first TSN end system to port n using the Req frame and Resp frame of port n; Step 4: Obtain time information from the Follow_Up, Pdelay_Resp, and Pdelay_Resp_Follow_Up frames of the AS protocol in the airborne avionics system, calculate the dwell time Tr inside the switch TSN using the time information, and record the dwell time Tr in the Req frame; Step 5: Calculate the transmission delay and reception delay from port m to the second TSN end system using the Req and Resp frames at the second TSN end system, and calculate the total transmission delay from the first TSN end system to the second TSN end system. ; Step 6: Calculate the reception delay Trdelay from the first TSN end system to the second TSN end system in the TSN network, and calculate the average delay Tdelay from the first TSN end system to the second TSN end system in the TSN network.
2. The test method according to claim 1, characterized in that, The steps for running the test protocol in step 2 include: The TSN network performs time synchronization, wherein the first TSN end system sends an internally generated master clock frame to the n port of the TSN switch; The second TSN end system receives the master clock frame of the m port and sends a slave clock frame to the m port of the TSN switch, wherein the slave clock frame includes Pdelay_Req, Pdelay_Resp and Pdelay_Resp_Follow_Up frames; The Req frame records the first timestamp of the Pdelay_Req and Pdelay_Resp received by the slave node of the second TSN end system. The Req frame is used as a data frame composed of slave nodes in the TSN network and sent to the TSN switch and the node of the second TSN end system.
3. The test method according to claim 2, characterized in that, Step 3 includes, The n port records the timestamp using the local time 1 in the Req frame. The timestamp is recorded using the local time 2 in the Req frame. The n port reads the timestamp from the timestamp extracted from Pdelay_Resp in the Resp frame. The timestamp is read from the timestamp extracted from Pdelay_Resp_Follow_Up in the Resp frame. ; Calculate the transmission delay Tsdelay1 from the first TSN end system to port n of the TSN switch. Calculate the receive delay Trdelay1 from the first TSN end system to the n port of the TSN switch. .
4. The test method according to claim 3, characterized in that, Step 4 includes, The actual dwell time is obtained through the Follow_Up frame of the TSN switch. The Master end of the first TSN system sends a timestamp when sending the first Pdelay_Resp_Follow_Up frame. Send the timestamp when sending the second Pdelay_Resp_Follow_Up. ; The slave end of the second TSN system records a timestamp when it receives the first Pdelay_Resp. Record the timestamp when receiving the second Pdelay_Resp. ; Calculate the dwell time offset Tr = actual dwell time * And recorded in the Req frame.
5. The test method according to claim 3, characterized in that, Step 5 includes, The second TSN terminal system records the timestamp using the local time 1 in the Req frame. ; Record the timestamp using the local time 2 in the Req frame. The second TSN terminal system reads the timestamp from the timestamp extracted from Pdelay_Resp in the Resp frame. The timestamp is read from the timestamp extracted from Pdelay_Resp_Follow_Up in the Resp frame. ; Calculate the transmission delay Tsdelay2 from port m of the TSN switch to the second TSN terminal system, where, ; Calculate the receive delay Trdelay2 from port m of the TSN switch to the second TSN end system, where, ; By sending delay Duration of stay and transmission delay The total transmission delay Tsdelay between the first TSN terminal system and the second TSN terminal system is obtained, where, 。 6. The test method according to claim 5, characterized in that, Step 5 includes, According to the receiving delay Duration of stay and reception delay Calculate the total reception delay Trdelay between the first TSN end system and the second TSN end system, where, ; The end-to-end average delay Tdelay of the TSN network is calculated based on the total reception delay Trdelay and the total transmission delay Tsdelay, where... .