A WLAN-TSN low-latency conversion gateway
By designing a WLAN-TSN low-latency conversion gateway, using hardware circuits to realize the conversion of WLAN and TSN protocols, the delay problem of traditional TSN technology in low-latency and high real-time application scenarios is solved, and low-latency and high reliability are achieved. Network transmission, suitable for small business private networks.
Patent Information
- Application Number
- CN202211413358.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Traditional TSN technology is mainly concentrated in the field of wired transmission, with long construction cycles, high costs and lack of flexibility, which cannot meet low latency and high real-time application scenarios, especially in the fusion of WLAN and TSN. .
A WLAN-TSN low-latency conversion gateway is designed, and hardware circuits are used to realize the conversion of WLAN and TSN protocols, including APB interface, registers, frame header verification module, CRC verification module, FIFO buffer and conversion module, passing the status The computer and CRC verification realize the disassembly and frame the protocol data, and support the protocol conversion of WLAN→TSN and TSN→WLAN.
It realizes low latency, high reliability, and deterministic network transmission. It is suitable for small enterprise private networks. It has the advantages of fast, stable and reliable. It is suitable for dedicated networks with insufficient bandwidth and frequent network topology changes.
Smart Images

Figure CN115733712B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication network technology, and more specifically, to a WLAN-TSN low-latency conversion gateway. Background Art
[0002] Time-sensitive networking (TSN) is a new type of industrial communication network technology that is being actively promoted by the global industry. Based on standard wired Ethernet, time-sensitive networking ensures the certainty and reliability of data transmission through various mechanisms such as time synchronization, traffic scheduling and shaping, and flow reservation. At present, due to the use of standardized protocols, time-sensitive networking can not only change the complex and diverse status of the existing industrial network system, but also improve the interoperability, scalability and compatibility of industrial networks.
[0003] However, traditional TSN technology is mainly concentrated in the field of wired transmission. Wired networking has disadvantages such as long construction period, high cost, and lack of flexibility. Therefore, the integration of TSN and wireless technology has become a hot topic in academia and industry. 5G technology and WIFI technology have become the two most suitable candidate technologies for integration with TSN. The current research hotspots are often based on the integration of 5G and TSN, and less attention is paid to the integration of WLAN (WIFI) and TSN. Summary of the invention
[0004] In order to solve the problem that traditional networks use software to implement network protocol conversion, the delay is relatively high and cannot meet the application scenarios of low delay and high real-time performance, the present invention provides a WLAN-TSN low-latency conversion gateway, which has the advantage of low delay.
[0005] In order to achieve the above-mentioned purpose of the present invention, the technical scheme adopted is as follows:
[0006] A WLAN-TSN low-latency conversion gateway, the circuit comprising: an APB interface, a register, a WLAN frame header check module, a WLAN CRC check module, a TSN frame header check module, a TSN CRC check module, a first conversion module, a second conversion module, a WLAN FIFO buffer, a TSN FIFO buffer, a first GMII interface, and a second GMII interface
[0007] Wherein, the APB interface is used to connect to an external CPU, and the CPU configures and reads registers through the APB interface;
[0008] The register is used to store field information of WLAN and TSN protocol frames and interrupt type information;
[0009] The WLAN frame header check module is used to perform state jump and output signal change by judging the first data received by the first GMII interface and the current state;
[0010] The WLAN CRC check module is used to perform CRC 32 check on the WLAN protocol data received through the first GMII interface, and when the check fails, set the WLAN error indication signal;
[0011] The TSN frame header check module is used to perform state jump and output signal change by judging the second data received by the second GMII interface and the current state;
[0012] The TSN CRC check module is used to perform CRC 32 check on the TSN protocol data received through the second GMII interface, and when the check fails, the TSN error indication signal is set;
[0013] The WLAN FIFO buffer is used to buffer the WLAN protocol data output by the WLAN CRC check module;
[0014] The TSN FIFO buffer is used to cache the TSN protocol data output by the TSN CRC check module;
[0015] The first conversion module is used to convert the WLAN protocol data received from the WLAN FIFO buffer into TSN protocol data.
[0016] The second conversion module is used to convert the TSN protocol data received from the TSN FIFO buffer into WLAN protocol data.
[0017] Preferably, the first conversion module includes a WLAN→TSN conversion module and a WLAN CRC calculator;
[0018] The WLAN→TSN conversion module is used to convert the received WLAN protocol data into TSN protocol data.
[0019] The WLAN CRC calculator is used to perform CRC32 check on the received WLAN protocol data and store the check result.
[0020] Further, the second conversion module includes a TSN→WLAN conversion module and a TSN CRC calculator;
[0021] The TSN→WLAN conversion module is used to convert the received TSN protocol data into WLAN protocol data;
[0022] The TSN CRC calculator is used to perform CRC32 check on the received TSN protocol data and store the check result.
[0023] Furthermore, the WLAN frame header check module and the TSN frame header check module are both mealy state machines.
[0024] Furthermore, the WLAN frame header check module performs state jump and output signal change by judging the first data received by the first GMII interface and the current state; wherein the interpretation and working process of each state are as follows:
[0025] (1) First idle state: After the WLAN frame header check module is powered on, it enters the idle initial state and waits for the first GMII interface to receive the first data; if the received first data is 16 consecutive 8'hff, it is determined to be a long preamble and enters the SFD state; if the received first data is 7 consecutive 8'h00, it is determined to be a short preamble and enters the SFD state; if the received first data is neither a long preamble nor a short preamble, it continues to be in the first idle state;
[0026] (2) SFD state: The SFD state is the start delimiter state. If the received data is 16'05CF, it is determined that the start delimiter is received and the header state is entered. Otherwise, the first idle state is returned.
[0027] (3) Header state: The header state is the MAC header state. Every time 1B of data is received, the WLAN CRC calculator increments by 1. When 6B is received, it is considered that the MAC header has been received and enters the MDPU state.
[0028] (4) MDPU state: The MDPU state is the MAC data receiving state. During the data reception process, the data is buffered into the WLAN FIFO buffer while being CRC checked by the WLAN CRC check module. At the same time, the frame length is counted by the WLAN CRC calculator, and the MAC address field is determined and stored by the value of the WLAN CRC calculator. After the data reception is completed, the WLAN frame header check module returns to the first idle state to wait for the reception of the next frame.
[0029] Furthermore, the TSN frame header check module is used to perform state jump and output signal change by judging the second data received by the second GMII interface and the current state, wherein each state interpretation and workflow are as follows:
[0030] (1) Second idle state: After the second state machine module is powered on, it enters the second idle state and waits for the second GMII interface to receive the second data; after the second GMII interface receives the second data, it enters the preamble receiving state;
[0031] (2) Receiving preamble state: In the receiving preamble state, the TSN frame header check module detects the value of the second data while receiving; if the data value of each byte in the 7B data is 01010101, it means that the preamble value of the received TSN data is correct, and the receiving start character state is entered, otherwise it returns to the second idle state;
[0032] (3) Receive start character state: In the receive start character state, the TSN frame header check module detects the value of the second data while receiving. If the received 1B data is 8′b11010101, it means that the start character value of the received TSN data is correct, and the state enters the receive MAC address state. Otherwise, it returns to the second idle state.
[0033] (4) Receive MAC address state: In the receive MAC address state, the TSN frame header check module receives the 6B MAC destination address and the 6B MAC source address in sequence. After receiving, it enters the receive VLAN Tag state;
[0034] (5) Receive VLAN Tag state: In the receive VLAN Tag state, after receiving and latching, it enters the receive data length state;
[0035] (6) Receive data length state: In the receive data length state, the TSN frame header check module receives and latches the number of bytes of the second data; after receiving, it enters the receive data state;
[0036] (7) Data receiving state: In the data receiving state, the TSN frame header check module receives the second data and caches the second data into the TSN FIFO buffer; when the number of received second data reaches the number of bytes latched in the data receiving length state, it indicates that the reception of the second data is completed and returns to the second idle state.
[0037] Furthermore, the first conversion module and the second conversion module perform protocol conversion between WLAN and TSN, and the following conditions are met:
[0038] Condition 1: WLAN network and TSN network are bridged;
[0039] Condition 2: There is a uniformly compiled MAC address.
[0040] Furthermore, when performing protocol conversion, the framing method of each field in the WLAN protocol and the TSN protocol is as follows:
[0041] (1) For the address field, directly replace Address1 and Address2 of the WLAN data frame with DestinationAddress and SourceAddress of the TSN data frame;
[0042] (2) When WLAN network and TSN network are bridged, first set the length of the payload field of TSN data frame and the FrameBody of WLAN data frame to 46 to 1500 bytes; then directly replace the FrameBody of WLAN data frame and the payload of TSN data frame;
[0043] (3) The length of the FCS field of the WLAN data frame and the TSN data frame is 4B. During protocol conversion, the FCS position is filled with the result calculated by the WLAN CRC calculator or the TSN CRC calculator;
[0044] (4) The Preamble and Header fields of the WLAN data frame are either a 144-bit long frame header or a 72-bit short frame header. The selection is made based on the register configured by the CPU during framing.
[0045] (5) The Preamble and SFD of the TSN data frame are fixed values of 7B and 1B respectively.
[0046] Furthermore, when the first conversion module converts the WLAN protocol data into the TSN data, the framebody of the WLAN protocol frame is counted, and the counting result is filled into the length / type field of the TSN protocol frame.
[0047] Furthermore, the remaining fields in the TSN data frame and the WLAN data frame are uniformly configured by the CPU, and the protocol frame is encapsulated according to the configuration value of the register during framing.
[0048] The beneficial effects of the present invention are as follows:
[0049] The present invention proposes a WLAN-TSN low-latency conversion gateway, which is suitable for small enterprise private networks. It has the advantages of low latency, high reliability, and deterministic latency. The WLAN-TSN low-latency conversion gateway is simple to implement and lightweight, suitable for private networks with insufficient bandwidth and frequent changes in network topology, and has the advantages of being fast, stable, and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the WLAN-TSN protocol conversion model of the present invention.
[0051] Figure 2This is the circuit architecture of the WLAN-TSN protocol conversion of the present invention.
[0052] Figure 3 It is a flow chart of the WLAN frame header check module working on the WLAN protocol.
[0053] Figure 4 It is a flow chart of the TSN frame header check module working on the TSN protocol.
[0054] Figure 5 This is a schematic diagram of protocol conversion between WLAN protocol frames and TSN protocol frames.
[0055] Figure 6 It is a schematic diagram of converting WLAN protocol frames into TSN protocol frames.
[0056] Figure 7 This is a schematic diagram of converting WLAN protocol frames into TSN protocol frames. DETAILED DESCRIPTION
[0057] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0058] Example 1
[0059] The TSN protocol is a set of protocol standards that ensure the time determinism of network data transmission. It is a protocol standard under IEEE802.1. According to the protocol standard, the TSN protocol works at the second layer of the OSI model, namely the data link layer. At the same time, most of the mechanisms of the TSN protocol are implemented by hardware, so it takes very little time to process the data stream. The WLAN protocol mainly follows the IEEE802.11 protocol standard. The protocol frame specified in the 802.11 standard also contains the Address field. Therefore, as long as the Address of the 802.11 and TSN protocols is uniformly addressed, the protocol conversion from the WLAN network to the TSN network can be realized.
[0060] Based on the above analysis, the present invention designs a network protocol conversion model of WLAN and TSN based on hardware circuit, such as Figure 1 As shown, it mainly works at the data link layer. At the data link layer, the WLAN-TSN low-latency conversion gateway designed by the present invention can complete the deframing and framing of the protocol data of WLAN and TSN, including: deframing and filling of TSN frame header, parsing and filling of VLAN Tag, unified addressing and mapping of MAC address, filling of payload, CRC check and recalculation, etc., as follows:
[0061] like Figure 2As shown, a WLAN-TSN low-latency conversion gateway, the circuit includes: an APB interface, a register, a WLAN frame header check module, a WLAN CRC check module, a TSN frame header check module, a TSN CRC check module, a first conversion module, a second conversion module, a WLAN FIFO buffer, a TSN FIFO buffer, a first GMII interface, and a second GMII interface
[0062] Wherein, the APB interface is used to connect to an external CPU, and the CPU configures and reads registers through the APB interface;
[0063] The register is used to store field information of WLAN and TSN protocol frames and interrupt type information;
[0064] The WLAN frame header check module is used to perform state jump and output signal change by judging the first data received by the first GMII interface and the current state;
[0065] The WLAN CRC check module is used to perform CRC 32 check on the WLAN protocol data received through the first GMII interface, and when the check fails, set the WLAN error indication signal;
[0066] The TSN frame header check module is used to perform state jump and output signal change by judging the second data received by the second GMII interface and the current state;
[0067] The TSN CRC check module is used to perform CRC 32 check on the TSN protocol data received through the second GMII interface, and when the check fails, the TSN error indication signal is set;
[0068] The WLAN FIFO buffer is used to buffer the WLAN protocol data output by the WLAN CRC check module;
[0069] The TSN FIFO buffer is used to cache the TSN protocol data output by the TSN CRC check module;
[0070] The first conversion module is used to convert the WLAN protocol data received from the WLAN FIFO buffer into TSN protocol data.
[0071] The second conversion module is used to convert the TSN protocol data received from the TSN FIFO buffer into WLAN protocol data.
[0072] This embodiment designs a WLAN-TSN low-latency conversion gateway that supports protocol conversion between WLAN protocol and TSN protocol at the data link layer. The WLAN-TSN low-latency conversion gateway is a hardware gateway based on digital circuits, which can use Verilog language for circuit description and has the advantage of low end-to-end latency. The WLAN-TSN low-latency conversion gateway supports protocol conversion between WLAN protocol data and TSN protocol data, and the minimum end-to-end latency can reach microseconds. This embodiment solves the problem that the traditional bridge system uses software to implement network protocol conversion, has a relatively high latency, and cannot meet the application scenarios of low latency and high real-time performance.
[0073] In a specific embodiment, the first conversion module includes a WLAN→TSN conversion module and a WLAN CRC calculator;
[0074] The WLAN→TSN conversion module is used to convert the received WLAN protocol data into TSN protocol data.
[0075] The WLAN CRC calculator is used to perform CRC32 check on the received WLAN protocol data and store the check result.
[0076] In a specific embodiment, the second conversion module includes a TSN→WLAN conversion module and a TSN CRC calculator;
[0077] The TSN→WLAN conversion module is used to convert the received TSN protocol data into WLAN protocol data;
[0078] The TSN CRC calculator is used to perform CRC32 check on the received TSN protocol data and store the check result.
[0079] exist Figure 2 In the figure, the solid-line frame contains all the circuit modules of the WLAN-TSN low-latency conversion gateway. The part in the dotted-line frame represents the circuit part that interacts with the WLAN-TSN low-latency conversion gateway. The black arrow indicates the data flow. The WLAN-TSN low-latency conversion gateway supports the CPU to update the contents of the configuration register in real time through the APB interface. The contents stored in the registers indicate the default values of each field of the WLAN protocol and the TSN protocol, and can also store information about the interrupt type.
[0080] In addition, the WLAN-TSN low-latency conversion gateway processes data in two directions, where the uplink direction refers to WLAN MAC to TSN switch, and the downlink direction refers to from TSN switch to WLAN MAC.
[0081] For the data in the uplink direction, the WLAN-TSN low-latency conversion gateway identifies and parses the WLAN protocol frame received by the first GMII interface, performs CRC check, and caches it.
[0082] The WLAN FIFO buffer performs framing according to the configuration information in the registers to complete the protocol conversion from the WLAN protocol to the TSN protocol, and forwards it to the TSN switch through the second GMII interface.
[0083] For data in the downlink direction, the WLAN-TSN low-latency conversion gateway performs the reverse processing of the uplink data processing process, specifically identifying and parsing the TSN protocol frame received through the second GMII interface, performing CRC check, caching it in the TSN FIFO buffer, framing it according to the configuration information in the registers to complete the protocol conversion from TSN protocol to WLAN protocol, and forwarding it to WLAN MAC through the first GMII interface.
[0084] Example 2
[0085] Based on the WLAN-TSN low-latency conversion gateway described in Example 1, more specifically, the WLAN frame header check module and the TSN frame header check module described in this embodiment are both a state machine module, that is, a mealy-type state machine.
[0086] In a specific embodiment, the WLAN frame header check module performs state jump and output signal change by judging the first data received by the first GMII interface and the current state; Figure 3 As shown, the explanation and workflow of each state are as follows:
[0087] (1) First idle state: After being powered on, the WLAN frame header check module enters the idle initial state and waits for the first GMII interface to receive the first data; if the received first data (8-bit data) is 16 consecutive 8′hff, it is determined to be a long preamble and enters the SFD state; if the received first data is 7 consecutive 8′h00, it is determined to be a short preamble and enters the SFD state; if the received first data is neither a long preamble nor a short preamble, it continues to stay in the first idle state.
[0088] (2) SFD state: The SFD state is the start delimiter state. If the received data is 16'05CF, it is determined that the start delimiter is received and the header state is entered. Otherwise, the first idle state is returned.
[0089] (3) Header state: The header state is the MAC header state. Every time 1B of data is received, the WLAN CRC calculator increments by 1. When 6B is received, it is considered that the MAC header has been received and enters the MDPU state.
[0090] (4) MDPU state: The MDPU state is the MAC data receiving state. During the data reception process, the data is buffered into the WLAN FIFO buffer while being CRC checked by the WLAN CRC check module. At the same time, the frame length is counted by the WLAN CRC calculator, and the MAC address field is determined and stored by the value of the WLAN CRC calculator. After the data reception is completed, the WLAN frame header check module returns to the first idle state to wait for the reception of the next frame.
[0091] In a specific embodiment, the TSN frame header check module is used to perform state jump and output signal change by judging the second data received by the second GMII interface and the current state. The workflow is similar to WLANheaderchecker, but the specific process details are different, such as Figure 4 As shown, the interpretation and workflow of each state are as follows:
[0092] (1) Second idle state: After the second state machine module is powered on, it enters the second idle state and waits for the second GMII interface to receive the second data; after the second GMII interface receives the second data, it enters the receiving preamble (rx_pre) state;
[0093] (2) Receive preamble (rx_pre) state: In the receive preamble (rx_pre) state, the TSN frame header check module detects the value of the second data while receiving; if the data value of each byte in the 7B data is 01010101, it means that the preamble value of the received TSN data is correct, and the state enters the receive start symbol (rx_sfd) state, otherwise it returns to the second idle state;
[0094] (3) Receive Start Character (rx_sfd) state: In the receive start character state, the TSN frame header check module detects the value of the second data while receiving. If the received 1B data is 8′b11010101, it means that the start character value of the received TSN data is correct, and the state enters the receive MAC address (rx_addr) state, otherwise it returns to the second idle state;
[0095] (4) Receive MAC address (rx_addr) state: In the receive MAC address state, the TSN frame header check module receives the 6B MAC destination address and the 6B MAC source address in sequence. After receiving, it enters the receive VLAN Tag (rx_vlan) state;
[0096] (5) Receive VLAN Tag (rx_vlan) state: In the receive VLAN Tag state, after receiving and latching, enter the receive data length (rx_leng) state;
[0097] (6) Receive data length (rx_leng) state: In the receive data length state, the TSN frame header check module receives and latches the number of bytes of the second data; after receiving, it enters the receive data (rx_data) state;
[0098] (7) Receive data (rx_data) state: In the receive data state, the TSN frame header check module receives the second data and caches the second data into the TSN FIFO buffer; when the number of received second data reaches the number of bytes latched in the receive data length state, it indicates that the reception of the second data is completed and returns to the second idle state.
[0099] Example 3
[0100] Based on the WLAN-TSN low-latency conversion gateway described in Example 1 or Example 2, more specifically, the first conversion module and the second conversion module described in this embodiment perform protocol conversion between WLAN and TSN, and meet the following conditions:
[0101] Condition 1: WLAN network and TSN network are bridged;
[0102] Condition 2: There is a uniformly compiled MAC address.
[0103] That is, when the WLAN network and the TSN network are bridged through the WLAN-TSN low-latency conversion gateway, and the WLAN network and the TSN network have uniformly compiled MAC addresses, protocol conversion can be performed.
[0104] In a specific embodiment, Figure 5 As shown, during protocol conversion, the framing method of each field in the WLAN protocol and the TSN protocol is as follows:
[0105] (1) For the address field, directly replace Address1 and Address2 of the WLAN data frame with DestinationAddress and SourceAddress of the TSN data frame.
[0106] (2) When WLAN network and TSN network are bridged, the length of the payload field of TSN data frame and the FrameBody of WLAN data frame are first set to 46 to 1500 bytes; then the FrameBody of WLAN data frame and the payload of TSN data frame are directly replaced.
[0107] (3) The length of the FCS field of the WLAN data frame and the TSN data frame is 4B. During protocol conversion, the FCS position is filled with the result calculated by the WLAN CRC calculator or the TSN CRC calculator.
[0108] (4) The Preamble and Header fields of the WLAN data frame are either a 144-bit long frame header or a 72-bit short frame header. The two fields are selected based on the register configured by the CPU during framing.
[0109] (5) The Preamble and SFD of the TSN data frame are fixed values of 7B and 1B respectively.
[0110] In this embodiment, the frame body FrameBody of the WLAN protocol and the payload of the TSN protocol can be directly replaced to form a frame. However, it is necessary to pay attention to the byte length of this field. The payload length of the TSN protocol frame is 46 to 1500B, while the field length of the WLAN protocol frame is 0 to 2312B. Therefore, if the data length of a network protocol is too long or too short, it will cause incompatibility between the two networks. Therefore, when bridging the WLAN network and the TSN network, the actual situation of the WLAN network and the TSN network should be fully considered, and the length of the payload field of the TSN protocol and the FrameBody of the WLAN protocol should be set to 46 to 1500B.
[0111] In a specific embodiment, when the first conversion module converts the WLAN protocol data into TSN data, it counts the framebody of the WLAN protocol frame and fills the counting result into the length / type field of the TSN protocol frame.
[0112] In a specific embodiment, the remaining fields in the TSN data frame and the WLAN data frame are uniformly configured by the CPU, and the protocol frame is encapsulated according to the configuration value of the register during framing.
[0113] Figure 6The process of converting WLAN protocol frames to TSN protocol frames is shown. When the WLAN-TSN low-latency conversion gateway receives the WLAN protocol frame, the WLAN frame header check module checks each field of the WLAN protocol frame, such as the Preamble and Header, in turn, latches the Address1 and Address2 fields of the WLAN protocol frame, and caches the Frame Body field with the WLAN FIFO buffer. After receiving the buffer, the rx_done_WLAN signal is set to indicate that the WLAN data buffer is completed. The first conversion module that converts the WLAN protocol to the TSN protocol starts to send each field of the TSN protocol frame from the second GMII interface in the next clock cycle after recognizing that the rx_done_WLAN signal is pulled high, where the Destination Address and Source Address fields are filled with the previously latched Address1 and Address2 fields, the VLAN tag field is filled with the value configured by the CPU, the payload field is filled with the data taken out of the WLAN FIFO buffer, and the FCS field is filled with the value calculated by the TSN CRC calculator.
[0114] Figure 7 The process of converting TSN protocol frames into TSN protocol frames is shown.
[0115] The working process of the circuit is Figure 6 The reverse process will not be described here.
[0116] from Figure 6 , Figure 7 From the simulation waveform, we can see that in the next clock cycle after the completion of receiving TSN data and WLAN data, rx_done_tsn and rx_done_WLAN are set, and in the next clock cycle, the data frame after protocol conversion starts to be sent. It can be seen that from receiving the completion data to starting to send the new protocol type data, only 2 clock cycles are consumed, so the delay of protocol conversion in the WLAN-TSN low-latency conversion gateway designed in this embodiment is very small.
[0117] The WLAN-TSN low-latency conversion gateway proposed in this embodiment is suitable for small enterprise private networks. It has the advantages of low latency, high reliability, and deterministic latency. The WLAN-TSN low-latency conversion gateway described in the present invention has the advantages of simple implementation and light content, and is suitable for private networks with insufficient bandwidth and frequent changes in network topology, and has the advantages of fast, stable, and reliable.
[0118] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. A WLAN-TSN low-latency conversion gateway, characterized in that: The gateway comprises: an APB interface, a register, a WLAN frame header check module, a WLAN CRC check module, a TSN frame header check module, a TSN CRC check module, a first conversion module, a second conversion module, a WLAN FIFO buffer, a TSN FIFO buffer, a first GMII interface, and a second GMII interface; Wherein, the APB interface is used to connect to an external CPU, and the CPU configures and reads registers through the APB interface; The register is used to store field information of WLAN and TSN protocol frames and interrupt type information; The WLAN frame header check module is used to perform state jump and output signal change by judging the first data received by the first GMII interface and the current state; The WLAN CRC check module is used to perform a CRC32 check on the WLAN protocol data received through the first GMII interface, and when an error occurs in the check, a WLAN error indication signal is set; The TSN frame header check module is used to perform state jump and output signal change by judging the second data received by the second GMII interface and the current state; The TSN CRC check module is used to perform CRC 32 check on the TSN protocol data received through the second GMII interface, and when the check fails, the TSN error indication signal is set; The WLAN FIFO buffer is used to buffer the WLAN protocol data output by the WLAN CRC check module; The TSN FIFO buffer is used to cache the TSN protocol data output by the TSN CRC check module; The first conversion module is used to convert the WLAN protocol data received from the WLAN FIFO buffer into TSN protocol data; wherein the first conversion module includes WLAN TSN conversion module, WLAN CRC calculator; the WLAN The TSN conversion module is used to convert the received WLAN protocol data into TSN protocol data; the WLAN CRC calculator is used to perform CRC32 check on the received WLAN protocol data and store the check result; The second conversion module is used to convert the TSN protocol data received from the TSN FIFO buffer into WLAN protocol data; wherein the second conversion module includes TSN WLAN conversion module, TSN CRC calculator; TSN The WLAN conversion module is used to convert the received TSN protocol data into WLAN protocol data; the TSN CRC calculator is used to perform CRC32 check on the received TSN protocol data and store the check result.
2. The WLAN-TSN low-latency conversion gateway according to claim 1, characterized in that: The WLAN frame header check module and the TSN frame header check module are both mealy-type state machines.
3. The WLAN-TSN low-latency conversion gateway according to claim 2, characterized in that: The WLAN frame header check module performs state jump and output signal change by judging the first data received by the first GMII interface and the current state; wherein the interpretation and working process of each state are as follows: (1) First idle state: After the WLAN frame header check module is powered on, it enters the idle initial state and waits for the first GMII interface to receive the first data; if the received first data is 16 consecutive 8'hff, it is determined to be a long preamble and enters the SFD state; if the received first data is 7 consecutive 8'h00, it is determined to be a short preamble and enters the SFD state; if the received first data is neither a long preamble nor a short preamble, it continues to be in the first idle state; (2) SFD state: The SFD state is the start delimiter state. If the received data is 16'05CF, it is determined that the start delimiter is received and the header state is entered. Otherwise, the first idle state is returned. (3) Header state: The header state is the MAC header state. Every time 1B of data is received, the WLAN CRC calculator increments by 1. When 6B is received, it is considered that the MAC header has been received and enters the MDPU state. (4) MDPU state: The MDPU state is a MAC data receiving state. During the data reception process, the data is buffered into the WLAN FIFO buffer while being CRC checked by the WLAN CRC check module. At the same time, the frame length is counted by the WLAN CRC calculator, and the MAC address field is determined and stored by the value of the WLAN CRC calculator. After the data reception is completed, the WLAN frame header check module returns to the first idle state to wait for the reception of the next frame.
4. The WLAN-TSN low-latency conversion gateway according to claim 2, characterized in that: The TSN frame header check module is used to perform state jump and output signal change by judging the second data received by the second GMII interface and the current state, wherein each state interpretation and workflow are as follows: (1) Second idle state: After the second state machine module is powered on, it enters the second idle state and waits for the second GMII interface to receive the second data; after the second GMII interface receives the second data, it enters the preamble receiving state; (2) Receiving preamble state: In the receiving preamble state, the TSN frame header check module detects the value of the second data while receiving; if the data value of each byte in the 7B data is 01010101, it means that the preamble value of the received TSN data is correct, and the state enters the receiving start character state, otherwise it returns to the second idle state; (3) Receive start character state: In the receive start character state, the TSN frame header check module detects the value of the second data while receiving. If the received 1B data is 8′b11010101, it means that the start character value of the received TSN data is correct, and the module enters the receive MAC address state. Otherwise, the module returns to the second idle state. (4) Receive MAC address state: In the receive MAC address state, the TSN frame header check module receives the 6B MAC destination address and the 6B MAC source address in sequence. After receiving, it enters the receive VLAN Tag state; (5) Receive VLAN Tag state: In the receive VLAN Tag state, after receiving and latching, it enters the receive data length state; (6) Receive data length state: In the receive data length state, the TSN frame header check module receives and latches the number of bytes of the second data; after receiving, it enters the receive data state; (7) Data receiving state: In the data receiving state, the TSN frame header check module receives the second data and caches the second data into the TSN FIFO buffer; when the number of received second data reaches the number of bytes latched in the data receiving length state, it indicates that the second data is received and returns to the second idle state.
5. The WLAN-TSN low-latency conversion gateway according to claim 1, characterized in that: The first conversion module and the second conversion module perform protocol conversion between WLAN and TSN, and meet the following conditions: Condition 1: WLAN network and TSN network are bridged; Condition 2: There is a uniformly compiled MAC address.
6. The WLAN-TSN low-latency conversion gateway according to claim 5, characterized in that: When performing protocol conversion, the framing method for each field in the WLAN protocol and the TSN protocol is as follows: (1) For the address field, directly replace Address1 and Address2 of the WLAN data frame with DestinationAddress and SourceAddress of the TSN data frame; (2) When bridging the WLAN network and the TSN network, first set the length of the payload field of the TSN data frame and the FrameBody of the WLAN data frame to 46~1500B; then directly replace the FrameBody of the WLAN data frame and the payload of the TSN data frame; (3) The length of the FCS field of the WLAN data frame and the TSN data frame is 4B. During protocol conversion, the FCS position is filled with the result calculated by the WLAN CRC calculator or the TSN CRC calculator; (4) The Preamble and Header fields of the WLAN data frame are either a 144-bit long frame header or a 72-bit short frame header. The selection is made based on the register configured by the CPU during framing. (5) The Preamble and SFD of the TSN data frame are fixed values of 7B and 1B respectively.
7. The WLAN-TSN low-latency conversion gateway according to claim 6, characterized in that: When the first conversion module converts the WLAN protocol data into TSN data, it counts the framebody of the WLAN protocol frame and fills the counting result into the length / type field of the TSN protocol frame.
8. The WLAN-TSN low-latency conversion gateway according to claim 7, characterized in that: The remaining fields in the TSN data frame and the WLAN data frame are uniformly configured by the CPU, and the protocol frame is encapsulated according to the configuration value of the register during framing.
Citation Information
Patent Citations
Time-sensitive heterogeneous network system of industrial control system, and management method thereof
CN112073388A
Multifunctional multi-protocol intelligent gateway
CN216751793U
Interface functionality for ran-WLAN radio aggregation
US20170318493A1
