Data packet forwarding method and device based on converged gateway, equipment storage and medium

By combining the entry storage of hardware units and software units in the converged gateway, the problem of limited ASIC memory resources is solved, the storage space of NFV network element entries is expanded, the efficiency and performance of edge clouds are improved, and the cost of cloud vendors is reduced. cost.

CN118802889APending Publication Date: 2024-10-18CHINA MOBILE COMM LTD RES INST +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311100090.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

ASICs have limited memory resources and can only store a small number of NFV network element entries, making it difficult to effectively deploy network function virtualization in edge cloud scenarios.

Method used

Using the data packet forwarding method based on the converged gateway, the hardware unit presets the flow table to store hotspot entries, and the software unit memory database stores non-hotspot entries. The target field is transferred between the hardware unit and the software unit to realize the search and processing of table entries. Update to expand storage space.

Benefits of technology

It solves the problem of limited ASIC memory resources, expands the ability to store NFV network element entries, improves the efficiency and performance of edge clouds, and reduces the costs of cloud vendors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802889A_ABST
    Figure CN118802889A_ABST
Patent Text Reader

Abstract

The invention provides a data packet forwarding method and device based on a converged gateway, an equipment storage and a medium, and the method comprises the steps: searching whether a table entry used for forwarding a data packet exists in a preset flow table or not after a hardware unit obtains the data packet; under the condition that the table item does not exist in the preset flow table, inserting a target field into the data packet, and forwarding the data packet inserted with the target field to a software unit; wherein the target field is used for representing table information corresponding to the table item; table items are looked up in a memory database based on the target field, and a preset flow table is updated based on the looked-up table items; and sending the data packet to a hardware unit, and forwarding the data packet based on the table items in the preset flow table. In the embodiment of the invention, a part of table entries are stored through the software unit, and compared with the prior art that only an ASIC hardware unit stores the table entries, the table storage space is expanded, so that the problem that only a small number of NFV network element table entries can be stored due to limited ASIC memory resources in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, device, equipment storage and medium for forwarding data packets based on a converged gateway. Background Art

[0002] In order to provide flexible network functions and reduce costs, cloud vendors often implement network functions (NF) in software form and run them in bare metal or virtual machines, and deploy them in the network in the form of resource pools. In some cloud computing or edge computing scenarios, network function virtualization (NFV) network elements are usually organized in a pipeline manner according to the order of previous and subsequent calculations. This series of NFs is called a service function chain (SFC), which usually includes functions such as load balancers, firewalls, and network address translation.

[0003] However, in edge scenarios, NFs are difficult to deploy in this way. 1) Edge cloud is an inefficient place. Unlike regular cloud services running on large data centers, edge services need to be close to end users (e.g., mobile or IoT devices) and are usually located in rented facilities with limited power, space, and computing. It is impossible to deploy a large number of server clusters as NFs. 2) The computing power resources of the central processing unit (CPU) in edge scenarios are precious and should be focused on processing tenants' computing tasks. If a large number of machines are only used for packet processing, the capacity and benefits of the edge cloud will be greatly reduced. Finally, the CPU is not specially designed for network traffic processing. Compared with the switching equipment, the ability to process network traffic is weak, resulting in software NFs being usually one to two orders of magnitude slower than hardware NFs. Today, as network traffic continues to grow, the computing power growth rate of a single-core CPU is significantly lower than the rate of traffic growth. It is difficult for software-based NFs to process packets at line speed, so they are gradually stretched in some large-scale scenarios.

[0004] In recent years, the popularity of protocol-independent forwarding architectures and programming languages ​​has attracted many researchers to focus on using programmable switches to offload NFV, such as Figure 1 The figure shows the P4 abstract forwarding model, where both the parser and flow table can be programmed and configured using the P4 language; when matching tables, the matching domain and action will no longer be restricted by existing protocols. When a packet enters a P4 switch, the packet header parsing designed by the programmer is completed first, and then the packet processing is completed through the "match-action" pipeline. When the switch is running, users can add table entries to the switch through the control plane.

[0005] Although the performance of hardware forwarding is much better than that of software, there is a problem in NFV offloading: the memory resources of P4 switches are limited and cannot store too many table entries. Taking Intel's Tofino chip as an example, Tofino has four independent pipelines for packet processing. Each pipeline consists of a fixed number of single stages. Each stage has its own static random access memory (SRAM) and ternary content addressable memory (TCAM). The memory resources are equally divided and attached to each stage, so that each stage can only access its local memory resources. Although the table can be configured across stages, for some NF network elements containing a large number of table entries (such as the Virtual Extensible Local Area Network (VXLAN) routing table in the public cloud gateway), it is obviously impossible to store them using a single P4 switch chip, resulting in the inability to offload NFs with large table entries to ASIC (Application Specific Integrated Circuit) hardware. Summary of the invention

[0006] The embodiments of the present application provide a data packet forwarding method, apparatus, device storage and medium based on a converged gateway to solve the problem in the prior art that only a small number of NFV network element entries can be stored due to limited ASIC memory resources.

[0007] To solve the above technical problems, this application is implemented as follows:

[0008] In a first aspect, an embodiment of the present application provides a data packet forwarding method based on a converged gateway, wherein the converged gateway includes a hardware unit and a software unit, wherein a preset flow table of the hardware unit stores hotspot entries corresponding to a gateway function virtualization NFV network element, and a memory database of the software unit stores non-hotspot entries corresponding to the NFV network element, wherein the method includes: after the hardware unit obtains a data packet, searching the preset flow table for an entry for forwarding the data packet; if the entry does not exist in the preset flow table, inserting a target field into the data packet, and forwarding the data packet with the inserted target field to the software unit; wherein the target field is used to represent table information corresponding to the entry; searching the entry in the memory database based on the target field, and updating the preset flow table based on the found entry; sending the data packet to the hardware unit, and forwarding the data packet based on the entry in the preset flow table.

[0009] In a second aspect, an embodiment of the present application provides a data packet forwarding device based on a converged gateway, wherein the converged gateway includes a hardware unit and a software unit, wherein a preset flow table of the hardware unit stores hotspot entries corresponding to a gateway function virtualization NFV network element, and a memory database of the software unit stores non-hotspot entries corresponding to the NFV network element, wherein the device includes: a search module, which is used to search in the preset flow table whether there is an entry for forwarding the data packet after the hardware unit obtains the data packet; a first processing module, which is used to insert a target field into the data packet if the entry does not exist in the preset flow table, and forward the data packet with the target field inserted to the software unit; wherein the target field is used to represent table information corresponding to the entry; a second processing module, which is used to search for the entry in the memory database based on the target field, and update the preset flow table based on the found entry; a third processing module, which is used to send the data packet to the hardware unit, and forward the data packet based on the entry in the preset flow table.

[0010] In a third aspect, an embodiment of the present application provides a communication device, including a transceiver and a processor, wherein the processor is used to search the preset flow table for a table entry for forwarding the data packet after the hardware unit obtains the data packet, and insert a target field into the data packet if the table entry does not exist in the preset flow table; the transceiver is used to forward the data packet with the target field inserted to the software unit; wherein the target field is used to represent the table information corresponding to the table entry; the processor is also used to search the table entry in the memory database based on the target field, and update the preset flow table based on the found table entry; the transceiver is also used to send the data packet to the hardware unit, and forward the data packet based on the table entry in the preset flow table. In a fourth aspect, an embodiment of the present application provides a communication device, including a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the data packet forwarding method based on the converged gateway as described in the first aspect above are implemented.

[0011] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data packet forwarding method based on the converged gateway as described in the first aspect above are implemented.

[0012] In the embodiment of the present application, since the hotspot table items corresponding to the gateway function virtualization NFV network element are stored in the preset flow table of the hardware unit, and the non-hotspot table items corresponding to the NFV network element are stored in the memory database of the software unit, when the table items for forwarding the data packet are not found in the hardware unit, the data packet will be forwarded to the software unit, and the search will be performed in the software unit, and then the found table items will be updated to the hardware unit, and the data packet will be sent to the hardware unit again, so as to find the table items for forwarding the data packet in the preset flow table of the hardware unit. It can be seen that in the embodiment of the present application, a part of the table items are stored by the software unit, compared with the prior art in which only the ASIC hardware unit stores the table items, the storage table space is expanded, thereby solving the problem in the prior art that the limited memory resources of the ASIC can only store a small number of NFV network element table items. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0014] Figure 1 It is a result schematic diagram of the P4 abstract forwarding model in the prior art;

[0015] Figure 2 It is a flow chart of a data packet forwarding method based on a fusion gateway provided in an embodiment of the present application;

[0016] Figure 3 It is a flow chart of a method for extending an NFV network element table entry based on a hyper-converged gateway provided in an embodiment of the present application;

[0017] Figure 4 It is a schematic diagram of the ToCPUHeader message structure encapsulating miss table information provided in an embodiment of the present application;

[0018] Figure 5 It is a schematic diagram of the x86 software unit processing flow provided by an embodiment of the present application;

[0019] Figure 6 It is a schematic diagram of the FromCPUHeader message structure encapsulating table lookup result information provided in an embodiment of the present application;

[0020] Figure 7 is a logic flow chart of table bypass provided in an embodiment of the present application;

[0021] Figure 8 It is a flow chart of the NFV network element table entry expansion method for continuous table lookup optimization provided by an embodiment of the present application;

[0022] Fig. 9 It is a schematic diagram of the ToCPUHeader message structure optimized by continuous table lookup provided in an embodiment of the present application;

[0023] Fig.10 It is a schematic diagram of the FromCPUHeader message structure optimized by continuous table lookup provided in an embodiment of the present application;

[0024] Fig.11 It is a result schematic diagram of a data packet forwarding device based on a fusion gateway provided in an embodiment of the present application;

[0025] Fig.12 It is a structural diagram of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] like Figure 1 As shown, since the P4 hyper-converged heterogeneous computing device is embedded with P4 ASIC, FPGA (Field Programmable Gate Array, Field Programmable Logic Gate Array) and general-purpose CPU (Central Processing Unit, Central Processing Unit), for the programmable switching chip, its computing speed is extremely high but the computing function is limited, and it is mainly suitable for completing functions such as high-speed table lookup, and its table entry storage space is limited. For the general-purpose CPU, its computing expression ability is extremely strong, but there is still a certain gap in data packet processing performance compared to the dedicated chip, and there is almost no problem of insufficient memory resources. For FPGA, its storage is larger than that of the programmable switching chip, but the processing rate is lower than that of the programmable switching chip, and the programming development and debugging are more difficult. Due to the extremely close physical distance, the transmission delay between the three inside the fusion gateway is extremely low. Therefore, in the embodiment of the present application, the method of software and hardware fusion is considered to realize the table entry expansion of the NFV network element. Specifically, while unloading the NF to the P4 ASIC hardware unit, the P4 large table entries that cannot be borne in the NF network element can be placed in the x86 software unit, and then sent to the x86 software unit for query when needed. Although the method in the embodiment of the present application is designed for a converged gateway, it can also be applied to other network devices that are limited by hardware resources, such as smartNIC.

[0028] Through the embodiments of the present application, the network function NF is offloaded to the ASIC, and the computing power resources of the CPU are released; secondly, by implementing NF through a dedicated chip, data packets can be processed at line speed, which has higher performance than the NF solution based on software implementation; thirdly, thanks to the reconfiguration capability of the programmable switch, NFV and SFC are more flexible; fourthly, it provides new ideas for expanding the memory resources of the programmable switch; finally, the efficiency of the edge cloud with limited space is improved, and cloud vendors reduce costs and increase efficiency.

[0029] Based on this, an embodiment of the present application provides a data packet forwarding method based on a converged gateway, and the converged gateway in the embodiment of the present application includes a hardware unit and a software unit. The preset flow table of the hardware unit stores hotspot table entries corresponding to the gateway function virtualization NFV network element, and the memory database of the software unit stores non-hotspot table entries corresponding to the NFV network element.

[0030] It should be noted that the table entries stored in the above software unit and hardware unit are the same as the table entries when the NF is unloaded to the ASIC hardware unit.

[0031] In a specific example, the hardware unit of the converged gateway in the embodiment of the present application may be an ASIC hardware unit, and the software unit may be an X86 software unit.

[0032] See also Figure 2 , Figure 2 is a flow chart of a method for forwarding data packets based on a fusion gateway provided in an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0033] Step 201, after the hardware unit obtains the data packet, it searches the preset flow table to see whether there is an entry for forwarding the data packet;

[0034] It should be noted that the first search in the hardware unit to see whether there is an entry for forwarding the data packet may be performed based on the destination address, destination port, etc. of the data packet.

[0035] Step 202: if there is no entry in the preset flow table, insert a target field into the data packet, and forward the data packet with the inserted target field to the software unit; wherein the target field is used to represent the table information corresponding to the entry;

[0036] Step 203, searching for table entries in the memory database based on the target field, and updating the preset flow table based on the found table entries;

[0037] Step 204: Send the data packet to the hardware unit, and forward the data packet based on the entry in the preset flow table.

[0038] Through the embodiment of the present application, since the hotspot table items corresponding to the gateway function virtualization NFV network element are stored in the preset flow table of the hardware unit, and the non-hotspot table items corresponding to the NFV network element are stored in the memory database of the software unit, when the table items for forwarding the data packet are not found in the hardware unit, the data packet will be forwarded to the software unit, and the search will be performed in the software unit, and then the found table items will be updated to the hardware unit, and the data packet will be sent to the hardware unit again, so as to find the table items for forwarding the data packet in the preset flow table of the hardware unit. It can be seen that in the embodiment of the present application, a part of the table items are stored by the software unit, compared with the prior art in which only the ASIC hardware unit stores the table items, the storage table space is expanded, thereby solving the problem in the prior art that the ASIC memory resources are limited and only a small number of NFV network element table items can be stored.

[0039] Taking the hardware unit of the converged gateway as an ASIC hardware unit and the software unit as an X86 software unit as an example, the process of the above steps 201 to 204 in a specific example can be: Figure 3 As shown, when a data packet misses the table, it is sent from the ASIC hardware unit to the x86 software unit. When the data packet (first dotted line) reaches the ASIC hardware unit, the data packet is not hit when looking up table i and the relevant table information is inserted, and it is bypassed to the exit of the ASIC hardware unit and sent to the x86 software unit for processing. After the data packet is sent to the x86 software unit, it looks up the table in the memory database, inserts the table entry into the ASIC hardware unit, and sends the data packet back to the ASIC hardware unit. The x86 software unit extracts the keyword information inside the data packet, and after searching all the table entries in the memory database of the x86 software unit, it returns to the ASIC hardware unit with the query result (solid line). At the same time, the flow table in the ASIC hardware unit is updated through the controller. The data packet returned to the ASIC hardware unit (second dotted line) skips the previous table and directly reaches the table i where it missed the last time to obtain correct forwarding.

[0040] In an optional implementation of the embodiment of the present application, the method of inserting a target field into a data packet involved in the above step 202 and forwarding the data packet with the target field inserted into it to the software unit may further include:

[0041] Step 11, determining table information corresponding to the table entry, wherein the table information includes an ID for identifying the table entry and a keyword corresponding to the table entry;

[0042] It should be noted that the table information in the embodiment of the present application includes at least an ID for identifying a table entry and a keyword corresponding to the table entry, and may also include other information as needed, such as keyword valid bits, matching type, number of keywords, etc. In a specific example, taking the ToCPUHeader message of a data packet as an example, Figure 4The ToCPUHeader message structure of the miss table information shown, wherein the fields of the table information may include table ID, number of keywords, keyword valid bits, match type, and keyword content.

[0043] Step 12, adding the ID of the entry and the keyword corresponding to the entry to the target field of the data packet;

[0044] Step 13: forward the data packet with the added target field to the software unit.

[0045] Based on the above Figure 4 , for the above steps 11 to 13, in the specific example, each preset flow table in the ASIC hardware unit is assigned a table ID, and the X86 software unit can identify the table that the data packet does not hit through the table ID. If the field has 6 bits in total, a maximum of 64 tables can be supported. The number of keywords is the number of keywords that the table needs to match. If the field has 2 bits in total, a maximum of 4 keywords can be supported. The keyword is the content of the data packet to be matched, and a maximum of 64 bits are supported; the keyword valid bit represents the valid part of the keyword; the matching types include exact match, longest prefix match, and ternary match. The encapsulated data packet is directly bypassed to the exit and sent to the x86 software unit.

[0046] In an optional implementation of the embodiment of the present application, the method of searching for table entries in the memory database based on the target field and updating the preset flow table based on the found table entries involved in the above step 203 may further include:

[0047] Step 21, parse the ID and keywords in the target field from the data packet;

[0048] Step 22: search for a corresponding table entry in the memory database based on the ID and the keyword, and generate a command for updating the flow table based on the table entry;

[0049] Step 23: Update the entry into the preset flow table of the hardware unit based on the command.

[0050] For the above steps 21 to 23, in a specific example, combined with the above Figure 4 , take the ToCPUHeader message of the data packet as an example, Figure 5 The x86 software unit processing flow shown in the figure, after parsing the ToCPUHeader, the x86 software unit extracts the table ID from the data packet to determine which table needs to be matched, and extracts the number of keywords to determine the keyword information to be extracted later. For each keyword, the keyword valid bit, matching type and keyword content are extracted. After confirming all the information, the corresponding table in the memory database is queried for the "parameters for generating update flow table commands" corresponding to the keyword. There are two types of search results:

[0051] 1) Hit, the x86 software unit matches the keyword in the full table and obtains the corresponding "parameters for generating downstream table commands". At this time, the table lookup result = 1, and the downstream table command is generated. The table entry is added to the stage of the ASIC hardware unit through the controller. In this process, in order to avoid the subsequent traffic mismatch caused by updating the flow table, the relevant table entries are added to the stage together.

[0052] 2) Missed, the x86 software unit looks up the table in the full table but still misses, and the table lookup result = 0.

[0053] In an optional implementation of the present application, the method of sending the data packet to the hardware unit involved in the above step 204 may further include:

[0054] Step 31, re-encapsulate the data packet, wherein the header field of the re-encapsulated data packet includes an ID and a table lookup result; the table lookup result is used to represent the result of searching for a table item in the memory database based on the target field;

[0055] Step 32, sending the repackaged data packet to the hardware unit.

[0056] For the above steps 31 and 32, in a specific example, the x86 software unit re-encapsulates the data packet after obtaining the table lookup result, such as Figure 6 As shown, the header fields of the data packet include: table ID, table lookup result, and Bos; among them, the table ID is used to uniquely mark the table, which is used in the ASIC hardware unit to directly reach the table that was missed last time; the table lookup result has two states, 1 and 0, occupying 1 bit; Bos is a reserved field.

[0057] In an optional implementation of the embodiment of the present application, the method of forwarding the data packet based on the entry in the preset flow table involved in the above step 204 may further include:

[0058] Step 41, parsing the repackaged data packet to obtain the ID of the table entry and the table lookup result;

[0059] Step 42: when the table lookup result indicates that a table entry corresponding to the ID is found in the memory database, a corresponding table entry is searched from a preset flow table based on the ID, and the data packet is forwarded based on the table entry.

[0060] It can be seen that in the embodiment of the present application, after the entry for forwarding the data packet is not found in the hardware unit, the data packet will be sent to obtain the entry, and the entry will be updated to the hardware unit. After the data packet is sent to the hardware unit again, it can be forwarded based on the entry.

[0061] In an optional implementation manner of an embodiment of the present application, when the preset flow table includes multiple flow tables, the method of searching the preset flow table for whether there is an entry for forwarding a data packet involved in step 201 above may further be:

[0062] Step 51, searching in a first flow table in a preset flow table whether there is an entry for forwarding a data packet; wherein the first flow table is any flow table among a plurality of flow tables;

[0063] Step 52, when there is no table entry for forwarding the data packet in the first flow table, extracting a keyword corresponding to the table entry from the data packet, wherein the table entry includes an ID for identifying the table entry;

[0064] Step 53, performing hash function calculation based on the keyword, and comparing the calculation result with the preset result to determine the second flow table, wherein the second flow table is the next flow table after the data packet is searched in the first flow table.

[0065] It can be seen that in the embodiment of the present application, when there are multiple flow tables in the hardware unit, the table lookup result of the previous table is required to guide the position of the next table to be matched when looking up the table. Since the data packet may not hit the previous table, the continuous table lookup mechanism will cause the data packet to not know the position of the next table after missing. In this regard, in the embodiment of the present application, the correct next table can be determined after performing a hash function calculation based on the keyword. Specifically, for the above step 53, performing a hash function calculation based on the keyword and comparing the calculation result with the preset result to determine the second flow table includes:

[0066] Step 61, performing a hash function calculation of the target quantity based on the keyword to obtain a calculation result, wherein the target quantity is the product of f and h, and each ID corresponds to a flag bit consisting of f bits;

[0067] Step 62, compare the calculated result with the preset result to determine the second flow table, wherein the preset result includes the result after the first result and the second result are ORed together, the first result is the result of h hash functions calculated at a flag bit of 1 after the current keyword is input into the target number of hash functions for calculation, and the second result is the result of h hash functions calculated at a flag bit of 1 after the previous keyword is input into the target number of hash functions for calculation.

[0068] For the above steps 61 and 62, in a specific example, all known keyword generation data structures are placed in the ASIC hardware unit, and each keyword has a corresponding table ID, and each next table ID corresponds to a flag consisting of f bits. The flag can be obtained by mapping the table ID, that is, flag = code (table ID). When generating the data structure, each keyword is sequentially input into the HF set (f*h hash function set), and the h hash functions at the state "1" in the corresponding flag are calculated, and the result is "or" operated with the result obtained last time as the latest result, and the final result is stored in the ASIC. It can be seen that when the data packet enters the ASIC hardware unit and a table lookup miss occurs, the position of the next table cannot be obtained. At this time, the next table ID can be obtained through the pre-generated data structure. Then extract the keyword of the data packet, and calculate this keyword for all f*h hash functions, compare the calculation result with the pre-generated data structure, if the h hash function results under a certain flag are h&&r=h, then the flag state is set to 1, and finally the flag is decoded to obtain the ID of the next table.

[0069] The present application is illustrated below in conjunction with a specific implementation of an embodiment of the present application. The specific implementation provides a method for extending an NFV network element table item based on a hyper-converged gateway, wherein the hyper-converged gateway includes: an x86 software unit and an ASIC hardware unit.

[0070] In this specific implementation, incremental control logic is added to the NF written by the original P4, so that it can realize the expansion of network element table entries, parse the packet header in the ASIC hardware unit, and distinguish the service data packet and the data packet returned from the x86 software unit according to the Ethernet type. The following rules are added in the matching-forwarding stage: if the service data packet does not hit, the miss table information is added to the data packet header, bypassed to the ASIC hardware unit exit, and forwarded to the x86 software unit; the data packet returned from the x86 software unit is directly bypassed to the table that missed the last time.

[0071] The x86 software unit consists of a memory database, a controller, and an agent. The controller is connected to the ASIC hardware unit and can update the flow table for the ASIC hardware unit through commands; the non-hotspot table items in the NF network element are stored in the memory database, and the storage format is "keyword-generate parameter for updating the flow table command"; the x86 software unit receives the data packet from the ASIC hardware unit, parses the keyword from the data packet, and looks up the table in the memory database according to the keyword, generates an update flow table command according to the obtained "generate parameter for updating the flow table command", and updates the flow table to the ASIC hardware unit through the controller. Based on the x86 software unit and the ASIC hardware unit, the specific implementation method provides an NFV network element table item expansion method based on a hyper-converged gateway, such as Figure 3shown.

[0072] Furthermore, the bypass method in this specific implementation includes: 1) After the data packet does not match the table, skip all subsequent tables and go directly to the output port. 2) After the data packet is sent back by the x86 software unit, skip all previous tables and go directly to the table that did not hit last time. This bypass method can avoid errors caused by out-of-order execution of the table. For example, the action of the subsequent table modifies the data packet field, which happens to be the keyword or action parameter matched by the previous table. In this case, the out-of-order execution table will cause a fault. Specifically, Figure 7 As shown, for the data packet entering the ASIC hardware unit, the ASIC hardware unit parses the Ethernet header field content. If it is a business data packet, it directly looks up the table according to the original P4 process, that is, the hardware unit looks up the table items from the corresponding table in turn. If it does not hit in Table 1, it adds the table information and the table lookup result and then sends it to the CPU. If it hits, it executes the corresponding action and continues to look up Table 2, which is similar to the processing method of Table 1. If the data packet is a data packet containing "table lookup result" information, the table ID and table lookup result are parsed from it. If the table ID is inconsistent with this table, it means that this table has been matched and it should jump to the next table. If the table ID is consistent with this table, different operations are performed according to the table lookup result: if the result is 0, it means that the full table of the x86 software unit still does not hit, and the default action of the table in the original P4 is executed at this time; if the result is 1, it means that it hits in the full table, and the data packet is matched again in the ASIC hardware unit.

[0073] In the above-mentioned NFV network element table expansion method based on hyper-converged gateway in this specific implementation, if the scale of a large number of tables in NF exceeds the carrying range of the stage, it will cause the data packets to frequently loop back between the ASIC hardware unit and the x86 software unit, thereby generating a large amount of delay and bandwidth penalties. Therefore, in this specific implementation, multiple tables can be queried together in one round trip, such as Figure 8 As shown, after the data packet (first dotted line) misses in table i, it will not be sent to the x86 software unit immediately, but will continue to look up the table backwards, collect all the table information on the way, and then send it up after reaching the exit. At this time, the data packet contains multiple missed table information. After the data packet (solid line) parallelly looks up the table in the memory database on the x86 software unit, it returns to the ASIC hardware unit. The ASIC parses the table ID in the data packet (second dotted line) and bypasses to the position of the last missed table in turn. Finally, the data packet completes all matching-forwarding processing.

[0074] Through the continuous table lookup optimization strategy in this specific implementation: On the one hand, the latency is reduced. For the ASIC hardware unit, it only needs to pass through the ASIC hardware unit twice, so the processing latency will be reduced. For the x86 software unit, multiple tables can be sent at a time for parallel table lookup, which greatly reduces the table lookup latency. In addition, the number of times the x86 software unit is uploaded is reduced, and the round-trip transmission latency of the data packet will also be reduced. On the other hand, the bandwidth occupancy is reduced. Although a single packet becomes larger, the number of transmissions is greatly reduced, so the bandwidth occupancy of the link between the ASIC hardware unit and the x86 software unit is lower.

[0075] In the above Figure 3 In the message format design, ToCPUHeader only includes the information of one table. If it needs to be expanded to accommodate the information of multiple tables, in order to enable the x86 software unit to correctly identify which bytes are the information of the table, such as Fig. 9 As shown, the number of missed tables is added to the packet header, and the x86 software unit extracts all table information according to the number of tables and performs table lookup in parallel and encapsulates the table lookup result information into the data packet, and sets the Bos field to help the ASIC hardware unit cyclically parse the table lookup result.

[0076] For packets returned from the x86 software unit, the table lookup result information in the fromCPUheader will also extend to multiple tables. Therefore, in order to allow the ASIC hardware unit to recognize information from multiple tables, the Fig.10 The bos field in the packet is marked: if bos is 1, the next byte is table information; if bos is 0, the following bytes are IP datagrams. This method parses an unknown amount of table information into the packet header stack, which is used as the basis for table bypass.

[0077] In addition, if there are multiple flow tables in the current hardware unit, the data packet is processed continuously in the form of a pipeline between the tables of the ASIC hardware unit, and a pipeline branch may occur, requiring the lookup result of the previous table to guide the location of the next table to be matched. Since the data packet may not hit the previous table, the continuous table lookup mechanism will cause the data packet to not know the location of the next table after a miss, so the pipeline processing cannot be completed. In this regard, in the specific implementation, the correct next table can be selected for the data packet based on the keyword, so the use of this data structure can realize the relational storage of the keyword and the corresponding target table with lower memory overhead.

[0078] That is, each table in the pipeline is allocated f flag bits (1-bit registers) for storing flags, the value of f is determined by the number of branches, and each flag bit has two states: 0 and 1. The present invention configures h hash functions for each flag bit as a basis for determining the state of the flag bit. The present invention describes in detail how to obtain the corresponding relationship between the keyword and the next table ID through this data structure.

[0079] First, a data structure is generated using all known keywords and placed in the ASIC hardware unit. Each keyword has a corresponding table ID, and each next table ID corresponds to a flag consisting of f bits. The flag can be mapped from the table ID: flag = code (table ID). When generating the data structure, each keyword is input into the HF set in turn, and the h hash functions at the corresponding flag state of "1" are calculated, and the result is "OR"ed with the last result as the latest result, and the final result is stored in the ASIC.

[0080] Secondly, when a data packet enters the ASIC hardware unit and a table lookup miss occurs, the location of the next table cannot be obtained. At this time, the ID of the next table can be obtained through the pre-generated data structure. Then the keyword of the data packet is extracted, and this keyword is used to calculate all f*h hash functions, and the calculation results are compared with the pre-generated data structure. If the h hash function results under a certain flag bit are h&&r=h, the flag bit state is set to 1, and finally the flag is decoded into the ID of the next table.

[0081] In the embodiment of the present application, the next table ID and the value in the register are not obtained by simple base conversion, which is to distinguish whether there is a false positive in the calculation result. If a false positive occurs and the system cannot distinguish the result, it is very serious and may cause a large number of business flow packet losses. Therefore, in the embodiment of the present application, the false positive is distinguished by fixing the number of 1s in the f flag bits. That is, the next table ID and the flag bits in the register correspond one to one. For example, in the embodiment of the present application, the number of 1s of the 5 flag bits can be fixed to 2, which can represent 10 table IDs, which is much less than the 32 IDs that can be represented by base conversion, that is, at the cost of this, the ability to distinguish false positives is brought to ASIC.

[0082] After calculating all the flags, if the number of "1" is less than 2, it can be determined that the keyword does not exist in the full table, is an unknown keyword, cannot match any table entry, and directly executes the default action; if the number of "1" is > 2, it can be considered that a false positive occurred when calculating the keyword. At this time, the system will end the continuous table lookup and send the table information that was previously missed to the x86 software unit; if the number of "1" = 2, there are two possibilities: 1) It is a keyword in the full table and no false positive occurs in the calculation. At this time, the system finds the correct next table ID and directly jumps to the corresponding table for table lookup; 2) It is not a keyword in the full table, but because of the false positive, the number of "1" calculated is just 2. At this time, the system will look up the corresponding table. After a miss, the x86 software unit will look up the table again and miss it, and it will be judged that it is not a keyword in the full table. In this way, the ASIC hardware unit in the embodiment of the present application can judge a false positive and terminate the continuous table lookup.

[0083] See also Fig.11 , Fig.11 1 is a structural diagram of a data packet forwarding device based on a fusion gateway provided in an embodiment of the present application. The fusion gateway includes a hardware unit and a software unit. The preset flow table of the hardware unit stores hotspot table items corresponding to the gateway function virtualization NFV network element, and the memory database of the software unit stores non-hotspot table items corresponding to the NFV network element, such as Fig.11 As shown, the device comprises:

[0084] A search module 1102 is used to search in a preset flow table whether there is an entry for forwarding the data packet after the hardware unit obtains the data packet;

[0085] The first processing module 1104 is used to insert a target field into a data packet when there is no entry in the preset flow table, and forward the data packet with the inserted target field to the software unit; wherein the target field is used to represent table information corresponding to the entry;

[0086] The second processing module 1106 is used to search for a table entry in the memory database based on the target field, and update the preset flow table based on the found table entry;

[0087] The third processing module 1108 is used to send the data packet to the hardware unit and forward the data packet based on the table entry in the preset flow table.

[0088] Optionally, the first processing module 1104 of the embodiment of the present application may further include: a determination unit, used to determine the table information corresponding to the table entry, wherein the table information includes an ID for identifying the table entry and a keyword corresponding to the table entry; an adding unit, used to add the ID of the table entry and the keyword corresponding to the table entry to the target field of the data packet; and a forwarding unit, used to forward the data packet with the added target field to the software unit.

[0089] Optionally, the second processing module 1106 of the embodiment of the present application may further include: a first parsing unit, used to parse the ID and keywords in the target field from the data packet; a first processing unit, used to search for corresponding table entries in the memory database based on the ID and keywords, and generate commands for updating the flow table based on the table entries; an update unit, used to update the table entries to the preset flow table of the hardware unit based on the commands.

[0090] Optionally, the third processing module 1108 of the embodiment of the present application may further include: an encapsulation unit, used to re-encapsulate the data packet, wherein the header field of the re-encapsulated data packet includes an ID and a table lookup result; the table lookup result is used to characterize the result of searching the table item in the memory database based on the target field; and a sending unit, used to send the re-encapsulated data packet to the hardware unit.

[0091] Optionally, the third processing module 1108 of the embodiment of the present application may further include: a second parsing unit, used to parse the re-encapsulated data packet to obtain the ID of the table item and the table lookup result; a second processing unit, used to search for the corresponding table item from the preset flow table based on the ID when the table lookup result represents that a table item corresponding to the ID is found in the memory database, and forward the data packet based on the table item.

[0092] Optionally, in the case where the preset flow table includes multiple flow tables, the search module 1102 of the embodiment of the present application may further include: a search unit, used to search whether there is a table entry for forwarding data packets in the first flow table among the preset flow tables; wherein the first flow table is any flow table among the multiple flow tables; an extraction unit, used to extract a keyword corresponding to the table entry from the data packet when there is no table entry for forwarding data packets in the first flow table, wherein the table entry includes an ID for identifying the table entry; a third processing unit, used to perform hash function calculation based on the keyword, and compare the calculation result with the preset result to determine the second flow table, wherein the second flow table is the next flow table for the data packet after the first flow table is searched.

[0093] Optionally, the third processing unit of the embodiment of the present application includes: a calculation subunit, used to perform a target number of hash function calculations based on the keyword to obtain a calculation result, wherein the target number is the product of f and h, and each ID corresponds to a flag bit consisting of f bits; a comparison subunit, used to compare the calculation result with a preset result to determine a second flow table, wherein the preset result includes a result after an OR operation is performed on the first result and the second result, the first result is the result of h hash functions calculated at the flag bit being 1 after the current keyword is input into the hash function calculation of the target number, and the second result is the result of h hash functions calculated at the flag bit being 1 after the previous keyword is input into the hash function calculation of the target number.

[0094] It should be noted that the terminal provided in the embodiment of the present application is capable of executing the above Figure 2 For the device of the data packet forwarding method based on the fusion gateway in the implementation manner, all implementation methods in the above-mentioned embodiment of the data packet forwarding method based on the fusion gateway are applicable to the terminal, and can achieve the same or similar beneficial effects.

[0095] For details, see Fig.12 As shown, an embodiment of the present application further provides an electronic device, including a bus 1201 , a transceiver 1202 , an antenna 1203 , a bus interface 1204 , a processor 1205 and a memory 1206 .

[0096] The processor 1205 is configured to search a preset flow table for an entry for forwarding the data packet after the hardware unit obtains the data packet, and insert a target field into the data packet if no entry exists in the preset flow table;

[0097] The transceiver 1202 is used to forward the data packet inserted into the target field to the software unit; wherein the target field is used to represent the table information corresponding to the table entry;

[0098] The processor 1205 is further configured to search for a table entry in the memory database based on the target field, and update the preset flow table based on the searched table entry;

[0099] The transceiver 1202 is further configured to send data packets to the hardware unit and forward the data packets based on the entries in the preset flow table.

[0100] exist Fig.12 In the embodiment, the bus architecture (represented by bus 1201) may include any number of interconnected buses and bridges, and bus 1201 links various circuits including one or more processors represented by processor 1205 and memory represented by memory 1206. Bus 1201 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1204 provides an interface between bus 1201 and transceiver 1202. Transceiver 1202 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 1205 is transmitted on a wireless medium via antenna 1203, and further, antenna 1203 also receives data and transmits the data to processor 1205.

[0101] The processor 1205 is responsible for managing the bus 1201 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 1206 can be used to store data used by the processor 1205 when performing operations.

[0102] Optionally, the processor 1205 may be a CPU, an ASIC, an FPGA or a CPLD.

[0103] It should be noted that the electronic device provided in the embodiment of the present application is capable of performing the above Figure 2 For the device of the data packet forwarding method based on the fusion gateway in the implementation manner, all implementation methods in the above-mentioned embodiment of the data packet forwarding method based on the fusion gateway are applicable to the electronic device, and can achieve the same or similar beneficial effects.

[0104] The embodiment of the present application also provides a communication device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program is executed by the processor to implement the above Figure 2 The various processes of the embodiment of the data packet forwarding method based on the fusion gateway are shown, and can achieve the same technical effect. To avoid repetition, they will not be described here.

[0105] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the embodiment of the packet forwarding method based on the fusion gateway shown in 2 above is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0106] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0108] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A data packet forwarding method based on a fusion gateway, characterized in that: The converged gateway includes a hardware unit and a software unit, a preset flow table of the hardware unit stores hotspot entries corresponding to a gateway function virtualization NFV network element, and a memory database of the software unit stores non-hotspot entries corresponding to the NFV network element, and the method includes: After the hardware unit obtains the data packet, searching in the preset flow table whether there is an entry for forwarding the data packet; In the case where the entry does not exist in the preset flow table, inserting a target field into the data packet, and forwarding the data packet into which the target field is inserted to the software unit; wherein the target field is used to represent the table information corresponding to the entry; Searching for the entry in the memory database based on the target field, and updating the preset flow table based on the found entry; The data packet is sent to the hardware unit, and the data packet is forwarded based on the entry in the preset flow table.

2. The method according to claim 1, characterized in that The inserting a target field into the data packet and forwarding the data packet with the target field inserted into it to the software unit comprises: Determining table information corresponding to the table entry, wherein the table information includes an ID for identifying the table entry and a keyword corresponding to the table entry; Adding the ID of the entry and the keyword corresponding to the entry to the target field of the data packet; The data packet with the destination field added is forwarded to the software unit.

3. The method according to claim 2, characterized in that Searching for the entry in the memory database based on the target field, and updating the preset flow table based on the found entry includes: Parsing the ID and the keyword in the target field from the data packet; Searching for the corresponding table entry in the memory database based on the ID and the keyword, and generating a command for updating the flow table based on the table entry; The entry is updated into the preset flow table of the hardware unit based on the command.

4. The method according to claim 3, characterized in that Sending the data packet to the hardware unit includes: Re-encapsulating the data packet, wherein the header field of the re-encapsulated data packet includes the ID and a table lookup result; the table lookup result is used to represent the result of searching the table entry in the memory database based on the target field; The re-encapsulated data packet is sent to the hardware unit.

5. The method according to claim 4, characterized in that Forwarding the data packet based on the entry in the preset flow table includes: Parsing the repackaged data packet to obtain the ID of the table entry and the table lookup result; In the case where the table lookup result indicates that a table entry corresponding to the ID is found in the memory database, the corresponding table entry is searched from the preset flow table based on the ID, and the data packet is forwarded based on the table entry.

6. The method according to claim 1, characterized in that In the case where the preset flow table includes a plurality of flow tables, searching in the preset flow table whether there is an entry for forwarding the data packet includes: Searching in the first flow table of the preset flow table whether there is an entry for forwarding the data packet; wherein the first flow table is any flow table of the multiple flow tables; If there is no table entry for forwarding the data packet in the first flow table, extracting a keyword corresponding to the table entry from the data packet, wherein the table entry includes an ID for identifying the table entry; A hash function calculation is performed based on the keyword, and a calculation result is compared with a preset result to determine a second flow table, wherein the second flow table is the next flow table after the data packet is searched in the first flow table.

7. The method according to claim 6, characterized in that Performing hash function calculation based on the keyword and comparing the calculation result with the preset result to determine the second flow table includes: Performing a hash function calculation of a target number based on the keyword to obtain the calculation result, wherein the target number is a product of f and h, and each of the IDs corresponds to a flag bit consisting of the f bits; The calculation result is compared with the preset result to determine the second flow table, wherein the preset result includes the result of an OR operation on the first result and the second result, the first result being the result of the h hash functions being calculated when the flag bit is 1 after the current keyword is input into the target number of hash functions for calculation, and the second result being the result of the h hash functions being calculated when the flag bit is 1 after the previous keyword is input into the target number of hash functions for calculation.

8. A data packet forwarding device based on a fusion gateway, characterized in that: The converged gateway includes a hardware unit and a software unit, wherein a preset flow table of the hardware unit stores hotspot entries corresponding to a gateway function virtualization NFV network element, and a memory database of the software unit stores non-hotspot entries corresponding to the NFV network element, and the device includes: A search module, used for searching in the preset flow table whether there is an entry for forwarding the data packet after the hardware unit obtains the data packet; A first processing module, configured to insert a target field into the data packet when the table entry does not exist in the preset flow table, and forward the data packet into which the target field is inserted to the software unit; wherein the target field is used to represent table information corresponding to the table entry; A second processing module, configured to search the table entry in the memory database based on the target field, and update the preset flow table based on the found table entry; The third processing module is used to send the data packet to the hardware unit and forward the data packet based on the table entry in the preset flow table.

9. A communication device, characterized in that: Including transceiver and processor, The processor is used for searching whether there is an entry for forwarding the data packet in a preset flow table after the hardware unit obtains the data packet, and inserting a target field into the data packet if the entry does not exist in the preset flow table; The transceiver is used to forward the data packet inserted into the target field to the software unit; wherein the target field is used to represent the table information corresponding to the table entry; The processor is further configured to search for the table entry in the memory database based on the target field, and update the preset flow table based on the found table entry; The transceiver is further configured to send the data packet to the hardware unit and forward the data packet based on the entry in the preset flow table.

10. A communication device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the data packet forwarding method based on a converged gateway are implemented as described in any one of claims 1 to 7.

11. A readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data packet forwarding method based on a converged gateway as described in any one of claims 1 to 7 are implemented.