Network flow table operation processing method, device, electronic device and storage medium

By adding a mask field and hardware expansion target keyword or index value in the network flow table operation instructions, operations on multiple table items are realized, which solves the problem of complex software and hardware interaction in the existing technology and improves the efficiency of network flow table operations. Efficiency and convenience.

CN117354237BActive Publication Date: 2024-09-27YUSUR TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311459073.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2024-09-27
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

In the existing network flow table operation processing method, the interaction between software and hardware is complicated, which affects the software's ability to manage the hardware flow table and the efficiency of the hardware in processing network flow table operations.

Method used

By adding a mask field to the data operation instructions, the hardware determines and expands the target keyword or index value based on the mask, enabling operations on multiple table items, simplifying software and hardware interaction, and improving hardware processing efficiency.

Benefits of technology

It realizes the operation and processing of multiple table items based on a single instruction, simplifies the interaction between software and hardware, and improves the ability of software to manage hardware flow tables and the efficiency and convenience of hardware processing network flow table operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117354237B
    Figure CN117354237B
Patent Text Reader

Abstract

The present application provides a network flow table operation processing method, device, electronic device and storage medium, the method comprising: receiving a data operation instruction for a network flow table, the instruction including a target keyword and a mask with one-to-one correspondence between bits; if it is known based on the mask that multiple table items containing the network flow table are to be operated, then the value of the target keyword is extended according to the mask to obtain each expanded value corresponding to the target keyword and each corresponding new keyword value; and corresponding operations are performed on multiple table items according to each new keyword value, operation code and identifier of the network flow table. The present application can implement the operation processing of multiple table items in hardware based on a single flow table operation instruction, can effectively simplify the interaction process between software and hardware, can improve the ability of software to manage hardware flow tables, and can improve the efficiency and convenience of hardware processing network flow table operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network data processing technology, and in particular to a network flow table operation processing method, device, electronic device and storage medium. Background Art

[0002] The flow table is the most basic basis for the network processor to process data packets. It directly affects the efficiency of data forwarding and the performance of the entire network. These flow tables are generally composed of hash tables and array tables. In order to achieve extremely high search and forwarding performance, the network processor generally uses hardware to forward network data. The software unloads the flow table to the hardware, and the hardware implements the addition, deletion, modification and query of the flow table. Therefore, a set of instruction devices is needed between the software and the hardware to manage the hardware flow table efficiently and in real time.

[0003] In the current network flow table operation processing method, the software usually issues an operation instruction for a hash table or array table. The instruction contains the table item information to be operated. The hardware operates the corresponding table item according to the table item information in the instruction information. After the operation is completed, the corresponding completion information is returned to the software. However, a single instruction can only operate on a certain table item in the hash table or array table. If multiple table items need to be operated, the software needs to issue multiple corresponding instructions. This will not only make the interaction process between software and hardware complicated, affecting the software's ability to manage hardware flow tables, but also affect the efficiency of the hardware in processing network flow table operations. Summary of the invention

[0004] In view of this, embodiments of the present application provide a network flow table operation processing method, device, electronic device and storage medium to eliminate or improve one or more defects existing in the prior art.

[0005] One aspect of the present application provides a network flow table operation processing method, which is implemented by hardware, and the method includes:

[0006] Receive a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of the network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword and the mask have a one-to-one correspondence with each other;

[0007] If it is known based on the mask that the data operation instruction is an operation instruction for multiple entries of the network flow table, then the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values;

[0008] Corresponding operations are performed on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0009] In some embodiments of the present application, the type of the data operation instruction of the network flow table includes a write operation, and correspondingly, the data operation instruction also includes a plurality of target values ​​corresponding to the target keyword;

[0010] Correspondingly, performing corresponding operations on multiple entries according to each of the new keyword values, the operation code, and the identifier of the network flow table includes:

[0011] Each of the new keyword values ​​is matched with each of the target values ​​one-to-one, and corresponding write operations are performed on multiple table entries based on the obtained matching results, the operation code and the identifier of the network flow table.

[0012] In some embodiments of the present application, the type of the data operation instruction of the network flow table includes a query operation or a delete operation;

[0013] Correspondingly, performing corresponding operations on multiple entries according to each of the new keyword values, the operation code, and the identifier of the network flow table includes:

[0014] Corresponding query or deletion operations are performed on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0015] In some embodiments of the present application, before the value of the target keyword is expanded according to the mask, the method further includes:

[0016] Determining whether the mask in the data operation instruction contains a bit that is 0;

[0017] If so, it is determined that the data operation instruction is an operation instruction containing multiple entries of the network flow table.

[0018] In some embodiments of the present application, if the data operation instruction is currently directed to a hash table in the network flow table, the target keyword is a target key;

[0019] Correspondingly, the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values, including:

[0020] According to all the bits that are 0 in the mask corresponding to the target key, extract the bits at the corresponding positions in the target key;

[0021] Arrange and expand the extracted bits in descending order to obtain 2^K expanded values ​​corresponding to the target key, and each of the expanded values ​​corresponds to a new key value, where K is the sum of all 0 bits in the mask corresponding to the target key.

[0022] In some embodiments of the present application, if the data operation instruction is currently directed to an array table in the network flow table, the target keyword is a target index;

[0023] Correspondingly, the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values, including:

[0024] According to all the bits that are 0 in the mask corresponding to the target index, extract the bits at the corresponding position in the target index;

[0025] Arrange and expand the extracted bits in descending order to obtain 2^K expanded values ​​corresponding to the target index, and each of the expanded values ​​corresponds to a new index value, where K is the sum of all bits that are 0 in the mask corresponding to the target index.

[0026] In some embodiments of the present application, it also includes:

[0027] If it is determined that the mask in the data operation instruction does not contain any bit equal to 0, it is determined that the data operation instruction is an operation instruction for a single entry in the network flow table, and a corresponding operation is performed on the network flow table based on the data operation instruction.

[0028] Another aspect of the present application provides a network flow table operation processing device, including:

[0029] The instruction receiving module is used to receive a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of the network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword and the mask have a one-to-one correspondence with each other;

[0030] A keyword expansion module, for, if it is known based on the mask that the data operation instruction is an operation instruction for a plurality of table entries including the network flow table, then expanding the value of the target keyword according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values;

[0031] The multi-table entry operation module is used to perform corresponding operations on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0032] The third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the network flow table operation processing method when executing the computer program.

[0033] The fourth aspect 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 network flow table operation processing method is implemented.

[0034] The network flow table operation processing method provided by the present application receives a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of a network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword corresponds to the bits of the mask one to one; if it is known based on the mask that the data operation instruction is an operation instruction for multiple table items containing the network flow table, then the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each expanded value; corresponding operations are performed on multiple table items according to each of the new keyword values, the operation code and the identifier of the network flow table, and the operation processing of multiple table items can be implemented in hardware based on a single flow table operation instruction, which can effectively simplify the interaction process between software and hardware, improve the ability of software to manage hardware flow tables, and improve the efficiency and convenience of hardware processing network flow table operations.

[0035] Additional advantages, purposes, and features of the present application will be partially described in the following description, and will become partially apparent to those skilled in the art after studying the following, or may be learned from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings.

[0036] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present application are not limited to the above specific description, and the above and other purposes that can be achieved by the present application will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but are only for the purpose of illustrating the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present application. In the drawings:

[0038] Figure 1 This is a schematic diagram of a first flow chart of a network flow table operation processing method in one embodiment of the present application.

[0039] Figure 2 This is a second flow chart of the network flow table operation processing method in one embodiment of the present application.

[0040] Figure 3 Schematic diagram of the structure of a network flow table operation processing device in one embodiment of the present application.

[0041] Figure 4 This is an example flow chart of the hash table insertion process in the application example of this application.

[0042] Figure 5 This is a schematic diagram showing an example of data types in a hash table insert instruction in an application example of this application.

[0043] Figure 6 This is a schematic diagram of an example operation of extracting the bits corresponding to the Key according to the bits where the Key mask is 0 in the application example of this application.

[0044] Figure 7 This is a schematic diagram of an example of the extended Key value in the application example of this application.

[0045] Figure 8 This is an example flowchart of the hash table query or deletion operation process in the application example of this application.

[0046] Fig. 9 This is a schematic diagram of an example of data types in a hash table query or deletion operation in an application example of this application.

[0047] Fig.10 This is an example flow chart of the array table writing process in the application example of this application.

[0048] Fig.11 This is a schematic diagram of an example of data types in an array table insert operation instruction in the application example of this application.

[0049] Fig.12 This is a schematic diagram of an example operation of extracting the bit corresponding to the index according to the bit with index mask being 0 in the application example of this application.

[0050] Fig.13 This is a schematic diagram of an example of the expanded index value in the application example of this application.

[0051] Fig.14 This is a specific flow chart of the array table query operation process in the application example of this application.

[0052] Fig.15 This is a schematic diagram of an example of data types in an array table query operation instruction in an application example of this application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the implementation modes and the accompanying drawings. Here, the illustrative implementation modes and descriptions of the present application are used to explain the present application, but are not intended to limit the present application.

[0054] It should also be noted here that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the scheme according to the present application are shown in the accompanying drawings, while other details that are not very relevant to the present application are omitted.

[0055] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0056] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0057] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0058] In order to solve the problems of complicated interaction between software and hardware in the existing network flow table operation processing method, which affects the software's ability to manage hardware flow tables and the efficiency of hardware in processing network flow table operations, the embodiments of the present application respectively provide a network flow table operation processing method, a network flow table operation processing device for executing the network flow table operation processing method, a physical device and a computer-readable storage medium. A mask field is added to the instruction information issued by the software, and the hardware can expand the target keyword of the network flow table according to the mask information. The software only needs to issue one instruction, and the hardware can automatically complete the operation of multiple table items, thereby simplifying the interaction between software and hardware and improving the software's ability to manage hardware flow tables.

[0059] The details are described in detail through the following examples.

[0060] Based on this, the embodiment of the present application provides a network flow table operation processing method that can be performed by a network flow table operation processing device implemented by hardware, see Figure 1 The network flow table operation processing method specifically includes the following contents:

[0061] Step 100: Receive a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of the network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword and the mask bits correspond one to one.

[0062] In one or more embodiments of the present application, the network flow table generally includes a hash table and an array table. If the data operation instruction is currently targeting the hash table in the network flow table, the target keyword is the target key, i.e., Key. If the data operation instruction is currently targeting the array table in the network flow table, the target keyword is the target index, i.e., index.

[0063] It can be understood that the mask can be referred to as mask. For the sake of convenience, the mask corresponding to the target key of the hash table can be written as: Key mask; the mask corresponding to the target key of the array table can be written as: index mask.

[0064] In one or more embodiments of the present application, the data bit widths of the target keyword and the mask remain consistent and are both represented by bits.

[0065] In step 100, the hardware can receive a data operation instruction for a network flow table sent by the software, and the software adds a mask field in advance to the issued data operation instruction, so that the hardware can judge based on the mask that the data operation instruction is an operation instruction for multiple items containing the network flow table, and can also perform extended processing on the value of the target keyword according to the same mask. Only by designing this mask field, it can realize both the judgment of the number of item operations and the extended processing of the value of the keyword for multiple item operations, thereby further simplifying the interaction process between software and hardware, and improving the efficiency and convenience of hardware processing network flow table operations. Specifically, as described in step 200 below.

[0066] Step 200: If it is known based on the mask that the data operation instruction is an operation instruction for multiple table entries including the network flow table, the value of the target keyword is expanded according to the mask to obtain the expanded values ​​corresponding to the target keyword and a new keyword value corresponding to each of the expanded values.

[0067] Step 300: Perform corresponding operations on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0068] In step 300, the corresponding operations performed on the plurality of table entries may specifically include a write operation, a delete operation or a query operation, which is specifically determined according to the operation type indicated by the operation code in the data operation instruction.

[0069] From the above description, it can be seen that the network flow table operation processing method provided in the embodiment of the present application can implement the operation processing of multiple table items in hardware based on a single flow table operation instruction, which can effectively simplify the interaction process between software and hardware, improve the software's ability to manage hardware flow tables, and improve the efficiency and convenience of hardware processing network flow table operations.

[0070] In order to further improve the processing efficiency and convenience of write operations in network flow table operation processing, in a network flow table operation processing method provided in an embodiment of the present application, the type of data operation instruction of the network flow table includes a write operation, and correspondingly, the data operation instruction also includes multiple target values ​​corresponding to the target keyword;

[0071] If the type of the data operation instruction of the network flow table is a write operation, refer to Figure 2 , step 300 of the network flow table operation processing method specifically includes the following contents:

[0072] Step 310: If the type of the data operation instruction of the network flow table is a write operation, each of the new keyword values ​​is paired one-to-one with each of the target values, and corresponding write operations are performed on multiple table entries based on the obtained pairing results, the operation code and the identifier of the network flow table.

[0073] In order to further improve the processing efficiency and convenience of query or delete operations in network flow table operation processing, in a network flow table operation processing method provided in an embodiment of the present application, the type of data operation instructions of the network flow table includes query operation or delete operation;

[0074] Correspondingly, if the type of the data operation instruction of the network flow table is a query operation, refer to Figure 2 , step 300 of the network flow table operation processing method specifically includes the following contents:

[0075] Step 320: If the type of the data operation instruction of the network flow table is a query operation, then a corresponding query operation is performed on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0076] And, if the type of the data operation instruction of the network flow table is a delete operation, see Figure 2 , step 300 of the network flow table operation processing method specifically includes the following contents:

[0077] Step 330: If the type of the data operation instruction of the network flow table is a delete operation, then corresponding delete operations are performed on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0078] In order to further improve the processing efficiency and convenience of determining whether to perform extended processing on the value of the target keyword in the network flow table operation processing, in a network flow table operation processing method provided in an embodiment of the present application, see Figure 2 The network flow table operation processing method specifically includes the following contents between step 100 and step 200:

[0079] Step 110: Determine whether the mask in the data operation instruction contains a bit that is 0;

[0080] If yes, it is determined that the data operation instruction is an operation instruction including multiple entries of the network flow table, and then the step 200 is executed. If no, the step 400 is executed.

[0081] In order to further improve the processing efficiency and convenience of the target keyword value expansion processing for the hash table in the network flow table in the network flow table operation processing, in a network flow table operation processing method provided in an embodiment of the present application, if the data operation instruction is currently for the hash table in the network flow table, the target keyword is the target key;

[0082] For the corresponding Figure 2 , step 200 of the network flow table operation processing method specifically includes the following contents:

[0083] Step 210: If the data operation instruction is currently for the hash table in the network flow table, extract the bits at the corresponding position in the target key according to all the bits that are 0 in the mask corresponding to the target key;

[0084] Step 220: Arrange and expand the extracted bits in descending order to obtain 2^K expanded values ​​corresponding to the target key, and each of the expanded values ​​corresponds to a new key value, where K is the sum of all 0 bits in the mask corresponding to the target key.

[0085] It can be understood that the target value corresponding to the Key is Value.

[0086] Specifically, the number of target values ​​corresponding to the target keyword can be written as N, for example, N can be a positive integer greater than 2. The number of bits of the target keyword and the mask can be M, for example, M can be a positive integer greater than 4. The sum of all 0 bits in the mask is recorded as K.

[0087] If the Key mask has a bit that is 0, the Key value needs to be expanded: the bits of the Key and the Key mask are in a one-to-one correspondence. The sum of all the bits that are 0 in the Key mask is recorded as K. According to the bits that are 0 in the Key mask, the bits corresponding to the Key are extracted, and these bits are arranged from high to low and expanded. The value range after expansion is 0 to 2^K-1, and there are a total of 2^K values. Each value corresponds to a new Key value. When performing a hash insertion operation, the number of Values ​​N=2^K.

[0088] In order to further improve the processing efficiency and convenience of the target keyword value expansion processing for the array table in the network flow table in the network flow table operation processing, in a network flow table operation processing method provided in an embodiment of the present application, if the data operation instruction is currently for the array table in the network flow table, the target keyword is the target index;

[0089] For the corresponding Figure 2 , step 200 of the network flow table operation processing method specifically includes the following contents:

[0090] Step 230: If the data operation instruction is currently for the array table in the network flow table, extract the bit at the corresponding position in the target index according to all the bits that are 0 in the mask corresponding to the target index;

[0091] Step 240: Arrange and expand the extracted bits in order from high to low to obtain 2^K expanded values ​​corresponding to the target index, and each of the expanded values ​​corresponds to a new index value, where K is the sum of all bits that are 0 in the mask corresponding to the target index.

[0092] It can be understood that the target value corresponding to the index is data.

[0093] Specifically, if the index mask has a bit that is 0, the value of the index needs to be expanded: the bits of the index and the index mask are in a one-to-one correspondence. The sum of all the bits that are 0 in the index mask is recorded as K. According to the bits of the index mask that are 0, the bits corresponding to the index are extracted, and these bits are arranged from high to low and expanded. The value range after expansion is 0 to 2^K-1, and there are a total of 2^k values. Each value corresponds to a new index value. When performing an array table write operation, the number of data N=2^k.

[0094] In order to further improve the applicability of network flow table operation processing, in a network flow table operation processing method provided in an embodiment of the present application, see Figure 2 The aforementioned step 400 specifically includes the following contents:

[0095] Step 400: Determine whether the data operation instruction is an operation instruction for a single entry of the network flow table, and perform a corresponding operation on the network flow table based on the data operation instruction.

[0096] From the functional level of hardware implementation, the present application also provides an embodiment of a network flow table operation processing device for executing all or part of the network flow table operation processing method, and the network flow table operation processing device is a hardware device, see Figure 3 The network flow table operation processing device specifically includes the following contents:

[0097] The instruction receiving module 10 is used to receive a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of the network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword and the mask have a one-to-one correspondence with each other;

[0098] A keyword expansion module 20 is used for, if it is known based on the mask that the data operation instruction is an operation instruction for multiple entries of the network flow table, then expanding the value of the target keyword according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values;

[0099] The multi-entry operation module 30 is used to perform corresponding operations on multiple entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

[0100] The embodiment of the network flow table operation processing device provided in the present application can be specifically used to execute the processing flow of the embodiment of the network flow table operation processing method in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the embodiment of the above-mentioned network flow table operation processing method.

[0101] The part of the network flow table operation processing device that performs the network flow table operation processing can be completed in the client device, such as a network processor. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor for specific processing of the network flow table operation processing.

[0102] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0103] The server and the client device may communicate with each other using any suitable network protocol, including network protocols that have not yet been developed on the date of filing this application. The network protocols may include, for example, TCP / IP, UDP / IP, HTTP, HTTPS, etc. Of course, the network protocols may also include, for example, RPC (Remote Procedure Call Protocol) and REST (Representational State Transfer) protocols used on top of the above protocols.

[0104] From the above description, it can be seen that the network flow table operation processing device provided in the embodiment of the present application can implement operation processing of multiple table items in hardware based on a single flow table operation instruction, can effectively simplify the interaction process between software and hardware, can improve the software's ability to manage hardware flow tables, and can improve the efficiency and convenience of hardware processing network flow table operations.

[0105] The embodiment of the present application also provides an electronic device, which may include a processor, a memory, a receiver and a transmitter, wherein the processor is used to execute the network flow table operation processing method mentioned in the above embodiment, wherein the processor and the memory may be connected via a bus or other means, for example, via a bus. The receiver may be connected to the processor and the memory via a wired or wireless manner.

[0106] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0107] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the network flow table operation processing method in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, the network flow table operation processing method in the above method embodiment is implemented.

[0108] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] The one or more modules are stored in the memory, and when executed by the processor, the network flow table operation processing method in the embodiment is executed.

[0110] In some embodiments of the present application, the user equipment may include a processor, a memory, and a transceiver unit, which may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected through a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.

[0111] As an implementation method, the functions of the receiver and the transmitter in the present application can be considered to be implemented through a transceiver circuit or a dedicated chip for transceiver, and the processor can be considered to be implemented through a dedicated processing chip, a processing circuit or a general chip.

[0112] As another implementation method, it is possible to use a general-purpose computer to implement the server provided in the embodiment of the present application, that is, to store the program code for implementing the functions of the processor, receiver, and transmitter in a memory, and the general-purpose processor implements the functions of the processor, receiver, and transmitter by executing the code in the memory.

[0113] 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, the steps of the aforementioned network flow table operation processing method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0114] To further illustrate the present solution, the present application also provides a specific application example of the network flow table operation processing method based on hardware, and describes in detail the four aspects of hash table insertion operation, hash table query or deletion operation, array table write operation and array table query operation.

[0115] (I) Hash table insertion operation

[0116] See also Figure 4 , the specific process of hash table insertion operation is as follows:

[0117] 1. The software sends a hash table insertion instruction, see Figure 5 The instruction contains information: operation code, table number, Key, Keymask and N Value values; specifically, it can be written as Value1, Value2…ValueN. Among them,

[0118] The data bit width of Key and Key mask is consistent, both represented by M bits.

[0119] 2. After receiving the instruction, the hardware decodes the Key and Key mask: if all bits of the Key mask are 1, it means that this instruction only operates on the Key table item; if there is a bit of 0 in the Key mask, it means that multiple table items need to be operated and the Key needs to be expanded.

[0120] 3. If the Key mask has bits that are 0, the Key value needs to be expanded: the bits of the Key and the Key mask are in a one-to-one correspondence, and the sum of all bits that are 0 in the Key mask is recorded as K, see Figure 6 , according to the bit where the Key mask is 0, extract the bits corresponding to the Key, arrange these bits from high to low and expand them, see Figure 7 , the expanded value range is 0 to 2^K-1, with a total of 2^K values, each of which corresponds to a new Key value. When performing a hash insertion operation, the number of Values ​​N = 2^K

[0121] 4. The hardware pairs the expanded Key value with the Value value, with each Key value corresponding to a Value value, and performs an insertion operation.

[0122] (II) Hash table query or deletion operation

[0123] Hash table query or delete operations are similar to hash table insertion, but the instructions do not contain Value information, see Figure 8 , the specific process of hash table query or deletion operation is as follows:

[0124] 1. The software sends a hash table insertion instruction, see Fig. 9 , the hash table query or delete operation contains the following information: operation code, table number, key and key mask. Among them, the data bit width of key and key mask is consistent, both represented by M bits, which can be written as: bit 1, bit 2, bit 3, bit 4...bit M.

[0125] 2. Refer to the insert instruction steps of the hash table to decode the Key mask. If the Key value needs to be expanded, expand the Key;

[0126] 3. Perform query or delete operations on the expanded Key value.

[0127] (III) Array table write operation

[0128] See also Fig.10 , the specific process of array table insertion operation is as follows:

[0129] 1. The software sends the array table write instruction, see Fig.11 , the array table insert operation instruction contains the following information: operation code, table number, index, index mask and N data values, which can be written as data1, data2...dataN; among them, the data bit width of index and index mask remains consistent, both represented by M bits.

[0130] 2. After receiving the instruction, the hardware decodes the index and index mask: if all bits of the index mask are 1, it means that this instruction only operates on the index table item; if the index mask has a bit of 0, it means that multiple table items need to be operated and the index needs to be expanded.

[0131] 3. If the index mask has bits that are 0, the value of index needs to be expanded: the bits of index and index mask are in one-to-one correspondence, and the sum of all bits that are 0 in index mask is recorded as K, see Fig.12 , according to the bit where index mask is 0, extract the bit corresponding to index, arrange these bits from high to low and expand them, see Fig.13 The expanded value range is 0 to 2^K-1, with a total of 2^K values. Each value corresponds to a new index value. When writing to the array table, the number of data N = 2^K.

[0132] 4. The hardware pairs the expanded index value with the data value, with each index value corresponding to one data value, and performs a write operation.

[0133] (IV) Array table query operation

[0134] The array table query operation is similar to the array table write operation, but the instruction does not contain data information, see Fig.14 , the specific process of array table query operation is as follows:

[0135] 1. The software sends array table query instructions, see Fig.15 , the array table query operation instruction contains the following information: operation code, table number, index and index mask; among them, the data bit width of index and index mask remains consistent, both represented by M bits.

[0136] 2. Refer to the write instruction steps of the array table to decode the index mask. If the index value needs to be expanded, expand the index;

[0137] 3. Perform query operations on the expanded index value.

[0138] Based on this, the application example of this application is aimed at the operation of the hash table. Through the Key mask in the instruction information, the Key in an instruction can be expanded, which is equivalent to operating multiple Keys.

[0139] At the same time, the application example of the present application is for the operation of the array table. Through the index mask in the instruction information, the index in an instruction can be expanded, which is equivalent to operating multiple indexes.

[0140] To summarize, according to the application example of the present application, a mask field is added to the instruction information issued by the software, and the hardware can expand the Key value of the hash table and the index value of the array table according to the mask information. The software only needs to issue one instruction, and the hardware can automatically complete the operation of multiple table items, which simplifies the interaction between software and hardware and improves the software's ability to manage hardware flow tables.

[0141] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0142] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0143] In the present application, features described and / or illustrated for one embodiment may be used in the same manner or in a similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0144] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A network flow table operation processing method, implemented by hardware, characterized in that: The method comprises: Receive a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of the network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword and the mask have a one-to-one correspondence with each other; If it is known based on the mask that the data operation instruction is an operation instruction for multiple entries of the network flow table, then the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values; Corresponding operations are performed on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

2. The network flow table operation processing method according to claim 1, characterized in that: The type of the data operation instruction of the network flow table includes a write operation, and correspondingly, the data operation instruction also includes a plurality of target values ​​corresponding to the target keyword; Correspondingly, performing corresponding operations on multiple entries according to each of the new keyword values, the operation code, and the identifier of the network flow table includes: Each of the new keyword values ​​is matched with each of the target values ​​one-to-one, and corresponding write operations are performed on multiple entries based on the obtained matching results, the operation code and the identifier of the network flow table.

3. The network flow table operation processing method according to claim 1, characterized in that: The type of data operation instruction of the network flow table includes query operation or deletion operation; Correspondingly, performing corresponding operations on multiple entries according to each of the new keyword values, the operation code, and the identifier of the network flow table includes: Corresponding query or deletion operations are performed on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

4. The network flow table operation processing method according to claim 2, characterized in that: Before the value of the target keyword is expanded according to the mask, the method further includes: Determining whether the mask in the data operation instruction contains a bit that is 0; If so, it is determined that the data operation instruction is an operation instruction containing multiple entries of the network flow table.

5. The network flow table operation processing method according to claim 4 is characterized in that: If the data operation instruction is currently directed to a hash table in the network flow table, the target keyword is a target key; Correspondingly, the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values, including: According to all the bits that are 0 in the mask corresponding to the target key, extract the bits at the corresponding positions in the target key; Arrange and expand the extracted bits in descending order to obtain 2^K expanded values ​​corresponding to the target key, and each of the expanded values ​​corresponds to a new key value, where K is the sum of all 0 bits in the mask corresponding to the target key.

6. The network flow table operation processing method according to claim 4 is characterized in that: If the data operation instruction is currently targeting an array table in the network flow table, the target keyword is a target index; Correspondingly, the value of the target keyword is expanded according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values, including: According to all the bits that are 0 in the mask corresponding to the target index, extract the bits at the corresponding position in the target index; Arrange and expand the extracted bits in descending order to obtain 2^K expanded values ​​corresponding to the target index, and each of the expanded values ​​corresponds to a new index value, where K is the sum of all bits that are 0 in the mask corresponding to the target index.

7. The network flow table operation processing method according to claim 4 is characterized in that: Also includes: If it is determined that the mask in the data operation instruction does not contain any bit equal to 0, it is determined that the data operation instruction is an operation instruction for a single entry in the network flow table, and a corresponding operation is performed on the network flow table based on the data operation instruction.

8. A network flow table operation processing device, characterized in that: include: The instruction receiving module is used to receive a data operation instruction for a network flow table, wherein the data operation instruction includes: an operation code, an identifier of the network flow table, a target keyword corresponding to the network flow table, and a mask corresponding to the target keyword, and the target keyword and the mask have a one-to-one correspondence with each other; A keyword expansion module, for, if it is known based on the mask that the data operation instruction is an operation instruction for a plurality of table entries including the network flow table, then expanding the value of the target keyword according to the mask to obtain each expanded value corresponding to the target keyword and a new keyword value corresponding to each of the expanded values; The multi-table entry operation module is used to perform corresponding operations on multiple table entries according to each of the new keyword values, the operation code and the identifier of the network flow table.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the network flow table operation processing method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the network flow table operation processing method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Packet processing method, device and system

    CN104584492A

  • Message processing method, device and system

    CN108173763A

  • OpenFlow multidimensional data matching and searching method based on FPGA (Field Programmable Gate Array)

    CN108875064A

  • Direct lookup tables and extensions thereto for packet classification

    US20070008888A1

  • Packet Key Parser for Flow-Based Forwarding Elements

    US20160094460A1