Method and device for realizing tunneling technology through field programmable gate array

By using field programmable gate arrays to encapsulate and parse packets in embedded systems, the problem of low tunnel forwarding efficiency is solved, and efficient tunnel forwarding technology is realized, suitable for communications of different local area networks.

CN119210936APending Publication Date: 2024-12-27北京东土军悦科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411373491.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Traditional tunnel forwarding technology is inefficient, especially in embedded systems. Since the CPU needs to process multiple business logic, the tunnel forwarding efficiency is not high.

Method used

Through field programmable gate array (FPGA), tunnel forwarding technology is realized and forwarding efficiency is improved. The specific steps include encapsulating the packet after receiving the packets, forwarding them through the wireless interface, parsing and sending them after receiving the target packets.

Benefits of technology

It realizes efficient tunnel forwarding, improves processing and forwarding efficiency, and is suitable for communication between different local area networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119210936A_ABST
    Figure CN119210936A_ABST
Patent Text Reader

Abstract

The invention relates to a method and a device for realizing a tunneling technology through a field programmable gate array. The method comprises the following steps: when a user interface of a field programmable gate array of a first terminal receives a first message to be sent by the first terminal, packaging the first message through the field programmable gate array to obtain a first target message, and forwarding the first target message through a wireless interface of the field programmable gate array; and when the wireless interface of the field-programmable gate array of the first terminal receives a second target message, analyzing the second target message through the field-programmable gate array to obtain a second message in the second target message, and sending the second message to the first terminal through the user interface of the field-programmable gate array, the second message is a message sent by a second terminal, and the second terminal and the first terminal are located in different local area networks. The technical problem of low forwarding efficiency of a tunnel forwarding technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communications, and in particular to a method and device for implementing tunneling technology through a field programmable gate array. Background Art

[0002] Traditional tunnel forwarding technology is often based on the central processing unit (CPU) system. Generally, the efficiency of the CPU system in implementing message tunnel forwarding technology cannot reach the line speed, and the CPU performance of the embedded system is often not very outstanding. In addition to completing the tunnel function, it is often necessary to undertake other business processing. The CPU pays more attention to some business processing logic rather than forwarding messages, resulting in low forwarding efficiency of the tunnel forwarding technology when the CPU is used to implement the tunnel forwarding technology. Summary of the invention

[0003] The present application provides a method and device for implementing tunnel technology through a field programmable gate array to solve the technical problem of low forwarding efficiency of tunnel forwarding technology.

[0004] In a first aspect, the present application provides a method for implementing tunnel technology through a field programmable gate array, comprising: when a user interface of the field programmable gate array of a first terminal receives a first message to be sent by the first terminal, encapsulating the first message through the field programmable gate array to obtain a first target message, and forwarding the first target message through the wireless interface of the field programmable gate array; when the wireless interface of the field programmable gate array of the first terminal receives a second target message, parsing the second target message through the field programmable gate array to obtain a second message within the second target message, and sending the second message to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks.

[0005] In a second aspect, the present application provides a device for implementing tunnel technology through a field programmable gate array, including: an encapsulation module, which is used to encapsulate the first message through the field programmable gate array to obtain a first target message when the user interface of the field programmable gate array of the first terminal receives a first message to be sent by the first terminal, and forward the first target message through the wireless interface of the field programmable gate array; a parsing module, which is used to parse the second target message through the field programmable gate array to obtain a second message within the second target message when the wireless interface of the field programmable gate array of the first terminal receives a second target message, and send the second message to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks.

[0006] As an optional example, the encapsulation module includes: a determination unit, used to, when the first message is a multicast message or a broadcast message, use the message type of the first message as the message type of the first target message, and use the MAC address of the first message as the MAC address of the first target message; when the first message is a non-multicast message and a non-broadcast message, determine that the message type of the first target message is a unicast type, and determine the MAC address of the first target message according to the tunnel table of the field programmable gate array.

[0007] As an optional example, the above-mentioned determination unit includes: a query subunit, used to search for a matching IP address from the above-mentioned tunnel table according to the MAC address of the above-mentioned first message, and determine the MAC address corresponding to the found matching IP address as the MAC address of the above-mentioned first target message; when no matching IP address is found, determine the MAC address corresponding to the static tunnel IP as the MAC address of the above-mentioned first target message.

[0008] As an optional example, the encapsulation module includes: an adding module, used to add the first target message to the tunnel message queue when a matching IP address is found, and forward the first target message when the sending conditions are met; when no matching IP address is found, add the first target message to the non-tunnel queue, wherein the forwarding priority of the message in the non-tunnel queue is higher than that of the message in the tunnel queue.

[0009] As an optional example, the above-mentioned parsing module includes: a first parsing unit, used to parse the above-mentioned second target message when the above-mentioned second target message is a tunnel message, to obtain the above-mentioned second message; record the relationship between the source MAC address of the above-mentioned second message and the source IP address of the above-mentioned second target message in the tunnel table.

[0010] As an optional example, the above-mentioned parsing module includes: a second parsing unit, which is used to record the relationship between the MAC address and the IP address of the wireless interface of the above-mentioned second terminal when the above-mentioned second target message is a non-tunnel message.

[0011] As an optional example, the above-mentioned device also includes: a setting module, which is used to, after recording the relationship between the MAC address and the IP address of the wireless interface of the above-mentioned second terminal, set the tunnel queue to allow sending when the above-mentioned second target message is a reply message in a non-tunnel message, wherein the message in the above-mentioned tunnel queue is a tunnel message; when the above-mentioned second target message is a request message or a control message in a non-tunnel message, construct a response message according to the MAC address and the IP address of the wireless interface of the above-mentioned second terminal, and respond to the above-mentioned response message to the above-mentioned second terminal; when the above-mentioned second target message is not the above-mentioned reply message, request message or control message, discard the above-mentioned second target message.

[0012] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned methods of implementing tunneling technology through a field programmable gate array when executing the computer program.

[0013] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute any of the above methods of implementing tunneling technology through a field programmable gate array of the present application.

[0014] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the solution provided by the embodiment of the present application, when the user interface of the field programmable gate array of the first terminal receives the first message to be sent by the first terminal, the first message is encapsulated by the field programmable gate array to obtain the first target message, and the first target message is forwarded by the wireless interface of the field programmable gate array; when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the field programmable gate array is used to parse the second target message to obtain the second message in the second target message. , the second message is sent to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks, so that the first message is received by the user interface of the field programmable gate array of the first terminal, encapsulated into a first target message, and the first target message is forwarded by the wireless interface of the field programmable gate array, and the second target message is received by the wireless interface, and the second message is forwarded through the user interface of the field programmable gate array after parsing, thereby realizing the effect of realizing tunnel forwarding technology through the field programmable gate array. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1 A flow chart of a method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0019] Figure 2 A flowchart of another method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0020] Figure 3A structural diagram of a method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0021] Figure 4 A flowchart of another method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0022] Figure 5 A flowchart of another method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0023] Figure 6 A flowchart of another method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0024] Figure 7 A flowchart of another method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0025] Figure 8 A flowchart of another method for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0026] Fig. 9 A schematic diagram of the structure of a device for implementing tunneling technology through a field programmable gate array provided in an embodiment of the present application;

[0027] Fig.10 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0029] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0030] In order to solve the technical problem of low forwarding efficiency of tunnel forwarding technology in the prior art, the present application provides a method for implementing tunnel technology through a field programmable gate array, which can achieve the effect of implementing tunnel forwarding technology through a field programmable gate array.

[0031] Figure 1 A flow chart of a method for implementing tunneling technology through a field programmable gate array is provided in an embodiment of the present application. Figure 1 As shown, the method for implementing the tunneling technology through the field programmable gate array includes:

[0032] S102, when a user interface of the field programmable gate array of the first terminal receives a first message to be sent by the first terminal, encapsulates the first message through the field programmable gate array to obtain a first target message, and forwards the first target message through the wireless interface of the field programmable gate array;

[0033] S104, when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed through the field programmable gate array to obtain a second message within the second target message, and the second message is sent to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks.

[0034] The Field Programmable Gate Array (FPGA) of this embodiment is a semi-customized circuit belonging to a special integrated circuit and is a programmable logic array. The above-mentioned tunnel technology (tunnel forwarding technology) is a method for providing a secondary encapsulation of Ethernet messages. When the message is transparently transmitted in the external network, the Ethernet message inside cannot be sensed. When the encapsulated message reaches another terminal node, the external encapsulation header will be stripped to achieve transparent transmission of the Ethernet message. Tunnel technology is actually a specific agreement and forwarding. This solution can achieve very high processing and forwarding efficiency by implementing this agreement and forwarding through FPGA.

[0035] In this embodiment, the first terminal and the second terminal are located in different local area networks. If the first terminal and the second terminal are to communicate with each other, the first terminal and the second terminal encapsulate the messages to be sent by themselves to the field programmable gate array on the terminal using tunnel technology, and then forward the encapsulated messages, so as to transmit the messages in the wireless communication network. The terminal receiving the encapsulated message parses the encapsulated message through the field programmable gate array to obtain the message before encapsulation.

[0036] In this embodiment, a field programmable gate array may be set on different terminals, and if the terminal wants to send a message, it may be sent through the field programmable gate array. Figure 2 As shown, Figure 2 In the example, there are two terminals, namely the first terminal and the second terminal, which are located in different local area networks. If the two terminals want to send messages to each other, Figure 2 The message including DMAC, SMAC, TYPE, Payload, and FCS must be sent to the tunnel board through the U port, and the tunnel board is a field programmable gate array. The tunnel board encapsulates the message into an outer layer of DMAC, SMAC, TYPE, IPHDR, an inner layer of message, FCS, an inner layer of DMAC, SMAC, TYPE, Payload, and FCS, and transmits the encapsulated message. Among them, DMAC is the destination MAC address, SMAC is the source MAC address, TYPE is the Ethernet message type, IPHDR is the IP header, Payload is the transmitted data, and FCS is the Ethernet check field, which is generally 4 bytes. The U port is the user interface, and the tunnel board sends and receives the first message or the second message with the terminal through the user interface. The N port is the wireless interface, and the tunnel board sends and receives the first target message or the second target message through the wireless interface.

[0037] In this embodiment, the field programmable gate array receives a first message from the first terminal through a user interface, then encapsulates the first message into a first target message, and forwards the first target message through a wireless interface. If the second terminal sends a second message, the field programmable gate array of the second terminal will also encapsulate the second message into a second target message for forwarding. When the wireless interface of the field programmable gate array of the first terminal receives the second target message, it can parse the second target message to obtain the second message, and send the second message to the first terminal through the user interface of the field programmable gate array.

[0038] The solution provided by the embodiment of the present application is that when the user interface of the field programmable gate array of the first terminal receives the first message to be sent by the first terminal, the first message is encapsulated by the field programmable gate array to obtain the first target message, and the first target message is forwarded through the wireless interface of the field programmable gate array; when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed by the field programmable gate array to obtain the second message in the second target message, and the second message is sent to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks, so that the first message is received by the user interface of the field programmable gate array of the first terminal, encapsulated into the first target message, and the first target message is forwarded by the wireless interface of the field programmable gate array, and the second target message is received by the above-mentioned wireless interface, and the second message is forwarded through the user interface of the field programmable gate array after parsing to obtain the second message, thereby realizing the effect of realizing tunnel forwarding technology through the field programmable gate array.

[0039] As an optional example, when the user interface of the field programmable gate array of the first terminal receives the first message to be sent by the first terminal, the first message is encapsulated through the field programmable gate array to obtain the first target message, including: when the first message is a multicast message or a broadcast message, the message type of the first message is used as the message type of the first target message, and the MAC address of the first message is used as the MAC address of the first target message; when the first message is a non-multicast message and a non-broadcast message, the message type of the first target message is determined to be a unicast type, and the MAC address of the first target message is determined according to the tunnel table of the field programmable gate array.

[0040] In this embodiment, the first message may include a source MAC value of the first message, a destination MAC address, a type of the first message, data content, and a check field. The data content is the data to be sent.

[0041] In this embodiment, when the first terminal is to send a first message, when the user interface of the field programmable gate array receives the first message to be sent by the first terminal, the first message is to be encapsulated. In the encapsulation process, the first message is to be encapsulated into a first target message, so the MC address and message type, IP header, check field and other information of the first target message are added to the first message. The MAC address includes the source MAC address and destination MAC address of the first target message, and both can be determined based on the source MAC address and destination MAC address of the first message.

[0042] For example, the type of the first target message is set to be the same as the type of the first message. If the first message is a multicast or broadcast message, the type of the first target message is also a multicast or broadcast message, and the MAC address of the first message is used as the MAC address of the first target message. The MAC address and message type of the first target message are both determined. In addition, the IP header can be determined based on the correspondence between the MAC address and the IP, and the IP header of the first target message is also determined. Thus, the first message is encapsulated as the first target message.

[0043] If the first message is not a multicast message or a broadcast message, the message type of the first target message may be determined as a unicast type, and the MAC address and IP header of the first target message may be determined from the tunnel table.

[0044] As an optional example, determining the MAC address of the first target message according to the tunnel table of the field programmable gate array includes: searching for a matching IP address from the tunnel table according to the MAC address of the first message, and determining the MAC address corresponding to the found matching IP address as the MAC address of the first target message; when no matching IP address is found, determining the MAC address corresponding to the static tunnel IP as the MAC address of the first target message.

[0045] In this embodiment, when the first message is a non-multicast message and a non-broadcast message, the MAC address of the first target message is determined according to the tunnel table of the field programmable gate array. At this time, the corresponding IP address can be found from the tunnel table of the field programmable gate array according to the MAC address of the first message (including the source MAC address and the target MAC address). When the corresponding IP address is found, the IP header and the MAC address corresponding to the IP address are obtained as the IP header and MAC address of the first target message. If the corresponding IP address cannot be found, the static tunnel IP is used to obtain the IP header of the static tunnel IP and the MAC address corresponding to the IP address of the static tunnel IP as the IP header and MAC address of the first target message.

[0046] As an optional example, forwarding the first target message through the wireless interface of the field programmable gate array includes: when a matching IP address is found, adding the first target message to a tunnel message queue, and forwarding the first target message when a sending condition is met; when no matching IP address is found, adding the first target message to a non-tunnel queue, wherein the forwarding priority of the message in the non-tunnel queue is higher than that of the message in the tunnel queue.

[0047] In this embodiment, if the corresponding IP address can be found according to the MAC address of the first message (including the source MAC address and the target MAC address), the first target message is added to the tunnel message queue after the first target message is encapsulated, and if the corresponding IP address cannot be found according to the MAC address of the first message (including the source MAC address and the target MAC address), the first target message is added to the non-tunnel message queue after the first target message is encapsulated. The message sending priority in the non-tunnel message queue is higher than that in the tunnel message queue.

[0048] As an optional example, when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed by the field programmable gate array to obtain a second message in the second target message, including: when the second target message is a tunnel message, the second target message is parsed to obtain the second message; and the relationship between the source MAC address of the second message and the source IP address of the second target message is recorded in the tunnel table.

[0049] In this embodiment, after the second terminal sends the second message and the field programmable gate array of the second terminal encapsulates the second target message, when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed to obtain the second message. During the parsing, if the second target message is a message encapsulated by the tunnel technology, when the second message is parsed, the relationship between the source MAC address of the second message and the source IP address of the second target message is recorded in the tunnel table for use when encapsulating the first message.

[0050] As an optional example, when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed by the field programmable gate array to obtain a second message within the second target message, including: when the second target message is a non-tunnel message, recording the relationship between the MAC address and IP address of the wireless interface of the second terminal.

[0051] In this embodiment, after the second terminal sends the second message and the field programmable gate array of the second terminal encapsulates the second target message, when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed to obtain the second message. During the parsing, if the second target message is a non-tunnel message, the relationship between the MAC address and the IP address of the wireless interface of the second terminal is recorded.

[0052] As an optional example, after recording the relationship between the MAC address and IP address of the wireless interface of the second terminal, the above method also includes: when the second target message is a reply message in a non-tunnel message, setting the tunnel queue to allow sending, wherein the message in the tunnel queue is a tunnel message; when the second target message is a request message or a control message in a non-tunnel message, constructing a response message according to the MAC address and IP address of the wireless interface of the second terminal, and sending the response message to the second terminal; when the second target message is not a reply message, a request message or a control message, discarding the second target message.

[0053] In this embodiment, if the second target message is a non-tunnel message, different processing is performed according to the type of the non-tunnel message. If the second target message is a response message in a non-tunnel message, the tunnel queue is set to allow sending, wherein the message in the tunnel queue is a tunnel message; if the second target message is a request message or a control message in a non-tunnel message, a response message is constructed according to the MAC address and IP address of the wireless interface of the second terminal, and the response message is sent to the second terminal; if the second target message is not a response message, a request message or a control message, the second target message is discarded.

[0054] Combination Figure 3 , illustrated with an example. Figure 3 It is a logic diagram of the field programmable gate array of this embodiment. The PORT module is a port module that realizes the reception and transmission of Ethernet messages. The message analysis module realizes the parsing and extraction of layer 2 and layer 3 message headers. The message generator generates corresponding response messages according to the message type, such as ARP or ICMP messages. The message queue management is responsible for the FIFO management of the message. In addition to calculating the Ethernet FCS, the CRC calculation module also contains various statistics, such as byte statistics, packet count statistics, etc. The message encap module completes the formation of the message according to three table items. The three table items are the tunnel table, the ARP table, and the static tunnel IP table. The timer module provides various timing processing, including responses to ARP messages, aging of various tunnel tables and ARP tables, etc.

[0055] Figure 4 This is the processing flow of the U port of the field programmable gate array of this embodiment when receiving a message from the terminal. After the U port receives the first message, it first determines whether it is a multicast or broadcast message. If it is a multicast or broadcast message, the corresponding message type will be extracted as the type of the tunnel message (first target message), and the MAC address is also copied to the destination MAC address of the internal first message. If the U port receives a non-multicast or broadcast message, it is necessary to search the tunnel table according to the destination MAC. If the tunnel table entry cannot be matched, that is, the destination IP cannot be found, the static tunnel IP configured by the user is used as the destination IP of the tunnel message, and sent to all static tunnel IPs. If the tunnel table is matched, the IP in the tunnel table is used as the destination IP of the tunnel message. After the tunnel message is formed, the destination MAC corresponding to the destination IP needs to be searched according to the ARP table entry. If the MAC address of the corresponding destination IP is found, the complete tunnel message can be formed. The three-layer message, that is, the IP layer message type is 301. The message received by the N port is also determined whether it is a tunnel message based on whether the three-layer type is 301. If the ARP table is not matched, an ARP table entry will be generated according to the directory IP, and the timer will be started. The ARP message will be added to the non-tunnel queue. The N port will give priority to sending the non-tunnel queue and end the communication at this time. If the ARP table is matched, the tunnel message will be added to the tunnel message queue and it will be determined whether it is allowed to be sent. If it matches the ARP table and is allowed to be sent, it will be sent out through the N port.

[0056] Figure 5This is the processing flow of the N port of the field programmable gate array of this embodiment when receiving the target message sent by other field programmable gate arrays. Determine whether it is a tunnel message. If it is not a tunnel message, it means that it is a protocol message between N ports, such as an ARP message or ICMP message between N ports. No matter which message it is, the corresponding relationship between IP and MAC between N ports needs to be learned into the ARP table entry, that is, saved into the ARP table entry, and a response message is created and sent back through the N port based on whether a response is needed. If the inbound message is a tunnel message, it means that the tunnel header needs to be removed from this message, and the encapsulated message inside is sent to the U port. At the same time, the source MAC of the encapsulated message and the source IP in the tunnel message header need to be added to the local as a tunnel table.

[0057] Figure 6 This is a communication example of this embodiment. The IP addresses of PC1 and PC2 are 192.168.0.1 and 192.168.0.2 respectively, the IP addresses of the uplink interfaces N1 and N2 are 192.168.10.1 and 192.168.10.2 respectively, and the MAC addresses of the interfaces are shown in the figure above. When PC1 sends a data packet to PC2, since it is the first communication, it will send an ARP message. The communication process of this ARP message is as follows: Figure 7 shown. Figure 7 In the example, the 0806 message type indicates an ARP communication. After the above communication, the information created by each tunnel board is shown in Table (1).

[0058] Table (1)

[0059]

[0060] After the above communication, PC1 and PC2 have established each other's ARP tables, so the next communication will trigger unicast communication. The communication process is as follows: Figure 8 As shown, the message type 08 00 indicates an IP message

[0061] Fig. 9 The present invention provides a schematic diagram of a device for implementing tunneling technology through a field programmable gate array. Fig. 9 As shown, the device for implementing the tunneling technology through the field programmable gate array includes:

[0062] The encapsulation module 902 is configured to encapsulate the first message through the field programmable gate array to obtain a first target message when the user interface of the field programmable gate array of the first terminal receives the first message to be sent by the first terminal, and forward the first target message through the wireless interface of the field programmable gate array;

[0063] The parsing module 904 is used to parse the second target message through the field programmable gate array when the wireless interface of the field programmable gate array of the first terminal receives the second target message, obtain the second message in the second target message, and send the second message to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks.

[0064] The Field Programmable Gate Array (FPGA) of this embodiment is a semi-customized circuit belonging to a special integrated circuit and is a programmable logic array. The above-mentioned tunnel technology (tunnel forwarding technology) is a method for providing a secondary encapsulation of Ethernet messages. When the message is transparently transmitted in the external network, the Ethernet message inside cannot be sensed. When the encapsulated message reaches another terminal node, the external encapsulation header will be stripped to achieve transparent transmission of the Ethernet message. Tunnel technology is actually a specific agreement and forwarding. This solution can achieve very high processing and forwarding efficiency by implementing this agreement and forwarding through FPGA.

[0065] In this embodiment, the first terminal and the second terminal are located in different local area networks. If the first terminal and the second terminal are to communicate with each other, the first terminal and the second terminal encapsulate the messages to be sent by themselves to the field programmable gate array on the terminal using tunnel technology, and then forward the encapsulated messages, so as to transmit the messages in the wireless communication network. The terminal receiving the encapsulated message parses the encapsulated message through the field programmable gate array to obtain the message before encapsulation.

[0066] In this embodiment, a field programmable gate array may be set on different terminals, and if the terminal wants to send a message, it may be sent through the field programmable gate array. Figure 2 As shown, Figure 2 In the example, there are two terminals, namely the first terminal and the second terminal, which are located in different local area networks. If the two terminals want to send messages to each other, Figure 2The message including DMAC, SMAC, TYPE, Payload, and FCS must be sent to the tunnel board through the U port, and the tunnel board is a field programmable gate array. The tunnel board encapsulates the message into an outer layer of DMAC, SMAC, TYPE, IPHDR, an inner layer of message, FCS, an inner layer of DMAC, SMAC, TYPE, Payload, and FCS, and transmits the encapsulated message. Among them, DMAC is the destination MAC address, SMAC is the source MAC address, TYPE is the Ethernet message type, IPHDR is the IP header, Payload is the transmitted data, and FCS is the Ethernet check field, which is generally 4 bytes. The U port is the user interface, and the tunnel board sends and receives the first message or the second message with the terminal through the user interface. The N port is the wireless interface, and the tunnel board sends and receives the first target message or the second target message through the wireless interface.

[0067] In this embodiment, the field programmable gate array receives a first message from the first terminal through a user interface, then encapsulates the first message into a first target message, and forwards the first target message through a wireless interface. If the second terminal sends a second message, the field programmable gate array of the second terminal will also encapsulate the second message into a second target message for forwarding. When the wireless interface of the field programmable gate array of the first terminal receives the second target message, it can parse the second target message to obtain the second message, and send the second message to the first terminal through the user interface of the field programmable gate array.

[0068] The solution provided by the embodiment of the present application is that when the user interface of the field programmable gate array of the first terminal receives the first message to be sent by the first terminal, the first message is encapsulated by the field programmable gate array to obtain the first target message, and the first target message is forwarded through the wireless interface of the field programmable gate array; when the wireless interface of the field programmable gate array of the first terminal receives the second target message, the second target message is parsed by the field programmable gate array to obtain the second message in the second target message, and the second message is sent to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks, so that the first message is received by the user interface of the field programmable gate array of the first terminal, encapsulated into the first target message, and the first target message is forwarded by the wireless interface of the field programmable gate array, and the second target message is received by the above-mentioned wireless interface, and the second message is forwarded through the user interface of the field programmable gate array after parsing to obtain the second message, thereby realizing the effect of realizing tunnel forwarding technology through the field programmable gate array.

[0069] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.

[0070] like Fig.10As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0071] Memory 113, used for storing computer programs;

[0072] In one embodiment of the present application, the processor 111 is used to implement the method of implementing the tunneling technology through the field programmable gate array provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.

[0073] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a method for implementing tunneling technology through a field programmable gate array as provided in any of the aforementioned method embodiments is implemented.

[0074] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0076] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0077] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for implementing tunneling technology through a field programmable gate array, characterized in that: include: When a user interface of a field programmable gate array of a first terminal receives a first message to be sent by the first terminal, encapsulating the first message through the field programmable gate array to obtain a first target message, and forwarding the first target message through a wireless interface of the field programmable gate array; When the wireless interface of the field programmable gate array of the first terminal receives a second target message, the second target message is parsed by the field programmable gate array to obtain a second message within the second target message, and the second message is sent to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks.

2. The method according to claim 1, characterized in that When the user interface of the field programmable gate array of the first terminal receives the first message to be sent by the first terminal, encapsulating the first message through the field programmable gate array to obtain the first target message includes: When the first message is a multicast message or a broadcast message, using the message type of the first message as the message type of the first target message, and using the MAC address of the first message as the MAC address of the first target message; When the first message is a non-multicast message and a non-broadcast message, it is determined that the message type of the first target message is a unicast type, and the MAC address of the first target message is determined according to the tunnel table of the field programmable gate array.

3. The method according to claim 2, characterized in that The determining the MAC address of the first target message according to the tunnel table of the field programmable gate array comprises: According to the MAC address of the first message, searching for a matching IP address from the tunnel table, and determining the MAC address corresponding to the found matching IP address as the MAC address of the first target message; When no matching IP address is found, the MAC address corresponding to the static tunnel IP is determined as the MAC address of the first target message.

4. The method according to claim 3, characterized in that The forwarding of the first target message through the wireless interface of the field programmable gate array includes: When a matching IP address is found, the first target message is added to the tunnel message queue, and the first target message is forwarded when a sending condition is met; When no matching IP address is found, the first target message is added to a non-tunnel queue, wherein the forwarding priority of the message in the non-tunnel queue is higher than that of the message in the tunnel queue.

5. The method according to claim 1, characterized in that When the wireless interface of the field programmable gate array of the first terminal receives the second target message, parsing the second target message through the field programmable gate array to obtain the second message in the second target message includes: When the second target message is a tunnel message, parsing the second target message to obtain the second message; The relationship between the source MAC address of the second message and the source IP address of the second target message is recorded in the tunnel table.

6. The method according to claim 1, characterized in that When the wireless interface of the field programmable gate array of the first terminal receives the second target message, parsing the second target message through the field programmable gate array to obtain the second message in the second target message includes: When the second target message is a non-tunnel message, the relationship between the MAC address and the IP address of the wireless interface of the second terminal is recorded.

7. The method according to claim 6, characterized in that After recording the relationship between the MAC address and the IP address of the wireless interface of the second terminal, the method further includes: When the second target message is a response message in a non-tunnel message, setting the tunnel queue to allow sending, wherein the message in the tunnel queue is a tunnel message; When the second target message is a request message or a control message in a non-tunnel message, construct a response message according to the MAC address and the IP address of the wireless interface of the second terminal, and respond to the response message to the second terminal; When the second target message is not the response message, the request message or the control message, the second target message is discarded.

8. A device for implementing tunneling technology through a field programmable gate array, characterized in that: include: an encapsulation module, configured to, when a user interface of a field programmable gate array of a first terminal receives a first message to be sent by the first terminal, encapsulate the first message through the field programmable gate array to obtain a first target message, and forward the first target message through a wireless interface of the field programmable gate array; A parsing module is used to parse the second target message through the field programmable gate array when the wireless interface of the field programmable gate array of the first terminal receives the second target message, obtain the second message in the second target message, and send the second message to the first terminal through the user interface of the field programmable gate array, wherein the second message is a message sent by the second terminal, and the second terminal and the first terminal are located in different local area networks.

9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and when the processor executes the computer program, the method for implementing tunneling technology through a field programmable gate array as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing computer-executable instructions for executing the method for implementing tunneling technology through a field programmable gate array as described in any one of claims 1 to 7 of the present application.