Health examination method, device, equipment and medium
By using geneve interface and eBPF technology to perform health checks under the NFV platform, the problem of component redundancy and forwarding rate affected in the existing methods is solved, and efficient health checks for gateway load balancing instances are realized.
Patent Information
- Application Number
- CN202411743012.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-29
AI Technical Summary
During the detection and activation of the backend host and forwarding node bound to the gateway load balancing instance under the NFV platform, there are problems such as component redundancy and forwarding node message forwarding rate affected.
Using geneve interface and eBPF technology, the original active packet is sent through the health check network element, the message is intercepted and the target IP is modified, and the probe request packet is formed, which is forwarded to the backend host to be checked, and its health status is determined based on the response packet.
The health inspection architecture is simplified, the forwarding node exploration work is stripped away, which greatly improves forwarding efficiency and is more stable, and simultaneous health inspections of the backend host and forwarding nodes are realized.
Smart Images

Figure CN119676113A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless network and security technology, and in particular to a health check method, device, equipment and medium. Background Art
[0002] Health check is one of the very important functions in load balancing service. The load balancer used to provide load balancing service forwards traffic to the backend server and detects whether the backend server is providing services normally through periodic health checks.
[0003] The current health check method is to perform a health check on each backend host or forwarding node of each load balancing service, and determine whether to forward traffic to the backend host or forwarding node based on the check results.
[0004] With the development of technology, in the new generation of NFV (Network Functions Virtualization) platform, gateway load balancing needs to perform health checks on the backend hosts bound to the gateway load balancing instances, and also needs to perform health checks on the forwarding nodes of the gateway load balancing. However, the current health check method requires corresponding health check components to perform health checks on the backend host services and forwarding node services, which not only results in component redundancy, but also affects the message forwarding rate of the forwarding nodes. Summary of the invention
[0005] The present application provides a health check method, device, equipment and medium to solve the above-mentioned problems existing in the existing health check methods.
[0006] In a first aspect, the present application proposes a health examination method, the method comprising:
[0007] The health check network element sends a first original live detection message, which includes an inner source IP, an inner destination IP and an outer destination IP. The inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element;
[0008] The health check network element intercepts the first original detection message by using the eBPF technology, determines the first target IP according to the inner source IP and the corresponding unique identifier, and modifies the outer destination IP to the first target IP;
[0009] Using the modified message as a liveness detection request message, and forwarding the liveness detection request message to the backend host to be checked via a forwarding node;
[0010] The health status of the backend host to be checked is determined according to whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked.
[0011] Optionally, the method further includes:
[0012] The health check network element uses the eBPF technology to intercept the first liveness detection response message sent by the backend host to be checked, determines the second target IP according to the outer layer destination IP and the corresponding unique identifier, and modifies the first target IP to the second target IP;
[0013] The modified message is forwarded to the geneve interface of the health check network element via the forwarding node.
[0014] Optionally, determining the health status of the backend host to be checked according to whether the geneve interface of the health check network element receives the first liveness response message sent by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked, includes:
[0015] The geneve interface of the health check network element does not receive the first liveness response message sent by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked is wrong, and the health status of the backend host to be checked is determined to be unhealthy;
[0016] The geneve interface of the health check network element receives the first liveness response message sent by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked is correct, and determines that the health status of the backend host to be checked is healthy.
[0017] Optionally, the method further includes:
[0018] The health check network element sends a second original live detection message, which includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the forwarding node to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element;
[0019] The health status of the forwarding node to be checked is determined according to whether the geneve interface of the health check network element receives the second liveness response message sent by the forwarding node to be checked, or the content of the second liveness response message received from the forwarding node to be checked.
[0020] Optionally, the method further includes:
[0021] The health check network element uses the eBPF technology to intercept the second liveness detection response message sent by the forwarding node to be checked, determines the third target IP according to the outer layer destination IP and the corresponding unique identifier, and modifies the outer layer destination IP to the third target IP;
[0022] The modified message is sent to the geneve interface of the health check network element.
[0023] Optionally, the health check method is used to detect the activity of a gateway load balancing service under the NFV platform, and the method further includes:
[0024] Based on the health status of the backend host to be checked or the forwarding node to be checked, the gateway load balancing removes or adds the backend host or the forwarding node.
[0025] In a second aspect, the present application provides a health examination device, the device comprising:
[0026] The first message sending module is used for the health check network element to send a first original live detection message, wherein the first original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element;
[0027] A first message interception module, used for the health check network element to intercept the first original live detection message using the eBPF technology, determine the first target IP according to the inner source IP and the corresponding unique identifier, and modify the outer destination IP to the first target IP;
[0028] A first forwarding module, configured to use the modified message as a liveness detection request message, and forward the liveness detection request message to the backend host to be checked via a forwarding node;
[0029] The first determination module is used to determine the health status of the backend host to be checked based on whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked.
[0030] Optionally, the device further comprises:
[0031] A modification module is used for the health check network element to intercept the first live response message sent by the backend host to be checked by using the eBPF technology, determine the second target IP according to the outer layer destination IP and the corresponding unique identifier, and modify the first target IP to the second target IP;
[0032] The second forwarding module is used to forward the modified message to the geneve interface of the health check network element via the forwarding node.
[0033] In a third aspect of an embodiment of the present application, an electronic device is proposed, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the health check method described in any one of the first aspects above.
[0034] In a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the health check method described in any one of the first aspects above is implemented.
[0035] The present application includes the following advantages: The present application proposes a health check method, device, equipment and medium, the method first sends a first original live detection message through a health check network element, the first original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element; then, the health check network element intercepts the first original live detection message using eBPF technology, determines the first target IP according to the inner source IP and the corresponding unique identifier, and modifies the outer destination IP to the first target IP; further, uses the modified message as a live detection request message, and forwards the live detection request message to the backend host to be checked via a forwarding node; finally, determines the health status of the backend host to be checked according to whether the geneve interface of the health check network element receives a first live detection response message sent by the backend host to be checked, or the content of the first live detection response message received from the backend host to be checked. This method uses the geneve interface and eBPF technology to not only implement health checks on backend host services, but also on the forwarding nodes of the gateway balancing service itself. It simplifies the inspection architecture, removes the liveness detection work of the forwarding nodes, greatly improves forwarding efficiency, and increases stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 It is a schematic diagram of the architecture flow of a health check proposed by the prior art;
[0038] Figure 2 It is a conceptual schematic diagram of a health examination method proposed in the prior art;
[0039] Figure 3 This is a schematic diagram of the steps of a health check method proposed in an embodiment of the present application;
[0040] Figure 4 It is a conceptual schematic diagram of a health examination method proposed in an embodiment of the present application;
[0041] Figure 5 It is a schematic diagram of the architecture flow of a health check proposed in an embodiment of the present application;
[0042] Figure 6 It is a flowchart of a health check method proposed in an embodiment of the present application applied to a backend host;
[0043] Figure 7 It is a module schematic diagram of a health examination device provided in an embodiment of the present application;
[0044] Figure 8 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] Health check is one of the very important functions in load balancing service. The load balancer used to provide load balancing service forwards traffic to the backend server and detects whether the backend server is providing services normally through periodic health checks.
[0047] The current health check method is to perform a health check on each backend host or forwarding node of each load balancing service, and determine whether to forward traffic to the backend host or forwarding node based on the check results. Figure 1 , Figure 1 It is a schematic diagram of the architecture flow of a health check proposed by the prior art. The forwarding node health check module is used to detect the liveness of the forwarding node, and the RS (real server) health check module is used to detect the liveness of the backend host. Two different health check components (forwarding node health check module and RS health check module) are used to complete the liveness detection of the forwarding node and the backend host. This method not only causes component redundancy, but also affects the message forwarding efficiency of the forwarding node because the forwarding node needs to detect liveness and forward messages at the same time. Among them, liveness detection (Health Check) refers to a monitoring mechanism used to regularly check whether the backend host service is running normally, that is, health check. RS is located at the back end of the load balancing service and is the real host for deploying and implementing the service.
[0048] In addition, if the network between the forwarding node to be checked and the backend host to be checked is unreachable, refer to Figure 2 , Figure 2 This is a conceptual diagram of a health check method proposed in the prior art. A vxlan tunnel is established between the forwarding node to be checked and the backend host to be checked to achieve network reachability and health check. However, this method relies on the control plane protocol and has a high configuration complexity. Since a tunnel header needs to be encapsulated and decapsulated for each message, the forwarding efficiency of the message is reduced.
[0049] Based on this, this application proposes a health check method based on the combination of geneve interface and eBPF technology, so that the method can simultaneously detect the forwarding nodes and backend host services of the gateway load balancing service, and promptly eliminate problematic forwarding nodes or backend hosts to ensure the stability of the gateway load balancing service.
[0050] Geneve (Generic Network Virtualization Encapsulation) is a tunneling protocol that allows user data packets to be encapsulated in existing Ethernet frames. The Linux kernel supports Geneve tunnels starting from version 4.0. eBPF (Extended Berkeley Packet Filter) technology originated from the Linux kernel. It can run sandbox programs in the operating system kernel to extend the kernel's functionality in a safe and effective way without changing the kernel source code or loading kernel modules.
[0051] In a first aspect, the present application embodiment provides a health check method, referring to Figure 3 , Figure 3 1 is a flow chart of a health check method proposed in an embodiment of the present application, the method comprising the following steps:
[0052] Step 301: The health check network element sends a first original live detection message.
[0053] A health check agent is a component or mechanism used to monitor and check the health status of network services or devices in a network function virtualization (NFV) environment. It is used to ensure the high availability and reliability of network services by regularly checking whether the services are running normally and taking appropriate measures when problems are detected, such as rerouting traffic or replacing faulty components.
[0054] In the process of health check, a detection message is first sent through the health check network element to perform health checks on components that need to be detected, such as backend hosts, forwarding nodes, etc., that is, to perform health checks on components that need to be checked. In order to ensure network accessibility and perform effective health checks, the first original detection message sent needs to contain at least an inner source IP, an inner destination IP, and an outer destination IP. The inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element.
[0055] The first original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, which can be obtained by reading the configuration information of the gateway load balancing instance and the backend host to be checked by the health check system.
[0056] Among them, the above-mentioned first original detection message can also include timeout settings, retry times, check intervals, health check content, expected responses, etc. The timeout setting is used to determine how long it takes for a health check to be considered failed when no response is received, the retry times are used to determine how many consecutive health check failures are considered to be unhealthy for the backend host, and the check interval is used to determine how often a health check is performed. The health check content is used for certain application layer protocols (such as HTTP), and the specific request content to be sent needs to be specified. The expected response is used to verify whether the component to be checked has returned a correct response.
[0057] It should be noted that the above-mentioned geneve interface is created by the health check network element, and is used to send out the first original live detection message and the response live detection message returned by the receiving component. In order to ensure that the sending of the first original live detection message and the receiving of the response live detection message can be achieved through the geneve interface. After the health check network element creates the geneve interface, a static MAC address is configured for the geneve interface, the configured static MAC address is the outer destination IP, and the routing is configured to ensure that the first original live detection message and the response live detection message returned by the receiving component are sent from the geneve interface.
[0058] Step 302: The health check network element uses the eBPF technology to intercept the first original detection message, determines the first target IP according to the inner source IP and the corresponding unique identifier, and modifies the outer destination IP to the first target IP.
[0059] After the health check network element sends out the first original detection message, the first original detection message is intercepted by the eBPF technology. Optionally, the first original detection message can be intercepted by the hook module in the eBPF technology. After intercepting the first original detection message, the first target IP is determined according to the inner source IP in the first original detection message and the unique identifier corresponding to the inner source IP. The first target IP is a fixed IP that corresponds one-to-one to the gateway load balancing instance IP. Then, the outer destination IP in the first original detection message is modified to the first target IP. Among them, the unique identifier corresponding to the inner source IP can be VNI (Virtual Network Identifier), a 24-bit identifier.
[0060] In an example, assuming that the outer destination IP in the first original detection message is (xxxx), based on the inner source IP in the first original detection message and the unique identifier corresponding to the inner source IP, the first target IP is determined to be (yyyy), and the outer destination IP in the first original detection message is modified to the first target IP, that is, the outer destination IP (xxxx) is modified to the first target IP (yyyy).
[0061] Step 303: Use the modified message as a liveness detection request message, and forward the liveness detection request message to the backend host to be checked via the forwarding node.
[0062] The message whose outer destination IP is modified to the first target IP is used as a liveness detection request message, and the liveness detection request message is sent to the forwarding node, and is forwarded to the backend host to be checked through the forwarding node.
[0063] It should be noted that the first target IP in step 302 may be the IP of the backend host to be checked, so that the modified liveness detection request message can be accurately sent to the backend host to be checked.
[0064] In addition, the liveness detection request message in the above step 303 may also be directly sent to the backend host to be checked without being forwarded by the forwarding node.
[0065] Step 304: Determine the health status of the backend host to be checked based on whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked.
[0066] After the backend host to be checked receives the liveness request message, if the backend host to be checked responds to the liveness request message normally, it will issue a first liveness response message and send it to the health check network element, but the geneve interface of the health check network element may not be able to receive the first liveness response message issued by the backend host to be checked, or. The content in the first liveness response message is changed by the backend host to be checked, causing an error in the content of the first liveness response message. Then, the health status of the backend host to be checked can be determined based on whether the geneve interface of the health check network element receives the first liveness response message issued by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked.
[0067] To illustrate the concept of the health check method proposed in this application, refer to Figure 4 , Figure 4 This is a conceptual diagram of a health check method proposed in an embodiment of the present application. This method uses the geneve interface and eBPF technology to not only implement health checks on backend host services, but also on the forwarding nodes of the gateway balancing service itself. Compared with the prior art, the configuration of establishing a vxlan tunnel in the prior art is complex. This application simplifies the overall process architecture, reduces the redundancy of health check components, has a low implementation cost, and can also carry more tunnels.
[0068] See also Figure 5 , Figure 5 This is a schematic diagram of the architecture flow of a health check proposed in an embodiment of the present application. It can be seen that a health check module is deployed between the forwarding node and the backend host to implement the health check method proposed in the present application. The health check can be performed on the forwarding node and the backend host at the same time, which eliminates the live detection work of the forwarding node and improves the message forwarding efficiency of the forwarding node. The overall structure is lighter, more flexible, and more stable.
[0069] Furthermore, this method can be extended and applied to more components in other NFV platforms, thus releasing the overall pressure of each component, allowing each component to focus on its own business functions and improving the resource utilization and stability of the entire business platform.
[0070] In an embodiment of the present application, a health check method is proposed, in which a first original live detection message is sent through a health check network element, wherein the first original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element; the health check network element adopts eBPF technology to intercept the first original live detection message, determines the first target IP according to the inner source IP and the corresponding unique identifier, and modifies the outer destination IP to the first target IP; uses the modified message as a live detection request message, and forwards the live detection request message to the backend host to be checked via a forwarding node; determines the health status of the backend host to be checked according to whether the geneve interface of the health check network element receives the first live detection response message sent by the backend host to be checked, or the content of the first live detection response message received from the backend host to be checked. This method uses the geneve interface and eBPF technology to not only implement health checks on backend host services, but also on the forwarding nodes of the gateway balancing service itself. It simplifies the inspection architecture, removes the liveness detection work of the forwarding nodes, greatly improves forwarding efficiency, and increases stability.
[0071] In an optional embodiment, the method further comprises the following steps:
[0072] Step 305: The health check network element uses eBPF technology to intercept the first detection response message sent by the backend host to be checked, determines the second target IP according to the outer destination IP and the corresponding unique identifier, and modifies the first target IP to the second target IP.
[0073] After the backend host to be checked sends the first live response message, if the outer destination IP of the first live response message sent by the backend host to be checked is not the IP of the geneve interface of the health check network element, then the geneve interface of the health check network element cannot recognize the first live response message sent by the backend host to be checked, which will cause the health check network element to believe that the first live response message has not been received, resulting in misjudgment of the health status of the backend host to be checked and reducing the accuracy of the inspection.
[0074] In order to avoid the above situation, after the backend host to be checked sends the first live response message, the health check network element uses eBPF technology to intercept the first live response message sent by the backend host to be checked, and determines the second target IP according to the outer destination IP and the corresponding unique identifier, and modifies the first target IP in the first live response message to the second target IP, and the second target IP is the IP of the geneve interface of the health check network element. Among them, the unique identifier corresponding to the outer destination IP can be OPTID, which is also an identifier.
[0075] In an example, assuming that the outer destination IP in the first detection alive response message is (yyyy), based on the outer destination IP in the first detection alive response message and the unique identifier corresponding to the outer destination IP, the second target IP is determined to be (xxxx), and the outer destination IP in the first detection alive response message is modified to the second target IP, that is, the outer destination IP (yyyy) in the first detection alive response message is modified to the second target IP (xxxx).
[0076] Step 306: The modified message is forwarded to the geneve interface of the health check network element via the forwarding node.
[0077] After modifying the first target IP of the first detection live response message to the second target IP, the modified message is forwarded to the geneve interface of the health check network element through the forwarding node, so that the geneve interface of the health check network element can successfully receive the modified message. Based on the message, the health check network element can judge the health status of the backend host to be checked.
[0078] In an optional implementation, in the above step 304, the health status of the backend host to be checked is determined according to whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked, specifically including the following sub-steps:
[0079] Step 3041: The geneve interface of the health check network element does not receive the first detection response message sent by the backend host to be checked, or the content of the first detection response message received from the backend host to be checked is incorrect, and the health status of the backend host to be checked is determined to be unhealthy.
[0080] In the case that the geneve interface of the health check network element does not receive the first detection alive response message sent by the backend host to be checked, the health check network element determines that the health check result of the backend host to be checked is an unhealthy health state. Alternatively, if the content of the first detection alive response message received by the geneve interface of the health check network element from the backend host to be checked is wrong, the health check network element determines that the health check result of the backend host to be checked is an unhealthy health state. The content error of the first detection alive response message may be that the information contained therein is inconsistent with the information in the first original detection alive message sent by the health check network element.
[0081] Step 3042: The first detection alive response message sent by the backend host to be checked is received at the geneve interface of the health check network element, or the content of the first detection alive response message received from the backend host to be checked is correct, and the health status of the backend host to be checked is determined to be healthy.
[0082] When the geneve interface of the health check network element receives the first detection response message sent by the backend host to be checked, the health check network element determines that the health check result of the backend host to be checked is a healthy state. Alternatively, if the content of the first detection response message from the backend host to be checked received by the geneve interface of the health check network element is correct, the health check network element determines that the health check result of the backend host to be checked is an unhealthy state. The correct content of the first detection response message may be that the information contained therein is consistent with the information in the first original detection message sent by the health check network element.
[0083] In order to implement health checks on the backend host and the forwarding node at the same time, in an optional implementation, the method further includes the following steps:
[0084] Step 307: The health check network element sends a second original live detection message.
[0085] The health check network element sends a first original live detection message to check the backend host to be checked. At the same time, the health check network element can send a message for checking the forwarding node to be checked. Specifically, the health check network element sends a second original live detection message, and the second original live detection message sent contains an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the forwarding node to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element.
[0086] Step 308: Determine the health status of the forwarding node to be checked based on whether the geneve interface of the health check network element receives the second liveness response message sent by the forwarding node to be checked, or the content of the second liveness response message received from the forwarding node to be checked.
[0087] After the forwarding node to be checked receives the second original liveness detection message, it will respond to the second original liveness detection message and send the responded message to the geneve interface of the health check network element. Specifically, after the forwarding node to be checked sends the second liveness detection response message, the health check network element determines the health status of the forwarding node to be checked based on whether the geneve interface of the health check network element receives the second liveness detection response message sent by the forwarding node to be checked, or the content of the second liveness detection response message received from the forwarding node to be checked. Among them, the second original liveness detection message sent by the health check network element can be sent directly to the forwarding node to be checked, or it can be forwarded to the forwarding node to be checked through other forwarding nodes.
[0088] It should be noted that, when the geneve interface of the health check network element does not receive the second liveness response message sent by the forwarding node to be checked, the health check network element determines that the health check result of the forwarding node to be checked is unhealthy.
[0089] Alternatively, the content of the second live detection response message received at the geneve interface of the health check network element from the forwarding node to be checked is wrong, and the health check network element determines that the health check result of the forwarding node to be checked is unhealthy. The content error of the second live detection response message may be that the information contained therein is inconsistent with the information in the second original live detection message sent by the health check network element.
[0090] When the geneve interface of the health check network element receives the second liveness detection response message sent by the forwarding node to be checked, the health check network element determines that the health check result of the forwarding node to be checked is healthy.
[0091] Alternatively, the content of the second detection response message received from the forwarding node to be checked at the geneve interface of the health check network element is correct, and the health check network element determines that the health check result of the forwarding node to be checked is healthy. The content of the second detection response message is correct, and the information contained therein is consistent with the information in the second original detection message sent by the health check network element.
[0092] After the forwarding node to be checked sends the second liveness response message, if the outer destination IP of the second liveness response message sent by the forwarding node to be checked is modified, resulting in the outer destination IP not being the IP of the geneve interface of the health check network element, then the geneve interface of the health check network element cannot recognize the second liveness response message sent by the outer destination IP to be checked, which will cause the health check network element to believe that it has not received the second liveness response message, resulting in misjudgment of the health status of the forwarding node to be checked and reducing the accuracy of the inspection.
[0093] Based on this, in an optional implementation manner, in order to avoid the above situation, the method further includes the following steps:
[0094] Step 309: The health check network element uses the eBPF technology to intercept the second live response message sent by the forwarding node to be checked, determines the third target IP according to the outer layer destination IP and the corresponding unique identifier, and modifies the outer layer destination IP to the third target IP
[0095] The health check network element intercepts the second liveness response message sent by the forwarding node to be checked through eBPF technology, and determines the third target IP based on the outer destination IP and the corresponding unique identifier of the second liveness response message, and modifies the outer destination IP to the third target IP, where the third target IP is the IP of the geneve interface of the health check network element.
[0096] Step 310: Send the modified message to the geneve interface of the health check network element.
[0097] After modifying the outer destination IP of the second liveness detection response message, it is ensured that the geneve interface of the health check network element can receive the modified message, and the modified message is sent to the geneve interface of the health check network element.
[0098] Based on the above embodiment, the health check method is used to detect the activity of the gateway load balancing service under the NFV platform, and the method further includes the following steps:
[0099] Step 311: Based on the health status of the backend host to be checked or the forwarding node to be checked, the gateway load balancing removes or adds the backend host or the forwarding node.
[0100] In order to ensure that the traffic accessing the gateway load balancing within the system is always forwarded to the forwarding nodes and backend hosts with normal service, after determining the health status of the backend host to be checked or the forwarding node to be checked, if the health status of the backend host to be checked or the forwarding node to be checked is unhealthy, the gateway load balancing dynamically removes the backend host or forwarding node with an unhealthy health check status, or dynamically adds a backend host or forwarding node to ensure that the traffic accessing the gateway load balancing within the system is always forwarded to the forwarding nodes and backend hosts with normal service.
[0101] See also Figure 6 , Figure 6 It is a flow chart of a health check method proposed in an embodiment of the present application applied to a backend host. First, in the geneve interface module, the configuration is read by the health check system. The health check system implements the detection of the backend host through the geneve interface and eBPF technology. The configuration includes at least the relevant information of the backend host. Then, the health check network element creates a geneve interface and configures the static MAC and static routing through the geneve interface. After the configuration is completed, the original detection message is sent from the geneve interface. Then, in the egress (i.e., the data traffic sent out by the network or device) direction, the eBPF technology is used to hook (i.e., intercept) the original detection message, and match the inner IP and VNI of the message, and modify the content of the original detection message based on the matched IP. The modified message is forwarded to the next node as a detection request message, and then reaches the backend host. After the backend host receives the detection request message and responds, it sends a response detection message. Use eBPF technology to hook (i.e. intercept) the response detection message of the backend host, match the inner IP and OPTID of the message, modify the content of the response detection message based on the matched IP, and send the modified message to the geneve interface (i.e. ingress (data flow entering the network or device) direction). The health check response message returns to the health check system, and finally reports the health check results.
[0102] See also Figure 7 , Figure 7 : is a module schematic diagram of a health examination device provided in an embodiment of the present application, the device comprising:
[0103] The first message sending module 701 is used for the health check network element to send a first original live detection message, wherein the first original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element;
[0104] A first message interception module 702 is used for the health check network element to intercept the first original live detection message using the eBPF technology, determine the first target IP according to the inner source IP and the corresponding unique identifier, and modify the outer destination IP to the first target IP;
[0105] The first forwarding module 703 is used to use the modified message as a liveness detection request message, and forward the liveness detection request message to the backend host to be checked via the forwarding node;
[0106] The first determination module 704 is used to determine the health status of the backend host to be checked based on whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked.
[0107] The health check device proposed in this application cleverly combines the Linux Geneve interface technology, and there is no need to additionally implement the Geneve encapsulation of the detection message, which reduces the design and maintenance costs of the component itself. The lightweight design of the components of the entire health check device is not only applicable to the forwarding component itself and its back-end host, but can also be expanded to detect other components in the NFV platform.
[0108] Optionally, the device further comprises:
[0109] A modification module is used for the health check network element to intercept the first live response message sent by the backend host to be checked by using the eBPF technology, determine the second target IP according to the outer layer destination IP and the corresponding unique identifier, and modify the first target IP to the second target IP;
[0110] The second forwarding module is used to forward the modified message to the geneve interface of the health check network element via the forwarding node.
[0111] Optionally, the first determining module includes:
[0112] A first determination submodule is used to determine that the health status of the backend host to be checked is unhealthy when the geneve interface of the health check network element does not receive the first detection response message sent by the backend host to be checked, or the content of the first detection response message received from the backend host to be checked is wrong;
[0113] The second determination submodule is used to receive the first detection response message sent by the backend host to be checked at the geneve interface of the health check network element, or the content of the first detection response message received from the backend host to be checked is correct, and determine that the health status of the backend host to be checked is healthy.
[0114] Optionally, the device further comprises:
[0115] A second message sending module is used for the health check network element to send a second original live detection message, wherein the second original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the forwarding node to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element;
[0116] The second determination module is used to determine the health status of the forwarding node to be checked based on whether the geneve interface of the health check network element receives the second live response message sent by the forwarding node to be checked, or the content of the second live response message received from the forwarding node to be checked.
[0117] Optionally, the device further comprises:
[0118] A second message interception module is used for the health check network element to intercept the second live response message sent by the forwarding node to be checked by using the eBPF technology, determine the third target IP according to the outer layer destination IP and the corresponding unique identifier, and modify the outer layer destination IP to the third target IP;
[0119] The third forwarding module is used to send the modified message to the geneve interface of the health check network element.
[0120] Optionally, the health check device is used to detect the activity of the gateway load balancing service under the NFV platform, and the device also includes:
[0121] The adjustment module is used to remove or add a backend host or a forwarding node from the gateway load balancing based on the health status of the backend host to be checked or the forwarding node to be checked.
[0122] Based on the same application concept, the embodiment of the present application discloses an electronic device in a third aspect. Figure 8 A schematic diagram of an electronic device disclosed in an embodiment of the present application is shown. Figure 8As shown, the electronic device 100 includes: a memory 110 and a processor 120, the memory of the electronic device is not less than 12G, the main frequency of the processor is not less than 2.4GHz, the memory 110 and the processor 120 are connected via a bus communication, and a computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement a health check method disclosed in an embodiment of the present application.
[0123] Based on the same application concept, the fourth aspect of the embodiment of the present application discloses a computer-readable storage medium, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, a health check method disclosed in the embodiment of the present application is implemented.
[0124] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0125] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0126] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0128] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0129] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0130] The above is a detailed introduction to a health check method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A health examination method, characterized in that: The method comprises: The health check network element sends a first original live detection message, which includes an inner source IP, an inner destination IP and an outer destination IP. The inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element; The health check network element intercepts the first original detection message by using the eBPF technology, determines the first target IP according to the inner source IP and the corresponding unique identifier, and modifies the outer destination IP to the first target IP; Using the modified message as a liveness detection request message, and forwarding the liveness detection request message to the backend host to be checked via a forwarding node; The health status of the backend host to be checked is determined according to whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked.
2. The health examination method according to claim 1, characterized in that: The method further comprises: The health check network element uses the eBPF technology to intercept the first liveness detection response message sent by the backend host to be checked, determines the second target IP according to the outer layer destination IP and the corresponding unique identifier, and modifies the first target IP to the second target IP; The modified message is forwarded to the geneve interface of the health check network element via the forwarding node.
3. The health examination method according to claim 1, characterized in that: Determining the health status of the backend host to be checked according to whether the geneve interface of the health check network element receives the first liveness response message sent by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked, includes: The geneve interface of the health check network element does not receive the first liveness response message sent by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked is wrong, and the health status of the backend host to be checked is determined to be unhealthy; The geneve interface of the health check network element receives the first liveness response message sent by the backend host to be checked, or the content of the first liveness response message received from the backend host to be checked is correct, and determines that the health status of the backend host to be checked is healthy.
4. The health examination method according to claim 1, characterized in that: The method further comprises: The health check network element sends a second original live detection message, which includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the forwarding node to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element; The health status of the forwarding node to be checked is determined according to whether the geneve interface of the health check network element receives the second liveness response message sent by the forwarding node to be checked, or the content of the second liveness response message received from the forwarding node to be checked.
5. The health examination method according to claim 4, characterized in that: The method further comprises: The health check network element uses the eBPF technology to intercept the second liveness detection response message sent by the forwarding node to be checked, determines the third target IP according to the outer layer destination IP and the corresponding unique identifier, and modifies the outer layer destination IP to the third target IP; The modified message is sent to the geneve interface of the health check network element.
6. The health examination method according to any one of claims 1 to 5, characterized in that: The health check method is used to detect the activity of the gateway load balancing service under the NFV platform, and the method also includes: Based on the health status of the backend host to be checked or the forwarding node to be checked, the gateway load balancing removes or adds the backend host or the forwarding node.
7. A health examination device, characterized in that: The device comprises: The first message sending module is used for the health check network element to send a first original live detection message, wherein the first original live detection message includes an inner source IP, an inner destination IP and an outer destination IP, wherein the inner source IP is the gateway load balancing instance IP, the inner destination IP is the IP of the backend host to be checked, and the outer destination IP is the IP of the geneve interface of the health check network element; A first message interception module, used for the health check network element to intercept the first original live detection message using the eBPF technology, determine the first target IP according to the inner source IP and the corresponding unique identifier, and modify the outer destination IP to the first target IP; A first forwarding module, configured to use the modified message as a liveness detection request message, and forward the liveness detection request message to the backend host to be checked via a forwarding node; The first determination module is used to determine the health status of the backend host to be checked based on whether the geneve interface of the health check network element receives the first live response message sent by the backend host to be checked, or the content of the first live response message received from the backend host to be checked.
8. The health examination device according to claim 7, characterized in that: The device also includes: A modification module is used for the health check network element to intercept the first live response message sent by the backend host to be checked by using the eBPF technology, determine the second target IP according to the outer layer destination IP and the corresponding unique identifier, and modify the first target IP to the second target IP; The second forwarding module is used to forward the modified message to the geneve interface of the health check network element via the forwarding node.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the health examination method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: A computer program / instruction is stored thereon, and when the computer program / instruction is executed by a processor, the health examination method described in any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Link health checking method and device
CN104301184A
Back-end server detection method and device based on ebpf and electronic equipment
CN110971482A
Providing modular network services through distributed resilient mid-boxes
CN116195239A
Secure network access from sandboxed applications
CN118869234A
Modular network services via distributed elastic middleboxes
WO2021252004A1