A flow table unloading method, device and cluster

By determining the storage method based on the length of the flow table entry and storing it in matching some table entry or full table entry, the problem of limited storage of flow table entry in the prior art is solved, and the high-performance service forwarding requirements are met.

CN119316387BActive Publication Date: 2025-02-25ZHUHAI XINGYUN ZHILIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411844758.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-02-25
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The existing OVS native stream table unloading method directly unloads the stream table to the offload hardware cache, resulting in very limited data storage of flow table entries and cannot meet the high-performance service forwarding needs.

Method used

By receiving flow table entries and deciding whether to store them in matching partial table entries or matching full table entries based on their length, we can optimize the storage method of flow tables and improve the storage specifications of offloaded hardware.

Benefits of technology

Through this method, the storage capacity of the flow table can be effectively improved, the high-performance service forwarding needs can be met, and the processing capabilities of the data center can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316387B_ABST
    Figure CN119316387B_ABST
Patent Text Reader

Abstract

The present application provides a flow table unloading method, device and cluster. The method includes: receiving a first flow table item, the first flow table item includes a first matching item and a first action item; determining whether to store the first matching item in a matching partial table item or a matching full table item of a first matching flow table according to the length of the first matching item, the first matching flow table is divided into a plurality of matching partial table items, the matching full table item includes N consecutive matching partial table items, N is an integer greater than 1; in the case of determining to store in the matching partial table item, selecting one of the matching partial table items from the first matching flow table as the first matching partial table item and unloading the first matching item to the first matching partial table item; in the case of determining to store in the matching full table item, selecting N consecutive matching partial table items from the first matching flow table as the first matching full table item and unloading the first matching item to the first matching full table item.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communications, and in particular to a flow table unloading method, device, and cluster. Background Art

[0002] With the development of cloud computing networks, its extensive business needs have led to the rapid growth of data centers and a sharp increase in data traffic. The limitations of data forwarding through virtual switches have become increasingly prominent, and it is increasingly unable to meet the growing business needs. In order to meet the needs of high-performance business forwarding, a dedicated forwarding chip is required to carry data forwarding services. It is imperative to offload data forwarding to offload hardware using virtual switches / virtual switches (OVS) + data plane development kit (DPDK).

[0003] Since OVS native flow table offload directly offloads the flow table to the offload hardware (e.g., read-only memory) cache, the data that the offload hardware can cache for flow table entries is very limited. Summary of the invention

[0004] The present application provides a flow table unloading method, device and cluster, which can prompt the storage specifications of the unloading hardware.

[0005] In a first aspect, a flow table unloading method is provided, comprising:

[0006] Receiving a first flow table entry, wherein the first flow table entry includes a first matching item and a first action item;

[0007] Determining whether to store the first matching item in a matching partial table item or a matching full table item of a first matching flow table according to the length of the first matching item, wherein the first matching flow table is divided into a plurality of matching partial table items, and the matching full table item includes N consecutive matching partial table items, where N is an integer greater than 1;

[0008] In the case of determining that the data is stored in the matching part table entry, selecting one of the matching part table entries from the first matching flow table as the first matching part table entry and unloading the first matching item to the first matching part table entry;

[0009] In the case of determining to store in the matching full table entry, N consecutive matching partial table entries are selected from the first matching flow table as the first matching full table entry and the first matching item is unloaded into the first matching full table entry.

[0010] In some possible designs, the first matching partial entry is a first matching half entry, and the length of the first matching full entry is twice the length of the first matching half entry.

[0011] Selecting one of the matching partial table entries from the matching flow table as a first matching partial table entry and unloading the first matching item to the first matching partial table entry comprises: selecting one of the matching half-table entries whose matching index number is an odd number or an even number from the matching flow table as a first matching half-table entry and unloading the first matching item to the first matching half-table entry;

[0012] Selecting multiple consecutive matching partial table items from the matching flow table as the first matching full table item and unloading the first matching item to the first matching full table item includes: selecting N consecutive matching half-table items whose matching index number of the first matching half-table item is an even number from the matching flow table as the first matching full table item and unloading the first matching item to the first matching full table item.

[0013] In some possible designs, the method further includes:

[0014] Receiving a second flow table entry, wherein the second flow table entry includes a second matching item and a second action item;

[0015] Determining whether to store the second matching item in a matching partial table item or a matching full table item of a second matching flow table according to the length of the second matching item, wherein the second matching flow table is divided into a plurality of matching partial table items;

[0016] In the case of determining that the data is stored in the matching part table entry, selecting one of the matching part table entries from the second matching flow table as the second matching part table entry and unloading the second matching item to the second matching part table entry;

[0017] In the case of determining that the items are stored in the matching full table item, selecting N consecutive matching partial table items from the second matching flow table as second matching full table items and unloading the second matching items to the second matching full table items;

[0018] The first matching flow table and the second matching flow table share a storage space. When the first matching flow table is idle and the second matching flow table is busy, the second matching flow table can occupy the space of the first matching flow table. When the first matching flow table is busy and the second matching flow table is idle, the first matching flow table can occupy the space of the second matching flow table.

[0019] In the case where the first matching flow table is a matching flow table of a data link layer, the second matching flow table is a matching flow table of a tunnel layer;

[0020] In the case where the first matching flow table is a matching flow table of a network layer, the second matching flow table is a matching flow table of a transport layer.

[0021] In some possible designs, the method further includes:

[0022] Determine whether to store the first action item in an action partial table item or an action full table item in an action flow table according to the length of the first action item, wherein the action flow table is divided into a plurality of action partial table items, the action full table item includes M consecutive action partial table items, and M is an integer greater than 1;

[0023] In the case of determining that the action part table entry is stored, selecting one of the action part table entries from the action flow table as a first action part table entry and unloading the first action item to the first action part table entry;

[0024] In the case of determining that the action is stored in the full action entry, a plurality of continuous partial action entries are selected from the action flow table as the first full action entry and the first action entry is unloaded into the first full action entry.

[0025] In some possible designs, the first action partial entry is a first action half entry, and the length of the first action full entry is twice the length of the first action half entry.

[0026] In the case of determining that the action is stored in the action semi-table entry, selecting one of the action partial table entries with an odd action index number or an even action index number from the action flow table as the first action semi-table entry and unloading the first action entry to the first action semi-table entry;

[0027] When it is determined that the first action item is stored in the full action item, N consecutive action half-items whose action index numbers are even numbers of the first action half-item are selected from the action flow table and the first action item is unloaded into the first full action item.

[0028] In some possible designs, when the first action item is unloaded to the first action semi-table item,

[0029] Unloading the first matching item to the first matching partial table entry includes: associating and storing the first matching item and the action index number of the first action semi-table entry in the first matching partial table entry;

[0030] Unloading the first matching item to the first matching full entry includes: associating and storing the first matching item and the action index number of the first action half entry in the first matching full entry.

[0031] In some possible designs, associating and storing the first matching item and the action index number of the first action semi-item in the first matching partial table item includes: associating and storing a first identifier, the first matching item, and the action index number of the first action semi-item in the first matching partial table item, wherein the first identifier is used to indicate whether to store in the matching partial table item or in the matching full table item, and the value of the first identifier is a first value;

[0032] Storing the action index number of the first matching item and the first action half-item in the first matching full table item associatively includes: storing the first identifier, the first matching item and the action index number of the first action half-item in the first matching partial table item associatively, wherein the value of the first identifier is the second value.

[0033] In some possible designs, when the first action item is unloaded to the first action full table item,

[0034] Unloading the first matching item to the first matching partial table item includes: associating and storing the first matching item and the action index number of the first action half-item in the first action full table item in the first matching partial table item;

[0035] Unloading the first matching item to the first matching full entry includes: associating and storing the first matching item and the action index number of the first action half-entry in the first action full entry in the first matching full entry.

[0036] In a second aspect, a computing device is provided, including a processor, offloading hardware and a network card, wherein the processor can communicate with the offloading hardware and the network card respectively, and the processor is used to execute the method described in any one of the first aspects.

[0037] In a third aspect, a computing device cluster is provided, comprising a plurality of computing devices, at least one computing device comprising a processor, offloading hardware and a network card, the processor being capable of communicating with the offloading hardware and the network card respectively, and the processor being used to execute a method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

[0039] Figure 1 It is a structural diagram of a software-defined network (SDN) provided by the present application;

[0040] Figure 2 It is a structural schematic diagram of a flow table unloading system provided by this application;

[0041] Figure 3 This is a schematic diagram of the structure of a matching flow table provided by this application;

[0042] Figure 4 It is a structural diagram of an action flow table provided by this application;

[0043] Figure 5 It is a flowchart of a flow table unloading method provided by this application;

[0044] Figure 6 It is a structural schematic diagram of a computing device provided by this application. DETAILED DESCRIPTION

[0045] The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention. The terms used in the implementation mode of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.

[0046] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of an SDN provided by this application. Figure 1 As shown, the software defined network of the present application includes: an SDN controller 110 and an open virtual switch (open vSwitch, OVS) 120.

[0047] The SDN controller 110 is a core component in the SDN architecture, which is responsible for the centralized management and control of the entire network. The SDN controller separates the control plane of the network from the data plane, thereby providing a more flexible, programmable and scalable network management method. The main functions of the SDN controller include: managing the control plane of the entire network, including topology discovery, route calculation, flow table delivery, etc. Specifically, the SDN controller 110 collects the topology information of the network by communicating with OVS120, calculates the route according to the application requirements, and then delivers the flow table to OVS120. Secondly, the SDN controller 110 can dynamically adjust the network routing and traffic distribution according to the characteristics and requirements of the traffic, thereby achieving load balancing, congestion control and service quality assurance of the traffic; it can implement security measures such as access control, traffic filtering and intrusion detection, and respond to network security events in a timely manner to protect the network from malicious attacks and data leakage threats, etc. The SDN controller 110 can be a physical device or a virtual device. When the number of SDN controllers 110 is multiple, physical devices and virtual devices can also be used in combination. The SDN controller 110 can run in physical servers, virtual machines, containers, cloud platforms, and bare metal servers.

[0048] OVS120 is an open source virtual switch software that implements a flexible, programmable and scalable switch platform for communicating with the SDN controller through the OpenFlow protocol, receiving the flow table issued by the SDN controller 110, and implementing traffic forwarding and routing according to the flow table. OVS120 supports packet switching and routing in Layer 2 and Layer 3 networks, so OVS120 supports the processing of Ethernet data frames and data packets, etc. OVS120 can run on physical servers, virtual machines, containers, cloud platforms, and bare metal servers. OVS120 can also be used in combination with physical switches, etc.

[0049] The SDN controller 110 and OVS120 can both be set in a container. In this case, the SDN controller 110 and OVS120 can be concentrated in the same container or distributed in different containers. The SDN controller 110 and OVS120 can both be set in a virtual machine. In this case, the SDN controller 110 and OVS120 can be concentrated in the same virtual machine or distributed in different virtual machines. The SDN controller 110 and OVS120 can both be set in a server. In this case, the SDN controller 110 and OVS120 can be concentrated in the same server or distributed in different servers. The SDN controller 110 and OVS120 can both be set in a bare metal server. In this case, the SDN controller 110 and OVS120 can be concentrated in the same bare metal server or distributed in different bare metal servers. Alternatively, the SDN controller 110 is set in a container, and OVS120 is set in any one of a virtual machine, a server, and a bare metal server. The SDN controller 110 is set in the virtual machine, and the OVS 120 is set in any one of the container, the server, and the bare metal server. The SDN controller 110 is set in the server, and the OVS 120 is set in any one of the container, the virtual machine, and the bare metal server. The SDN controller 110 is set in the bare metal server, and the OVS 120 is set in any one of the container, the virtual machine, and the server.

[0050] The following will describe the process of transmitting a data packet from a source IP address to a destination IP address in conjunction with a specific embodiment. First, the user can perform routing calculations on the SDN controller 110 based on the source IP address, the destination IP address, and the network topology of the SDN to obtain a suitable forwarding path, and generate a flow table entry based on the forwarding path. Then, the SDN controller sends the flow table entry to the relevant OVS120. When a data packet arrives at OVS120, OVS120 checks its header information and matches it with the matching items in the flow table entry. If the header information of the data packet can match the matching items, OVS120 will forward the data packet according to the forwarding items of the flow table entry.

[0051] The above OVS120 is usually virtualized using computing resources (e.g., processor), storage resources, and network resources (e.g., network card) of computing devices, and in order to improve the forwarding performance of OVS120, it is often necessary to set up offloading hardware for acceleration. Therefore, the processor, offloading hardware, and network card can be combined into a flow table offloading system.

[0052] See also Figure 2 , Figure 2 Schematic diagram of a flow table unloading system provided by this application. Figure 2 As shown, the flow table offloading system application of the present application includes a processor 11 , offloading hardware 12 , and a network card 13 .

[0053] Processor 11 is a computing core and a control core that can handle complex situations. Processor 11 can be a very large-scale integrated circuit. An operating system and other software programs are installed in processor 11, so that processor 11 can access memory and various PCIE devices. Processor 11 can quickly access memory through an on-chip bus. Processor 11 can include one or more processor cores. In one implementation, processor 11 can be a multi-core chip, that is, a chip containing multiple processing cores. In another implementation, processor 11 can include one or more processor cores. It can be a chip with one processing core. OVS and Data Plane Development Kit (DPDK) can be run in processor 11. For an introduction to OVS, see Figure 1 The relevant description in . OVS is also not efficient in reading memory. DPDK's lightweight library function uses a very effective memory processing mechanism, that is, it uses a ring buffer to transmit data packets back and forth between the physical network card and the virtual switch using DPDK, thereby improving the overall performance of the system. OVS lacks optimization for the processing of high-speed data packets, which leads to the use of processors in many steps of the data packet processing process. Since the processor needs to handle multiple tasks, its availability (especially when overloaded) will have performance bottlenecks. In order to reduce the number of processor interrupts required for data packet reading, DPDK uses a periodic polling mechanism to periodically poll new data packets. If the packet rate drops to a very low value, it can be switched to interrupt mode instead of periodic polling mode. Through effective cache management, optimized minimum number of CPU interrupts and other enhanced features, DPDK can enable virtual switches to achieve near-native performance.

[0054] The offloading hardware 12 is usually used to store flow tables, etc. The offloading hardware 12 can use ternary content addressable memory (TCAM), dynamic random access memory (DRAM), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), data processing unit (DPU), etc. The offloading hardware 12 can also be other random access memories, such as static random access memory (SRAM), etc. This embodiment does not limit the number and type of offloading hardware 12. In addition, the offloading hardware 12 can be configured to have a power preservation function. The power preservation function means that when the system loses power and then powers on again, the data stored in the memory will not be lost.

[0055] The network card 13 is used to receive or send data packets. Since it has a Media Access Control Address (MAC) address, it belongs between Layer 1 and Layer 2 of the Open System Interconnection (OSI) model. It allows users to connect to each other via cables or wirelessly. Each network card has a unique 48-bit serial number called a MAC address, which is written in a ROM on the card. Here, the network card can be a Field Programmable Gate Array (FPGA) network card or an Application Specific Integrated Circuit (ASIC) network card, etc. The network card can interact with the virtual switch, that is, the network card can receive data packets from the virtual switch and can also send data packets to the virtual switch.

[0056] The offloading hardware 12 may include a matching item storage space and an action item storage space. Among them, the matching item storage space is used to store matching flow tables, and the action item storage space is used to store action flow tables. The matching item storage space can store one or more of the matching flow tables of the data link layer, the matching flow tables of the tunnel layer, the matching flow tables of the network layer, and the matching flow tables of the transport layer. When the matching item storage space stores the matching flow tables of the data link layer and the matching flow tables of the tunnel layer at the same time, the matching flow tables of the data link layer and the matching flow tables of the tunnel layer can share the storage space. When the matching item storage space stores the matching flow tables of the network layer and the matching flow tables of the transport layer at the same time, the matching flow tables of the network layer and the matching flow tables of the transport layer can share the storage space. One of the matching flow tables sharing the same storage space can use the space of other matching flow table items when it is busy and other matching flow tables are not busy. Compared with each matching flow table occupying a storage space separately, when one matching flow table is busy and other matching flow tables are not busy, the storage space of other matching flow tables cannot be occupied, which can effectively avoid the waste of storage resources.

[0057] The matching flow table is divided into multiple matching partial table entries, where N consecutive matching partial table entries form a matching full table entry. For example, the matching partial table entry is a matching half table entry, where 2 consecutive matching partial table entries form a matching full table entry. Figure 3 As shown, it is assumed that the matching flow table includes 8 matching table items, wherein the matching index number of the first matching table item is 0, the matching index number of the second matching table item is 1, ..., and the matching index number of the 8th matching table item is 7. The matching half-table item with matching index number 0 and the matching half-table item with matching index number 1 can form a matching full table item; the matching half-table item with matching index number 2 and the matching half-table item with matching index number 3 can form a matching full table item; the matching half-table item with matching index number 4 and the matching half-table item with matching index number 5 can form a matching full table item; the matching half-table item with matching index number 6 and the matching half-table item with matching index number 7 can form a matching full table item.

[0058] The action flow table is divided into multiple action partial table entries, where N consecutive action partial table entries constitute an action full table entry. For example, the action partial table entry is an action half-table entry, where 2 consecutive action partial table entries constitute an action full table entry. Figure 4As shown, it is assumed that the action flow table includes 8 action items, wherein the action index number of the first action item is 0, the action index number of the second action item is 1, ..., and the action index number of the 8th action item is 7. The action semi-item with action index number 0 and the action semi-item with action index number 1 can form a full action item; the action semi-item with action index number 2 and the action semi-item with action index number 3 can form a full action item; the action semi-item with action index number 4 and the action semi-item with action index number 5 can form a full action item; the action semi-item with action index number 6 and the action semi-item with action index number 7 can form a full action item.

[0059] See also Figure 5 , Figure 5 This is a flow chart of a flow table unloading method provided by this application. Figure 5 As shown, the flow table unloading method of the present application includes:

[0060] S101: The processor receives a first flow table entry.

[0061] The first flow table entry includes the first match item and the first action item. The first match item usually refers to the condition used to match network traffic in the flow table. It contains a set of attributes that network devices (such as switches or routers) use to identify and process data packets. Common match items include: one or more of the source Internet Protocol (IP) address, destination IP address, source port, destination port, protocol type, Media Access Control (MAC) address, and virtual local area network identifier (VLAN ID).

[0062] S102: The processor determines, according to the length of the first matching item, whether to store the first matching item in a matching partial item or a matching full item of the first matching flow table.

[0063] The first matching flow table may be any one of a matching flow table of a data link layer, a matching flow table of a tunnel layer, a matching flow table of a network layer, and a matching flow table of a transport layer. Figure 3 As shown, the first matching flow table is divided into a plurality of matching partial table entries, and the matching full table entry includes N consecutive matching partial table entries, where N is an integer greater than 1. In a specific embodiment, the first matching flow table is divided into a plurality of matching half table entries, and the matching full table entry includes 2 consecutive matching half table entries.

[0064] The processor determines whether to store the first matching item in the matching partial table item or the matching full table item of the first matching flow table according to the length of the first matching item. In a specific embodiment, the length of the matching full table item is 320 bits, and the length of the matching half table item is 160 bits. Therefore, when the length of the first matching item is less than 160 bits, the first matching item is stored in the matching half table item, and when the length of the first matching item is greater than or equal to 160 bits and less than 320 bits, the first matching item is stored in the matching full table item. The flow table is divided into layer 2 (L2, such as data link layer), layer 3 (L3, such as network layer), layer 4 (L4, such as transport layer), tunnel layer 4 (tunnel4) and other types. Among them, the length of the matching items of L2 and L3 is relatively short, and most of them use matching half table items. The length of the matching items of L4 and tunnel4 is relatively long, and most of them use matching full table items.

[0065] If it is determined that the data is stored in the matching partial table entry, the process goes to step S103 ; if it is determined that the data is stored in the matching full table entry, the process goes to step S104 .

[0066] S103: The processor selects one of the matching partial table entries from the first matching flow table as the first matching partial table entry and unloads the first matching entry to the first matching partial table entry of the unloading hardware.

[0067] Select one of the matching partial table entries from the matching flow table as the first matching partial table entry: Select one of the matching partial table entries with an odd matching index or an even matching index from the matching flow table as the first matching partial table entry. Figure 3 Taking the matching flow table shown as an example, as long as the matching half-table entry is not occupied, any matching half-table entry with index numbers 0 to 7 can be selected.

[0068] Unloading the first match item to the first match partial table item may include: associating and storing the action index numbers of the first match item and the first action semi-table item in the first match partial table item. Since the first match item and the first action item are stored in the first match flow table and the first action flow table respectively, it is necessary to associate and store the action index numbers of the first match item and the first action semi-table item in the first match partial table item. In this way, the first action item corresponding to the first match item can be found by the action index number. In addition, storing the first match item and the first action item in the first match flow table and the first action flow table respectively can improve the reuse rate of the first action item. For example, when the action items of the first match item and the second match item are exactly the same, only one action item needs to be stored, and the index number of the action item is stored in the various corresponding match semi-table items of the first match item and the second match item. More specifically, the first identifier, the first match item and the action index number of the first action semi-table item are associated and stored in the first match partial table item. Among them, the first identifier is used to indicate whether to store in the match partial table item or in the match full table item. Here, the value of the first identifier is the first value. The length of the first identifier may be one or more bits. When the length of the first identifier is one bit, the value of the first identifier may be any one of 0 and 1.

[0069] S104: The processor selects N consecutive matching partial table entries from the first matching flow table as first matching full table entries and unloads the first matching entry to the first matching full table entry of the processor.

[0070] Selecting N consecutive matching partial table entries from the first matching flow table as the first matching full table entry may include: selecting two consecutive matching half table entries whose matching index numbers of the first matching half table entries are even numbers from the matching flow table. Figure 3 Taking the matching flow table shown as an example, as long as the matching full table item is not occupied, then, two consecutive matching half-table items with even matching index numbers of the first matching half-table item can be selected as the first matching full table item. For example, the matching half-table item with index number 0 and the matching half-table item with index number 1 can be selected to form the first matching full table item, the matching half-table item with index number 2 and the matching half-table item with index number 3 can be selected to form the first matching full table item, the matching half-table item with index number 4 and the matching half-table item with index number 5 can be selected to form the first matching full table item, and the matching half-table item with index number 6 and the matching half-table item with index number 7 can be selected to form the first matching full table item.

[0071] Unloading the first match item to the first match full table item may include: associating and storing the first match item and the action index number of the first action semi-item in the first match full table item. More specifically, associating and storing the first identifier, the first match item, and the action index number of the first action semi-item in the first match full table item. Here, the value of the first identifier is the second value. The length of the first identifier may be one or more bits. When the length of the first identifier is one bit, the value of the first identifier may be the other of 0 and 1.

[0072] Since the first identifier can be used to determine whether it is stored in the matching full table item or the matching half table item, when the first identifier is used to determine whether it is stored in the matching full table item, the action index number of the first action partial table item can be read from the last matching partial table item of N consecutive matching partial table items, thereby finding the first action item in the first action partial table item; when the first identifier is used to determine whether it is stored in the matching partial table item, the action index number of the first action half table item can be read from the matching partial table item, thereby finding the first action item in the first action partial table item.

[0073] S105: The processor determines whether to store the first action item in an action partial entry or an action full entry in the first action flow table according to the length of the first action item.

[0074] The first action flow table may be any one of an action flow table of a data link layer, an action flow table of a tunnel layer, an action flow table of a network layer, and an action flow table of a transport layer. Figure 4 As shown, the first action flow table is divided into a plurality of action partial table entries, and the action full table entry includes N consecutive action partial table entries, where N is an integer greater than 1. In a specific embodiment, the first action flow table is divided into a plurality of action half table entries, and the action full table entry includes 2 consecutive action half table entries.

[0075] The processor determines whether to store the first action item in an action partial entry or an action full entry of the first action flow table according to the length of the first action item. In a specific embodiment, the length of the action full entry is 176 bits, and the length of the action half entry is 88 bits. Therefore, when the length of the first action item is less than 88 bits, the first action item is stored in the action half entry, and when the length of the first action item is greater than or equal to 88 bits and less than 176 bits, the first action item is stored in the action full entry.

[0076] If it is determined that the data is stored in the partial action entry, the process goes to step S106 ; if it is determined that the data is stored in the full action entry, the process goes to step S107 .

[0077] S106: The processor selects one of the action part table entries from the first action flow table as the first action part table entry and unloads the first action item to the first action part table entry of the unloading hardware.

[0078] Select one of the action part entries from the action flow table as the first action part entry: Select one of the action part entries with an odd action index or an even action index from the action flow table as the first action part entry. Figure 4 Taking the action flow table shown as an example, as long as the action half-table entry is not occupied, any action half-table entry with an index number of 0 to 7 can be selected.

[0079] S107: The processor selects N consecutive partial action entries from the first action flow table as first full action entries and unloads the first action entry into the first full action entry of the processor.

[0080] Selecting N consecutive action partial entries from the first action flow table as the first action full entry may include: selecting two consecutive action half entries whose action index numbers of the first action half entries are even numbers from the action flow table. Figure 4 Taking the action flow table shown as an example, as long as the full action table item is not occupied, then two consecutive action half-table items with an even action index number of the first action half-table item can be selected as the first full action table item. For example, the action half-table item with an index number of 0 and the action half-table item with an index number of 1 can be selected to form the first full action table item, the action half-table item with an index number of 2 and the action half-table item with an index number of 3 can be selected to form the first full action table item, the action half-table item with an index number of 4 and the action half-table item with an index number of 5 can be selected to form the first full action table item, and the action half-table item with an index number of 6 and the action half-table item with an index number of 7 can be selected to form the first full action table item.

[0081] In the above scheme, the number of different types of matching flow tables with opposite numbers are divided into one shared storage space. For example, L2 (half table and more), tunnel (full table and more) are divided into one shared storage space, and L3 (half table and more), L4 (full table and more) are divided into one shared storage space. Since the matching flow tables in the shared storage space are of the same specification, the specification of a certain type of matching flow table can be increased.

[0082] For example, the matching flow table is divided into four types: L2, L3, L4, and tunnel4. Each type is allocated 5K storage resources. Taking the shared storage space of L3 and L4 as an example, the shared storage space shares 10K storage resources.

[0083] (1) Scenarios with many half-tables. If all are L3 type matching flow tables, ordinary flow table unloading unloads a total of 5K L3 type matching flow tables; after introducing full table and half-table, a total of 8K-10K L3 type matching flow tables are unloaded, which is 1.6-2 times that of ordinary flow table unloading; after using shared storage space, a total of 16K-20K L3 type matching flow tables are unloaded, which is 3.2-4 times that of ordinary flow table unloading.

[0084] (2) Scenarios with many full tables. If all are L4 type matching flow tables, ordinary flow table unloading unloads a total of 5K L4 type matching flow tables; after introducing full and half tables, a total of 5K-7K L4 type matching flow tables are unloaded (since some L4 flow tables have few fields, they can also be half tables), which is 1-1.4 times the unloading of ordinary flow tables; after using shared storage space, a total of 10K-14K tunnel4 type matching flow tables are unloaded, which is 2-2.8 times the unloading of ordinary flow tables.

[0085] It can be seen that in the scenario with half a lot of tables, the flow table specifications can be increased by 3.2-4 times, and in the scenario with full a lot of tables, the flow table specifications can be increased by 2-2.8 times.

[0086] See also Figure 6 , Figure 6 4 is a schematic diagram of a computing device provided by the present application. The computing device 400 includes: one or more processing units 410 , a communication interface 420 and a storage unit 430 .

[0087] The processing unit 410, the communication interface 420 and the storage unit 430 are interconnected via a bus 440. Optionally, the computing device 400 may also include an input / output interface 450, which is connected to an input / output device for receiving parameters set by a user, etc. The computing device 400 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processing unit 410 can also be used to implement some or all of the operation steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 400 can refer to the specific details in the above-mentioned embodiment, such as the processing unit 410 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in the embodiment of the present application, the computing device 400 can be used to implement some or all of the functions of one or more components in the above-mentioned device embodiment, and the communication interface 420 can be specifically used for the communication functions necessary to implement the functions of these devices and components, and the processing unit 410 can be specifically used for the processing functions necessary to implement the functions of these devices and components, etc.

[0088] Figure 6The computing device 400 may include one or more processing units 410, and the multiple processing units 410 may provide processing capabilities in a coordinated manner in a parallel connection manner, a serial connection manner, a serial-parallel connection manner, or any connection manner, or the multiple processing units 410 may constitute a processor sequence or a processor array, or the multiple processing units 410 may be divided into a main processor and an auxiliary processor, or the multiple processing units 410 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 6 The computing device 400 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 400 may include Figure 6 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.

[0089] The processing unit 410 may have a variety of specific implementation forms. For example, the processing unit 410 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processing unit 410 may also be a single-core processor or a multi-core processor. The processing unit 410 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processing unit 410 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 420 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.

[0090] The storage unit 430 may be a non-volatile memory, such as a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The storage unit 430 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous connection dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). The storage unit 430 may also be used to store program codes and data, so that the processing unit 410 can call the program codes stored in the storage unit 430 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 6 Show more or fewer components, or have different component configurations.

[0091] The bus 440 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 440 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 440 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0092] The present application also provides a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.

[0093] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one network site, computer, server or data center to another network site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or it can be a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape, etc.), an optical medium (e.g., a DVD, etc.), or a semiconductor medium (e.g., a solid-state hard disk), etc. In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

Claims

1. A flow table unloading method, characterized in that: include: Receiving a first flow table entry, wherein the first flow table entry includes a first matching item and a first action item; Determining whether to store the first matching item in a matching partial table item or a matching full table item of a first matching flow table according to the length of the first matching item, wherein the first matching flow table is divided into a plurality of matching partial table items, and the matching full table item includes N consecutive matching partial table items, where N is an integer greater than 1; In the case of determining that the data is stored in the matching part table entry, selecting one of the matching part table entries from the first matching flow table as the first matching part table entry and unloading the first matching item to the first matching part table entry; In the case of determining to store in the matching full table entry, N consecutive matching partial table entries are selected from the first matching flow table as the first matching full table entry and the first matching item is unloaded into the first matching full table entry.

2. The method according to claim 1, characterized in that The first matching partial table entry is a first matching half table entry, and the length of the first matching full table entry is twice the length of the first matching half table entry. Selecting one of the matching partial table entries from the matching flow table as a first matching partial table entry and unloading the first matching item to the first matching partial table entry comprises: selecting one of the matching half-table entries whose matching index number is an odd number or an even number from the matching flow table as a first matching half-table entry and unloading the first matching item to the first matching half-table entry; Selecting multiple consecutive matching partial table items from the matching flow table as the first matching full table item and unloading the first matching item to the first matching full table item includes: selecting two consecutive matching half table items whose matching index number of the first matching half table item is an even number from the matching flow table as the first matching full table item and unloading the first matching item to the first matching full table item.

3. The method according to claim 1, characterized in that The method further comprises: Receiving a second flow table entry, wherein the second flow table entry includes a second matching item and a second action item; Determining whether to store the second matching item in a matching partial table item or a matching full table item of a second matching flow table according to the length of the second matching item, wherein the second matching flow table is divided into a plurality of matching partial table items; In the case of determining that the data is stored in the matching part table entry, selecting one of the matching part table entries from the second matching flow table as the second matching part table entry and unloading the second matching item to the second matching part table entry; In the case of determining that the items are stored in the matching full table item, selecting N consecutive matching partial table items from the second matching flow table as second matching full table items and unloading the second matching items to the second matching full table items; The first matching flow table and the second matching flow table share a storage space. When the first matching flow table is idle and the second matching flow table is busy, the second matching flow table can occupy the space of the first matching flow table. When the first matching flow table is busy and the second matching flow table is idle, the first matching flow table can occupy the space of the second matching flow table. In the case where the first matching flow table is a matching flow table of a data link layer, the second matching flow table is a matching flow table of a tunnel layer; In the case where the first matching flow table is a matching flow table of a network layer, the second matching flow table is a matching flow table of a transport layer.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Determine whether to store the first action item in an action partial table item or an action full table item in an action flow table according to the length of the first action item, wherein the action flow table is divided into a plurality of action partial table items, the action full table item includes M consecutive action partial table items, and M is an integer greater than 1; In the case of determining that the action part table entry is stored, selecting one of the action part table entries from the action flow table as a first action part table entry and unloading the first action item to the first action part table entry; In the case of determining that the action is stored in the full action entry, a plurality of continuous partial action entries are selected from the action flow table as the first full action entry and the first action entry is unloaded into the first full action entry.

5. The method according to claim 4, characterized in that The first action partial entry is a first action half entry, and the length of the first action full entry is twice the length of the first action half entry. In the case of determining that the action is stored in the action semi-table entry, selecting one of the action partial table entries with an odd action index number or an even action index number from the action flow table as the first action semi-table entry and unloading the first action entry to the first action semi-table entry; When it is determined that the first action item is stored in the full action item, N consecutive action half-items whose action index numbers are even numbers of the first action half-item are selected from the action flow table and the first action item is unloaded into the first full action item.

6. The method according to claim 5, characterized in that In the case where the first action item is unloaded to the first action semi-table item, Unloading the first matching item to the first matching partial table entry includes: associating and storing the first matching item and the action index number of the first action semi-table entry in the first matching partial table entry; Unloading the first matching item to the first matching full entry includes: associating and storing the first matching item and the action index number of the first action half entry in the first matching full entry.

7. The method according to claim 6, characterized in that The associating and storing the first matching item and the action index number of the first action semi-item into the first matching partial item includes: associating and storing a first identifier, the first matching item, and the action index number of the first action semi-item into the first matching partial item, wherein the first identifier is used to indicate whether to store into the matching partial item or into the matching full item, and the value of the first identifier is a first value; Storing the first matching item and the action index number of the first action half-item in the first matching full-item by associating them into the first matching full-item includes: storing the first identifier, the first matching item and the action index number of the first action half-item in the first matching partial-item by associating them into the first matching partial-item, wherein the value of the first identifier is the second value.

8. The method according to claim 5, characterized in that In the case where the first action item is unloaded to the first action full table item, Unloading the first matching item to the first matching partial table item includes: associating and storing the first matching item and the action index number of the first action half-item in the first action full table item in the first matching partial table item; Unloading the first matching item to the first matching full entry includes: associating and storing the first matching item and the action index number of the first action half-entry in the first action full entry in the first matching full entry.

9. A computing device, characterized in that The method comprises a processor, offloading hardware and a network card, wherein the processor can communicate with the offloading hardware and the network card respectively, and the processor is used to execute the method according to any one of claims 1 to 8.

10. A computing device cluster, characterized in that: It comprises a plurality of computing devices, at least one of which comprises a processor, offloading hardware and a network card, the processor can communicate with the offloading hardware and the network card respectively, and the processor is used to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Message processing method and forwarding device

    CN103905310A

  • Flow table unloading method, system, equipment, cluster and medium

    CN117527689A