User mode protocol stack health check method and device, equipment and storage medium

By using a health check method based on the user-mode protocol stack and directly sending and receiving health check messages using Keepalived and DPVS, the performance bottleneck of the KNI port is avoided, the problems of health check delay and inaccurate identification in the existing technology are solved, and more efficient back-end exception handling is achieved.

CN120474954BActive Publication Date: 2025-10-21CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510959078.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-10-21
Estimated Expiration
2045-07-11

AI Technical Summary

Technical Problem

In the existing technology, the Keepalived health check program uses the kni port for message interaction, which has a performance bottleneck and causes delays and inaccurate backend identification when the backend is abnormal.

Method used

A health check method based on the user-state protocol stack is adopted. The health check of the server cluster is performed using the user-state protocol stack through Keepalived. The message characteristics of the health check message are used to send the preset FDIR rules to the target network card. The target network card receives the packet and obtains the packet reception result. The abnormal backend location is determined based on the packet reception result, avoiding the flow of health check messages in DPVS and kernel-state protocol stack.

Benefits of technology

Improved the performance of Keepalived, increased the convenience of removing the DPVS backend and the accuracy of health checks, ensured the accuracy of backend anomaly identification, and improved the speed and efficiency of health checks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120474954B_ABST
    Figure CN120474954B_ABST
Patent Text Reader

Abstract

The application discloses a user-mode protocol stack health check method and device, equipment and storage medium, the method uses the user-mode protocol stack to check the health of the server cluster by using Keepalived, obtains the health check message; according to the message characteristics of the health check message, the preset FDIR rule is issued to the target network card, and the packet is received through the target network card, and the packet receiving result is obtained; according to the packet receiving result, the abnormal back-end position in the server cluster is determined, the abnormal back-end is removed according to the abnormal back-end position, the health check message can be avoided to circulate in DPVS and the kernel-mode protocol stack, the performance of Keepalived is improved, the convenience of removing the back-end of DPVS is improved, the precision of Keepalived health check is improved, the accuracy when identifying the back-end exception is guaranteed, and the speed and efficiency of the user-mode protocol stack health check are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data health check, and in particular to a health check method, apparatus, device and storage medium based on a user-mode protocol stack. Background Art

[0002] DPDK, short for Data Plane Development Kit, is a data plane development toolkit provided by Intel. It provides library functions and driver support for efficient user-space packet processing under the Intel architecture (IA) processor architecture. Unlike the Linux system, which is designed for general purpose, it focuses on high-performance packet processing in network applications. DPDK applications run in user space and use their own data plane library to send and receive packets, bypassing the packet processing process of the Linux kernel protocol stack. The Linux kernel regards DPDK applications as ordinary user-mode processes, including their compilation, linking, and loading methods are no different from those of ordinary programs. After starting, the DPDK program can only have one main thread, and then create some child threads and bind them to specific CPU cores to run.

[0003] Kni (Kernel NIC Interface) is a DPDK solution that allows user mode and kernel mode to exchange messages. It simulates a virtual network port and provides communication between DPDK applications and the Linux kernel. The Kni interface allows messages to be received from user mode and forwarded to the Linux protocol stack.

[0004] DPVS is a high-performance Layer-4 load balancer based on DPDK. The name DPVS comes from DPDK+LVS.

[0005] Keepalived is a lightweight high-availability solution for Linux, specifically used to monitor the status of each service node in a cluster system. It detects the status of each service node based on the third, fourth, and fifth layer switching mechanisms of the Transmission Control Protocol (TCP) / Internet Protocol (IP) reference model. If a service node becomes abnormal or fails, Keepalived will detect it and remove the failed service node from the cluster system. After the failed node returns to normal, Keepalived can automatically re-add the service node to the server cluster. All these tasks are completed automatically without manual intervention. The only manual work required is to repair the failed service node.

[0006] Health check is an important part of the four-layer load balancing. It helps the load balancer determine whether the business backend services are in normal working condition and promptly eliminates non-working backend services, so that the load balanced backend services are always in a healthy state and ensure the stable operation of the load balanced business.

[0007] The backend in the cloudification scenario is located in the cloudification network. Traditional health check programs are implemented as socket programs. Therefore, after receiving the health check message, DPVS needs to send it to the kernel protocol stack through the KNI port for processing. When the health check program sends the health check message, it also needs to forward the message to DPVS through the KNI port. Then DPVS sends the health check message through the physical network card.

[0008] When the health check program Keepalived detects a backend anomaly, it notifies DPVS through the ipvsadm tool to update the backend list. The specific process is as follows:

[0009] TCP_CHECK → Health check fails → Set internal status to DOWN → Call ipvsadm to remove or restore the backend → DPVS stops or restarts traffic distribution.

[0010] In the above solution, there are two flaws in the interaction between the Keepalived health check program and DPVS:

[0011] 1. The Keepalived health check program needs to interact with the DPVS program through the KNI port when sending and receiving health check messages. The KNI port will become a performance bottleneck for health check message interaction.

[0012] 2. When the Keepalived health checker detects a backend anomaly, it removes or restores the backend by calling the ipvsadm tool to notify DPVS to update the backend list (the underlying layer uses Unix domain sockets for message exchange). This results in latency and issues with identifying backends with the same IP address in different VPCs. Summary of the Invention

[0013] The main purpose of the present invention is to provide a health check method, device, equipment and storage medium based on the user-mode protocol stack, aiming to solve the technical problems of Keepalived health check program in the prior art, the use of KNI port, the message performance interaction bottleneck, and the delay and inaccurate back-end identification when the back-end abnormality occurs.

[0014] In a first aspect, the present invention provides a user-mode protocol stack health check method, the user-mode protocol stack health check method comprising the following steps:

[0015] Use Keepalived to perform health checks on the server cluster using the user-mode protocol stack and obtain health check messages;

[0016] Sending a preset FDIR rule to a target network card according to the message characteristics of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result;

[0017] The abnormal backend position in the server cluster is determined according to the packet receiving result, and the abnormal backend is removed according to the abnormal backend position.

[0018] Optionally, performing a health check on the server cluster using a user-mode protocol stack using Keepalived to obtain a health check message includes:

[0019] Use Keepalived and the user-mode protocol stack to perform health checks on the server cluster through DPVS and obtain health check messages.

[0020] Optionally, using Keepalived using a user-mode protocol stack to perform a health check on the server cluster through DPVS to obtain a health check message includes:

[0021] Use Keepalived to send health check requests to each server in the server cluster using the user-mode protocol stack at preset time intervals;

[0022] Receive response information from each server receiving the health check request, analyze the response information through DPVS to obtain analysis results, and generate a health check message based on the analysis results.

[0023] Optionally, the sending of a preset FDIR rule to a target network card according to a message feature of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result includes:

[0024] Acquire a message format, a source IP address, a destination IP address, a port number, and message content from the health check message, and use the message format, the source IP address, the destination IP address, the port number, and the message content as message features;

[0025] According to the message characteristics, the preset FDIR rules are issued to the target network card, and the health check message returned from the back end is redirected to the separate queue of the target network card using the preset FDIR rules to complete the packet reception and obtain the packet reception result.

[0026] Optionally, issuing a preset FDIR rule to a target network card according to the message feature, redirecting the health check message returned from the backend to a separate queue of the target network card by using the preset FDIR rule, completing packet reception, and obtaining a packet reception result includes:

[0027] Sending the preset FDIR rules to the target network card, and configuring the target network card according to the preset FDIR rules and the message characteristics;

[0028] After receiving the message feature, the target network card monitors and analyzes the message feature according to the preset FDIR rule to obtain an analysis result;

[0029] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, the health check message returned from the backend is redirected to a separate queue of the target network card using the preset FDIR rule to complete packet reception and obtain a packet reception result.

[0030] Optionally, when the analysis result indicates that the message feature matches a condition of the preset FDIR rule, redirecting the health check message returned from the backend to a separate queue of the target network card using the preset FDIR rule, completing packet reception, and obtaining a packet reception result includes:

[0031] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, determining the network card queue corresponding to the target network card;

[0032] Execute a health check thread from the network card queue, receive packets, and generate a packet receiving result.

[0033] Optionally, determining the abnormal backend location in the server cluster according to the packet receiving result, and removing the abnormal backend according to the abnormal backend location includes:

[0034] Obtain the number of received packets, error rate, and delay time from the packet receiving result;

[0035] The Keepalived health check program is used to detect and analyze the number of received packets, error rate, and delay time to determine the abnormal backend location in the server cluster;

[0036] According to the preset exception handling strategy, the abnormal backend corresponding to the abnormal backend position is removed from the forwarding list of the load balancer, and the abnormal information is fed back to the system administrator.

[0037] In a second aspect, to achieve the above-mentioned purpose, the present invention further proposes a user-mode protocol stack health check device, the user-mode protocol stack health check device comprising:

[0038] The check module is used to use Keepalived to perform health checks on the server cluster using the user-mode protocol stack and obtain health check messages;

[0039] A packet receiving module is used to send a preset FDIR rule to a target network card according to the message characteristics of the health check message, receive the packet through the target network card, and obtain a packet receiving result;

[0040] The abnormal removal module is used to determine the abnormal backend position in the server cluster according to the packet receiving result, and remove the abnormal backend according to the abnormal backend position.

[0041] In the third aspect, in order to achieve the above-mentioned purpose, the present invention also proposes a user-mode protocol stack-based health check device, which includes: a memory, a processor, and a user-mode protocol stack-based health check program stored on the memory and runnable on the processor, and the user-mode protocol stack-based health check program is configured to implement the steps of the user-mode protocol stack-based health check method as described above.

[0042] In a fourth aspect, in order to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a user-mode protocol stack health check program is stored. When the user-mode protocol stack health check program is executed by the processor, the steps of the user-mode protocol stack health check method as described above are implemented.

[0043] The user-mode protocol stack health check method proposed in the present invention performs a health check on a server cluster using the user-mode protocol stack by utilizing Keepalived to obtain a health check message; sends a preset FDIR rule to a target network card according to the message characteristics of the health check message, receives the packet through the target network card, and obtains a packet receiving result; determines the abnormal backend position in the server cluster according to the packet receiving result, and removes the abnormal backend according to the abnormal backend position, thereby avoiding the flow of health check messages in the DPVS and kernel-mode protocol stacks and being independent of the kernel protocol stack, thereby improving the performance of Keepalived, improving the convenience of removing the DPVS backend, improving the accuracy of Keepalived health checks, ensuring the accuracy of identifying backend anomalies, and improving the speed and efficiency of health checks based on the user-mode protocol stack. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;

[0045] Figure 2 This is a flow chart of a first embodiment of a user-mode protocol stack health check method according to the present invention;

[0046] Figure 3 This is a flow chart of a second embodiment of the user-mode protocol stack health check method according to the present invention;

[0047] Figure 4 This is a flow chart of a third embodiment of a method for checking user-mode protocol stack health according to the present invention;

[0048] Figure 5 This is a flow chart of a fourth embodiment of a user-mode protocol stack health check method according to the present invention;

[0049] Figure 6 This is a schematic diagram of the overall architecture of the DPVS program in the user-mode protocol stack health check method of the present invention;

[0050] Figure 7 This is a functional module diagram of the first embodiment of the user-mode protocol stack health check device of the present invention.

[0051] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0053] The solution of the embodiment of the present invention is mainly as follows: by using Keepalived to use the user-mode protocol stack to perform a health check on the server cluster, a health check message is obtained; according to the message characteristics of the health check message, a preset FDIR rule is issued to the target network card, and the packet is received by the target network card to obtain a packet receiving result; according to the packet receiving result, the abnormal backend position in the server cluster is determined, and the abnormal backend is removed according to the abnormal backend position, which can avoid the flow of health check messages in DPVS and kernel-mode protocol stacks and does not rely on the kernel protocol stack, thereby improving the performance of Keepalived, improving the convenience of removing the DPVS backend, improving the accuracy of Keepalived health checks, ensuring the accuracy of identifying backend anomalies, and improving the speed and efficiency of health checks based on the user-mode protocol stack, solving the technical problems of the Keepalived health check program in the prior art, using the KNI port to have a message performance interaction bottleneck, and having time delay and inaccurate backend identification when a backend anomaly occurs.

[0054] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0055] like Figure 1As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as a disk storage. The memory 1005 may also be a storage device independent of the processor 1001.

[0056] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0057] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and a health check program based on a user-mode protocol stack.

[0058] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001 and performs the following operations:

[0059] Use Keepalived to perform health checks on the server cluster using the user-mode protocol stack and obtain health check messages;

[0060] Sending a preset FDIR rule to a target network card according to the message characteristics of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result;

[0061] The abnormal backend position in the server cluster is determined according to the packet receiving result, and the abnormal backend is removed according to the abnormal backend position.

[0062] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001, and further performs the following operations:

[0063] Use Keepalived and the user-mode protocol stack to perform health checks on the server cluster through DPVS and obtain health check messages.

[0064] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001, and further performs the following operations:

[0065] Use Keepalived to send health check requests to each server in the server cluster using the user-mode protocol stack at preset time intervals;

[0066] Receive response information from each server receiving the health check request, analyze the response information through DPVS to obtain analysis results, and generate a health check message based on the analysis results.

[0067] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001, and further performs the following operations:

[0068] Acquire a message format, a source IP address, a destination IP address, a port number, and message content from the health check message, and use the message format, the source IP address, the destination IP address, the port number, and the message content as message features;

[0069] According to the message characteristics, the preset FDIR rules are issued to the target network card, and the health check message returned from the back end is redirected to the separate queue of the target network card using the preset FDIR rules to complete the packet reception and obtain the packet reception result.

[0070] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001, and further performs the following operations:

[0071] Sending the preset FDIR rules to the target network card, and configuring the target network card according to the preset FDIR rules and the message characteristics;

[0072] After receiving the message feature, the target network card monitors and analyzes the message feature according to the preset FDIR rule to obtain an analysis result;

[0073] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, the health check message returned from the backend is redirected to a separate queue of the target network card using the preset FDIR rule to complete packet reception and obtain a packet reception result.

[0074] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001, and further performs the following operations:

[0075] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, determining the network card queue corresponding to the target network card;

[0076] Execute a health check thread from the network card queue, receive packets, and generate a packet receiving result.

[0077] The device of the present invention calls the user-mode protocol stack health check program stored in the memory 1005 through the processor 1001, and further performs the following operations:

[0078] Obtain the number of received packets, error rate, and delay time from the packet receiving result;

[0079] The Keepalived health check program is used to detect and analyze the number of received packets, error rate, and delay time to determine the abnormal backend location in the server cluster;

[0080] According to the preset exception handling strategy, the abnormal backend corresponding to the abnormal backend position is removed from the forwarding list of the load balancer, and the abnormal information is fed back to the system administrator.

[0081] Through the above scheme, this embodiment uses Keepalived to use the user-mode protocol stack to perform a health check on the server cluster to obtain a health check message; according to the message characteristics of the health check message, a preset FDIR rule is sent to the target network card, and the packet is received by the target network card to obtain a packet receiving result; according to the packet receiving result, the abnormal backend position in the server cluster is determined, and the abnormal backend is removed according to the abnormal backend position. This can avoid the flow of health check messages in DPVS and kernel-mode protocol stacks, does not rely on the kernel protocol stack, improves the performance of Keepalived, improves the convenience of removing the DPVS backend, improves the accuracy of Keepalived health checks, ensures the accuracy of identifying backend anomalies, and improves the speed and efficiency of health checks based on the user-mode protocol stack.

[0082] Based on the above hardware structure, an embodiment of the user-mode protocol stack health check method of the present invention is proposed.

[0083] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the user-mode protocol stack health check method according to the present invention.

[0084] In a first embodiment, the user-mode protocol stack health check method includes the following steps:

[0085] Step S10: Use Keepalived to perform a health check on the server cluster using the user-mode protocol stack to obtain a health check message.

[0086] It should be noted that Keepalived can be used to use the user-mode protocol stack to perform health checks on the server cluster and obtain health check messages.

[0087] Step S20: Sending a preset FDIR rule to a target network card according to the message characteristics of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result.

[0088] It should be understood that, generally, in a network environment, in order to ensure the normal operation of servers, network devices, etc., health check messages are sent regularly, and the characteristics of the health check messages are given to the Ethernet FlowDirector technology (Intel Ethernet Flow Director, FDIR) rules pre-set under the network card. FDIR is a technology proposed by Intel that accurately matches the fields of the packet and assigns it to a specific queue. That is, the preset FDIR rules are sent to the target network card based on the message characteristics of the health check message, and the packet is received through the target network card to obtain the packet receiving result.

[0089] In a specific implementation, by adding a user-mode protocol stack, the Keepalived program can be rewritten to use the user-mode protocol stack to send and receive messages.

[0090] Step S30: Determine the location of the abnormal backend in the server cluster according to the packet receiving result, and remove the abnormal backend according to the abnormal backend location.

[0091] It is understandable that the location of the abnormal backend in the server cluster can be determined based on the packet receiving result, and the abnormal backend can be removed based on the abnormal backend location.

[0092] Through the above scheme, this embodiment uses Keepalived to use the user-mode protocol stack to perform a health check on the server cluster to obtain a health check message; according to the message characteristics of the health check message, a preset FDIR rule is sent to the target network card, and the packet is received by the target network card to obtain a packet receiving result; according to the packet receiving result, the abnormal backend position in the server cluster is determined, and the abnormal backend is removed according to the abnormal backend position. This can avoid the flow of health check messages in DPVS and kernel-mode protocol stacks, does not rely on the kernel protocol stack, improves the performance of Keepalived, improves the convenience of removing the DPVS backend, improves the accuracy of Keepalived health checks, ensures the accuracy of identifying backend anomalies, and improves the speed and efficiency of health checks based on the user-mode protocol stack.

[0093] Furthermore, Figure 3 This is a flow chart of the second embodiment of the user-mode protocol stack health check method according to the present invention. Figure 3As shown, based on the first embodiment, a second embodiment of the user-mode protocol stack health check method of the present invention is proposed. In this embodiment, step S10 specifically includes the following steps:

[0094] Step S11: Use Keepalived to use the user-mode protocol stack and perform a health check on the server cluster through DPVS to obtain a health check message.

[0095] It should be noted that after using the user-mode protocol stack, Keepalived can directly send and receive health check messages through DPVS, avoiding the use of the KNI port and the kernel-mode protocol stack for message interaction, and solving the performance problems caused by the KNI port. Keepalived is a high-availability solution based on the Virtual Router Redundancy Protocol (VRRP) protocol, which is often used to implement server failover and load balancing. It can monitor the status of the server and automatically switch the service to the backup server when the primary server fails, thereby ensuring service continuity. In the health check scenario, Keepalived can periodically send check requests to the server and determine whether it is operating normally based on the server's response. By using Keepalived and the user-mode protocol stack, you can perform health checks on the server cluster through DPVS and obtain health check messages.

[0096] Furthermore, the step S11 specifically includes the following steps:

[0097] Use Keepalived to send health check requests to each server in the server cluster using the user-mode protocol stack at preset time intervals;

[0098] Receive response information from each server receiving the health check request, analyze the response information through DPVS to obtain analysis results, and generate a health check message based on the analysis results.

[0099] It can be understood that Keepalived uses the user-mode protocol stack to send health check requests (for example, HTTP requests, TCP connection requests, etc.) to each server in the server cluster at a certain time interval, that is, the preset time interval. After receiving the request, the server will return a response. DPVS will determine whether the server is running normally based on the analysis results of Keepalived on these responses. If a server fails or the response times out, DPVS will remove it from the list of available servers and no longer distribute new requests to the server.

[0100] This embodiment adopts the above solution, uses Keepalived to use the user-mode protocol stack, performs health checks on the server cluster through DPVS, and obtains health check messages. This can avoid the flow of health check messages between DPVS and the kernel-mode protocol stack, does not rely on the kernel protocol stack, and improves the speed and efficiency of health checks based on the user-mode protocol stack.

[0101] Furthermore, Figure 4 This is a flow chart of the third embodiment of the user-mode protocol stack health check method according to the present invention. Figure 4 As shown, based on the first embodiment, a third embodiment of the user-mode protocol stack health check method of the present invention is proposed. In this embodiment, step S20 specifically includes the following steps:

[0102] Step S21: Obtain a message format, a source IP address, a destination IP address, a port number, and message content from the health check message, and use the message format, the source IP address, the destination IP address, the port number, and the message content as message features.

[0103] It should be noted that the health check message has corresponding characteristics, namely, message format, source IP address, destination IP address, port number and message content, and the message format, source IP address, destination IP address, port number and message content are used as message characteristics.

[0104] In specific implementations, different health check protocols have their own specific message formats. For example, common HTTP health check messages follow the HTTP protocol format and include parts such as the request line, request header, blank line, and request body. SNMP (Simple Network Management Protocol) health check messages also have their standard PDU (Protocol Data Unit) format.

[0105] Source IP and destination IP, that is, health check messages usually have fixed source IP addresses (sender) and destination IP addresses (receiver); for example, a load balancer may act as the source and send health check messages to each server in a server cluster. In this case, the load balancer's IP is the source IP, and the server's IP is the destination IP.

[0106] The port number is the number of ports that the message will use for communication. For example, HTTP health checks usually use port 80 (HTTP) or 443 (HTTPS); FTP health checks may use ports 20 and 21.

[0107] Message content: The message may contain a specific string or data to identify it as a health check request. For example, an HTTP health check request may contain a URL path such as " / healthcheck".

[0108] Step S22: issuing a preset FDIR rule to the target network card according to the message characteristics, redirecting the health check message returned from the backend to a separate queue of the target network card using the preset FDIR rule, completing packet reception, and obtaining a packet reception result.

[0109] It is understandable that, according to the message characteristics, a preset FDIR rule may be sent to the target network card, and the target network card receives the packet to obtain a corresponding packet receiving result.

[0110] Furthermore, the step S22 specifically includes the following steps:

[0111] Sending the preset FDIR rules to the target network card, and configuring the target network card according to the preset FDIR rules and the message characteristics;

[0112] After receiving the message feature, the target network card monitors and analyzes the message feature according to the preset FDIR rule to obtain an analysis result;

[0113] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, the health check message returned from the backend is redirected to a separate queue of the target network card using the preset FDIR rule to complete packet reception and obtain a packet reception result.

[0114] It should be understood that after the preset FDIR rules are sent to the target network card, the target network card can be configured according to the preset FDIR rules and message characteristics. After receiving the message characteristics, the target network card monitors and analyzes the message characteristics according to the preset FDIR rules to obtain corresponding analysis results. When the analysis result shows that the message characteristics match the conditions of the preset FDIR rules, the target network card can receive the packet to obtain the packet receiving result.

[0115] In the specific implementation, FDIR rules formulated based on the characteristics of health check messages are configured on the network card. The network administrator or operation and maintenance personnel input the pre-defined FDIR rules into the network card configuration through the network card's management interface (such as the command line interface, graphical management tool, etc.); these rules can be set based on various characteristics of the message, such as source IP, destination IP, port number, message format, etc.; after receiving the message, the network card will monitor and analyze the message in real time according to the configured FDIR rules; once the characteristics of the message match the conditions in the rule, the network card will process it according to the action specified by the rule; as the network environment changes or the health check policy is adjusted, the FDIR rules can also be dynamically modified and updated; for example, if the IP address of the server changes, the part about the destination IP in the FDIR rule needs to be modified in time to ensure the accuracy and effectiveness of the health check.

[0116] It should be noted that packet reception refers to the situation in which the server cluster receives network data packets. The packet reception results contain a variety of information, such as the number of received data packets, the integrity of the data packets, whether there is packet loss, the time interval for receiving data packets, etc. These results are the basic data source for subsequent operations.

[0117] Furthermore, when the analysis result shows that the message feature matches the condition of the preset FDIR rule, the health check message returned from the backend is redirected to a separate queue of the target network card using the preset FDIR rule, and the packet is received to obtain a packet receiving result, which specifically includes the following steps:

[0118] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, determining the network card queue corresponding to the target network card;

[0119] Execute a health check thread from the network card queue, receive packets, and generate a packet receiving result.

[0120] It is understandable that when the analysis result shows that the message feature matches the condition of the preset FDIR rule, the network card queue corresponding to the target network card is determined, a health check thread is executed from the network card queue, packets are received, and a packet receiving result is generated.

[0121] It should be noted that the network card queue is a buffer inside the network card for storing data packets. Data packets enter the queue in the order of arrival and wait for processing. Modern network cards are usually equipped with multiple queues, which can work in parallel to improve the processing efficiency of data packets. For example, some high-performance network cards may have 8, 16 or even more receiving queues. The queue can ensure that data packets are processed in the order of arrival to avoid data packet disorder.

[0122] It should be understood that according to the characteristics of the health check message, the FDIR rule is set for the network card so that the health check message can be distributed to a separate network card queue. The health check thread only receives packets from this network card queue, which can ensure that the health check message is not affected by other business messages.

[0123] This embodiment adopts the above scheme, obtains the message format, source IP address, destination IP address, port number and message content from the health check message, and uses the message format, source IP address, destination IP address, port number and message content as message features; issues a preset FDIR rule to the target network card according to the message features, and uses the preset FDIR rule to redirect the health check message returned from the backend to a separate queue of the target network card, completes packet reception, and obtains a packet reception result. This can avoid the flow of health check messages in DPVS and kernel protocol stacks, does not rely on the kernel protocol stack, improves the performance of Keepalived, and improves the speed and efficiency of health checks based on the user protocol stack.

[0124] Furthermore, Figure 5 This is a flow chart of the fourth embodiment of the user-mode protocol stack health check method according to the present invention. Figure 5 As shown, based on the first embodiment, a fourth embodiment of the user-mode protocol stack health check method of the present invention is proposed. In this embodiment, step S30 specifically includes the following steps:

[0125] Step S31: Obtain the number of received packets, error rate, and delay time in the packet receiving result.

[0126] It should be noted that the number of received packets, error rate and delay time in the packet receiving result are obtained.

[0127] Step S32: Detect and analyze the number of received packets, error rate, and delay time through the Keepalived health check program to determine the abnormal backend location in the server cluster.

[0128] It is understandable that the analysis of the packet reception results and the execution of the Keepalived health check program can identify the specific locations of the backend servers in the cluster that are operating abnormally, failing, or experiencing performance degradation (which can be the server's IP address, physical location identifier, etc.).

[0129] In the specific implementation, see Figure 6 , Figure 6 This is a schematic diagram of the overall architecture of the DPVS program in the user-mode protocol stack health check method of the present invention. Figure 6As shown, the DPVS program includes a Keepalived program based on the user-mode protocol stack and a business program. The Keepalived program based on the user-mode protocol stack corresponds to the health check message queue, and the business program corresponds to the business message queue. Compared with the existing technical solutions, this solution adds a user-mode protocol stack module, rewrites the Keepalived program to use the user-mode protocol stack to send and receive messages, and uses a separate network card queue to send and receive health check messages. These changes mainly achieve the following functions:

[0130] 1) Avoid the flow of health check messages between DPVS and kernel protocol stack

[0131] After using the user-mode protocol stack, Keepalived can directly send and receive health check messages through DPVS, avoiding the use of the KNI port and the kernel-mode protocol stack for message interaction and solving the performance problems caused by the KNI port.

[0132] 2) Health check messages go through a separate network card queue

[0133] Based on the characteristics of health check messages, FDIR rules are set for the network card so that the health check messages can be distributed to a separate network card queue. The health check thread only receives packets from this network card queue, ensuring that the health check messages are not affected by other business messages.

[0134] 3) Keepalived health check program runs as a thread of DPVS

[0135] The Keepalived health checker runs as a thread of DPVS. When the Keepalived health checker detects a backend anomaly, it can directly modify the backend status in the backend list in DPVS, which can quickly remove the abnormal backend and solve the problem of identifying overlapping backend IP addresses in the VPC network. As a completely user-mode program, the Keepalived health checker does not rely on the kernel protocol stack. The Keepalived health checker and the four-layer load balancer DPVS are integrated into a single process, which improves the performance of Keepalived and makes it easier to remove and add DPVS backends.

[0136] Step S33: Remove the abnormal backend corresponding to the abnormal backend position from the forwarding list of the load balancer according to the preset abnormality handling strategy, and feedback the abnormality information to the system administrator.

[0137] It should be understood that, according to a preset exception handling policy, the abnormal backend corresponding to the abnormal backend position may be removed from the forwarding list of the load balancer, and the abnormal information may be fed back to the system administrator.

[0138] In the specific implementation, according to the packet receiving results of the server cluster during the network communication process, the detailed indicators such as the number of received packets, error rate, and delay time are deeply analyzed. Then, the diversified detection mechanisms provided by the Keepalived health check program, including but not limited to HTTP request detection, TCP connection detection, and custom script detection, are used to perform a comprehensive and detailed health check on each back-end server in the server cluster. Through the comprehensive analysis of the packet receiving results and the health check data of Keepalived, the specific location of the abnormal back-end server in the server cluster is accurately determined. For example, it is clearly pointed out that the server with a specific IP address on a rack in the data center has experienced severe packet loss, response timeout and other abnormal conditions. At the same time, in order to better handle the abnormality, the system can also automatically record the time when the abnormality occurred, the specific manifestation of the abnormality and other information, and perform corresponding processing according to the preset strategy, such as temporarily removing the abnormal back-end server from the forwarding list of the load balancer, or issuing an alarm to notify the system administrator for further investigation and repair, so as to ensure the overall stability and reliability of the server cluster.

[0139] This embodiment adopts the above scheme, obtains the number of received packets, error rate and delay time in the packet receiving result; detects and analyzes the number of received packets, error rate and delay time through the Keepalived health check program to determine the abnormal backend position in the server cluster; removes the abnormal backend corresponding to the abnormal backend position from the forwarding list of the load balancer according to the preset exception handling strategy, and feeds back the exception information to the system administrator, which can avoid the flow of health check messages in DPVS and kernel protocol stack, does not rely on the kernel protocol stack, improves the performance of Keepalived, improves the convenience of removing the DPVS backend, improves the accuracy of Keepalived health check, ensures the accuracy of identifying backend anomalies, and improves the speed and efficiency of health check based on user protocol stack.

[0140] Accordingly, the present invention further provides a health check device based on a user-mode protocol stack.

[0141] Reference Figure 7 , Figure 7 This is a functional module diagram of the first embodiment of the user-mode protocol stack health check device of the present invention.

[0142] In a first embodiment of a user-mode protocol stack health check device according to the present invention, the user-mode protocol stack health check device includes:

[0143] The checking module 10 is used to perform a health check on the server cluster using Keepalived using a user-mode protocol stack and obtain a health check message.

[0144] The packet receiving module 20 is used to send a preset FDIR rule to a target network card according to the message characteristics of the health check message, receive the packet through the target network card, and obtain a packet receiving result.

[0145] The abnormal removal module 30 is configured to determine the position of the abnormal backend in the server cluster according to the packet receiving result, and remove the abnormal backend according to the abnormal backend position.

[0146] The checking module 10 is further configured to utilize Keepalived and a user-mode protocol stack to perform a health check on the server cluster through DPVS to obtain a health check message.

[0147] The inspection module 10 is also used to use Keepalived to use the user-mode protocol stack to send a health check request to each server in the server cluster at a preset time interval; receive response information fed back by each server after receiving the health check request, analyze the response information through DPVS, obtain analysis results, and generate a health check message based on the analysis results.

[0148] The packet receiving module 20 is also used to obtain the message format, source IP address, destination IP address, port number and message content from the health check message, and use the message format, source IP address, destination IP address, port number and message content as message features; according to the message features, the preset FDIR rules are issued to the target network card, and the health check message returned from the back end is redirected to a separate queue of the target network card using the preset FDIR rules to complete the packet receiving and obtain the packet receiving result.

[0149] The packet receiving module 20 is further used to send the preset FDIR rules to the target network card and configure the target network card according to the preset FDIR rules and the message characteristics; after receiving the message characteristics, the target network card monitors and analyzes the message characteristics according to the preset FDIR rules to obtain analysis results; when the analysis result shows that the message characteristics match the conditions of the preset FDIR rules, the health check message returned from the back end is redirected to a separate queue of the target network card using the preset FDIR rules to complete packet receiving and obtain a packet receiving result.

[0150] The packet receiving module 20 is further configured to determine the network card queue corresponding to the target network card when the analysis result shows that the message feature matches the condition of the preset FDIR rule; execute a health check thread from the network card queue, receive packets, and generate a packet receiving result.

[0151] The exception removal module 30 is used to obtain the number of packets received, error rate and delay time in the packet receiving results; detect and analyze the number of packets received, error rate and delay time through the Keepalived health check program to determine the abnormal backend location in the server cluster; remove the abnormal backend corresponding to the abnormal backend location from the forwarding list of the load balancer according to the preset exception handling strategy, and feedback the exception information to the system administrator.

[0152] Among them, the steps implemented by each functional module of the user-mode protocol stack health check device can refer to the various embodiments of the user-mode protocol stack health check method of the present invention, and will not be repeated here.

[0153] In addition, an embodiment of the present invention further provides a storage medium, on which a user-mode protocol stack health check program is stored. When the user-mode protocol stack health check program is executed by a processor, the following operations are implemented:

[0154] Use Keepalived to perform health checks on the server cluster using the user-mode protocol stack and obtain health check messages;

[0155] Sending a preset FDIR rule to a target network card according to the message characteristics of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result;

[0156] The abnormal backend position in the server cluster is determined according to the packet receiving result, and the abnormal backend is removed according to the abnormal backend position.

[0157] Furthermore, when the user-mode protocol stack health check program is executed by the processor, the following operations are also implemented:

[0158] Use Keepalived and the user-mode protocol stack to perform health checks on the server cluster through DPVS and obtain health check messages.

[0159] Furthermore, when the user-mode protocol stack health check program is executed by the processor, the following operations are also implemented:

[0160] Use Keepalived to send health check requests to each server in the server cluster using the user-mode protocol stack at preset time intervals;

[0161] Receive response information from each server receiving the health check request, analyze the response information through DPVS to obtain analysis results, and generate a health check message based on the analysis results.

[0162] Furthermore, when the user-mode protocol stack health check program is executed by the processor, the following operations are also implemented:

[0163] Acquire a message format, a source IP address, a destination IP address, a port number, and message content from the health check message, and use the message format, the source IP address, the destination IP address, the port number, and the message content as message features;

[0164] According to the message characteristics, the preset FDIR rules are issued to the target network card, and the health check message returned from the back end is redirected to the separate queue of the target network card using the preset FDIR rules to complete the packet reception and obtain the packet reception result.

[0165] Furthermore, when the user-mode protocol stack health check program is executed by the processor, the following operations are also implemented:

[0166] Sending the preset FDIR rules to the target network card, and configuring the target network card according to the preset FDIR rules and the message characteristics;

[0167] After receiving the message feature, the target network card monitors and analyzes the message feature according to the preset FDIR rule to obtain an analysis result;

[0168] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, the health check message returned from the backend is redirected to a separate queue of the target network card using the preset FDIR rule to complete packet reception and obtain a packet reception result.

[0169] Furthermore, when the user-mode protocol stack health check program is executed by the processor, the following operations are also implemented:

[0170] When the analysis result shows that the message feature matches the condition of the preset FDIR rule, determining the network card queue corresponding to the target network card;

[0171] Execute a health check thread from the network card queue, receive packets, and generate a packet receiving result.

[0172] Furthermore, when the user-mode protocol stack health check program is executed by the processor, the following operations are also implemented:

[0173] Obtain the number of received packets, error rate, and delay time from the packet receiving result;

[0174] The Keepalived health check program is used to detect and analyze the number of received packets, error rate, and delay time to determine the abnormal backend location in the server cluster;

[0175] According to the preset exception handling strategy, the abnormal backend corresponding to the abnormal backend position is removed from the forwarding list of the load balancer, and the abnormal information is fed back to the system administrator.

[0176] Those skilled in the art will understand that all or part of the steps in the above-mentioned implementation methods can be completed by instructing related hardware through a program. The program is stored in a storage medium and includes a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application; and the aforementioned storage medium is a computer-readable storage medium, including but not limited to: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0177] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0178] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0179] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A health check method based on a user-mode protocol stack, characterized in that: The user-mode protocol stack health check method includes: Use Keepalived to perform health checks on the server cluster using the user-mode protocol stack and obtain health check messages; Sending a preset FDIR rule to a target network card according to the message characteristics of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result; Determine the abnormal backend location in the server cluster according to the packet receiving result, and remove the abnormal backend according to the abnormal backend location; The determining of the abnormal backend location in the server cluster according to the packet receiving result, and removing the abnormal backend according to the abnormal backend location, includes: Obtain the number of received packets, error rate, and delay time from the packet receiving result; The Keepalived health check program is used to detect and analyze the number of received packets, error rate, and delay time to determine the abnormal backend location in the server cluster; Remove the abnormal backend corresponding to the abnormal backend position from the DPVS forwarding list according to the preset exception handling strategy, and feedback the abnormal information to the system administrator; Here, the use of Keepalived to perform a health check on the server cluster using the user-mode protocol stack to obtain a health check message includes: Use Keepalived and the user-mode protocol stack to perform health checks on the server cluster through DPVS and obtain health check messages.

2. The user-mode protocol stack health check method according to claim 1, wherein: The method uses Keepalived to use the user-mode protocol stack to perform a health check on the server cluster through DPVS and obtain a health check message, including: Use Keepalived to send health check requests to each server in the server cluster using the user-mode protocol stack at preset time intervals; Receive response information from each server receiving the health check request, analyze the response information through DPVS to obtain analysis results, and generate a health check message based on the analysis results.

3. The user-mode protocol stack health check method according to claim 1, wherein: The step of sending a preset FDIR rule to a target network card according to the message characteristics of the health check message, receiving the packet through the target network card, and obtaining a packet receiving result includes: Acquire a message format, a source IP address, a destination IP address, a port number, and message content from the health check message, and use the message format, the source IP address, the destination IP address, the port number, and the message content as message features; According to the message characteristics, the preset FDIR rules are issued to the target network card, and the health check message returned from the back end is redirected to the separate queue of the target network card using the preset FDIR rules to complete the packet reception and obtain the packet reception result.

4. The user-mode protocol stack health check method according to claim 3, wherein: The step of issuing a preset FDIR rule to a target network card according to the message feature, redirecting the health check message returned from the backend to a separate queue of the target network card by using the preset FDIR rule, completing packet reception, and obtaining a packet reception result includes: Sending the preset FDIR rules to the target network card, and configuring the target network card according to the preset FDIR rules and the message characteristics; After receiving the message feature, the target network card monitors and analyzes the message feature according to the preset FDIR rule to obtain an analysis result; When the analysis result shows that the message feature matches the condition of the preset FDIR rule, the health check message returned from the backend is redirected to a separate queue of the target network card using the preset FDIR rule to complete packet reception and obtain a packet reception result.

5. The user-mode protocol stack health check method according to claim 4, wherein: When the analysis result shows that the message feature matches the condition of the preset FDIR rule, redirecting the health check message returned from the backend to a separate queue of the target network card by using the preset FDIR rule, completing packet reception, and obtaining a packet reception result, includes: When the analysis result shows that the message feature matches the condition of the preset FDIR rule, determining the network card queue corresponding to the target network card; Execute a health check thread from the network card queue, receive packets, and generate a packet receiving result.

6. A health check device based on a user-mode protocol stack, characterized in that: The user-mode protocol stack-based health check device includes: The check module is used to use Keepalived to perform health checks on the server cluster using the user-mode protocol stack and obtain health check messages; A packet receiving module is used to send a preset FDIR rule to a target network card according to the message characteristics of the health check message, receive the packet through the target network card, and obtain a packet receiving result; An abnormality removal module, configured to determine the position of an abnormal backend in the server cluster according to the packet receiving result, and remove the abnormal backend according to the abnormal backend position; The abnormal removal module is further configured to obtain the number of received packets, error rate, and delay time from the packet receiving result; detect and analyze the number of received packets, error rate, and delay time through the Keepalived health check program to determine the abnormal backend location in the server cluster; remove the abnormal backend corresponding to the abnormal backend location from the DPVS forwarding list according to a preset abnormality handling strategy, and feedback the abnormal information to the system administrator; The inspection module is further configured to utilize Keepalived and a user-mode protocol stack to perform a health check on the server cluster through DPVS and obtain a health check message.

7. A health check device based on a user-mode protocol stack, characterized in that: The user-state protocol stack-based health check device includes: a memory, a processor, and a user-state protocol stack-based health check program stored in the memory and executable on the processor, wherein the user-state protocol stack-based health check program is configured to implement the steps of the user-state protocol stack-based health check method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium stores a user-mode protocol stack health check program, which, when executed by a processor, implements the steps of the user-mode protocol stack health check method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Firewall system of user mode pipeline architecture

    CN111614631A

  • DPVS-based back-end server health detection method and server

    CN111835576A