Data processing method and device and electronic equipment
By using a double hash fast forwarding table in the NAT gateway device to process key information of traffic packets, the problem of low forwarding efficiency caused by complex software and hardware collaboration mechanisms is solved, achieving more efficient forwarding of network service messages and simplifying the design. and maintenance.
Patent Information
- Application Number
- CN202410984562.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-09-27
AI Technical Summary
The existing combination of software and hardware results in a complex coordination mechanism in the NAT gateway device, which reduces the accuracy and efficiency of network service packet forwarding.
By obtaining the key information in the traffic packet, query whether there is a matching entry in the double hash fast forwarding table. If it exists, extract the entry information for address processing. If it does not exist, perform packet processing and use the processed network address. For data packet transmission, fast and slow forwarding planes are concentrated in the same device without interaction.
It improves the accuracy and efficiency of network business message forwarding, reduces hash conflicts, simplifies network business traffic model design, and reduces development and maintenance costs.
Smart Images

Figure CN118714070A
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a data processing method, device and electronic device. Background Art
[0002] To improve the service quality and experience of public cloud resources, NAT gateway devices, as key devices for carrying network traffic services between public cloud VPC internal resources and the Internet, have extremely high requirements for network service message forwarding and processing performance. Since NAT gateway devices are a stateful network service, traditional hardware devices find it difficult to process stateful network service messages.
[0003] The method commonly used in the industry at present is a combination of software and hardware. Specially designed hardware accelerators or network processors can be used to process network service messages, while software is used to manage the forwarding logic and status of network service messages to achieve more efficient and reliable network service message forwarding.
[0004] However, this combination of software and hardware will make the coordination mechanism between software and hardware more complicated, thereby reducing the accuracy and efficiency of forwarding processing. Summary of the invention
[0005] In view of this, the present application provides a data processing method, device and electronic device, the main purpose of which is to solve the technical problem that the coordination mechanism of the existing software and hardware combination is more complicated, thereby reducing the accuracy and efficiency of forwarding processing.
[0006] According to a first aspect of the present disclosure, there is provided a data processing method, the method comprising:
[0007] Get traffic data packets;
[0008] Extract key information from the traffic data packet, and query whether there is a matching table entry matching the key information in the double hash fast forwarding table;
[0009] If there is a matching table entry that matches the key information, extracting the table entry information of the matching table entry, and performing address processing on the network address of the table entry information, so as to use the processed network address to perform data packet transmission processing of the traffic data packet;
[0010] If there is no matching table entry that matches the key information, data packet processing is performed on the traffic data packet, and address processing is performed on the network address of the processed traffic data packet to perform data packet transmission processing of the traffic data packet using the processed network address.
[0011] According to a second aspect of the present disclosure, there is provided a data processing device, the device comprising:
[0012] An acquisition module, used to acquire traffic data packets;
[0013] A query module, used to extract key information from the traffic data packet, and query whether there is a matching table entry matching the key information in the double hash fast forwarding table;
[0014] A processing module, configured to extract the table entry information of the matching table entry if there is a matching table entry that matches the key information, and perform address processing on the network address of the table entry information, so as to perform data packet transmission processing of the traffic data packet using the processed network address;
[0015] The transmission module is used to perform data packet processing on the traffic data packet if there is no matching table entry matching the key information, and perform address processing on the network address of the processed traffic data packet, so as to use the processed network address to perform data packet transmission processing on the traffic data packet.
[0016] According to the third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of the aforementioned first aspect.
[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method of the aforementioned first aspect.
[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method of the aforementioned first aspect when executed by a processor.
[0019] The data processing method, device and electronic device provided by the present invention, compared with the prior art, obtain a traffic data packet; extract key information in the traffic data packet, and query whether there is a matching table item matching the key information in the double hash fast forwarding table; if there is a matching table item matching the key information, extract the table item information of the matching table item, and perform address processing on the network address of the table item information, so as to use the processed network address to perform data packet transmission processing of the traffic data packet; if there is no matching table item matching the key information, perform data packet processing on the traffic data packet, and perform address processing on the network address of the processed traffic data packet, so as to use the processed network address to perform data packet transmission processing of the traffic data packet. For the disclosed scheme, for traffic data packets that match table entries, a fast forwarding path can be taken, that is, the table entry information of the matching table entries is extracted, and the processed network address is used for fast data packet transmission processing; for traffic data packets that do not have matching table entries, a slow forwarding path can be taken, that is, it is necessary to perform data packet processing on the traffic data packets, and perform address processing on the network addresses of the processed traffic data packets, and use the processed network addresses for fast data packet transmission processing. Since the fast and slow forwarding planes are concentrated in the same software operating system of the same device, there is no need for interaction between the fast and slow forwarding planes, and therefore it has better forwarding processing performance; since the fast forwarding table (i.e., the double hash fast forwarding table) constructed by the present application using double hash (bihash) technology can effectively reduce hash conflicts and further improve the accuracy and efficiency of forwarding.
[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0022] In order to more clearly illustrate the embodiments of the present application 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.
[0023] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure;
[0024] Figure 2A schematic diagram of the overall flow of a data processing method provided by an embodiment of the present disclosure;
[0025] Figure 3 A flowchart of a data processing method provided by an embodiment of the present disclosure;
[0026] Figure 4 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0027] Figure 5 A representation of a session record table and a double hash fast forwarding table provided in an embodiment of the present disclosure;
[0028] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, in the absence of conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0030] The data processing method, device and electronic device according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0031] In order to effectively solve the technical problem that the coordination mechanism between software and hardware is more complicated and the accuracy and efficiency of forwarding processing are reduced. This embodiment provides a data processing method, such as Figure 1 As shown, the method includes:
[0032] like Figure 1 As shown, an embodiment of the present disclosure provides a data processing method, the method comprising:
[0033] Step 101, obtain a traffic data packet; extract key information from the traffic data packet, and query whether there is a matching table entry matching the key information in the double hash fast forwarding table.
[0034] The traffic data packet may be a traffic packet transmitted in a virtual private cloud (VPC). A VPC may be a public cloud provider that isolates some computing, network, and storage resources in a cloud resource pool for use by a single tenant, where the resources are isolated from those of other tenants, and service use is not affected by other tenants (i.e., allows users to create a virtual private network in a cloud environment).
[0035] The key information may include five-tuple information (i.e., source MAC address, destination MAC address, source IP address, destination IP address, and protocol type) and an identification field (i.e., the VNI field in the VXLAN message header).
[0036] VXLAN is an encapsulation protocol that can be used to encapsulate internal network traffic in UDP packets for transmission over existing network infrastructure. The VNI field in the VXLAN message header (i.e., message header encapsulation information) can be a 24-bit identifier that can be used to uniquely identify the virtual network within the VXLAN segment.
[0037] A double hash (ie, bihash) fast forwarding table may be a data structure for quickly searching and forwarding data packets, and one or more hash tables may be used to store forwarding table entries.
[0038] For the disclosed embodiments, the execution subject may be a network address translation (i.e., NAT) gateway device. In the present application, the NAT gateway device may be implemented by the DPDK-based open source network operating system project VPP. Since the design of the present application is completely based on the open source network operating system project and is a pure software forwarding implementation solution, the development and maintenance costs are relatively low.
[0039] Among them, DPDK (Data Plane Development Kit) is a development kit for high-speed data processing, which provides libraries and drivers for network application development.
[0040] VPP (Virtual Packet Processor) can be an open source network operating system based on DPDK, which can efficiently process network data packets.
[0041] like Figure 2As shown, the NAT gateway device can be designed with VTEP port, Bridge interface, vxlan tunnel interface, loopback interface, VRF, NAT rules, fast forwarding table (i.e., bihash fast forwarding table), and nat session table. This application can be applied to the design and implementation of public cloud NAT gateway devices, which can provide higher network service forwarding processing performance with extremely low development and maintenance costs, and the simplified and flexible network service traffic model design is conducive to the simplification and iterative update of network service architecture.
[0042] Among them, VTEP can be a virtual tunnel endpoint, which is the endpoint for implementing tunnel technology (such as VXLAN) in a virtualized network. VTEP can be used to establish a virtualized network connection between different network segments.
[0043] Bridge is a bridge interface that can be used to connect two or more network segments, allowing data packets to be forwarded between different network segments. In a NAT gateway, a bridge interface can be used to connect an internal network to an external network, or to connect different internal subnets.
[0044] VXLAN is an encapsulation protocol that can be used to transmit Ethernet frames between different network technologies. It can encapsulate the IP address and port number of the internal network to enable transmission between different network technologies.
[0045] A loopback interface is a virtual interface that can be used to send packets back to their original sender. In a NAT gateway, a loopback interface can be used for testing and monitoring purposes.
[0046] VRF is a technology that allows multiple virtual routing and forwarding instances to be created on a physical network device. Each VRF has its own routing table and forwarding rules, which can be used to isolate different network traffic.
[0047] NAT rules can be used to define the mapping of internal private addresses to corresponding external public addresses, and vice versa.
[0048] The NAT session table (i.e., session record table) can be used to store detailed session information of NAT conversion, including internal private addresses, external public addresses, port numbers, etc. Each NAT detailed session information can represent an ongoing data packet conversion process.
[0049] In specific application scenarios, each tenant virtual private cloud (VPC) corresponds to a Bridge interface, a loopback interface, a VRF, several vxlan tunnel ports, and the tenant VPC's network address translation (NAT) rules. These pre-configured items are managed by the SDN controller.
[0050] A global double-hash fast forwarding table is designed inside the NAT gateway for use by all tenant VPCs. The fast forwarding table entries of different tenant VPCs are distinguished by the VNI field in the VXLAN message header. A global natsession table (i.e., session record table) is designed inside the NAT gateway to store the NAT session information (i.e., detailed session information) of all tenant VPCs. The NAT session information of different tenant VPCs is also distinguished by the VNI field in the VXLAN message header.
[0051] For the embodiments of the present disclosure, Figure 3 As shown, when the traffic data packet arrives at the virtual tunnel (VTEP) port, the VNI field in the VXLAN message header and the five-tuple information of the overlay layer are extracted from the data packet of the traffic data packet, and the VNI field and the five-tuple information can be used as the key (i.e., key) for searching the double hash fast forwarding table to find the table entry that matches the key in the double hash fast forwarding table.
[0052] Among them, each forwarding table entry in the double hash fast forwarding table contains a key-value pair, where the key can be used to look up key information of the data packet (such as source MAC address, source IP address, etc.), and the value can be one or more information associated with the key, such as NAT session index, traffic direction flag, etc.
[0053] Step 102: If there is a matching table entry that matches the key information, extract the table entry information of the matching table entry, and perform address processing on the network address of the table entry information to use the processed network address to perform data packet transmission processing of the traffic data packet.
[0054] For the embodiments of the present disclosure, if there is a matching table entry that matches the key information, as a possible implementation method, the value in the matching table entry (i.e., the table entry information) can be extracted, and the network address of the table entry information can be processed according to the direction of traffic entering and leaving the cloud. Finally, the processed network address can be used to perform data packet transmission processing on the data packet of the traffic data packet through the VTEP port to send it to the next destination.
[0055] Specifically, Figure 3 As shown, if there is a matching table entry that matches the key information, it means that the traffic data packet is non-first packet traffic (that is, it is not the first data packet transmitted in network communication), and can take the fast forwarding path, that is, pass through the VTEP port and the fast forwarding table in sequence, and then perform NAT business processing according to the table entry content and send it out from the VTEP port.
[0056] Step 103: If there is no matching table entry that matches the key information, data packet processing is performed on the traffic data packet, and address processing is performed on the network address of the processed traffic data packet to perform data packet transmission processing of the traffic data packet using the processed network address.
[0057] For the embodiments of the present disclosure, if there is no matching table entry that matches the key information, as a possible implementation method, packet processing can be performed on the traffic data packet to determine which interface or queue the traffic data packet should be sent to; address processing is performed on the network address of the processed traffic data packet to ensure that the traffic data packet can be accurately forwarded to the destination.
[0058] Specifically, Figure 3 As shown, if there is no matching table entry that matches the key information, it means that the traffic data packet is the first packet traffic (that is, the data packet transmitted for the first time in network communication), and can take the slow forwarding path, that is, pass through the VTEP port, fast forwarding table, vxlan port, loopback interface, VRF, and NAT rules in sequence. In the process of NAT business processing, all the required field information is extracted to generate a fast table entry and sent to the fast forwarding table, and then sent out through the vxlan port and VTEP port.
[0059] For this embodiment, since the fast and slow forwarding planes are concentrated in the same software operating system of the same device, there is no need for interaction between the fast and slow forwarding planes, and thus better forwarding processing performance is achieved.
[0060] like Figure 3 As shown, the tenant VPC network traffic model designed by this application has a clear and concise structure, can be flexibly deployed and applied in the public cloud, can be adapted to various cloud network architectures, and is conducive to the iterative upgrade and maintenance of the cloud network architecture. Therefore, this application proposal has high commercial value.
[0061] In summary, compared with the prior art, the data processing method disclosed in the present invention obtains a traffic data packet; extracts key information from the traffic data packet, and queries whether there is a matching table entry that matches the key information in the double hash fast forwarding table; if there is a matching table entry that matches the key information, the table entry information of the matching table entry is extracted, and the network address of the table entry information is address processed to use the processed network address to perform data packet transmission processing of the traffic data packet; if there is no matching table entry that matches the key information, data packet processing is performed on the traffic data packet, and the network address of the processed traffic data packet is address processed to use the processed network address to perform data packet transmission processing of the traffic data packet. For the disclosed scheme, for traffic data packets that match table entries, a fast forwarding path can be taken, that is, the table entry information of the matching table entries is extracted, and the processed network address is used for fast data packet transmission processing; for traffic data packets that do not have matching table entries, a slow forwarding path can be taken, that is, it is necessary to perform data packet processing on the traffic data packets, and perform address processing on the network addresses of the processed traffic data packets, and use the processed network addresses for fast data packet transmission processing. Since the fast and slow forwarding planes are concentrated in the same software operating system of the same device, there is no need for interaction between the fast and slow forwarding planes, and therefore it has better forwarding processing performance; since the fast forwarding table (i.e., the double hash fast forwarding table) constructed by the present application using double hash (bihash) technology can effectively reduce hash conflicts and further improve the accuracy and efficiency of forwarding.
[0062] Further, as a refinement and extension of the above embodiment, in order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 4 The specific method shown comprises the following steps:
[0063] Step 201: If there is a matching table entry that matches the key information, extract the session index and traffic direction flag in the matching table entry; extract the full session information according to the session index, and extract the session field information according to the traffic direction flag.
[0064] The table entry information may include the full session information and the session field information;
[0065] The session index can be used to quickly find and reference the identifier of the NAT session. Each NAT session has a unique index in the device. The session index can be used to locate specific session information in the NAT session table.
[0066] The full session information may be all detailed information related to the NAT session, such as the original source IP address, the original destination IP address, the source port, the destination port, etc.
[0067] The session field information may be a part of specific fields extracted from the full session information.
[0068] The traffic direction flag can be used to indicate the transmission direction of the traffic, for example, from the private cloud to the public cloud (outbound cloud) or from the public cloud to the private cloud (inbound cloud), to help network devices correctly process and route the traffic and ensure that the data packets can be transmitted along the expected path.
[0069] For the embodiment of the present disclosure, if there is a matching table entry that matches the key information, the NAT session index (i.e., session index) and the traffic direction flag in the matching table entry are extracted, and the corresponding NAT session information (i.e., full session information) is searched in the NAT session table pointed to by the NAT session index, wherein the NAT session table may contain all detailed information of the NAT session, such as the mapping relationship between the internal private address and the external public address, port number mapping, session status, etc.
[0070] Finally, specific field information (i.e., session field information) can be extracted from the NAT session information (i.e., full session information) based on the traffic direction flag. For example, if the traffic direction flag indicates that the traffic direction of the traffic data packet is entering the cloud environment, the internal address and port number in the NAT session information (i.e., full session information) can be extracted as session field information; if the traffic direction flag indicates that the traffic direction of the traffic data packet is leaving the cloud environment, the external address and port number in the NAT session information (i.e., full session information) can be extracted as session field information.
[0071] Step 202: According to the network address translation rules corresponding to the full session information, perform address translation processing on the IP addresses in the full session information to convert the public IP addresses into the corresponding private IP addresses, and / or convert the private IP addresses into the corresponding public IP addresses; perform address mapping processing on the MAC addresses in the session field information to map the MAC addresses to different target MAC addresses.
[0072] Among them, the network address includes IP address and MAC address, and the IP address includes public IP address and private IP address.
[0073] For the embodiment of the present disclosure, NAT service processing may be performed on the full information of the session, that is, according to the NAT type in the full information of the session, address translation processing may be performed on the IP address extracted from the full information of the session to convert the public IP address into the corresponding private IP address, and / or convert the private IP address into the corresponding public IP address;
[0074] For the embodiments of the present disclosure, the session field information can be processed by overlay layer 2 MAC field, that is, the MAC address in the session field information can be address mapped to map the MAC address to a different target MAC address to ensure that the traffic data packet is correctly forwarded in the VXLAN tunnel.
[0075] For the embodiments disclosed herein, since the information of the original message is directly used on the slow forwarding processing path, there is no situation of modifying the original message. Only during NAT business processing, it is necessary to perform business processing on information such as the original message five-tuple field according to NAT rules. Therefore, there is no additional bandwidth loss and additional CPU resource consumption.
[0076] Step 203: If there is no matching table entry that matches the key information, check whether the traffic data packet contains the message header encapsulation information; if the traffic data packet contains the message header encapsulation information, unseal the message header encapsulation information in the traffic data packet; and perform data verification processing on the unsealed traffic data packet.
[0077] For the embodiment of the present disclosure, if there is no matching table entry that matches the key information, it is checked whether the traffic data packet contains the message header encapsulation information. If the traffic data packet contains the message header encapsulation information, it can be indicated that the traffic data packet is transmitted under the coverage of the VXLAN tunnel port. The traffic data packet is then unpacked, that is, the message header encapsulation information in the traffic data packet is removed, and then the unpacked traffic data packet is sent to the VXLAN interface associated with the VXLAN tunnel.
[0078] After unpacking the traffic data packet, the NAT gateway device can perform layer 2 (MAC address) and layer 3 (IP address) learning and verification operations to ensure the integrity and correctness of the data message, and then the traffic data packet can be sent to the loopback interface, where the loopback interface can be a virtual interface for internal testing and monitoring.
[0079] Step 204: perform address conversion processing on the IP address of the verified traffic data packet according to the network address conversion rule corresponding to the traffic data packet, so as to convert the public IP address into the corresponding private IP address, and / or convert the private IP address into the corresponding public IP address; perform address mapping processing on the MAC address of the verified traffic data packet, so as to map the MAC address to a different target MAC address.
[0080] For the embodiments of the present disclosure, the NAT gateway device can convert the IP addresses of traffic data packets according to the network address translation rules configured in the tenant VPC to map private IP addresses to public IP addresses, or map public IP addresses to private IP addresses, so as to enable effective communication between the internal and external networks of the tenant VPC.
[0081] Among them, the MAC address can be an address of the data link layer, which can be used to uniquely identify a network device in a local area network. In an overlay network, the MAC address can be the local MAC address of a traffic data packet, which is passed between network devices to correctly forward the data packet.
[0082] In a specific application scenario, in the VXLAN tunnel port, VXLAN packets need to be routed in the physical network, and the physical network is forwarded based on the MAC address. Therefore, the MAC address is mapped to different target MAC addresses so that the VXLAN packets can be forwarded to the correct physical network segment.
[0083] For the embodiments of the present disclosure, after executing the network address processing, a session record table can be created based on the message information (i.e., the key information of the traffic data packet) and the NAT rules of the tenant VPC (i.e., the network address translation rules), and the session record table contains the content information in the session record table entry.
[0084] Among them, the session record table is as follows Figure 5 As shown in the NAT session table entry in the figure, the NAT session table entry consists of the overlay layer source and destination IP addresses (s_addr, d_addr), source and destination ports (s_port, d_port), protocol type (protocol), vni (vxlan_vni) of the VXLAN message header, vxlan interface index if_index of the message outgoing interface, source and destination MAC addresses (s_mac, d_mac), and other basic data structure information fields required by the program. Among them, the quintuple of the cloud outgoing direction, vni, and vxlan interface index of the message outgoing interface in the NAT session table entry elements are used for NAT and forwarding processing in the cloud outgoing direction, that is, they have a corresponding relationship with i2oflow bihash k / v; the quintuple of the cloud inbound direction, vni, and vxlan interface index of the message outbound interface are used for NAT and forwarding processing in the cloud inbound direction, that is, they have a corresponding relationship with o2i flowbihash k / v; s_mac and d_mac are common fields for traffic in both directions and are used when entering and leaving the cloud.
[0085] In order to achieve fast routing and forwarding, a double-hash fast forwarding table entry corresponding to two flows can be generated for traffic in both directions of entering and leaving the cloud.
[0086] Among them, the double hash fast forwarding table entry for data packets in the outbound direction is as follows: Figure 5As shown in the i2oflow bihash k / v in the table, it can be composed of the overlay layer local IP address (l_addr), remote IP address (r_addr), local port number (l_port), remote port number (r_port), protocol type (protocol), vni (vxlan_vni) of the vxlan message header, nat session index (session_index), flow direction flag (i2o_flag), etc. Among them, session_index and i2o_flag are values, and other elements are keys. Session_index points to the index position of the nat session table item;
[0087] The double hash fast forwarding table entry for data packets in the cloud direction is as follows: Figure 5 As shown in the o2i flow bihash k / v in the table, it can be composed of the overlay layer local IP address (l_addr), remote IP address (r_addr), local port number (l_port), remote port number (r_port), protocol type (protocol), vni (vxlan_vni) of the vxlan message header, nat session index (session_index), flow direction flag (o2i_flag), etc. Among them, session_index and o2i_flag are values, and other elements are keys. Session_index points to the index position of the nat session table item.
[0088] The generated double hash fast forwarding table entry is stored in the double hash fast forwarding table, so that whenever a traffic data packet needs to be forwarded, the NAT gateway device can quickly search the latest double hash fast forwarding table to determine how to process the traffic data packet.
[0089] Accordingly, a session record table can be created based on the key information of the traffic data packet and the network address translation rules, wherein the session record table contains the session record table item information of the traffic data packet; a double hash fast forwarding table item in the outbound cloud direction and a double hash fast forwarding table item in the inbound cloud direction are constructed based on the session record table item information; the double hash fast forwarding table item in the outbound cloud direction and the double hash fast forwarding table item in the inbound cloud direction are stored in the double hash fast forwarding table to update the double hash fast forwarding table.
[0090] Step 205, obtain the encapsulation tunnel exit information of the traffic data packet; encapsulate the message header encapsulation information of the traffic data packet according to the encapsulation tunnel exit information; and perform data packet transmission processing on the encapsulated traffic data packet according to the converted IP address and the mapped target MAC address.
[0091] The encapsulation tunnel exit information may be information for completing the encapsulation and decapsulation process of a traffic data packet when the traffic data packet is transmitted through the tunnel technology in the network.
[0092] For the embodiments of the present disclosure, each VXLAN tunnel interface corresponds to a unique interface index, which is used to identify different VXLAN tunnel interfaces. The corresponding VXLAN tunnel information (i.e., encapsulated tunnel exit information) can be obtained according to the interface index of the outgoing interface VXLAN tunnel port, so that the VXLAN message header can be correctly encapsulated according to the VXLAN tunnel information when sending traffic data packets, and the encapsulated traffic data packets can be sent out through the VTEP port according to the converted IP address and the mapped target MAC address, so as to perform data packet transmission processing of the traffic data packets.
[0093] In the embodiment of the present application, since the fast forwarding table entries are generated and sent to the fast forwarding table in the process of processing the first packet of the tenant VPC traffic in the same software operating system of the same device, and there is no encapsulation and parsing of the interactive message, the fast forwarding table entries can be generated faster, so that the non-first packet traffic of the tenant VPC can be forwarded faster, and the processing of the first packet is also simple and fast under this traffic design model, and the cloud network as a whole is not prone to congestion and performance bottlenecks.
[0094] In summary, compared with the prior art, the data processing method disclosed in the present invention obtains a traffic data packet; extracts key information from the traffic data packet, and queries whether there is a matching table entry that matches the key information in the double hash fast forwarding table; if there is a matching table entry that matches the key information, the table entry information of the matching table entry is extracted, and the network address of the table entry information is address processed to use the processed network address to perform data packet transmission processing of the traffic data packet; if there is no matching table entry that matches the key information, data packet processing is performed on the traffic data packet, and the network address of the processed traffic data packet is address processed to use the processed network address to perform data packet transmission processing of the traffic data packet. For the disclosed scheme, for traffic data packets that match table entries, a fast forwarding path can be taken, that is, the table entry information of the matching table entries is extracted, and the processed network address is used for fast data packet transmission processing; for traffic data packets that do not have matching table entries, a slow forwarding path can be taken, that is, it is necessary to perform data packet processing on the traffic data packets, and perform address processing on the network addresses of the processed traffic data packets, and use the processed network addresses for fast data packet transmission processing. Since the fast and slow forwarding planes are concentrated in the same software operating system of the same device, there is no need for interaction between the fast and slow forwarding planes, and therefore it has better forwarding processing performance; since the fast forwarding table (i.e., the double hash fast forwarding table) constructed by the present application using double hash (bihash) technology can effectively reduce hash conflicts and further improve the accuracy and efficiency of forwarding.
[0095] Based on the above Figure 1 and Figure 4 The present disclosure provides a data processing device, such as Figure 6 As shown, the device includes: an acquisition module 31, a query module 32, a processing module 33, and a transmission module 34;
[0096] An acquisition module 31 is used to acquire traffic data packets;
[0097] A query module 32, used to extract key information from the traffic data packet, and query whether there is a matching table entry matching the key information in the double hash fast forwarding table;
[0098] A processing module 33 is used to extract the table information of the matching table if there is a matching table item that matches the key information, and perform address processing on the network address of the table item information, so as to use the processed network address to perform data packet transmission processing of the traffic data packet;
[0099] The transmission module 34 is used to perform packet processing on the traffic data packet if there is no matching table entry matching the key information, and perform address processing on the network address of the processed traffic data packet, so as to use the processed network address to perform packet transmission processing of the traffic data packet.
[0100] In a specific application scenario, the table entry information includes the full session information and the session field information. The processing module 33 can be used to extract the session index and the traffic direction flag in the matching table entry if there is a matching table entry that matches the key information.
[0101] The full session information is extracted according to the session index, and the session field information is extracted according to the traffic direction flag.
[0102] In a specific application scenario, a network address includes an IP address and a MAC address, and an IP address includes a public IP address and a private IP address; a processing module 33 may be used to perform address conversion processing on the IP address in the full information of the session according to a network address conversion rule corresponding to the full information of the session, so as to convert a public IP address into a corresponding private IP address, and / or convert a private IP address into a corresponding public IP address;
[0103] Address mapping is performed on the MAC address in the session field information to map the MAC address to a different target MAC address.
[0104] In a specific application scenario, the transmission module 34 may be used to check whether the traffic data packet contains the message header encapsulation information if there is no matching table entry matching the key information;
[0105] If the traffic data packet contains message header encapsulation information, decapsulating the message header encapsulation information in the traffic data packet;
[0106] Performing data verification processing on the unsealed traffic data packet;
[0107] Performing address translation processing on the IP address of the verified traffic data packet according to the network address translation rule corresponding to the traffic data packet, so as to convert the public IP address into the corresponding private IP address, and / or convert the private IP address into the corresponding public IP address;
[0108] The verified MAC address of the traffic data packet is subjected to address mapping processing to map the MAC address to a different target MAC address.
[0109] In a specific application scenario, the transmission module 34 can be used to obtain the encapsulation tunnel exit information of the traffic data packet; encapsulate the message header encapsulation information of the traffic data packet according to the encapsulation tunnel exit information; and perform data packet transmission processing on the encapsulated traffic data packet according to the converted IP address and the mapped target MAC address.
[0110] In a specific application scenario, the transmission module 34 may be used to create a session record table containing session record table entry information of the traffic data packet according to the key information of the traffic data packet and the network address translation rule if there is no matching table entry matching the key information;
[0111] Constructing a cloud-outbound double-hash fast forwarding table entry and a cloud-inbound double-hash fast forwarding table entry according to the session record entry information;
[0112] The cloud-outbound dual-hash fast forwarding table entry and the cloud-inbound dual-hash fast forwarding table entry are stored in a dual-hash fast forwarding table to update the dual-hash fast forwarding table.
[0113] It should be noted that for other corresponding descriptions of the functional units involved in the data processing device provided by the present disclosure, please refer to Figure 1 and Figure 4 The corresponding description in will not be repeated here.
[0114] Based on the above Figure 1 and Figure 4The method shown in the present disclosure, accordingly, also provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned Figure 1 and Figure 4 The method shown.
[0115] Based on this understanding, the technical solution of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present disclosure.
[0116] Based on the above Figure 1 and Figure 4 The method shown, and Figure 6 In order to achieve the above-mentioned purpose, the embodiment of the present disclosure also provides an electronic device that can be configured on the vehicle (such as an electric vehicle) side, and the device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 4 The method shown.
[0117] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0118] Those skilled in the art will appreciate that the above-mentioned physical device structure provided by the present disclosure does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0119] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present disclosure can be implemented by means of software plus a necessary general hardware platform, or by hardware. According to the data processing method, device and electronic device provided by the present disclosure, compared with the prior art, the present disclosure obtains a flow data packet; extracts key information from the flow data packet, and queries whether there is a matching table entry that matches the key information in the double hash fast forwarding table; if there is a matching table entry that matches the key information, extracts the table entry information of the matching table entry, and performs address processing on the network address of the table entry information, so as to use the processed network address to perform data packet transmission processing of the flow data packet; if there is no matching table entry that matches the key information, performs data packet processing on the flow data packet, and performs address processing on the network address of the processed flow data packet, so as to use the processed network address to perform data packet transmission processing of the flow data packet.
[0121] For the disclosed scheme, for traffic data packets that match table entries, a fast forwarding path can be taken, that is, the table entry information of the matching table entries is extracted, and the processed network address is used for fast data packet transmission processing; for traffic data packets that do not have matching table entries, a slow forwarding path can be taken, that is, it is necessary to perform data packet processing on the traffic data packets, and perform address processing on the network addresses of the processed traffic data packets, and use the processed network addresses for fast data packet transmission processing. Since the fast and slow forwarding planes are concentrated in the same software operating system of the same device, there is no need for interaction between the fast and slow forwarding planes, and therefore it has better forwarding processing performance; since the fast forwarding table (i.e., the double hash fast forwarding table) constructed by the present application using double hash (bihash) technology can effectively reduce hash conflicts and further improve the accuracy and efficiency of forwarding.
[0122] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0123] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A data processing method, characterized in that: The method comprises: Get traffic data packets; Extract key information from the traffic data packet, and query whether there is a matching table entry matching the key information in the double hash fast forwarding table; If there is a matching table entry that matches the key information, extracting the table entry information of the matching table entry, and performing address processing on the network address of the table entry information, so as to use the processed network address to perform data packet transmission processing of the traffic data packet; If there is no matching table entry that matches the key information, data packet processing is performed on the traffic data packet, and address processing is performed on the network address of the processed traffic data packet to perform data packet transmission processing of the traffic data packet using the processed network address.
2. The method according to claim 1, characterized in that The table entry information includes the full session information and session field information; If there is a matching table entry that matches the key information, extracting the table entry information of the matching table entry includes: If there is a matching table entry that matches the key information, extracting the session index and the flow direction flag in the matching table entry; The full session information is extracted according to the session index, and the session field information is extracted according to the traffic direction flag.
3. The method according to claim 2, characterized in that The network address includes an IP address and a MAC address, and the IP address includes a public IP address and a private IP address; The performing address processing on the network address of the entry information includes: According to the network address translation rule corresponding to the full session information, perform address translation processing on the IP address in the full session information to convert the public IP address into the corresponding private IP address and / or convert the private IP address into the corresponding public IP address; Address mapping is performed on the MAC address in the session field information to map the MAC address to a different target MAC address.
4. The method according to claim 1, characterized in that: If there is no matching table entry matching the key information, performing data packet processing on the traffic data packet, and performing address processing on the network address of the processed traffic data packet, including: If there is no matching table entry matching the key information, checking whether the traffic data packet contains message header encapsulation information; If the traffic data packet contains message header encapsulation information, decapsulating the message header encapsulation information in the traffic data packet; Performing data verification processing on the unsealed traffic data packet; Performing address translation processing on the IP address of the verified traffic data packet according to the network address translation rule corresponding to the traffic data packet, so as to convert the public IP address into the corresponding private IP address, and / or convert the private IP address into the corresponding public IP address; The verified MAC address of the traffic data packet is subjected to address mapping processing to map the MAC address to a different target MAC address.
5. The method according to claim 1, characterized in that Before performing data packet transmission processing of the traffic data packet using the processed network address, the method further includes: Obtain the encapsulation tunnel exit information of the traffic data packet; Encapsulating the message header encapsulation information of the traffic data packet according to the encapsulation tunnel exit information; The method of using the processed network address to perform data packet transmission processing of the traffic data packet includes: The encapsulated traffic data packet is processed for data packet transmission according to the converted IP address and the mapped target MAC address.
6. The method according to claim 1, characterized in that The method further comprises: If there is no matching table entry that matches the key information, creating a session record table according to the key information of the traffic data packet and the network address translation rule, the session record table including the session record table entry information of the traffic data packet; Constructing a cloud-outbound double-hash fast forwarding table entry and a cloud-inbound double-hash fast forwarding table entry according to the session record entry information; The cloud-outbound dual-hash fast forwarding table entry and the cloud-inbound dual-hash fast forwarding table entry are stored in a dual-hash fast forwarding table to update the dual-hash fast forwarding table.
7. A data processing device, the device comprising: An acquisition module, used to acquire traffic data packets; A query module, used to extract key information from the traffic data packet, and query whether there is a matching table entry matching the key information in the double hash fast forwarding table; A processing module, configured to extract the table entry information of the matching table entry if there is a matching table entry that matches the key information, and perform address processing on the network address of the table entry information, so as to perform data packet transmission processing of the traffic data packet using the processed network address; The transmission module is used to perform data packet processing on the traffic data packet if there is no matching table entry matching the key information, and perform address processing on the network address of the processed traffic data packet, so as to use the processed network address to perform data packet transmission processing on the traffic data packet.
8. A non-transitory computer-readable storage medium having computer instructions stored thereon, characterized in that: The computer instructions are used to make a computer execute the method as claimed in claims 1-6.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Cited By
Data packet identification method and system based on double hash values, and terminal
CN119172310A
Data transmission method, first physical device, cluster and storage medium
CN120223670A
Public network traffic forwarding method and device for cloud computing system, equipment and medium
CN120956691A
Public network traffic forwarding method and device for cloud computing system, equipment and medium
CN120956691B
Data processing system and method, device, and storage medium
WO2026118930A1
