Flow table management method and device, equipment, storage medium and program product
By introducing a message sampling mechanism on the network card side, the stream table aging optimization is handed over to the host software for processing, which solves the problem of poor host processing performance caused by frequent synchronization of software and hardware message counts in traditional stream table management methods, and achieves the effect of improving host processing performance.
Patent Information
- Application Number
- CN202411703392.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In traditional flow table management methods, software and hardware packet counts are frequently synchronized, resulting in poor host processing performance.
By introducing a message sampling mechanism on the network card side, the message sampling is sent to the host, so that the stream table aging optimization is handed over to the host software to process, thereby reducing the pressure of frequent synchronization of software and hardware message counts.
It effectively alleviates the performance bottleneck caused by frequent synchronous flow table hits between network card hardware and host software, and improves the processing performance of hosts.
Smart Images

Figure CN119520449A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a flow table management method, apparatus, device, storage medium and program product. Background Art
[0002] In the traditional flow table management method, the host (CPU) will send the processing rules of the hit data message to the underlying hardware (network card) and record it in the flow entry of the hardware flow table. During the data message processing process, if the message hits the processing rules recorded in the hardware flow table in the hardware, it will be directly processed and forwarded by the hardware and no longer sent to the CPU. If the message does not hit the hardware flow table, it needs to be sent to the CPU for processing, and then the processing rules corresponding to the message are sent to the underlying hardware. The message hit status of the processing rules in each flow entry is regularly synchronized from the underlying hardware to the CPU. The software in the CPU determines whether there is an aging flow table based on its own aging logic, and then sends a deletion instruction to the underlying hardware. The software and hardware synchronize the message hit count too frequently, which greatly wastes software and hardware resources and leads to poor processing performance of the host. Summary of the invention
[0003] Based on this, it is necessary to provide a flow table management method, device, equipment, storage medium and program product that can reduce the pressure of frequent synchronization of software and hardware message counts and improve the processing performance of the host in response to the above technical problems.
[0004] In a first aspect, the present application provides a flow table management method, which is applied to a network card; the method comprises:
[0005] Receive a data message, and parse the message header of the data message to obtain the message header information of the data message;
[0006] Matching the message header information with the hardware flow table in the network card;
[0007] If there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the message header information is sent to the host;
[0008] receiving a flow table deletion instruction issued by the host after determining that the hardware flow entry has aged based on the message header information;
[0009] The hardware flow entry in the hardware flow table is deleted based on the flow table deletion instruction.
[0010] In one embodiment, the method further comprises:
[0011] If the sampling time interval counted by the sampling counter corresponding to the hardware flow entry meets the preset time interval, it is determined that the sampling count of the hardware flow entry meets the preset sampling condition; or,
[0012] If the number of sampled messages counted by the sampling counter corresponding to the hardware flow entry meets the preset number of messages, it is determined that the sampling count of the hardware flow entry meets the preset sampling condition.
[0013] In a second aspect, the present application provides a flow table management method, which is applied to a host; the method comprises:
[0014] Receive the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is determined that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition and is sent;
[0015] Determining whether the hardware flow entry has aged based on the message header information;
[0016] If it is determined that the hardware flow entry has aged, a flow table deletion instruction for the hardware flow entry is generated, and the flow table deletion instruction is sent to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0017] In one embodiment, the host includes a network card driver and a data processing software program; the message header information of the data message sent by the receiving network card includes:
[0018] Receiving the message header information of the data message sent by the network card through the network card driver, and sending the message header information to the data processing software program;
[0019] The determining whether the hardware flow entry has aged based on the message header information includes:
[0020] The data processing software program determines whether the hardware flow entry has aged based on the message header information.
[0021] In one embodiment, the host stores a software flow table corresponding to the hardware flow table; and judging whether the hardware flow entry has aged based on the message header information by the data processing software program includes:
[0022] Matching the message header information with the software flow table in the host through the data processing software program;
[0023] If there is a software flow entry matching the message header information in the software flow table, it is determined that the hardware flow entry is not aged;
[0024] If there is no software flow entry matching the message header information in the software flow table, it is determined that the hardware flow entry has aged.
[0025] In a third aspect, the present application provides a flow table management device, which is applied to a network card; the device includes:
[0026] A parsing module, used for receiving a data message, and parsing a message header of the data message to obtain message header information of the data message;
[0027] A matching module, used for matching the message header information with the hardware flow table in the network card;
[0028] A first sending module, configured to send the message header information to a host if there is a hardware flow entry matching the message header information in the hardware flow table and the sampling count of the hardware flow entry meets a preset sampling condition;
[0029] A first receiving module, configured to receive a flow table deletion instruction issued by the host after the host determines that the hardware flow entry has aged based on the message header information;
[0030] A deleting module is used to delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0031] In a fourth aspect, the present application provides a flow table management device, which is applied to a host; the device includes:
[0032] The second receiving module is used to receive the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is judged that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition and is sent;
[0033] A judging module, configured to judge whether the hardware flow entry has aged based on the message header information;
[0034] The second sending module is used to generate a flow table deletion instruction for the hardware flow entry if it is determined that the hardware flow entry has aged, and send the flow table deletion instruction to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0035] In a fifth aspect, the present application provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.
[0036] In a sixth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method embodiments of the present application.
[0037] In a seventh aspect, the present application provides a computer program product, including a computer program, which implements the steps in the method embodiments of the present application when the computer program is executed by a processor.
[0038] The above-mentioned flow table management method, device, equipment, storage medium and program product, the network card receives the data message, and parses the message header of the data message to obtain the message header information of the data message; matches the message header information with the hardware flow table in the network card; if there is a hardware flow entry in the hardware flow table that matches the message header information, and the sampling count of the hardware flow entry meets the preset sampling condition, then the message header information is sent to the host; the host receives the flow table deletion instruction issued after judging that the hardware flow entry has aged based on the message header information; based on the flow table deletion instruction, the hardware flow entry in the hardware flow table is deleted. Compared with the traditional flow table management method, the present application uses a message sampling mechanism to send message samples to the host on the network card side, so that the flow table aging optimization is handed over to the host software, thereby realizing the software processing of the flow table aging logic, which can reduce the pressure of frequent synchronization of software and hardware message counts, effectively alleviate the performance bottleneck caused by frequent synchronization of flow table hits between the network card hardware and the host software, and improve the processing performance of the host. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 An application environment diagram of a flow table management method in an embodiment;
[0040] Figure 2 A schematic diagram of a flow table management method in an embodiment;
[0041] Figure 3 A schematic diagram of a flow table management method in another embodiment;
[0042] Figure 4 is an application environment diagram of a flow table management method in another embodiment;
[0043] Figure 5 is a structural block diagram of a flow table management device in an embodiment;
[0044] Figure 6 is a structural block diagram of a flow table management device in another embodiment;
[0045] Figure 7 is an internal structure diagram of a computer device in one embodiment;
[0046] FIG. 8 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The flow table management method provided in this application can be applied to Figure 1 In the application environment shown. Specifically, the network card 102 can receive a data message, and parse the message header of the data message to obtain the message header information of the data message. The network card 102 can match the message header information with the hardware flow table in the network card 102; if there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the message header information is sent to the host 104. The network card 102 can receive a flow table deletion instruction issued by the host 104 after determining that the hardware flow entry has aged based on the message header information, and delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0049] It is understood that this embodiment does not limit this. It is understood that Figure 1 The application scenarios are only for illustration and are not limited to this.
[0050] In one embodiment, Figure 2 As shown, a flow table management method is provided, which is applied to a network card; the method comprises the following steps:
[0051] Step 202: Receive a data message, and parse the message header of the data message to obtain the message header information of the data message.
[0052] Specifically, the service system can send data messages to the network card, and the network card can receive the data messages, wherein the network card is a hardware logic device. The network card can start the hardware logic built into the network card to parse the message header of the data message to obtain the message header information of the data message.
[0053] Step 204: Match the message header information with the hardware flow table in the network card.
[0054] Specifically, the network card includes a hardware flow table, and the hardware flow table includes multiple hardware flow entries. Each hardware flow entry has a mapping relationship with the corresponding message header information. After parsing and obtaining the message header information of the data message, the network card can match the message header information with the message header information corresponding to each hardware flow entry in the hardware flow table to determine whether there is a hardware flow entry in the hardware flow table that matches the message header information of the message data.
[0055] Step 206: If there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the message header information is sent to the host.
[0056] In one embodiment, if there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the network card can send the message header information to the host. The network card can notify the host that new message header information has been uploaded through an interrupt or event notification mechanism, so as to remind the host to process it in time. At the same time, the network card can perform corresponding data processing on the data message, such as forwarding the data message to a third-party device.
[0057] Step 208: receiving a flow table deletion instruction issued by the host after determining that the hardware flow entry has aged based on the message header information.
[0058] Specifically, after receiving the message header information, the host can determine whether the hardware flow entry has aged based on the message header information. If the hardware flow entry is determined to have aged based on the message header information, the host can send a flow table deletion instruction to the network card, and the network card can receive the flow table deletion instruction sent by the host.
[0059] Step 210: Delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0060] Specifically, after receiving the flow table deletion instruction sent by the host, the network card can find the hardware flow entry in the hardware flow table, and delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0061] In the above flow table management method, the network card receives the data message, and parses the message header of the data message to obtain the message header information of the data message; matches the message header information with the hardware flow table in the network card; if there is a hardware flow entry in the hardware flow table that matches the message header information, and the sampling count of the hardware flow entry meets the preset sampling condition, the message header information is sent to the host; the host receives the flow table deletion instruction issued after judging that the hardware flow entry has aged based on the message header information; based on the flow table deletion instruction, the hardware flow entry in the hardware flow table is deleted. Compared with the traditional flow table management method, the present application uses a message sampling mechanism to send message samples to the host on the network card side, so that the flow table aging optimization is handed over to the host software, thereby realizing the software processing of the flow table aging logic, which can reduce the pressure of frequent synchronization of software and hardware message counts, effectively alleviate the performance bottleneck caused by frequent synchronization of flow table hits between the network card hardware and the host software, and improve the processing performance of the host.
[0062] In one embodiment, the method also includes: if the sampling time interval counted by the sampling counter corresponding to the hardware flow entry meets the preset time interval, then it is determined that the sampling count of the hardware flow entry meets the preset sampling condition; or, if the number of sampled messages counted by the sampling counter corresponding to the hardware flow entry meets the preset number of messages, then it is determined that the sampling count of the hardware flow entry meets the preset sampling condition.
[0063] In the above embodiment, by setting a preset time interval or a preset number of messages in the sampling counter, the setting of the network card triggering the sending of the message header information to the host is made more flexible.
[0064] In one embodiment, Figure 3 As shown, a flow table management method is provided, which is applied to a network card; the method comprises the following steps:
[0065] Step 302, receiving the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is sent after determining that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition.
[0066] Step 304: determine whether the hardware flow entry has aged based on the message header information.
[0067] Step 306: If it is determined that the hardware flow entry has aged, a flow table deletion instruction for the hardware flow entry is generated, and the flow table deletion instruction is sent to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0068] Specifically, the service system can send a data message to the network card, and the network card can receive the data message, wherein the network card is a hardware logic device. The network card can start the hardware logic built into the network card to parse the message header of the data message and obtain the message header information of the data message. The network card includes a hardware flow table, and the hardware flow table includes multiple hardware flow entries. Among them, each hardware flow entry has a mapping relationship with the corresponding message header information. After parsing and obtaining the message header information of the data message, the network card can match the message header information with the message header information corresponding to each hardware flow entry in the hardware flow table to determine whether there is a hardware flow entry matching the message header information of the message data in the hardware flow table. If there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the network card can send the message header information to the host. The network card can notify the host that new message header information has been uploaded through an interrupt or event notification mechanism, so as to remind the host to process it in time. At the same time, the network card can perform corresponding data processing on the data message, such as forwarding the data message to a third-party device. After receiving the message header information, the host can determine whether the hardware flow entry has aged based on the message header information. If the hardware flow entry is determined to have aged based on the message header information, the host can send a flow table deletion instruction to the network card, and the network card can receive the flow table deletion instruction sent by the host. After receiving the flow table deletion instruction sent by the host, the network card can find the hardware flow entry in the hardware flow table and delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0069] In the above embodiment, the host receives the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is judged that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition before sending; based on the message header information, it is judged whether the hardware flow entry has aged; if it is judged that the hardware flow entry has aged, a flow table deletion instruction for the hardware flow entry is generated, and the flow table deletion instruction is sent to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction. Compared with the traditional flow table management method, the present application uses a message sampling mechanism to send message samples to the host on the network card side, so that the flow table aging optimization is handed over to the host software, thereby realizing the software processing of the flow table aging logic, which can reduce the pressure of frequent synchronization of software and hardware message counts, effectively alleviate the performance bottleneck caused by frequent synchronization of flow table hits between the network card hardware and the host software, and improve the processing performance of the host.
[0070] In one embodiment, the host includes a network card driver and a data processing software program; receiving the message header information of the data message sent by the network card, including: receiving the message header information of the data message sent by the network card through the network card driver, and sending the message header information to the data processing software program; judging whether the hardware flow entry has aged based on the message header information, including: judging whether the hardware flow entry has aged based on the message header information through the data processing software program.
[0071] In one embodiment, the data processing software program may be a DPDK (Data Plane Development Kit) application. DPDK runs on a Linux system and is a collection of function libraries and drivers for fast data packet processing, which can greatly improve data processing performance and throughput, and improve the work efficiency of data plane applications.
[0072] In the above embodiment, a network card driver and a data processing software program are set in the host so that the host can separate the interaction process with the network card from the data processing process, thereby improving the data processing performance and efficiency of the host.
[0073] In one embodiment, a software flow table corresponding to the hardware flow table is stored in the host; judging whether the hardware flow entry has aged based on the message header information by a data processing software program includes: matching the message header information with the software flow table in the host by the data processing software program; if there is a software flow entry in the software flow table that matches the message header information, determining that the hardware flow entry has not aged; if there is no software flow entry in the software flow table that matches the message header information, determining that the hardware flow entry has aged.
[0074] In the above embodiment, the packet header information is matched with the software flow table in the host by the data processing software program to determine whether the hardware flow entry in the network card has aged, which can improve the accuracy of determining the aging of the hardware flow entry.
[0075] In one embodiment, Figure 4As shown, the business system can send a data message to the network card, the network card can receive the data message, and start the built-in hardware logic in the network card to parse the message header of the data message to obtain the message header information of the data message. The network card includes a hardware flow table, and the hardware flow table includes multiple hardware flow entries. Among them, each hardware flow entry has a mapping relationship with the corresponding message header information. After parsing and obtaining the message header information of the data message, the network card can match the message header information with the message header information corresponding to each hardware flow entry in the hardware flow table to determine whether there is a hardware flow entry matching the message header information of the message data in the hardware flow table. If there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the network card can send the message header information to the network card driver of the host. The host can receive the message header information of the data message sent by the network card through the network card driver, and send the message header information to the data processing software program. The host can determine whether the hardware flow entry has aged based on the message header information through the data processing software program. If the hardware flow entry is judged to be aged based on the message header information, the host can send a flow table deletion instruction to the network card through the network card driver, and the network card can receive the flow table deletion instruction sent by the host. After receiving the flow table deletion instruction sent by the host, the network card can find the hardware flow entry in the hardware flow table and delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0076] It should be understood that, although each step in the flow chart of the above-mentioned embodiments is shown in order, these steps are not necessarily performed in order. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in order, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0077] In one embodiment, Figure 5 As shown, a flow table management device 500 is provided, which is applied to a network card; the device specifically includes:
[0078] The parsing module 502 is used to receive a data message and parse the message header of the data message to obtain the message header information of the data message;
[0079] A matching module 504, used to match the message header information with the hardware flow table in the network card;
[0080] A first sending module 506, configured to send the message header information to the host if there is a hardware flow entry matching the message header information in the hardware flow table and the sampling count of the hardware flow entry meets a preset sampling condition;
[0081] A first receiving module 508, configured to receive a flow table deletion instruction issued by the host after determining that the hardware flow entry has aged based on the message header information;
[0082] The deleting module 510 is configured to delete a hardware flow entry in the hardware flow table based on a flow table deletion instruction.
[0083] In one embodiment, the first sending module 508 is also used to determine that the sampling count of the hardware flow entry meets the preset sampling condition if the sampling time interval counted by the sampling counter corresponding to the hardware flow entry meets the preset time interval; or, if the number of sampling messages counted by the sampling counter corresponding to the hardware flow entry meets the preset message number, then determine that the sampling count of the hardware flow entry meets the preset sampling condition.
[0084] In the above-mentioned flow table management device, the network card receives the data message, and parses the message header of the data message to obtain the message header information of the data message; matches the message header information with the hardware flow table in the network card; if there is a hardware flow entry in the hardware flow table that matches the message header information, and the sampling count of the hardware flow entry meets the preset sampling condition, the message header information is sent to the host; the flow table deletion instruction issued by the host after the host determines that the hardware flow entry has aged based on the message header information is received; based on the flow table deletion instruction, the hardware flow entry in the hardware flow table is deleted. Compared with the traditional flow table management method, the present application uses a message sampling mechanism to send message samples to the host on the network card side, so that the flow table aging optimization is handed over to the host software, thereby realizing the software processing of the flow table aging logic, which can reduce the pressure of frequent synchronization of software and hardware message counts, effectively alleviate the performance bottleneck caused by frequent synchronization of flow table hits between the network card hardware and the host software, and improve the processing performance of the host.
[0085] In one embodiment, Figure 6 As shown, a flow table management device 600 is provided, which is applied to a host; the device specifically includes:
[0086] The second receiving module 602 is used to receive the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is determined that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition and is sent;
[0087] A determination module 604 is used to determine whether the hardware flow entry has aged based on the message header information;
[0088] The second sending module 606 is used to generate a flow table deletion instruction for the hardware flow entry if it is determined that the hardware flow entry has aged, and send the flow table deletion instruction to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
[0089] In one embodiment, the host includes a network card driver and a data processing software program; the second receiving module 602 is also used to receive the message header information of the data message sent by the network card through the network card driver, and send the message header information to the data processing software program; the judgment module 604 is also used to judge whether the hardware flow entry has aged based on the message header information through the data processing software program.
[0090] In one embodiment, a software flow table corresponding to the hardware flow table is stored in the host; the judgment module 604 is also used to match the message header information with the software flow table in the host through a data processing software program; if there is a software flow entry in the software flow table that matches the message header information, it is determined that the hardware flow entry has not aged; if there is no software flow entry in the software flow table that matches the message header information, it is determined that the hardware flow entry has aged.
[0091] In the above-mentioned flow table management device, the host receives the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is judged that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition before sending; based on the message header information, it is judged whether the hardware flow entry has aged; if it is judged that the hardware flow entry has aged, a flow table deletion instruction for the hardware flow entry is generated, and the flow table deletion instruction is sent to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction. Compared with the traditional flow table management method, the present application uses a message sampling mechanism to send message samples to the host on the network card side, so that the flow table aging optimization is handed over to the host software, thereby realizing the software processing of the flow table aging logic, which can reduce the pressure of frequent synchronization of software and hardware message counts, effectively alleviate the performance bottleneck caused by frequent synchronization of flow table hits between the network card hardware and the host software, and improve the processing performance of the host.
[0092] Each module in the above-mentioned flow table management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0093] In one embodiment, a computer device is provided. The computer device may be a host, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a flow table management method is implemented.
[0094] In one embodiment, a computer device is provided, which may be a network card, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a flow table management method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0095] Those skilled in the art will understand that Figure 7 The structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0096] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0097] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0098] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0099] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0100] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0101] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A flow table management method, characterized in that: Applied to a network card; the method comprises: Receive a data message, and parse the message header of the data message to obtain the message header information of the data message; Matching the message header information with the hardware flow table in the network card; If there is a hardware flow entry matching the message header information in the hardware flow table, and the sampling count of the hardware flow entry meets the preset sampling condition, the message header information is sent to the host; receiving a flow table deletion instruction issued by the host after determining that the hardware flow entry has aged based on the message header information; The hardware flow entry in the hardware flow table is deleted based on the flow table deletion instruction.
2. The method according to claim 1, characterized in that The method further comprises: If the sampling time interval counted by the sampling counter corresponding to the hardware flow entry meets the preset time interval, it is determined that the sampling count of the hardware flow entry meets the preset sampling condition; or, If the number of sampled messages counted by the sampling counter corresponding to the hardware flow entry meets the preset number of messages, it is determined that the sampling count of the hardware flow entry meets the preset sampling condition.
3. A flow table management method, characterized in that: Applied to a host; the method comprises: Receive the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is determined that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition and is sent; Determining whether the hardware flow entry has aged based on the message header information; If it is determined that the hardware flow entry has aged, a flow table deletion instruction for the hardware flow entry is generated, and the flow table deletion instruction is sent to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
4. The method according to claim 3, characterized in that: The host computer includes a network card driver and a data processing software program; The message header information of the data message sent by the receiving network card includes: Receiving the message header information of the data message sent by the network card through the network card driver, and sending the message header information to the data processing software program; The determining whether the hardware flow entry has aged based on the message header information includes: The data processing software program determines whether the hardware flow entry has aged based on the message header information.
5. The method according to claim 4, characterized in that The host stores a software flow table corresponding to the hardware flow table; The determining whether the hardware flow entry has aged based on the message header information by the data processing software program includes: Matching the message header information with the software flow table in the host through the data processing software program; If there is a software flow entry matching the message header information in the software flow table, it is determined that the hardware flow entry is not aged; If there is no software flow entry matching the message header information in the software flow table, it is determined that the hardware flow entry has aged.
6. A flow table management device, characterized in that: Applied to a network card; the device comprises: A parsing module, used for receiving a data message, and parsing a message header of the data message to obtain message header information of the data message; A matching module, used for matching the message header information with the hardware flow table in the network card; A first sending module, configured to send the message header information to a host if there is a hardware flow entry matching the message header information in the hardware flow table and the sampling count of the hardware flow entry meets a preset sampling condition; A first receiving module, configured to receive a flow table deletion instruction issued by the host after the host determines that the hardware flow entry has aged based on the message header information; A deleting module is used to delete the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
7. A flow table management device, characterized in that: Applied to a host; the device comprises: The second receiving module is used to receive the message header information of the data message sent by the network card; the message header information is obtained by the network card when parsing the message header of the received data message, and it is judged that there is a hardware flow entry matching the message header information in the hardware flow table of the network card, and the sampling count of the hardware flow entry meets the preset sampling condition and is sent; A judging module, configured to judge whether the hardware flow entry has aged based on the message header information; The second sending module is used to generate a flow table deletion instruction for the hardware flow entry if it is determined that the hardware flow entry has aged, and send the flow table deletion instruction to the network card, so that the network card deletes the hardware flow entry in the hardware flow table based on the flow table deletion instruction.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Stream aging method and network appliance
CN101247353A
Flow table processing method, Openflow switch and computing device
CN115996201A
Network card detection method and device, electronic equipment and storage medium
CN116016258A
Hardware flow table aging and statistical method of intelligent network card
CN117851203A
Flow speed limiting device and method based on hardware unloading
CN118250228A
Cited By
RDMA message forwarding method and network card
CN122554388A