Data forwarding method, receiving method and equipment of large two-layer network switching equipment

By using multi-column analytical matrix and encapsulation action tables in large-layer second network switching devices, data encapsulation and decapsulation are realized, and data forwarding problems caused by the lack of dynamic data allocation chips are solved, ensuring the effectiveness of data in large-layer second networks Forward.

CN119276780APending Publication Date: 2025-01-07PENG CHENG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411247007.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In large layer two networks, the lack of integrated circuit chips that can achieve dynamic data allocation results in the inability to effectively implement the data packaging and decapsulation process, and thus data forwarding is impossible.

Method used

By presetting a row and multiple columns of analytical matrices in the chip of the switching device, and using sorted parsing and encapsulating data packets, combining the encapsulation action table to determine the target encapsulation action, the data encapsulation process is realized without real-time addition, deletion or Modify the packet.

Benefits of technology

In the absence of dynamic data allocation chips, the reliability of the data packaging and decapsulation process is achieved, ensuring the data forwarding function in the large-layer second-tier network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276780A_ABST
    Figure CN119276780A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data forwarding method, receiving method and device for large two-layer network switching equipment, and the method comprises the steps: firstly, obtaining an analysis matrix and a packaging action table, and enabling the analysis matrix to comprise a first column of analysis blocks and a second column of analysis blocks which are sequentially ranked; then, analyzing the sent data packet by using a second column analysis block to obtain first header analysis information; then, determining a target packaging action based on the first head analysis information and a packaging action table; then, packaging the sending data packet based on the target packaging action by using the first column of analysis blocks to obtain packaged sending data; and finally, carrying out network address translation on the packaged sending data based on the first header analysis information, and forwarding the converted packaged sending data to realize the packaging process of the sending data packet, without carrying out real-time addition, deletion, modification and other operations on the sending data packet, so that the processing efficiency is improved. Therefore, the data forwarding process in the large two-layer network is effectively realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security technology, and in particular to a data forwarding method, a receiving method and a device for a large layer 2 network switching device. Background Art

[0002] A large Layer 2 network refers to a Layer 2 (i.e. link layer) network that spans multiple physical locations or multiple subnets, allowing hosts in different geographical locations or subnets to communicate as if they were in the same local area network (LAN). Data forwarding in a large Layer 2 network usually involves using VXLAN technology at the forwarding node to encapsulate the data frame into a Layer 3 IP packet, which is then transmitted through the network to the target receiving node.

[0003] In the related art, the forwarding node is usually provided with an integrated circuit chip that can perform dynamic data allocation, i.e., real-time addition, deletion, and modification operations, so as to add a data header to the data frame to implement the encapsulation process. However, since there is no integrated circuit chip that can realize dynamic data allocation in some large layer 2 network switching devices, the encapsulation process cannot be effectively implemented, and thus the switching device cannot be used to implement data forwarding in the large layer 2 network. Summary of the invention

[0004] The embodiments of the present application provide a data forwarding method, a receiving method and a device for a large Layer 2 network switching device, which can effectively implement a data encapsulation process in a switching device that is not provided with an integrated circuit chip that can realize dynamic data allocation to realize data forwarding in a large Layer 2 network.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a data forwarding method for a large layer 2 network switching device, the method comprising: Obtain a parsing matrix and a packaged action table, wherein the parsing matrix includes a first column of parsing blocks and a second column of parsing blocks that are sequentially arranged; Parsing the sent data packet using the second column parsing block to obtain first header parsing information; Determine a target encapsulation action based on the first header parsing information and the encapsulation action table; Encapsulating the transmission data packet based on the target encapsulation action using the first column parsing block to obtain encapsulated transmission data; The encapsulated sending data is subjected to network address translation based on the first header parsing information, and the converted encapsulated sending data is forwarded.

[0006] In some embodiments, the using the second column parsing block to parse the sent data packet to obtain the first header parsing information includes: Utilizing the second column parsing block to parse the Ethernet header of the sent data packet to obtain Ethernet parsing information; Utilizing the second column parsing block to parse the network layer header of the sent data packet to obtain network layer parsing information; Parsing the VXLAN header of the sent data packet using the second column parsing block to obtain VXLAN parsing information; The first header parsing information is obtained based on the Ethernet parsing information, the network layer parsing information and the VXLAN parsing information.

[0007] In some embodiments, the encapsulation action table includes a plurality of encapsulation information rules and an encapsulation action corresponding to each of the encapsulation information rules, and determining a target encapsulation action based on the first header parsing information and the encapsulation action table includes: Selecting the encapsulation information rule that matches the first header parsing information from the plurality of encapsulation information rules as the first matching information rule; The encapsulation action corresponding to the first matching information rule is used as the target encapsulation action.

[0008] In some embodiments, the step of encapsulating the transmission data packet based on the target encapsulation action using the first column parsing block to obtain encapsulated transmission data includes: Determine target encapsulation information corresponding to the target encapsulation action; Based on the target encapsulation information, the first column parsing block is used to encapsulate the transmission data packet to obtain the encapsulated transmission data.

[0009] In some embodiments, the target encapsulation information includes a target IP header, a target UDP header, and a target VXLAN header, and the encapsulating the sending data packet based on the target encapsulation information and using the first column parsing block to obtain the encapsulated sending data includes: Utilizing the first column parsing block, the target IP header, the target UDP header and the target VXLAN header are stored in the header position of the sending data packet to obtain the encapsulated sending data.

[0010] In some embodiments, performing network address translation on the encapsulated transmission data based on the first header parsing information includes: Acquire an address conversion action table, wherein the address conversion action table includes a plurality of conversion information rules and an address conversion action corresponding to each of the conversion information rules; The conversion information rule that matches the first header parsing information is selected from the multiple conversion information rules as the second matching information rule, and the network address conversion is performed on the encapsulated transmission data based on the address conversion action corresponding to the second matching information rule.

[0011] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a data receiving method of a large layer 2 network switching device, the method comprising: Obtaining a parsing matrix and a decapsulation action table, wherein the parsing matrix includes a second column parsing block and a third column parsing block arranged in sequence, the decapsulation action table includes a plurality of decapsulation information rules and a decapsulation action corresponding to each of the decapsulation information rules, and the memory address of the parsing block in the third column corresponds to the memory address of the received data corresponding to the received data packet; Input the received data packet into the second column parsing block for parsing to obtain second header parsing information, and determine a target decapsulation action based on the second header parsing information and the decapsulation action table; The received data packet is decapsulated by using the third column parsing block based on the target decapsulation action to obtain the received data.

[0012] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes a data forwarding device of a large layer 2 network switching device, the device comprising: An acquisition module, used for acquiring a parsing matrix and a packaged action table, wherein the parsing matrix includes a first column of parsing blocks and a second column of parsing blocks which are sequentially arranged; A parsing module, used for parsing the sent data packet using the second column parsing blocks to obtain first header parsing information; an action determination module, configured to determine a target encapsulation action based on the first header parsing information and the encapsulation action table; An encapsulation module, configured to encapsulate the transmission data packet based on the target encapsulation action by using the first column parsing block to obtain encapsulated transmission data; A forwarding module is used to perform network address conversion on the encapsulated sending data based on the first header parsing information, and forward the converted encapsulated sending data.

[0013] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the data forwarding method of the large Layer 2 network switching device as described in the first aspect or the data receiving method of the large Layer 2 network switching device as described in the second aspect.

[0014] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the storage medium stores a computer program. When the computer program is executed by a processor, it implements the data forwarding method of the large Layer 2 network switching device described in the first aspect or the data receiving method of the large Layer 2 network switching device as described in the second aspect.

[0015] The data forwarding method, receiving method and device of a large layer 2 network switching device proposed in the embodiments of the present application include: first, obtaining a parsing matrix and an encapsulation action table, the parsing matrix including a first column parsing block and a second column parsing block arranged in sequence; next, parsing the sending data packet using the second column parsing block to obtain first header parsing information; then, determining a target encapsulation action based on the first header parsing information and the encapsulation action table; then, encapsulating the sending data packet based on the target encapsulation action using the first column parsing block to obtain encapsulated sending data; finally, performing network address conversion on the encapsulated sending data based on the first header parsing information, and forwarding the converted encapsulated sending data. The embodiment of the present application utilizes a chip of a switching device to pre-set a parsing matrix with one row and multiple columns, and pre-divides the memory address of the chip storing the sending data packet into a first parsing block corresponding to the parsing matrix, so that the sending data packet is parsed by the second parsing block sorted after the first parsing block to obtain encapsulation information, and further uses the first parsing block corresponding to the memory address of the sending data packet to store the encapsulation information at the head position of the sending data packet to implement the encapsulation process of the sending data packet, without the need to perform real-time addition, deletion, modification and other operations on the sending data packet; in addition, the parsing information after the second parsing block parses the sending data packet is used to find a suitable corresponding encapsulation action from the encapsulation action table, so as to more reliably implement the encapsulation process, and then effectively implement the process of data forwarding in a large Layer 2 network.

[0016] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a structural diagram of a switching device provided in one embodiment of the present application.

[0018] Figure 2 This is a flow chart of a data forwarding method for a large layer 2 network switching device provided by another embodiment of the present application.

[0019] Figure 3 yes Figure 2 Flowchart of step 200 in FIG.

[0020] Figure 4 yes Figure 2 Flowchart of step 300 in FIG.

[0021] Figure 5 yes Figure 2 Flowchart of step 400 in FIG.

[0022] Figure 6 yes Figure 5 Flowchart of step 420 in FIG.

[0023] Figure 7 yes Figure 2 Flowchart of step 500 in FIG.

[0024] Figure 8 This is a data forwarding process diagram provided by another embodiment of the present application.

[0025] Fig. 9 This is a flow chart of a data receiving method for a large layer 2 network switching device provided by another embodiment of the present application.

[0026] Fig.10 This is a data receiving process diagram provided by another embodiment of the present application.

[0027] Fig.11 It is a structural diagram of a data forwarding device of a large layer 2 network switching device provided in one embodiment of the present application.

[0028] Fig.12 It is a structural diagram of a data receiving device of a large layer 2 network switching device provided in one embodiment of the present application.

[0029] Fig.13 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0031] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.

[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0033] First, some nouns involved in this application are analyzed: A large Layer 2 network is a Layer 2 (link layer) network architecture that spans multiple physical locations or multiple subnets. It allows hosts in different geographical locations or different subnets to communicate as if they were in the same local area network (LAN), thus providing a unified broadcast domain. This network architecture simplifies network configuration and improves network flexibility and scalability, allowing communication between hosts to be achieved directly through Layer 2 switching without going through a complex Layer 3 routing process. Large Layer 2 networks are usually implemented using Overlay network technologies (such as VXLAN, NVGRE, etc.), which allow Layer 2 data frames to be encapsulated into Layer 3 IP packets and transmitted through a Layer 3 network, thereby creating a logically large Layer 2 network in a physically dispersed network.

[0034] Switching devices in large Layer 2 networks are special network devices that enable large-scale Layer 2 (link layer) communications across multiple physical locations or subnets. These switching devices use overlay network technologies (such as VXLAN, NVGRE, etc.) to encapsulate Layer 2 data frames and transmit them through Layer 3 networks, thereby logically creating a unified broadcast domain, allowing hosts in different geographical locations or different subnets to communicate as if they were in the same local area network (LAN).

[0035] VXLAN (Virtual eXtensible Local Area Network) is a network virtualization technology that allows the creation of large Layer 2 networks spanning multiple physical locations. VXLAN encapsulates Layer 2 data frames on top of UDP / IP, allowing hosts in different geographical locations or different subnets to communicate as if they were in the same local area network (LAN), thus providing a unified broadcast domain.

[0036] Generally speaking, there are integrated circuit chips (such as network processors, CPUs) in switching devices that are responsible for processing the encapsulation and decapsulation of data packets. These integrated circuit chips can realize real-time dynamic data allocation, that is, real-time addition, deletion, modification and other operations, thereby utilizing the characteristics of dynamic data allocation to use VXLAN technology. When forwarding data, the encapsulated data (such as UDP header, VNI header, IP header, etc.) is added to the original Layer 2 data frame in real time to obtain a new Layer 3 IP packet; when receiving data, the header encapsulation data in the Layer 3 IP packet is directly removed to obtain a Layer 2 data frame.

[0037] However, in some large Layer 2 network switching devices, there are no integrated circuit chips that can realize dynamic data allocation. There are only switching chips such as Intel's Tofino chip. This type of switching chip has limited functions and cannot realize dynamic data allocation like integrated circuit chips. Therefore, it cannot replace the functions of integrated circuit chips and cannot realize the encapsulation process and the corresponding decapsulation process in the relevant technology. Therefore, this type of switching device that only includes a switching chip cannot be used in a large Layer 2 network.

[0038] The Tofino chip is a highly programmable network processor launched by Intel. It is designed to build high-performance, customizable network devices such as switches and routers. The Tofino chip supports P4 language programming, allowing users to define the processing logic of network data packets, thereby achieving highly flexible network functions.

[0039] Compared with conventional integrated circuit chips (such as CPUs), Tofino chips have high-performance forwarding capabilities. Tofino chips are designed specifically for network packet processing and can process a large number of packets with extremely low latency. They are also highly programmable, allowing users to define packet forwarding logic through the P4 language to achieve highly customized network functions. Seagull has low latency and high throughput, and is specifically optimized for network packet processing, achieving lower latency and higher packet processing throughput than general-purpose CPUs.

[0040] In order to be able to effectively implement the data encapsulation process in a switching device that is not equipped with an integrated circuit chip that can realize dynamic data allocation to realize data forwarding in a large Layer 2 network, the embodiment of the present application uses a parsing matrix with one row and multiple columns pre-set in the chip of the switching device, and pre-divides the memory address of the chip storing the sending data packet into the first parsing block corresponding to the parsing matrix, so that the sending data packet is parsed by the second parsing block sorted after the first parsing block to obtain the encapsulation information, and further uses the first parsing block corresponding to the memory address of the sending data packet to store the encapsulation information in the head position of the sending data packet to realize the encapsulation process of the sending data packet, and there is no need to add, delete, modify, etc. to the sending data packet in real time; in addition, the parsing information after the second parsing block parses the sending data packet is used to find a suitable corresponding encapsulation action from the encapsulation action table, so as to more reliably realize the encapsulation process, thereby effectively realizing the process of realizing data forwarding in the large Layer 2 network.

[0041] In order to better describe the data forwarding method of the large layer 2 network switching device provided by the present application, the following first describes the switching device applied to the data forwarding method of the large layer 2 network switching device. Figure 1 , is a schematic diagram of the structure of a switching device provided in an embodiment of the present application. Figure 1 As shown in, the switching device includes at least one Tofino chip, in which there are a control plane and a data plane, wherein the control plane includes a flow table control function, which includes an encapsulation action table, a decapsulation action table, and an address translation action table; the data plane includes a parsing matrix with one row and three columns, an encapsulation module corresponding to the encapsulation action table, a decapsulation module corresponding to the decapsulation action table, and an address translation module corresponding to the address translation action table, and the parsing matrix includes a first parsing block, a second parsing block, and a third parsing block arranged in sequence.

[0042] Since the Tofino chip cannot realize dynamic data allocation, in order to effectively realize the process from encapsulation of layer 2 data frames to layer 3 data frames, and decapsulation of layer 3 data frames to layer 2 data frames, it is necessary to pre-allocate the storage addresses inside the Tofino chip for the layer 2 data frames that need to be forwarded, and the storage addresses inside the Tofino chip for the layer 3 data frames that need to be received; and further combined with the sequentially sorted addresses of the three parsing blocks, the storage addresses inside the Tofino chip of the layer 2 data frames that need to be forwarded correspond to the storage addresses of the first parsing block, and the storage addresses inside the Tofino chip of the layer 2 data frames corresponding to the decapsulation of the layer 3 data frames that need to be received correspond to the storage addresses of the third parsing block.

[0043] In conjunction with the above switching device, the data forwarding method, receiving method and device of the large layer 2 network switching device provided in the embodiment of the present application will be further described below. The data forwarding method of the large layer 2 network switching device provided in the embodiment of the present application can be applied to the switching device or to the chip in the switching device.

[0044] The following will specifically describe the data forwarding method of the large layer 2 network switching device in the embodiment of the present application. Figure 2 , is an optional flow chart of a data forwarding method for a large layer 2 network switching device provided in an embodiment of the present application, Figure 2 The method may include but is not limited to steps 100 to 500. It can also be understood that this embodiment Figure 2 The order of step 100 to step 500 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0045] Step 100: Obtain the parsing matrix and encapsulation action table.

[0046] The following is a detailed description of step 100.

[0047] In some embodiments, when the switching device responds to a request to send a data packet, in order to encapsulate the second-layer transmission data packet into the third-layer transmission data packet, it is first necessary to obtain the parsing matrix in the data plane of the switching device and the encapsulation action table in the control plane. Figure 1 As shown in , the parsing matrix includes a first column parsing block, a second column parsing block and a third column parsing block arranged in sequence, wherein the memory address of the chip of the first column parsing block in the switching device corresponds to the memory address stored in the chip of the switching device where the sent data packet is sent.

[0048] It can be understood that the parsing matrix is ​​used to parse the data packet to be sent and to encapsulate the data packet in combination with the encapsulation module of the data plane, and the encapsulation action table is used to determine how to encapsulate the data packet to be sent.

[0049] Step 200: parse the transmitted data packet using the second column parsing block to obtain first header parsing information.

[0050] The following is a detailed description of step 200.

[0051] In some embodiments, after obtaining the parsing matrix, the second column of parsing blocks located in the middle of the parsing blocks is used to parse the second layer of the transmission data packet to obtain the first header parsing information of the transmission data packet. This will be further described below.

[0052] Reference Figure 3 , using the second column parsing block to parse the sent data packet to obtain the first header parsing information, including the following steps 210 to 240.

[0053] Step 210: Utilize the second column parsing block to parse the Ethernet header of the transmitted data packet to obtain Ethernet parsing information.

[0054] Step 220: Utilize the second column parsing block to parse the network layer header of the transmitted data packet to obtain network layer parsing information.

[0055] Step 230: Use the second column parsing block to parse the VXLAN header of the sent data packet to obtain VXLAN parsing information.

[0056] Step 240: Obtain first header parsing information based on the Ethernet parsing information, the network layer parsing information, and the VXLAN parsing information.

[0057] Steps 210 to 240 are described in detail below.

[0058] In some embodiments, the second column of parsing blocks located in the middle of the parsing blocks is used to parse the second layer transmission data packet, specifically including: 1) Input the sending data packet into the second column parsing block, and then use the second column parsing block to parse the Ethernet header of the sending data packet to obtain the Ethernet parsing information of the sending data packet, such as the MAC address of the source sending node and the MAC address of the target node, etc.

[0059] 2) Parse the network layer header of the data packet to be sent, and obtain the network layer parsing information of the data packet, such as IPv4 header information (i.e. IPv4 version number), service type (such as QoS priority), total length of the data packet (i.e. the length of the data packet sent in the entire two-layer structure), identification information (i.e. the field used to identify the data packet), the protocol used (i.e. the type of upper-layer protocol used by the sending data packet), the IP address of the source sending node, the IP address of the target node, etc.

[0060] 3) Parse the VXLAN header of the data packet to obtain the VXLAN parsing information of the data packet, such as VNI (VXLAN Network Identifier, a 24-bit identifier used to uniquely identify a VXLAN network), flag bits (used to identify specific attributes in the VXLAN header), etc.

[0061] 4) Parse the transport layer header of the sent data packet to obtain the transport layer parsing information of the sent data packet, such as the port number of the application of the source sending node, the port number of the application of the target node, etc.

[0062] Through the above steps 210 to 240, the second column parsing block is used to parse the sending data packet to accurately obtain the first header parsing information in the sending data packet, so as to facilitate the subsequent use of the first header parsing information to determine the appropriate encapsulation action in the encapsulation action table to appropriately encapsulate the sending data packet; and to facilitate the subsequent use of the first header parsing information to determine the appropriate address conversion action in the address conversion action table to appropriately convert the address of the sending data packet, thereby improving the reliability of forwarding the sending data packet in the large Layer 2 network.

[0063] Step 300: Determine a target encapsulation action based on the first header parsing information and the encapsulation action table.

[0064] The following is a detailed description of step 300.

[0065] In some embodiments, after obtaining the first header parsing information of the transmission data packet by using the second parsing block, the first header parsing information is used to determine a suitable target encapsulation action from the encapsulation action table to perform a suitable encapsulation operation on the transmission data packet.

[0066] Reference Figure 4, determining a target encapsulation action based on the first header parsing information and the encapsulation action table, includes the following steps 310 to 320.

[0067] Step 310: Select an encapsulation information rule that matches the first header parsing information from multiple encapsulation information rules as the first matching information rule.

[0068] Step 320: Use the encapsulation action corresponding to the first matching information rule as the target encapsulation action.

[0069] Steps 310 to 320 are described in detail below.

[0070] In some embodiments, the encapsulation action table includes multiple encapsulation information rules and encapsulation actions corresponding to each encapsulation information rule. The encapsulation information rule is generated based on relevant Ethernet information parameters, network layer information parameters, and VXLAN information parameters. For example, a certain encapsulation information rule is: the MAC address of the source sending node is in the range of 00:11:22:33:44:00 to 00:11:22:33:44:FF, the MAC address of the target node is in the range of 00:11:22:33:44:55 to 00:11:22:33:44:AB, the data packet length is within 2000 bytes, the VNI is 1000, and the like.

[0071] After determining the first header parsing information of the sending data packet, the first header parsing information is used to select an encapsulation information rule that matches the first header parsing information from multiple encapsulation information rules in the encapsulation action table as the first matching information rule, and then the encapsulation action corresponding to the first matching information rule is used as the target encapsulation action, so that the target encapsulation action can be used in the subsequent first parsing block to encapsulate the sending data packet.

[0072] Step 400: Encapsulate the transmission data packet based on the target encapsulation action using the first column parsing block to obtain encapsulated transmission data.

[0073] The following is a detailed description of step 400.

[0074] In some embodiments, after determining the target encapsulation action, the first column parsing block corresponding to the memory address of the transmission data packet is used to encapsulate the transmission data packet of the second layer data structure based on the target encapsulation action and the encapsulation module to obtain an encapsulated transmission packet of the third layer data structure, so that data forwarding can be performed in the large second layer network. How to perform encapsulation will be further described below.

[0075] Reference Figure 5 , using the first column parsing block to encapsulate the sending data packet based on the target encapsulation action to obtain encapsulated sending data, including the following steps 410 to 420.

[0076] Step 410: Determine target encapsulation information corresponding to the target encapsulation action.

[0077] Step 420: Based on the target encapsulation information, the first column parsing block is used to encapsulate the transmission data packet to obtain encapsulated transmission data.

[0078] Steps 410 to 420 are described in detail below.

[0079] In some embodiments, the target encapsulation information corresponding to the target encapsulation action is first determined. It can be understood that the encapsulation information is used to indicate the relevant information of the VXLAN that sends the data packet, usually including: the source sending node address (including IP address and MAC address), the target node address (including IP address and MAC address), the information indicating the upper layer protocol type (which can be IPv4, IPv6, TCP, UDP, etc.), the length / size of the data packet, the verification code for reliable verification during transmission, the sequence number for determining the order of the data packet, the VXLAN header (including VNI), the UDP header, the IP header, etc.

[0080] After determining the target encapsulation information, the first column parsing block and the encapsulation module are used to encapsulate the transmission data packet of the second-layer data structure based on the target encapsulation information to obtain an encapsulated transmission packet of the third-layer data structure, as described in detail below.

[0081] Reference Figure 6 , based on the target encapsulation information, using the first column parsing block, encapsulates the sending data packet to obtain encapsulated sending data, including the following steps 421.

[0082] Step 421: Using the first column parsing block, the target IP header, the target UDP header, and the target VXLAN header are stored in the header position of the sent data packet to obtain encapsulated sending data.

[0083] Step 421 is described in detail below.

[0084] In some embodiments, the target encapsulation information includes a target IP header, a target UDP header, a target VXLAN header, and a target transport structure. Therefore, by using the first column parsing block corresponding to the memory address of the sent data packet, in combination with the encapsulation module, the target IP header, the target UDP header, and the target VXLAN header are stored at the memory address corresponding to the head position of the sent data packet, so that the head position of the sent data packet of the two-layer data structure has new target encapsulation information, so that the sent data packet of the two-layer data structure is converted into the encapsulated sent data of the three-layer data structure to realize the encapsulation process.

[0085] Through the above steps 310 to 320, 410 to 420 and 421, the first header parsing information obtained by parsing the sending data packet by the second column parsing block is matched in the encapsulation action table with the target encapsulation information suitable for the first header parsing information, and the first column parsing block corresponding to the memory address of the sending data packet is used to store the target encapsulation information in the header position of the sending data packet, thereby eliminating the need to perform real-time operations such as adding, deleting, and modifying data in the sending data packet, and achieving the appropriate and reliable encapsulation process, thereby effectively realizing the process of data forwarding in a large Layer 2 network.

[0086] Step 500: Perform network address translation on the encapsulated transmission data based on the first header parsing information, and forward the converted encapsulated transmission data.

[0087] The following is a detailed description of step 500.

[0088] In some embodiments, after obtaining the encapsulated transmission data, an address translation module is also required in the switching device to perform network address translation on the encapsulated transmission data, so as to facilitate data forwarding of the encapsulated transmission data in a large layer 2 network.

[0089] In order to further improve the reliability of network address translation, this embodiment again utilizes the first header parsing information in combination with the address translation action table and the address translation module to perform network address translation, which will be further described in detail below.

[0090] Reference Figure 7 , based on the first header parsing information, the encapsulated sending data is network addressed, including the following steps 510 to 520.

[0091] Step 510: Obtain the address translation action table.

[0092] Step 520: Select a conversion information rule that matches the first header parsing information from multiple conversion information rules as a second matching information rule, and perform network address translation on the encapsulated transmission data based on the address translation action corresponding to the second matching information rule.

[0093] Steps 510 to 520 are described in detail below.

[0094] In some embodiments, an address translation action table is first obtained, the address translation action table including a plurality of translation information rules and an address translation action corresponding to each translation information rule. It can be understood that the translation information rules are similar to the encapsulation information rules, and are generated based on relevant Ethernet information parameters, network layer information parameters, and VXLAN information parameters.

[0095] After determining the first header parsing information of the sent data packet, the first header parsing information is used to select a conversion information rule that matches the first header parsing information from multiple conversion information rules in the address conversion action table as the second matching information rule, and then the address conversion action corresponding to the second matching information rule is used in combination with the address conversion module to perform network address conversion on the encapsulated sending data, that is, the IP address of the source sending node of the encapsulated sending data is converted into the public IP address of the NAT device, so as to facilitate data forwarding of the encapsulated sending data after address conversion in the large Layer 2 network.

[0096] Reference Figure 8 , is a schematic diagram of a data forwarding process provided by an embodiment of the present application. Figure 8 As shown in , firstly, the second parsing block in the parsing matrix is ​​used to parse the sending data packet to obtain parsing information (i.e., the first header parsing information), and then the target encapsulation action is determined from the encapsulation action table according to the parsing information. Next, the first parsing block corresponding to the memory address of the sending data packet and the encapsulation module are used to store the target encapsulation information corresponding to the target encapsulation action into the header of the sending data packet to complete the encapsulation process of the sending data packet. Afterwards, according to the address conversion action matching the parsing information, the address conversion module is used to perform address conversion on the encapsulated sending data, and the replaced encapsulated sending data is forwarded.

[0097] The data receiving method of the large layer 2 network switching device provided in the embodiment of the present application uses the second column parsing block to parse the transmission data packet to accurately obtain the first header parsing information in the transmission data packet, so as to facilitate the subsequent use of the first header parsing information in the encapsulation action table to determine the appropriate encapsulation action to appropriately encapsulate the transmission data packet; and facilitate the subsequent use of the first header parsing information in the address conversion action table to determine the appropriate address conversion action to appropriately convert the transmission data packet, thereby improving the reliability of forwarding the transmission data packet in the large layer 2 network. The first header parsing information obtained by parsing the transmission data packet by the second column parsing block is matched in the encapsulation action table with the target encapsulation information suitable for the first header parsing information, and the first column parsing block corresponding to the memory address of the transmission data packet is used to store the target encapsulation information in the header position of the transmission data packet, so that there is no need to perform real-time data addition, deletion, modification and other operations on the transmission data packet, and the appropriate and reliable encapsulation process can be realized, thereby effectively realizing the process of data forwarding in the large layer 2 network.

[0098] In addition, in terms of code implementation, the data forwarding method for a large layer 2 network switching device provided by the present application can compress the above data forwarding process steps into one line of code for implementation, thereby effectively improving the implementation efficiency of the data forwarding process.

[0099] The embodiment of the present application also provides a method for receiving data from a large layer 2 network switching device. Fig. 9 , is an optional flow chart of a data forwarding method for a large layer 2 network switching device provided in an embodiment of the present application, Fig. 9 The method may include but is not limited to steps 600 to 800. It can also be understood that this embodiment Fig. 9 The order of step 600 to step 800 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0100] Step 600: Obtain a parsing matrix and a decapsulation action table.

[0101] Step 700: input the received data packet into the second column parsing block for parsing, obtain second header parsing information, and determine the target decapsulation action based on the second header parsing information and the decapsulation action table.

[0102] Step 800: Decapsulate the received data packet based on the target decapsulation action using the third column parsing block to obtain received data.

[0103] Steps 600 to 800 are described in detail below.

[0104] In some embodiments, after the switching device responds to a receiving request for receiving a data packet, similar to the data forwarding method of the large Layer 2 network switching device described above, a parsing matrix and a decapsulation action table are first obtained, wherein the parsing matrix includes a first column of parsing blocks, a second column of parsing blocks, and a third column of parsing blocks arranged in sequence, wherein the memory address of the third column of parsing blocks in the chip of the switching device corresponds to the memory address of the received data corresponding to the received data packet stored in the chip of the switching device.

[0105] In addition, the decapsulation action table includes multiple decapsulation information rules and decapsulation actions corresponding to each decapsulation information rule, wherein the decapsulation information rule is similar to the encapsulation information rule mentioned above and is generated based on relevant Ethernet information parameters, network layer information parameters, and VXLAN information parameters. In addition, the decapsulation action includes whether it is necessary to store part of the information in the outer header (i.e., encapsulation information) of the received data packet after removing the outer header of the received data packet to the memory address corresponding to the decapsulated received data.

[0106] Next, similar to the data forwarding method of the above-mentioned large Layer 2 network switching device, the received data packet is input into the second column parsing block for relevant parsing steps (such as Ethernet header parsing, network layer header parsing, VXLAN header parsing) to obtain the second header parsing information of the sent data packet, and then based on the second header parsing information, the matching decapsulation information rule is determined from the decapsulation action table as the third matching information rule; next, the decapsulation action corresponding to the third matching information rule in the decapsulation action table is used as the target decapsulation action.

[0107] Finally, by using the third column parsing block and decapsulation module corresponding to the memory address of the chip in the switching device corresponding to the received data packet, the target decapsulation action is performed on the received data packet to remove the association between the memory address of the header information of the received data packet and the memory address of the received data, thereby effectively realizing the decapsulation action of the sent data packet without the need to perform real-time addition, deletion, modification and other operations on the received data packet in the switching device, thereby effectively realizing the process of data reception in the large Layer 2 network.

[0108] Reference Fig.10 , is a schematic diagram of the data receiving process of a large layer 2 network switching device provided in an embodiment of the present application. Fig.10 As shown in , the received data packet is first parsed using the second parsing block in the parsing matrix to obtain parsing information (i.e., the second header parsing information), and then the target decapsulation action is determined from the decapsulation action table according to the parsing information. Next, the third parsing block corresponding to the memory address of the received data and the decapsulation module are used to perform the target decapsulation action on the sent data packet to complete the decapsulation process of the received data packet to obtain the received data.

[0109] The embodiment of the present application also provides a data forwarding device for a large layer 2 network switching device, which can implement the data forwarding method for the large layer 2 network switching device. Fig.11 , the device 1100 comprises: An acquisition module 1110 is used to acquire a parsing matrix and a packaged action table, wherein the parsing matrix includes a first column of parsing blocks and a second column of parsing blocks that are sequentially arranged; The parsing module 1120 is used to parse the transmitted data packet using the second column parsing block to obtain first header parsing information; An action determination module 1130, configured to determine a target encapsulation action based on the first header parsing information and the encapsulation action table; The encapsulation module 1140 is used to encapsulate the transmission data packet based on the target encapsulation action by using the first column parsing block to obtain encapsulated transmission data; The forwarding module 1150 is used to perform network address translation on the encapsulated transmission data based on the first header parsing information, and forward the converted encapsulated transmission data.

[0110] In some embodiments, the parsing module 1120 is further configured to: Utilizing the second column parsing block to parse the Ethernet header of the sent data packet to obtain Ethernet parsing information; Utilizing the second column parsing block to parse the network layer header of the sent data packet to obtain network layer parsing information; Parsing the VXLAN header of the sent data packet using the second column parsing block to obtain VXLAN parsing information; The first header parsing information is obtained based on the Ethernet parsing information, the network layer parsing information and the VXLAN parsing information.

[0111] In some embodiments, the action determination module 1130 is further configured to: Selecting the encapsulation information rule that matches the first header parsing information from the plurality of encapsulation information rules as the first matching information rule; The encapsulation action corresponding to the first matching information rule is used as the target encapsulation action.

[0112] In some embodiments, the packaging module 1140 is further configured to: Determine target encapsulation information corresponding to the target encapsulation action; Based on the target encapsulation information, the first column parsing block is used to encapsulate the transmission data packet to obtain the encapsulated transmission data.

[0113] In some embodiments, the packaging module 1140 is further configured to: Utilizing the first column parsing block, the target IP header, the target UDP header and the target VXLAN header are stored in the header position of the sending data packet to obtain the encapsulated sending data.

[0114] In some embodiments, the forwarding module 1150 is further configured to: Acquire an address conversion action table, wherein the address conversion action table includes a plurality of conversion information rules and an address conversion action corresponding to each of the conversion information rules; The conversion information rule that matches the first header parsing information is selected from the multiple conversion information rules as the second matching information rule, and the network address conversion is performed on the encapsulated transmission data based on the address conversion action corresponding to the second matching information rule.

[0115] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, the specific implementation method of the data forwarding device of the large Layer 2 network switching device is basically the same as the specific implementation method of the data forwarding method of the above-mentioned large Layer 2 network switching device, and will not be repeated here.

[0116] In the embodiment of the present application, the data forwarding device of the large layer 2 network switching device uses the second column parsing block to parse the transmission data packet to accurately obtain the first header parsing information in the transmission data packet, so as to facilitate the subsequent use of the first header parsing information in the encapsulation action table to determine the appropriate encapsulation action to appropriately encapsulate the transmission data packet; and facilitate the subsequent use of the first header parsing information in the address conversion action table to determine the appropriate address conversion action to appropriately convert the transmission data packet, thereby improving the reliability of forwarding the transmission data packet in the large layer 2 network. The first header parsing information obtained by parsing the transmission data packet by the second column parsing block is matched in the encapsulation action table with the target encapsulation information suitable for the first header parsing information, and the first column parsing block corresponding to the memory address of the transmission data packet is used to store the target encapsulation information in the header position of the transmission data packet, so that there is no need to perform real-time data addition, deletion, modification and other operations on the transmission data packet, and the appropriate and reliable encapsulation process can be realized, thereby effectively realizing the process of data forwarding in the large layer 2 network.

[0117] The embodiment of the present application also provides a data receiving device for a large layer 2 network switching device, which can implement the data receiving method for the large layer 2 network switching device. Fig.12 , the device 1200 comprises: A receiving and obtaining module 1210 is used to obtain a parsing matrix and a decapsulation action table, wherein the parsing matrix includes a second column of parsing blocks and a third column of parsing blocks arranged in sequence, and the decapsulation action table includes a plurality of decapsulation information rules and a decapsulation action corresponding to each decapsulation information rule; The receiving and parsing module 1220 is used to input the received data packet into the second column parsing block for parsing, obtain second header parsing information, and determine a target decapsulation action based on the second header parsing information and the decapsulation action table; The decapsulation module 1230 is used to decapsulate the received data packet based on the target decapsulation action using the third column parsing block to obtain received data.

[0118] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, the specific implementation method of the data forwarding device of the large Layer 2 network switching device is basically the same as the specific implementation method of the data receiving method of the above-mentioned large Layer 2 network switching device, and will not be repeated here.

[0119] The present application also provides an electronic device, including: at least one memory; at least one processor; at least one program; The program is stored in the memory, and the processor executes the at least one program to implement the data forwarding method of the large layer 2 network switching device implemented in the present application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.

[0120] See also Fig.13 , Fig.13 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes: The processor 1301 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 1302 can be implemented in the form of ROM (Read Only Memory), static storage device, dynamic storage device or RAM (Random Access Memory). The memory 1302 can store operating systems and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1302, and the processor 1301 calls and executes the data forwarding method of the large layer 2 network switching device in the embodiments of this application; Input / output interface 1303, used to implement information input and output; The communication interface 1304 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.); A bus 1305 that transmits information between various components of the device (e.g., the processor 1301, the memory 1302, the input / output interface 1303, and the communication interface 1304); The processor 1301 , the memory 1302 , the input / output interface 1303 and the communication interface 1304 are connected to each other in communication within the device via a bus 1305 .

[0121] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the data forwarding method of the above-mentioned large Layer 2 network switching device is implemented.

[0122] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0123] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0124] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0125] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on 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.

[0126] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0127] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0128] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0129] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0130] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0133] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A data forwarding method for a large layer 2 network switching device, characterized in that: The method comprises: Acquire a parsing matrix and an encapsulation action table, wherein the parsing matrix includes a first column of parsing blocks and a second column of parsing blocks that are sequentially arranged, and a memory address of the first column of parsing blocks corresponds to a memory address of a sent data packet; Parsing the sent data packet using the second column parsing block to obtain first header parsing information; Determine a target encapsulation action based on the first header parsing information and the encapsulation action table; Encapsulating the transmission data packet based on the target encapsulation action using the first column parsing block to obtain encapsulated transmission data; The encapsulated sending data is subjected to network address translation based on the first header parsing information, and the converted encapsulated sending data is forwarded.

2. The data forwarding method of a large layer 2 network switching device according to claim 1, characterized in that: The step of parsing the transmitted data packet using the second column parsing block to obtain first header parsing information includes: Utilizing the second column parsing block to parse the Ethernet header of the sent data packet to obtain Ethernet parsing information; Utilizing the second column parsing block to parse the network layer header of the sent data packet to obtain network layer parsing information; Parsing the VXLAN header of the sent data packet using the second column parsing block to obtain VXLAN parsing information; The first header parsing information is obtained based on the Ethernet parsing information, the network layer parsing information and the VXLAN parsing information.

3. The data forwarding method of a large layer 2 network switching device according to claim 1, characterized in that: The encapsulation action table includes a plurality of encapsulation information rules and an encapsulation action corresponding to each of the encapsulation information rules, and determining a target encapsulation action based on the first header parsing information and the encapsulation action table includes: Selecting the encapsulation information rule that matches the first header parsing information from the plurality of encapsulation information rules as the first matching information rule; The encapsulation action corresponding to the first matching information rule is used as the target encapsulation action.

4. The data forwarding method of a large layer 2 network switching device according to claim 3, characterized in that: The step of encapsulating the transmission data packet based on the target encapsulation action by using the first column parsing block to obtain encapsulated transmission data includes: Determine target encapsulation information corresponding to the target encapsulation action; Based on the target encapsulation information, the first column parsing block is used to encapsulate the transmission data packet to obtain the encapsulated transmission data.

5. The data forwarding method of a large layer 2 network switching device according to claim 4, characterized in that: The target encapsulation information includes a target IP header, a target UDP header, and a target VXLAN header. Based on the target encapsulation information, the first column parsing block is used to encapsulate the sending data packet to obtain the encapsulated sending data, including: Utilizing the first column parsing block, the target IP header, the target UDP header and the target VXLAN header are stored in the header position of the sending data packet to obtain the encapsulated sending data.

6. The data forwarding method of a large layer 2 network switching device according to claim 1, characterized in that: The performing network address conversion on the encapsulated transmission data based on the first header parsing information includes: Acquire an address conversion action table, wherein the address conversion action table includes a plurality of conversion information rules and an address conversion action corresponding to each of the conversion information rules; The conversion information rule that matches the first header parsing information is selected from the multiple conversion information rules as the second matching information rule, and the network address conversion is performed on the encapsulated transmission data based on the address conversion action corresponding to the second matching information rule.

7. A data receiving method for a large layer 2 network switching device, characterized in that: The method comprises: Obtaining a parsing matrix and a decapsulation action table, wherein the parsing matrix includes a second column parsing block and a third column parsing block arranged in sequence, the decapsulation action table includes a plurality of decapsulation information rules and a decapsulation action corresponding to each of the decapsulation information rules, and the memory address of the parsing block in the third column corresponds to the memory address of the received data corresponding to the received data packet; Input the received data packet into the second column parsing block for parsing to obtain second header parsing information, and determine a target decapsulation action based on the second header parsing information and the decapsulation action table; The received data packet is decapsulated by using the third column parsing block based on the target decapsulation action to obtain the received data.

8. A data forwarding device for a large layer 2 network switching device, characterized in that: The device comprises: An acquisition module, used for acquiring a parsing matrix and a packaged action table, wherein the parsing matrix includes a first column of parsing blocks and a second column of parsing blocks which are sequentially arranged; A parsing module, used for parsing the sent data packet using the second column parsing blocks to obtain first header parsing information; an action determination module, configured to determine a target encapsulation action based on the first header parsing information and the encapsulation action table; An encapsulation module, configured to encapsulate the transmission data packet based on the target encapsulation action by using the first column parsing block to obtain encapsulated transmission data; A forwarding module is used to perform network address conversion on the encapsulated sending data based on the first header parsing information, and forward the converted encapsulated sending data.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method for forwarding data of a large layer 2 network switching device according to any one of claims 1 to 6 or the method for receiving data of a large layer 2 network switching device according to any one of claim 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for forwarding data of a large layer 2 network switching device according to any one of claims 1 to 6 or the method for receiving data of a large layer 2 network switching device according to any one of claim 7 is implemented.