Data receiving and forwarding storage control method and system of TSN exchanger
By adding time-sensitive network tags to the port of the TSN switch and quickly classifying data frames, the problem of multi-port switching receiving and storage is solved, efficient processing of data frames and multi-port switching is realized, and the real-time and reliability of the switch is improved.
Patent Information
- Application Number
- CN202510227101.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art has failed to effectively solve the problem of multi-port switched reception storage, resulting in high data frame reception delay and low processing efficiency.
By adding time-sensitive network tags to the front section of the data frame on the switch port, quickly classify data frames, and perform single-port or multi-port forwarding and storage according to the data frame type, the secondary flow processing method can be used to improve data frame processing efficiency.
Multi-port switching reception and storage of data frames is realized, which reduces data frame reception delay, improves data frame processing efficiency, and enhances the real-time, reliability and performance of TSN switches.
Smart Images

Figure CN120075171A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer networks and relates to a method and system for data reception, forwarding, storage control of a TSN switch. Background Art
[0002] Time Sensitive Network (TSN) is a series of IEEE 802 Ethernet sub - standards formulated by the IEEE 802.1 TSN task group. Based on traditional Ethernet, it can support BE (Best Effort) traffic while ensuring that the transmission of critical traffic is not affected. The TSN time - sensitive network inherits the advantages of the traditional Ethernet specification, such as being simple, easy to implement, and capable of supporting high - speed data transmission. At the same time, it can ensure the efficient and reliable processing of critical data, meeting the applications in some fields with low - latency and high - reliability transmission, such as unmanned driving and industrial control. As a bridge device in the time - sensitive network, the TSN switch has relatively high requirements for the forwarding time delay of data streams.
[0003] The literature "Design and Implementation of a Pure - Hardware IEEE 1588v2 Precise Time Synchronization System" proposed a design method for the peer - to - peer delay reception control function, but did not involve the multi - port switching reception and storage problem. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and system for data reception, forwarding, storage control of a TSN switch to solve the technical problem of not involving multi - port switching reception and storage. The present invention can realize the multi - port switching reception and storage of data frames, which is beneficial to reducing the data frame reception delay and improving the data frame processing efficiency.
[0005] To achieve the above object, the present invention adopts the following technical solutions: In the first aspect, the present invention provides a method for data reception, forwarding, storage control of a TSN switch, including the following steps: Add a time - sensitive network label to the front segment of the data frame at the port of the switch to obtain a data frame containing the time - sensitive network label; Obtain status information according to the data frame containing the time - sensitive network label, and judge the type of the data frame according to the status information. The types of the data frame include PTP data frame, ST / RC data frame, and BE / CFG data frame; For the PTP data frame, after extracting the valid information from the data frame and completing the parsing, send the parsing result to the PM subsystem to complete the local clock timing calibration; For ST / RC data frames and BE / CFG data frames, extract the data frame information and perform parsing. Based on the parsing results, obtain the forwarding port type, and perform single-port forwarding or multi-port forwarding on the corresponding data frames according to the obtained forwarding port type. Request the corresponding data frame storage area according to the obtained forwarding port type for data frame storage.
[0006] Further, obtain the status information according to the data frame containing the time-sensitive network label, and judge the type of the data frame according to the status information, specifically as follows: Strip and extract the status information from the data frame containing the time-sensitive network label; Parse the status information; Judge the type of the data frame according to the parsing results of the status information.
[0007] Further, for PTP data frames, independently process the PTP data frames received by each port.
[0008] Further, for ST / RC data frames and BE / CFG data frames, when the storage of ST / RC data frames and BE / CFG data frames is completed, write the data frame descriptor information to the send queue according to the length of the data frame. The data frame descriptor information includes the position, length, and type of the data frame in the storage area; For ST / RC data frames and BE / CFG data frames, the parsing of data frame information, the obtaining of the forwarding port type, and the data frame storage are all in a two-stage pipelining processing mode. While storing a data frame, start parsing the next frame.
[0009] Further, forward the CFG data frame to the configuration port and extract the data frame information to complete the local configuration function.
[0010] Further, the data frame storage area is specifically as follows: Divide the data frame storage area into a single-port forwarding data frame storage area and a multi-port forwarding data frame storage area according to different data frame types and the number of forwarding ports; The single-port forwarding data frame storage area includes the ST / RC single-port forwarding data frame storage area and the BE / CFG single-port forwarding data frame storage area The single-port forwarding data frame storage area is set separately for each forwarding port; The multi-port forwarding data frame storage area is shared by each port.
[0011] Further, the request for the corresponding data frame storage area to store the data frame according to the obtained forwarding port type is specifically as follows: Obtain the corresponding data frame storage area according to the obtained forwarding port type. The data frame storage area contains multiple data storage pages with fixed specifications; Initialize the data storage page to obtain a blank storage page after initialization; Connect the head addresses of each blank storage page in sequence as linked list nodes; When storing a data frame, starting from the head of the linked list, take out the number of storage pages that match the data frame length and allocate them to the current data frame to complete the data frame storage, and delete the used storage pages from the linked list; After completing the data frame forwarding, insert the address of the released storage page as a node at the tail of the linked list for use as a new blank storage page.
[0012] Further, when storing the data frame, starting from the head of the linked list, take out the number of storage pages that match the data frame length and allocate them to the current data frame to complete the data frame storage, and delete the used storage pages from the linked list, which is specifically as follows: Initiate a storage request, and the storage request information includes: frame header indication, frame length, data, data valid indication, and frame tail indication; Allocate the number of storage pages that match the data frame length according to the storage request information; Store the previous data frame into the number of storage pages that match the data frame length; And delete the used storage pages from the linked list.
[0013] Further, the ports of the switch are provided with 8 transmission queues, which are divided into an ST data frame queue, an RC data frame queue, and a BE / CFG data frame queue according to the data frame type, and the quantity and priority of each data frame queue can be configured; The transmission queue does not store data frames, but only stores the written data frame descriptor information; When performing single-port forwarding or multi-port forwarding on the corresponding data frame, read the data frame and forward it according to the address pointed to by the first descriptor in the current transmission queue.
[0014] In a second aspect, the present invention provides a data reception and forwarding storage control system for a TSN switch, including: A data frame acquisition module: used to add a time-sensitive network label to the front segment of the data frame at the port of the switch to obtain a data frame containing a time-sensitive network label; A data frame type judgment module: used to obtain status information according to the data frame containing a time-sensitive network label, and judge the type of the data frame according to the status information, and the types of the data frame include PTP data frames, ST / RC data frames, and BE / CFG data frames; A PTP data frame processing module: for a PTP data frame, after extracting valid information from the data frame and completing the parsing, send the parsing result to the PM subsystem to complete the local clock timing calibration; Data Frame Forwarding and Storage Module: For ST / RC data frames and BE / CFG data frames, it extracts data frame information and performs parsing, obtains the forwarding port type according to the parsing result, performs single-port forwarding or multi-port forwarding on the corresponding data frames according to the obtained forwarding port type, and requests the corresponding data frame storage area for data frame storage according to the obtained forwarding port type.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention adds a time-sensitive network label to the front segment of the data frame at the port of the switch to obtain a data frame containing the time-sensitive network label, which facilitates quickly completing the classification and judgment of the data frame after the port receives valid data status information, parsing out the classification result of the current data frame, reducing the data frame reception delay, and improving the data frame processing efficiency. Obtain the status information according to the data frame containing the time-sensitive network label, and judge the type of the data frame according to the status information. The types of the data frame include PTP data frames, ST / RC data frames, and BE / CFG data frames. For PTP data frames, after extracting the valid information from the data frame and completing the parsing, the parsing result is sent to the PM subsystem to complete the local clock timing calibration, ensuring that the local clock of the switch can be synchronized with other devices in the network. For ST / RC data frames and BE / CFG data frames, extract the data frame information and perform parsing, obtain the forwarding port type according to the parsing result, perform single-port forwarding or multi-port forwarding on the corresponding data frames according to the obtained forwarding port type, and request the corresponding data frame storage area for data frame storage according to the obtained forwarding port type. It avoids storage access conflicts and ensures the integrity and reliability of the data frame during the forwarding process. By adding a time-sensitive network label, quickly classifying data frames, processing PTP data frames for time synchronization, and performing forwarding and storage according to the data frame type and forwarding port type, the present invention effectively improves the real-time performance, reliability, and performance of the TSN switch, can realize the multi-port switching reception and storage of data frames, is conducive to reducing the data frame reception delay, and improves the data frame processing efficiency.
[0016] 2. For PTP data frames, the PTP data frames received by each port are independently processed without interference, which can maximize the real-time requirements of the TSN network.
[0017] 3. For ST / RC data frames and BE / CFG data frames, the parsing of data frame information, the obtaining of the forwarding port type, and the data frame storage are all in a two-stage pipelining processing mode. While storing the data frame, the parsing of the next frame is started, further improving the data frame processing efficiency.
[0018] 4. The single-port forwarding data frame storage area of the present invention is set separately for each forwarding port, and the multi-port forwarding data frame storage area is shared by each port, avoiding conflicts during data frame reception and storage. Each port can perform read operations separately, avoiding missing the time slot interval for allowing data transmission.
[0019] 5. The system of the present invention includes: a data frame acquisition module, a data frame type judgment module, a PTP data frame processing module, and a data frame forwarding and storage module. The data frame acquisition module is used to add a time-sensitive network tag to the front section of the data frame at the port of the switch to obtain a data frame containing the time-sensitive network tag; the data frame type judgment module is used to obtain status information according to the data frame containing the time-sensitive network tag, and judge the type of the data frame according to the status information. The types of the data frame include PTP data frames, ST / RC data frames, and BE / CFG data frames; the PTP data frame processing module is used to extract valid information from the PTP data frame, complete parsing, and then send the parsing result to the PM subsystem to complete local clock timing calibration; the data frame forwarding and storage module is used to extract data frame information and perform parsing for ST / RC data frames and BE / CFG data frames, obtain the forwarding port type according to the parsing result, perform single-port forwarding or multi-port forwarding on the corresponding data frames according to the obtained forwarding port type, and request the corresponding data frame storage area according to the obtained forwarding port type for data frame storage. Each module cooperates with each other to realize multi-port switching reception and storage of data frames, which is beneficial to reducing data frame reception delay and improving data frame processing efficiency. Description of the Drawings
[0020] Figure 1 It is the TSN sub-switch interconnection diagram of the embodiment of the present invention; Figure 2 It is the Ethernet frame format diagram with VLAN tags; Figure 3 It is the ARI interface timing diagram of the embodiment of the present invention; Figure 4 It is the design structure diagram of the data frame processing module of the embodiment of the present invention; Figure 5 It is the flowchart of the method of the present invention; Figure 6 It is the system module diagram of the present invention. Detailed Embodiment
[0021] In order to enable those skilled in the art to better understand the solution of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0023] The following will further describe the present invention in detail with reference to the accompanying drawings: See Figure 5 , the present invention discloses a data reception, forwarding, and storage control method for a TSN switch, including the following steps: S1. Add a time-sensitive network tag to the front segment of the data frame at the port of the switch to obtain a data frame containing the time-sensitive network tag, which is convenient for quickly completing the classification and judgment of the data frame after receiving valid data status information at the port, and parsing out the classification result of the current data frame, which is beneficial to reducing the data frame reception delay and improving the data frame processing efficiency.
[0024] S2. Obtain the status information according to the data frame containing the time-sensitive network tag, and judge the type of the data frame according to the status information. The types of the data frame include PTP data frames, ST / RC data frames, and BE / CFG data frames. Through accurate classification, the switch can ensure that each type of data frame is properly processed.
[0025] S3. For PTP data frames, after extracting and parsing the valid information from the data frame, send the parsing result to the PM subsystem to complete the local clock timing calibration, ensuring that the local clock of the switch can be synchronized with other devices in the network.
[0026] S4. For ST / RC data frames and BE / CFG data frames, extract the data frame information and perform parsing. Based on the parsing results, obtain the forwarding port type. According to the obtained forwarding port type, perform single-port forwarding or multi-port forwarding on the corresponding data frames, and request the corresponding data frame storage area for data frame storage according to the obtained forwarding port type. This avoids storage access conflicts and ensures the integrity and reliability of the data frames during the forwarding process.
[0027] The present invention effectively improves the real-time performance, reliability, and performance of the TSN switch by adding time-sensitive network tags, quickly classifying data frames, processing PTP data frames for time synchronization, and performing forwarding and storage according to the data frame type and forwarding port type.
[0028] Embodiment 1: See Figure 5 , this embodiment discloses a method for controlling data reception, forwarding, and storage of a TSN switch, including the following steps: S1. Add a time-sensitive network tag to the front segment of the data frame at the port of the switch to obtain a data frame containing the time-sensitive network tag; S2. Obtain the status information according to the data frame containing the time-sensitive network tag, and judge the type of the data frame according to the status information. The types of the data frames include PTP data frames, ST / RC data frames, and BE / CFG data frames; Preferably, the preprocessing of the data frame containing the time-sensitive network tag and obtaining the status information of the data frame are specifically as follows: Strip and extract the status information from the data frame containing the time-sensitive network tag; Parse the status information; Judge the type of the data frame according to the parsing result of the status information.
[0029] S3. For PTP data frames, after extracting the valid information from the data frame and completing the parsing, send the parsing result to the PM subsystem to complete the local clock timing calibration; Preferably, for PTP data frames, the PTP data frames received by each port are independently processed without interference, which can maximally meet the real-time requirements of the TSN network.
[0030] S4. For ST / RC data frames and BE / CFG data frames, extract the data frame information and perform parsing. Based on the parsing results, obtain the forwarding port type. According to the obtained forwarding port type, perform single-port forwarding or multi-port forwarding on the corresponding data frames, and request the corresponding data frame storage area for data frame storage.
[0031] Preferably, for ST / RC data frames and BE / CFG data frames, when the storage of ST / RC data frames and BE / CFG data frames is completed, data frame descriptor information is written to the transmission queue according to the length of the data frame. The data frame descriptor information includes the position, length, and type of the data frame in the storage area. For ST / RC data frames and BE / CFG data frames, the parsing of data frame information, the acquisition of the forwarding port type, and the storage of data frames are all in a two-level pipelining processing mode. While storing a data frame, the parsing of the next frame starts, further improving the data frame processing efficiency.
[0032] Preferably, the CFG data frame is forwarded to the configuration port and the data frame information is extracted to complete the local configuration function.
[0033] Preferably, the data frame storage area is specifically as follows: The data frame storage area is divided into a single-port forwarding data frame storage area and a multi-port forwarding data frame storage area according to different data frame types and the number of forwarding ports. The single-port forwarding data frame storage area includes an ST / RC single-port forwarding data frame storage area and a BE / CFG single-port forwarding data frame storage area. The single-port forwarding data frame storage area is set separately for each forwarding port to avoid conflicts during data frame reception and storage. Each port can perform read operations separately to avoid missing the time slot interval for allowing data transmission. The multi-port forwarding data frame storage area is shared by each port.
[0034] Preferably, the corresponding data frame storage area is requested according to the obtained forwarding port type for data frame storage, specifically as follows: The corresponding data frame storage area is obtained according to the obtained forwarding port type. The data frame storage area contains multiple data storage pages of fixed specifications. The data storage pages are initialized to obtain blank storage pages after initialization. The head addresses of the blank storage pages are connected in sequence as linked list nodes. When storing a data frame, starting from the head of the linked list, the storage pages matching the length of the data frame are taken out and allocated to the current data frame to complete the data frame storage, and the used storage pages are deleted from the linked list. After the data frame forwarding is completed, the addresses of the released storage pages are inserted as nodes at the tail of the linked list for use as new blank storage pages.
[0035] Preferably, when storing a data frame, starting from the head of the linked list, the storage pages matching the length of the data frame are taken out and allocated to the current data frame to complete the data frame storage, and the used storage pages are deleted from the linked list, specifically as follows: Initiate a storage request, where the storage request information includes: frame header indication, frame length, data, data validity indication, and frame tail indication; Allocate storage pages with a quantity matching the data frame length according to the storage request information; Store the previous data frame into the storage pages with a quantity matching the data frame length; And delete the used storage pages from the linked list.
[0036] Preferably, the ports of the switch are provided with 8 transmission queues, which are divided into ST data frame queue, RC data frame queue, and BE / CFG data frame queue according to the data frame type. The quantity and priority of each data frame queue can be configured; The transmission queue does not store data frames, but only stores the written data frame descriptor information; When performing single-port forwarding or multi-port forwarding on the corresponding data frames, read the data frames and forward them according to the address pointed to by the first descriptor in the current transmission queue.
[0037] Embodiment 2: Refer to Figure 5 , this embodiment discloses a data receiving, forwarding, and storage control method for a TSN switch, which is specifically as follows: Time Sensitive Network (TSN) can achieve efficient and reliable processing of critical data streams because when designing the scheduling algorithm, a "dedicated channel" is reserved for high-priority critical data. In this way, even if the traffic on other channels is very high, the transmission of critical data will not be affected. However, in terms of supporting standard traffic, adopting the Best Effort forwarding strategy makes it difficult to ensure that the transmission of standard traffic is not affected.
[0038] The present invention proposes a receiving, forwarding, and storage control method for a 20-port TSN switch that can balance time-sensitive traffic and standard event traffic. The 20 ports include 3 10Gigabit transceiver ports and 17 Gigabit transceiver ports. The present invention can achieve parallel processing of different types of event traffic from different ports. On the one hand, for time-sensitive traffic, it can be quickly received and stored to ensure that its switching delay is controllable; on the other hand, when there is no time-sensitive traffic in the network, it can effectively reduce the switching delay of standard event traffic and improve the communication quality of general traffic.
[0039] A Time Sensitive Network (TSN) consists of multiple TSN end controllers and TSN switches combined. As a bridge device in the network, the TSN switch needs to have multiple Ethernet ports and be able to support the forwarding of BE, RC, and ST flows simultaneously. Among them, the full English name of BE is Best Efort, which refers to the ordinary Ethernet traffic that makes the best effort; the full English name of RC is Reserved Tratic, which refers to reserved traffic. This kind of traffic reserves a specific bandwidth in the network to ensure that its transmission is not affected by other traffic; the full English name of ST is Scheduled Trafic, which refers to scheduled traffic. This is a kind of traffic that needs to be transmitted at a specific time and is mainly used for applications with high requirements for real-time performance.
[0040] The TSN switch in the present invention is a 10 Gigabit Ethernet switch based on a store-and-forward architecture, with 20 forwarding ports. Among them, 3 ports are 10 Gigabit transceiver ports, and 17 are Gigabit transceiver ports, supporting the reception and transmission of ST flows, RC flows, and BE flows. Each port supports 8 transmit queues, supports Qbv / Qch / CBS queue scheduling, supports address management and VLAN management, supports port mirroring and link aggregation, supports jumbo frames, and supports rate control and other related functions. Among them, Qbv refers to the IEEE802.10bv protocol, which is a standard for Time Sensitive Networks (TSN). A switch that supports the Qbv protocol can open / close the switch output queue according to the configured gating list, thus providing deterministic delay guarantee for periodic important data; Och's full English name is Cyclic Queue Forwarding, which refers to cyclic queue forwarding; CBS's full English name is CreditBased Shaping, which refers to credit-based shaping, which is a technology for data transmission scheduling and is managed by assigning a "credit value" to different transmission queues.
[0041] The present invention is achieved through the following technical methods: The TSN switch in the present invention is internally divided into two sub-switches SW0 and SW1. The sub-switches are both 11-port switches, and the port numbers of the sub-switches are p0~p10. In SW0, p0, p1, p2, and p10 are 10 Gigabit Ethernet transceiver ports, and the remaining ports are Gigabit Ethernet transceiver ports; in SW1, p10 is a 10 Gigabit Ethernet transceiver port, and the remaining ports are Gigabit Ethernet transceiver ports. The two sub-switches are interconnected through their respective p10 ports, as Figure 1As shown. The external port numbers of the switch are P0 to P19. When ports P0 to P9 need to be forwarded to ports P10 to P19, it needs to be forwarded through port p10 of SW0. Similarly, when ports P10 to P19 need to be forwarded to ports P0 to P9, it needs to be forwarded through port p10 of SW1.
[0042] See Figure 2 is the Ethernet frame format with VLAN tags. The traditional classification and judgment method is to distinguish by setting TSN_TAG in the VLAN domain. It can be seen that only after receiving the 6-byte destination MAC address and source MAC address can the type of the current data frame be judged through the information in the VLAN tag. The present invention no longer uses TSN_TAG in the VLAN domain to judge the data frame type, but sets a dedicated TSN_TAG identifier in the ARI status information received at the port, ensuring that the classification result of the current data frame can be immediately parsed after receiving the valid status information, thereby avoiding the delay overhead of having to receive dozens of bytes of valid data before making a judgment.
[0043] See Figure 3 is the waveform of the ARI interface signal of each port of the MAC input in the present invention. It can be seen that the status information of the data frame (when the signal ari_rxstatus_val_o is valid) is received before the data frame (when the signal ari_val_o is valid). The present invention adds TSN_TAG to bits 16 to 18 in the status information. When bit 18 is 1, it indicates that the current data frame is a PTP frame; when bits 17 to 16 are "01", it indicates that the current data frame is an ST frame; when bits 17 to 16 are "10", it indicates that the current data frame is an RC frame; when bits 17 to 16 are "11", it indicates that the current data frame is a CFG frame; when bits 17 to 16 are "00", it indicates that the current data frame is a BE frame; accordingly, the classification of the data frame can be achieved earlier and faster, and the subsequent processing process can be completed after the diversion.
[0044] Among them, the Chinese name of VLAN (Virtual Local Area Network) is "Virtual Local Area Network"; TSN_TAG, that is, the Time-Sensitive Network tag, is an identifier used for the Time-Sensitive Network (TSN). It allows additional information to be inserted into the Ethernet frame to support time-sensitive network functions. The TSN tag inserts a length of 4 bytes into the standard Ethernet frame, and different priorities of the flow are defined through the Priority Code Point (PCP) and VLAN Identifier (VID) in these tags. This mechanism ensures that the data flow in the network can be managed and transmitted according to different priorities, thus meeting the requirements of real-time performance; ARI (Application Receive Interface) is the application receive interface, which is part of the Ethernet MAC layer and is used to receive data in the Ethernet environment. In the processing of the MAC layer, ARI is part of the interface with the MAC Transport Layer (MTL), responsible for processing the received data and delivering it to the MAC layer or other relevant layers.
[0045] See Figure 4 FIG. is the structural diagram of the ST / RC data frame processing module and the BE / CFG data frame processing module. Their basic frameworks and connection relationships are similar, but they are completely different in terms of internal processing logic, information extraction and parsing related to data frame categories, and interface signals between sub-modules. The No. 1 module in the figure is the preprocessing module, which internally contains the preprocessing logic for 11 ports; the No. 2 module performs port arbitration; the No. 3 module completes the parsing of the current data frame and sends the parsing result to the No. 4 module to obtain the forwarding port and forwarding queue information; the No. 5 module is the single-port forwarding storage control module, with a quantity of 11. The 11 No. 5 modules are respectively 5(1)~5(11), each independently controlling a single-port forwarding storage area, that is, the No. 8 module. The No. 8 module includes 8(1)~8(11), and writes the data frame into the allocated blank storage page. The No. 5 module is also responsible for passing the descriptor information of the single-port forwarding data frame to the corresponding No. 7 module. The No. 7 module includes 7(1)~7(11); the No. 6 module is the multi-port forwarding storage control module, which controls writing the multicast data frame into the multi-port forwarding storage area, that is, the No. 9 module, and passes the data frame descriptor information to all No. 7 modules that need to forward this data frame; the No. 7 module is the send queue control module, which is responsible for writing the data frame descriptor into the No. 10 module, that is, the send control module.
[0046] The present invention sets up an independent receive preprocessing module for each port, and its main functions are: Strip and extract the status information of the data frame from the ARI status information received from each port; Judge the data frame type through the parsing result of the status information, and accordingly determine which next-level processing module the data frame should be shunted to; The PTP (Precision Time Protocol) frame is sent to the PTP data frame processing module; The ST / RC frame is sent to the ST / RC data frame processing module; The BE / CFG frame is sent to the BE / CFG data frame processing module.
[0047] The PTP data frame processing module is responsible for processing PTP-type data frames. PTP-type data frames have high requirements for time precision and do not need to be stored inside the switch. Its processing method is to extract the valid information from the data frame and complete the parsing, and then send the parsing result to the PM subsystem to complete functions such as local clock timing calibration. The PTP data frame processing module independently processes the data frames received on each port without interference, and can meet the real-time requirements of the TSN network to the greatest extent.
[0048] The ST / RC data frame processing module is responsible for processing ST / RC-type data frames. Its main processing flow is: poll and select the port for receiving ST / RC data frames; extract the data frame information and perform parsing, and obtain the forwarding port according to the parsing result; judge whether the ST / RC data frame needs single-port forwarding or multi-port forwarding according to the obtained forwarding port, and request the corresponding data frame storage area accordingly; when the storage of ST / RC data frames and BE / CFG data frames is completed, write the data frame descriptor information to the sending queue in a timely manner according to the data frame length, including the position, length, type, etc. of the data frame in the storage area; the parsing of the data frame and the obtaining of the forwarding port are designed in a two-stage pipelining processing method, and the parsing of the next frame starts while storing the data.
[0049] The BE / CFG data frame processing module is responsible for processing BE / CFG-type data frames. Its main processing flow is: poll and select the port for receiving BE / CFG data frames; forward the local CFG data frame to the configuration port and extract the data frame information to complete the local configuration function; judge whether the BE / CFG data frame needs single-port forwarding or multi-port forwarding, and request the corresponding data frame storage area accordingly; write the data frame descriptor information to the sending queue in a timely manner according to the data frame length, including the position, length, type, etc. of the data frame in the storage area; the parsing of the data frame and the obtaining of the forwarding port are designed in a two-stage pipelining processing method, and the parsing of the next frame starts while storing the data.
[0050] The data frame storage area is divided into three categories: the ST / RC single-port forwarding data frame storage area, the BE / CFG single-port forwarding data frame storage area, and the multi-port forwarding data frame storage area according to the data frame type and the number of forwarding ports; the single-port forwarding data frame storage area is set separately for each forwarding port; the multi-port forwarding data frame storage area is shared by each port.
[0051] Each data storage area is divided into multiple data storage pages of a fixed specification. After initialization, the start addresses of the blank storage pages are connected in sequence as linked list nodes. When storing a data frame, starting from the head of the linked list, the number of storage pages that match the data frame length is taken out and allocated to the current data frame to complete the data storage, and the used storage pages are deleted from the linked list. After the data frame forwarding is completed, the addresses of the released storage pages are inserted as nodes at the tail of the linked list and used as new blank storage pages.
[0052] When storing a data frame, a storage request is initiated by the ST / RC data frame processing module or the BE / CFG data frame processing module. The request information includes frame header indication, frame length, data, data validity indication, frame tail indication, etc. The storage area management module allocates storage pages based on the above information and feeds back the storage page addresses to the data frame processing module.
[0053] Each port of each switch is provided with 8 transmission queues, which can be divided into ST data frame queues, RC data frame queues, and BE / CFG data frame queues according to different data frame types. The quantity and priority of each type of data frame queue can be configured. The data frames are not stored in the transmission queues, but only the data frame descriptor information written during data frame processing is stored. When transmitting a data frame, according to the address pointed to by the first descriptor in the current transmission queue, the data frame is read and forwarded.
[0054] In summary, the core of the present invention lies in: The 20-port TSN switch is divided into two 11-port sub-switches and realized through internal interconnection; A dedicated TSN_TAG identifier is set in the ARI status information, and data frame classification is completed in advance through preprocessing, saving the delay overhead caused by using TSN_TAG in the VLAN domain for differentiation in the traditional method; Classify and process different types of data frames in parallel to ensure the transmission real-time performance of critical traffic with high requirements for time delay; By setting up an independent single-port forwarding storage area, the storage area read conflict during forwarding is reduced, and the throughput line speed requirement is achieved.
[0055] Through functional simulation of the present invention, it is proved that through the preprocessing function, the type of the data frame can be judged before receiving the data, and different types of data frames are respectively sent to the matching next-level modules for processing; the ST / RC data frame processing module and the BE / CFG data frame processing module can realize parallel processing of data frames, and due to the adoption of independent storage areas, the two types of data frames can be received simultaneously and written into their respective storage areas without affecting each other; under the conditions of a working clock frequency of 125 MHz and a data bit width of 128 bit, the line speed throughput forwarding can be satisfied for ordinary BE traffic.
[0056] As an important part of the TSN network, the TSN switch has high time requirements for data frame transmission. When designing and implementing the TSN switch, the internal subsystems and sub-modules should minimize the time overhead as much as possible to achieve the best final design result.
[0057] Based on the above method, the present invention also discloses a data reception, forwarding and storage control system for a TSN switch, see Figure 6 , including: Data frame acquisition module: used to add a time-sensitive network label to the front segment of the data frame at the port of the switch to obtain a data frame containing the time-sensitive network label; Data frame type judgment module: used to obtain the status information according to the data frame containing the time-sensitive network label, and judge the type of the data frame according to the status information. The types of the data frame include PTP data frame, ST / RC data frame and BE / CFG data frame; PTP data frame processing module: for the PTP data frame, after extracting the valid information from the data frame and completing the parsing, the parsing result is sent to the PM subsystem to complete the local clock timing calibration; Data frame forwarding and storage module: for the ST / RC data frame and the BE / CFG data frame, extract the data frame information and perform parsing, obtain the forwarding port type according to the parsing result, perform single-port forwarding or multi-port forwarding on the corresponding data frame according to the obtained forwarding port type, and request the corresponding data frame storage area according to the obtained forwarding port type for data frame storage.
[0058] Each module of the system of the present invention cooperates with each other, and can realize the multi-port exchange reception and storage of data frames, which is beneficial to reducing the reception delay of data frames and improving the data frame processing efficiency.
[0059] In summary, the effects of the invention are as follows: 1. If traditional classification and judgment methods are used for different types of data streams in the TSN network, by setting TSN_TAG in the VLAN domain for differentiation, referring to Figure 2 As can be seen from the position of the VLAN domain shown in the data frame, this method must receive dozens of bytes of valid data before it can parse the judgment result of the data frame type, and then classify and process different types of data. Such a processing method will undoubtedly increase the reception delay of the data stream. The present invention can quickly complete the classification and judgment of the data frame after receiving the valid data status information at the port, and parse the classification result of the current data frame, so as to eliminate the delay overhead of judging after receiving dozens of bytes of valid data, see Figure 3 .
[0060] 2. Assume that the ST / RC data frames of all ports share a storage area. When the ST queues of multiple ports read data simultaneously, there will be access conflicts in this storage area, and some ports must queue up and wait. This will cause the ST queues of the waiting ports to be unable to obtain data although the gating has been opened. Similarly, assume that the BE / CFG data frames of all ports share a storage area, and the forwarding opportunity will also be missed due to access conflicts. To avoid conflicts as much as possible during data frame reception and storage, independent single-port forwarding storage areas are set for each port, and each port can perform read operations separately to avoid missing the time slot interval for allowing data transmission. As Figure 4 shown, this design not only separates the parsing and processing of ST / RC type data frames from BE / CFG data frames, but also isolates the storage of unicast data frames from multicast and broadcast frames, minimizing the mutual influence of data frame forwarding between different ports.
[0061] 3. Perform functional simulation on the invention. In this design, through the preprocessing function, the types of the two data frames are determined before receiving the data, and the two types of data frames are respectively sent to the matching next-level modules for processing. The ST / RC data frame processing module and the BE / CFG data frame processing module process the data frames in parallel. Since independent storage areas are used, the two types of data frames can be received simultaneously and written into their respective storage areas without mutual influence. Under the conditions of a working clock frequency of 125 MHz and a data bit width of 128 bit, the line speed throughput forwarding can be achieved.
[0062] The above content is only to illustrate the technical idea of the invention, and the protection scope of the invention cannot be limited thereby. Any changes made on the basis of the technical solution according to the technical idea proposed by the invention shall fall within the protection scope of the invention.
Claims
1. A data receiving and forwarding storage control method for a TSN switch, characterized in that: The following steps are involved: Add a time-sensitive network label to the front part of the data frame at the port of the switch to obtain a data frame containing the time-sensitive network label; Acquire state information according to a data frame containing a time-sensitive network tag, and determine the type of the data frame according to the state information, wherein the type of the data frame includes a PTP data frame, a ST / RC data frame, and a BE / CFG data frame; For PTP data frames, after extracting valid information from the data frames and completing parsing, the parsing results are sent to the PM subsystem to complete the local clock timing calibration; For ST / RC data frames and BE / CFG data frames, extract the data frame information and parse it, obtain the forwarding port type according to the parsing result, perform single-port forwarding or multi-port forwarding on the corresponding data frame according to the obtained forwarding port type, and request the corresponding data frame storage area to store the data frame according to the obtained forwarding port type.
2. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: The state information is obtained according to the data frame containing the time-sensitive network tag, and the type of the data frame is determined according to the state information, specifically as follows: Stripping and extracting state information from data frames containing time-sensitive network tags; Parse the status information; The type of the data frame is determined based on the parsing result of the status information.
3. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: For the PTP data frames, the PTP data frames received by each port are processed independently.
4. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: For the ST / RC data frame and the BE / CFG data frame, when the storage of the ST / RC data frame and the BE / CFG data frame is completed, the data frame descriptor information is written to the sending queue according to the length of the data frame, and the data frame descriptor information includes the position, length and type of the data frame in the storage area; For the ST / RC data frame and the BE / CFG data frame, the parsing of the data frame information, the acquisition of the forwarding port type and the data frame storage are all two-level pipeline processing methods, and the next frame is parsed while the data frame is being stored.
5. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: The CFG data frame is forwarded to the configuration port and the data frame information is extracted to complete the local configuration function.
6. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: The data frame storage area is specifically as follows: The data frame storage area is divided into a single-port forwarding data frame storage area and a multi-port forwarding data frame storage area according to the data frame type and the number of forwarding ports; The single-port forwarding data frame storage area includes an ST / RC single-port forwarding data frame storage area and a BE / CFG single-port forwarding data frame storage area The single-port forwarding data frame storage area is separately set for each forwarding port; The multi-port forwarding data frame storage area is shared by each port.
7. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: The corresponding data frame storage area is requested to store the data frame according to the acquired forwarding port type, as follows: Acquire a corresponding data frame storage area according to the acquired forwarding port type, wherein the data frame storage area includes a plurality of data storage pages of fixed specifications; Initialize the data storage page to obtain an initialized blank storage page; Connect the first addresses of each blank storage page as linked list nodes in sequence; When storing a data frame, starting from the head of the linked list, take out the storage pages that match the length of the data frame and allocate them to the current data frame to complete the data frame storage, and delete the used storage pages from the linked list; After the data frame forwarding is completed, the released storage page address is inserted into the tail of the linked list as a node and is used as a new blank storage page.
8. The data receiving and forwarding storage control method of the TSN switch according to claim 7, characterized in that: When storing the data frame, starting from the head of the linked list, the storage pages matching the length of the data frame are taken out and allocated to the current data frame to complete the data frame storage, and the used storage pages are deleted from the linked list, as follows: Initiate a storage request, the storage request information includes: frame header indication, frame length, data, data valid indication and frame end indication; Allocate storage pages of a number matching the length of the data frame according to the storage request information; Store the previous data frame into the storage pages matching the length of the data frame; And remove the used storage pages from the linked list.
9. The data receiving and forwarding storage control method of the TSN switch according to claim 1, characterized in that: The switch port is equipped with 8 sending queues, which are divided into ST data frame queue, RC data frame queue and BE / CFG data frame queue according to the data frame type. The number and priority of each data frame queue are configurable; The sending queue does not store data frames, only the written data frame descriptor information; When the corresponding data frame is forwarded by a single port or multiple ports, the data frame is read and forwarded according to the address pointing contained in the first descriptor in the current sending queue.
10. A data receiving and forwarding storage control system of a TSN switch for implementing any of the methods described in claims 1 to 9, characterized in that: include: Data frame acquisition module: used to add a time-sensitive network tag to the front part of the data frame at the port of the switch to obtain the data frame containing the time-sensitive network tag; A data frame type determination module is used to obtain status information according to a data frame containing a time-sensitive network tag, and determine the type of the data frame according to the status information, wherein the types of the data frame include PTP data frame, ST / RC data frame and BE / CFG data frame; PTP data frame processing module: for PTP data frames, extracting valid information from the data frames and completing the analysis, and then sending the analysis results to the PM subsystem to complete the local clock timing calibration; Data frame forwarding storage module: used for extracting data frame information and parsing ST / RC data frames and BE / CFG data frames, obtaining the forwarding port type according to the parsing result, performing single-port forwarding or multi-port forwarding on the corresponding data frame according to the obtained forwarding port type, and requesting the corresponding data frame storage area to store the data frame according to the obtained forwarding port type.