CN112311907A - ARP request response method, load balancing equipment and related device - Google Patents
ARP request response method, load balancing equipment and related device Download PDFInfo
- Publication number
- CN112311907A CN112311907A CN202011296892.6A CN202011296892A CN112311907A CN 112311907 A CN112311907 A CN 112311907A CN 202011296892 A CN202011296892 A CN 202011296892A CN 112311907 A CN112311907 A CN 112311907A
- Authority
- CN
- China
- Prior art keywords
- address
- virtual
- arp request
- target
- target virtual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses an ARP request response method which is applied to load balancing equipment and comprises the following steps: receiving an ARP request and determining a target virtual IP address corresponding to the ARP request; judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on the virtual service; if so, utilizing the network port configured with the IP address of the target network segment to respond to the ARP request; wherein, the target network segment is a network segment of a target virtual IP address; if not, using the network port configured with the target virtual IP address to respond the ARP request. The method and the device can realize the response to the ARP request on the premise of decoupling the virtual IP and the network port, and improve the operability and the maintainability of the load balancing equipment. The application also discloses load balancing equipment, electronic equipment and a storage medium, and the load balancing equipment, the electronic equipment and the storage medium have the beneficial effects.
Description
Technical Field
The present application relates to the field of network configuration technologies, and in particular, to an ARP request response method, a load balancing device, an electronic device, and a storage medium.
Background
In configuring a virtual service, all virtual IPs on the virtual service are typically configured on a load-balanced portal. However, in an actual scenario, the total number of virtual IP configurations of users is hundreds to thousands, and the virtual IP configuration amount of each network port is huge, which is not beneficial to the maintenance of the load balancing device.
In order to simplify user configuration, decoupling of virtual IP from internet ports has been implemented in the related art. However, more and more users want to monitor the state of the virtual service in real time through the IP of ping the virtual service, and the current load balancing device can ping only when the virtual IP is configured on the network port, and when the virtual IP is decoupled from the network port, the virtual IP which is not configured on the network port cannot ping, and cannot meet the requirement of the user on monitoring the state of the virtual service through the virtual IP, resulting in low operability and maintainability of the load balancing device.
Therefore, how to implement a response to the ARP request on the premise of decoupling the virtual IP from the network port, and improving the operability and maintainability of the load balancing device is a technical problem that needs to be solved by those skilled in the art at present.
Disclosure of Invention
The present application aims to provide an ARP request response method, a load balancing device, an electronic device, and a storage medium, which can implement a response to an ARP request on the premise of decoupling a virtual IP from a network port, and improve the operability and maintainability of the load balancing device.
In order to solve the above technical problem, the present application provides an ARP request response method, which is applied to a load balancing device, and the ARP request response method includes:
receiving an ARP request and determining a target virtual IP address corresponding to the ARP request;
judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on a virtual service;
if so, utilizing the network port configured with the IP address of the target network segment to respond to the ARP request; wherein, the target network segment is the network segment of the target virtual IP address;
and if not, utilizing the network port configured with the target virtual IP address to respond to the ARP request.
Optionally, before responding to the ARP request by using a portal configured with an IP address of the target network segment, the method further includes:
judging whether a network port for configuring the IP address of the target network segment exists or not by the inquiring routing system;
if yes, executing the operation of utilizing the network port configured with the IP address of the target network segment to respond to the ARP request;
and if not, utilizing all the network ports to respond to the ARP request.
Optionally, before responding to the ARP request by using the portal configured with the target virtual IP address, the method further includes:
judging whether a network port configured with the target virtual IP address exists or not by an inquiry routing system;
if yes, executing the operation of utilizing the network port configured with the target virtual IP address to respond to the ARP request;
if not, refusing to respond to the ARP request.
Optionally, before receiving the ARP request, the method further includes:
configuring a plurality of virtual IP addresses of the same network segment for each virtual service in the load balancing equipment;
and configuring a corresponding floating IP address in the same network segment for the network port according to the configured virtual IP address of each virtual service.
Optionally, after detecting that the master/standby load balancing device is switched, the method further includes:
and performing ARP broadcast corresponding to the main-standby switching by configuring the network ports of the floating IP addresses in the same network segment.
Optionally, the method further includes:
if an ICMP request is received, matching an IP address corresponding to the ICMP request with the virtual IP configuration information;
if the matching is successful, determining a target virtual service according to the IP address corresponding to the ICMP request, and constructing an ICMP response according to the current state of the target virtual service;
returning the ICMP response to the sender of the ICMP request.
Optionally, when the number of the target virtual services is greater than 1, constructing an ICMP response according to the current state of the target virtual service, including:
if the current states of all the target virtual services are normal states, the ICMP response is constructed;
or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; wherein the preset condition is that the target virtual service is the virtual service specified by the ICMP request.
The present application further provides a load balancing apparatus, the apparatus including:
the device comprises a request processing module, a target processing module and a target processing module, wherein the request processing module is used for receiving an ARP request and determining a target virtual IP address corresponding to the ARP request;
the judging module is used for judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on a virtual service;
the first response module is used for responding the ARP request by utilizing a network port configured with the IP address of the target network segment if the target virtual IP address is the preset IP address in the virtual IP configuration information; wherein, the target network segment is the network segment of the target virtual IP address;
and the second response module is used for responding the ARP request by using the network port configured with the target virtual IP address if the target virtual IP address is not the preset IP address in the virtual IP configuration information.
The present application further provides a storage medium having a computer program stored thereon, which when executed performs the steps performed by the ARP request response method described above.
The application also provides an electronic device, which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the execution of the ARP request response method when calling the computer program in the memory.
The application provides an ARP request response method which is applied to load balancing equipment and comprises the following steps: receiving an ARP request and determining a target virtual IP address corresponding to the ARP request; judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on a virtual service; if so, utilizing the network port configured with the IP address of the target network segment to respond to the ARP request; wherein, the target network segment is the network segment of the target virtual IP address; and if not, utilizing the network port configured with the target virtual IP address to respond to the ARP request.
According to the method and the device, the target virtual IP address corresponding to the ARP request is determined after the ARP request is received, and the load balancing device can store the IP address in the virtual IP configuration information in advance so as to judge whether the target virtual IP address is stored in the virtual IP configuration information. If the target virtual IP address is stored in the virtual IP configuration information, the matching of the target virtual IP address and the stored virtual IP address is successful, and at the moment, the network port configured with the IP address of the target network segment can be used for responding to the ARP request; if the target virtual IP address is not stored in the virtual IP configuration information, the network port configured with the target virtual IP address may be used to respond to the ARP request. The method and the device for realizing the ARP request response under the premise of decoupling the virtual IP and the network port can improve the operation and maintenance performance of the load balancing device. The application also provides a load balancing device, an electronic device and a storage medium, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of an ARP request response method according to an embodiment of the present application;
fig. 2 is a flowchart of another ARP request response method according to an embodiment of the present application;
fig. 3 is a flowchart of a method for responding to an ICMP request according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a load balancing device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of an ARP request response method according to an embodiment of the present disclosure.
The specific steps may include:
s101: receiving an ARP request and determining a target virtual IP address corresponding to the ARP request;
the embodiment can be applied to load balancing equipment, any number of virtual services can be deployed in the load balancing equipment, each virtual service can have a corresponding virtual IP address, and the embodiment is established on the premise that the virtual IP address corresponding to the virtual service is decoupled from the network port of the load balancing equipment, that is: the virtual IP address corresponding to the virtual service may not be configured on the portal.
Before this step, there may be an operation in which the client or the router sends an Address Resolution Protocol (ARP) request, and after receiving the ARP request, the load balancing device may analyze the ARP request to obtain a target virtual IP Address corresponding to the ARP request. After determining the target virtual IP address corresponding to the ARP request, the load balancing device may return the MAC address corresponding to the target virtual IP address to the client or the router using the specific internet access.
S102: judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; if yes, entering S103; if not, entering S104;
the virtual IP configuration information may be information stored in the load balancing device, and a preset IP address in the virtual IP configuration information is an IP address configured on the virtual service. The process of constructing the virtual IP configuration information is as follows: and when the virtual service is configured, automatically generating virtual IP configuration information according to the virtual IP addresses of all the filled virtual services, and loading the virtual IP configuration information into a memory. The user may view the virtual IP configuration information at the configuration interface.
The ARP request belongs to a broadcast message, theoretically, all network ports accessed to the switch can receive the ARP request, and at the moment, the equipment can analyze the target virtual IP address of the ARP request and judge whether the same virtual IP exists in the virtual IP configuration information or not. If the same virtual IP exists, then the same network segment routing judgment operation of S103 is executed, if there is no network port in the same network segment, all the network ports receiving the ARP respond to the ARP request, and if there is a network port in the same network segment, the network port in the same network segment may be used to respond to the ARP request.
S103: utilizing the network port configured with the IP address of the target network segment to respond to the ARP request;
the step is established on the basis that the IP address of the target network segment exists in the virtual IP configuration information, the target network segment corresponding to the target virtual IP address can be determined at the moment, the network port configured with the IP address corresponding to the target network segment is inquired, and the network port is further utilized to respond to the ARP request. The following operations may be present before this step: and judging whether a first target internet access is configured with an IP address in the same network segment with the target virtual IP address by the query routing system. The same network segment routing judgment can ensure that the ARP request only responds from the network port configured with the same network segment with the virtual IP.
By the ARP request response mode in the step, each network port only needs to be configured with one IP address, and all virtual IP addresses are not required to be bound with the network ports. And responding the ARP request by using the network port configured with the IP address of the target network segment, so that the MAC address corresponding to the virtual IP address can be acquired after the virtual IP address and the network port are decoupled, and further the communication between the client and the virtual IP address is realized.
S104: and responding the ARP request by utilizing the network interface configured with the target virtual IP address.
The step is established on the basis that the IP address of the target network segment does not exist in the virtual IP configuration information, at the moment, the load balancing equipment can respond to the ARP request only when the network port is configured with the IP address which is completely the same as the target virtual IP address, otherwise, the load balancing equipment has ARP deception behavior. Therefore, in this step, when the IP address of the target network segment does not exist in the virtual IP configuration information, the network port configured with the target virtual IP address is queried and the network port is used to respond to the ARP request. The embodiment can ensure that the client can still normally access the virtual service when the virtual IP is not configured on the network port, and can reduce the configuration operation of the user.
In this embodiment, after receiving the ARP request, the target virtual IP address corresponding to the ARP request is determined, and the load balancing device may store the IP address in the virtual IP configuration information in advance to further determine whether the target virtual IP address is stored in the virtual IP configuration information. If the target virtual IP address is stored in the virtual IP configuration information, the matching of the target virtual IP address and the stored virtual IP address is successful, and at the moment, the network port configured with the IP address of the target network segment can be used for responding to the ARP request; if the target virtual IP address is not stored in the virtual IP configuration information, the network port configured with the target virtual IP address may be used to respond to the ARP request. The embodiment provides a response scheme for realizing the ARP request on the premise of decoupling the virtual IP and the network port, and can improve the operability and the maintainability of the load balancing equipment.
As a possible implementation, before S103 responding to the ARP request with the portal configured with the IP address of the target network segment, there may be the following operations: judging whether a network port for configuring the IP address of the target network segment exists or not by the inquiring routing system; if yes, executing the operation corresponding to the S103; and if not, utilizing all the network ports to respond to the ARP request.
As another possible implementation, before S104 responds to the ARP request with the portal configured with the target virtual IP address, the following operations may also be performed: judging whether a network port configured with the target virtual IP address exists or not by an inquiry routing system; if yes, executing the operation corresponding to the S104; if not, refusing to respond to the ARP request.
Combining the above two possible implementation manners with the embodiment corresponding to fig. 1, please refer to fig. 2, where fig. 2 is a flowchart of another ARP request response method provided in the embodiment of the present application, and this embodiment may include the following steps:
s201: and receiving the ARP request and determining a target virtual IP address corresponding to the ARP request.
S202: judging whether a prestored virtual IP address is the same as a target virtual IP address; if yes, entering S203; if not, the process proceeds to S206.
S203: judging whether a first target internet access is configured with an IP address in the same network segment with the target virtual IP address by the inquiry routing system; if yes, entering S204; if not, the process proceeds to S205.
S204: detecting whether an entry link of the first target internet access is consistent with a routed link; if the ARP request is consistent with the ARP request, utilizing the first target network port to respond to the ARP request; and if not, not responding to the ARP request.
S205: all the ports are used to respond to the ARP request.
S206: judging whether a second target internet access is provided with an IP address which is completely the same as the target virtual IP address or not by the inquiry routing system; if yes, entering S207; if not, the process proceeds to S208.
S207: the second target portal is utilized to respond to the ARP request.
S208: the ARP request is not responded to.
Through the response mode of the ARP request, the virtual IP address can respond to the ARP request from any network port after the virtual IP address and the network port are decoupled, so that the client can normally access the virtual service. In the embodiment, the use scene of the user is fully considered, the decoupling implementation scheme and the ICMP behavior of the virtual IP and the internet access are designed in detail, the configuration quantity of the internet access IP of the user can be greatly reduced, the requirement of the user for monitoring the virtual service which is not coupled with the internet access through the virtual IP can be met, and the operation and maintenance performance can be guaranteed. The embodiment can also provide more configuration strategies, so that an administrator can select the configuration meeting the requirements of the administrator according to the actual application scene, and the use experience of the user is guaranteed.
As a further description of the corresponding embodiment of fig. 1, one virtual service may be configured with multiple virtual IP addresses, and this embodiment may configure multiple virtual IP addresses in the same network segment for each virtual service in the load balancing device, for example, may configure virtual IP addresses in multiple specific network segments (192.168.0.1 to 192.168.255.255) for a virtual service, such as: 192.168.0.1, 192.168.0.6, and 192.168.0.8. In this embodiment, a corresponding floating IP address in the same network segment may be configured for the network port according to the configured virtual IP address of each virtual service.
When the load balancing device performs the master-slave switching under the dual-machine or cluster condition, the load balancing device that raises the master (i.e., switches to the master) may broadcast the gratuitous ARP to the external device, so as to inform the external device (switch) of the MAC address corresponding to each VIP. If all the network ports perform ARP broadcasting, the switch MAC is frequently refreshed (i.e., the MAC address corresponding to the virtual IP address is frequently refreshed), which may trigger a switch protection mechanism, resulting in blocking traffic accessing the virtual IP address, so as to interrupt the virtual service traffic. Based on the above problem, in this embodiment, when the network port IP of the load balancing device of the host exists and the virtual IP has the same network segment, only the gratuitous ARP broadcast is responded from the network port, so that the virtual IP address only corresponds to one MAC address, and the situation of virtual service traffic interruption is avoided.
According to the analysis, in this embodiment, after the primary/secondary switching of the load balancing device is detected, the ARP broadcast corresponding to the primary/secondary switching is further performed by configuring the network port of the floating IP address in the same network segment. Therefore, when the virtual service is configured with a plurality of virtual IPs in the same network segment, only one floating IP in the same network segment needs to be configured on the network port, and the floating IP and the virtual service are enabled on the same device, so that the interruption of virtual service flow caused by the active-standby switching can be avoided.
As a further description of the embodiment corresponding to fig. 1, the embodiment may also respond to an ICMP (Internet Control Message Protocol) request in the following manner, so as to feed back the health status of the virtual service to the client.
Referring to fig. 3, fig. 3 is a flowchart of a method for responding an ICMP request according to an embodiment of the present application, where this embodiment describes a process of responding an ICMP request on the premise that a virtual IP address is decoupled from a port of a load balancing device, and the process may specifically include the following steps:
step 1: receiving an ICMP request sent by a client;
step 2: matching the IP address corresponding to the ICMP request with the virtual IP configuration information by using a PREROUTING process;
and step 3: and if the matching is successful, sending a mark connection tracking instruction to the LOCAL _ IN process so that the LOCAL _ IN process confirms the target virtual service corresponding to the IP address IN the ICMP request through connection tracking and constructs an ICMP response according to the current state of the target virtual service.
And 4, step 4: the LOCAL _ IN process sends an ICMP response to the LOCAL _ OUT process.
And 5: the LOCAL _ OUT process searches routing information according to the ICMP response matching backward connection tracking;
step 6: the POSTROUTING process returns an ICMP response to the client by means of symmetric routing or asymmetric routing.
In the above embodiment, after receiving the ICMP request, matching is performed using the virtual IP configuration information, and if matching is successful, the health status of the virtual service is detected, and the ICMP request is responded. Specifically, when the number of the target virtual services is greater than 1, the process of constructing an ICMP response according to the current state of the target virtual service may include: if the current states of all the target virtual services are normal states, the ICMP response is constructed; or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; wherein the preset condition is that the target virtual service is the virtual service specified by the ICMP request. That is, when a virtual IP address corresponds to a plurality of virtual services, the ICMP may be responded when all the virtual services corresponding to the virtual IP address are communicated, or may be responded when one of the virtual IP addresses is communicated. In the process of responding the ICMP request, if the load balancing equipment opens the symmetrical route, responding from the network port where the ICMP request enters; if the load balancing device does not start the symmetric route, the ICMP request can be responded according to the preset internet access by inquiring the routing table. The embodiment realizes the ping function of the virtual IP, the ping packet response is proxied by the application layer, and the kernel does not need to sink, thereby not only improving the operation and maintenance performance of the virtual service, but also improving the response speed of the ping packet.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a load balancing apparatus according to an embodiment of the present disclosure;
the apparatus may include:
a request processing module 100, configured to receive an ARP request and determine a target virtual IP address corresponding to the ARP request;
a judging module 200, configured to judge whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on a virtual service;
a first response module 300, configured to respond to the ARP request by using a portal configured with the IP address of the target network segment if the target virtual IP address is a preset IP address in the virtual IP configuration information; wherein, the target network segment is the network segment of the target virtual IP address;
a second response module 400, configured to respond to the ARP request by using the portal configured with the target virtual IP address if the target virtual IP address is not the preset IP address in the virtual IP configuration information.
In this embodiment, after receiving the ARP request, the target virtual IP address corresponding to the ARP request is determined, and the load balancing device may store the IP address in the virtual IP configuration information in advance to further determine whether the target virtual IP address is stored in the virtual IP configuration information. If the target virtual IP address is stored in the virtual IP configuration information, the matching of the target virtual IP address and the stored virtual IP address is successful, and at the moment, the network port configured with the IP address of the target network segment can be used for responding to the ARP request; if the target virtual IP address is not stored in the virtual IP configuration information, the network port configured with the target virtual IP address may be used to respond to the ARP request. The embodiment provides a response scheme for realizing the ARP request on the premise of decoupling the virtual IP and the network port, and can improve the operability and the maintainability of the load balancing equipment.
Further, the method also comprises the following steps:
a network segment judging module, which is used for judging whether the network port configured with the IP address of the target network segment exists by the inquiring routing system before the network port configured with the IP address of the target network segment responds to the ARP request; if yes, starting a workflow corresponding to the first response module 300; and if not, utilizing all the network ports to respond to the ARP request.
Further, the method also comprises the following steps:
an IP judging module, configured to judge whether there is a port configured with the target virtual IP address by querying a routing system before responding to the ARP request by using the port configured with the target virtual IP address; if yes, starting a workflow corresponding to the second response module 400; if not, refusing to respond to the ARP request.
Further, the method also comprises the following steps:
the network port configuration module is used for configuring a plurality of virtual IP addresses of the same network segment for each virtual service in the load balancing equipment before receiving an ARP request; and the virtual IP address configuration module is also used for configuring a corresponding floating IP address of the same network segment for the network port according to the configured virtual IP address of each virtual service.
Further, the method also comprises the following steps:
and the broadcasting module is used for carrying out ARP broadcasting corresponding to the main-standby switching through configuring the network port with the floating IP address in the same network segment after detecting the main-standby switching of the load balancing equipment.
Further, the method also comprises the following steps:
the IP matching module is used for matching an IP address corresponding to the ICMP request with the virtual IP configuration information if the ICMP request is received;
an ICMP response construction module, configured to determine a target virtual service according to the IP address corresponding to the ICMP request if matching is successful, and construct an ICMP response according to the current state of the target virtual service;
and a response returning module, configured to return the ICMP response to the sending end of the ICMP request.
Further, when the number of the target virtual services is greater than 1, the ICMP response constructing module constructs an ICMP response according to the current state of the target virtual service, including: if the current states of all the target virtual services are normal states, the ICMP response is constructed; or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; wherein the preset condition is that the target virtual service is the virtual service specified by the ICMP request.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
The present application also provides a storage medium having a computer program stored thereon, which when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application further provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the electronic device may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. An ARP request response method is applied to load balancing equipment, and comprises the following steps:
receiving an ARP request and determining a target virtual IP address corresponding to the ARP request;
judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on a virtual service;
if so, utilizing the network port configured with the IP address of the target network segment to respond to the ARP request; wherein, the target network segment is the network segment of the target virtual IP address;
and if not, utilizing the network port configured with the target virtual IP address to respond to the ARP request.
2. The ARP request response method of claim 1, wherein before responding to the ARP request using a portal configured with the IP address of the target network segment, further comprising:
judging whether a network port for configuring the IP address of the target network segment exists or not by the inquiring routing system;
if yes, executing the operation of utilizing the network port configured with the IP address of the target network segment to respond to the ARP request;
and if not, utilizing all the network ports to respond to the ARP request.
3. The ARP request response method of claim 1, before responding to the ARP request using the portal configured with the target virtual IP address, further comprising:
judging whether a network port configured with the target virtual IP address exists or not by an inquiry routing system;
if yes, executing the operation of utilizing the network port configured with the target virtual IP address to respond to the ARP request;
if not, refusing to respond to the ARP request.
4. The ARP request response method of claim 1, prior to receiving an ARP request, further comprising:
configuring a plurality of virtual IP addresses of the same network segment for each virtual service in the load balancing equipment;
and configuring a corresponding floating IP address in the same network segment for the network port according to the configured virtual IP address of each virtual service.
5. The ARP request response method of claim 4, after detecting that the load balancing device is switched between the active device and the standby device, further comprising:
and performing ARP broadcast corresponding to the main-standby switching by configuring the network ports of the floating IP addresses in the same network segment.
6. The ARP request response method of claim 1, further comprising:
if an ICMP request is received, matching an IP address corresponding to the ICMP request with the virtual IP configuration information;
if the matching is successful, determining a target virtual service according to the IP address corresponding to the ICMP request, and constructing an ICMP response according to the current state of the target virtual service;
returning the ICMP response to the sender of the ICMP request.
7. The ARP request response method of claim 6, wherein when the number of the target virtual services is greater than 1, constructing an ICMP response according to the current status of the target virtual services comprises:
if the current states of all the target virtual services are normal states, the ICMP response is constructed;
or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; wherein the preset condition is that the target virtual service is the virtual service specified by the ICMP request.
8. A load balancing device, comprising:
the device comprises a request processing module, a target processing module and a target processing module, wherein the request processing module is used for receiving an ARP request and determining a target virtual IP address corresponding to the ARP request;
the judging module is used for judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; the preset IP address in the virtual IP configuration information is an IP address configured on a virtual service;
the first response module is used for responding the ARP request by utilizing a network port configured with the IP address of the target network segment if the target virtual IP address is the preset IP address in the virtual IP configuration information; wherein, the target network segment is the network segment of the target virtual IP address;
and the second response module is used for responding the ARP request by using the network port configured with the target virtual IP address if the target virtual IP address is not the preset IP address in the virtual IP configuration information.
9. An electronic device comprising a memory in which a computer program is stored and a processor which, when invoked by the computer program in the memory, carries out the steps of the ARP request response method according to any of claims 1 to 7.
10. A storage medium having stored thereon computer-executable instructions which, when loaded and executed by a processor, carry out the steps of the ARP request response method according to any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011296892.6A CN112311907B (en) | 2020-11-18 | 2020-11-18 | ARP request response method, load balancing equipment and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011296892.6A CN112311907B (en) | 2020-11-18 | 2020-11-18 | ARP request response method, load balancing equipment and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112311907A true CN112311907A (en) | 2021-02-02 |
CN112311907B CN112311907B (en) | 2023-05-12 |
Family
ID=74334832
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011296892.6A Active CN112311907B (en) | 2020-11-18 | 2020-11-18 | ARP request response method, load balancing equipment and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112311907B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112804377A (en) * | 2021-04-08 | 2021-05-14 | 紫光恒越技术有限公司 | Data query method, electronic equipment, server, storage equipment and gateway equipment |
CN114079636A (en) * | 2021-10-25 | 2022-02-22 | 深信服科技股份有限公司 | A traffic processing method, switch, soft load device, and storage medium |
CN114760266A (en) * | 2022-03-01 | 2022-07-15 | 烽台科技(北京)有限公司 | Virtual address generation method and device, computer equipment and computer program product |
US11968169B1 (en) | 2023-06-14 | 2024-04-23 | International Business Machines Corporation | Domain name based deployment |
US12199940B1 (en) | 2023-06-14 | 2025-01-14 | International Business Machines Corporation | Address resolution protocol based deployment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1558614A (en) * | 2004-01-17 | 2004-12-29 | 港湾网络有限公司 | Method for responding requests from address analysis protocol of network address conversion virtual address |
JP2014230216A (en) * | 2013-05-24 | 2014-12-08 | 日本電信電話株式会社 | Network device, relay management method, relay management program and communication system |
CN110062064A (en) * | 2019-05-30 | 2019-07-26 | 新华三信息安全技术有限公司 | A kind of Address Resolution Protocol ARP request message response method and device |
-
2020
- 2020-11-18 CN CN202011296892.6A patent/CN112311907B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1558614A (en) * | 2004-01-17 | 2004-12-29 | 港湾网络有限公司 | Method for responding requests from address analysis protocol of network address conversion virtual address |
JP2014230216A (en) * | 2013-05-24 | 2014-12-08 | 日本電信電話株式会社 | Network device, relay management method, relay management program and communication system |
CN110062064A (en) * | 2019-05-30 | 2019-07-26 | 新华三信息安全技术有限公司 | A kind of Address Resolution Protocol ARP request message response method and device |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112804377A (en) * | 2021-04-08 | 2021-05-14 | 紫光恒越技术有限公司 | Data query method, electronic equipment, server, storage equipment and gateway equipment |
CN114079636A (en) * | 2021-10-25 | 2022-02-22 | 深信服科技股份有限公司 | A traffic processing method, switch, soft load device, and storage medium |
CN114760266A (en) * | 2022-03-01 | 2022-07-15 | 烽台科技(北京)有限公司 | Virtual address generation method and device, computer equipment and computer program product |
US11968169B1 (en) | 2023-06-14 | 2024-04-23 | International Business Machines Corporation | Domain name based deployment |
US12199940B1 (en) | 2023-06-14 | 2025-01-14 | International Business Machines Corporation | Address resolution protocol based deployment |
Also Published As
Publication number | Publication date |
---|---|
CN112311907B (en) | 2023-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112311907A (en) | ARP request response method, load balancing equipment and related device | |
CN107078969B (en) | Realize computer equipment, the system and method for load balancing | |
CN103051740B (en) | Domain name analytic method, dns server and domain name analysis system | |
KR101442309B1 (en) | Failover in a host concurrently supporting multiple virtual ip addresses across multiple adapters | |
CN102447624B (en) | Load balancing method in server cluster, as well as node server and cluster | |
US9525648B2 (en) | Method for acquiring physical address of virtual machine | |
US9438679B2 (en) | Method, apparatus, name server and system for establishing FCOE communication connection | |
CN102025630A (en) | Load balancing method and load balancing system | |
CN109151009B (en) | CDN node distribution method and system based on MEC | |
CN101171821A (en) | System, network device, method and computer program product for active load balancing using nodes of a cluster as authoritative domain name servers | |
CN107193673B (en) | Message processing method and device | |
CN103458013A (en) | Streaming media server cluster load balancing system and balancing method | |
CN112825527A (en) | Service node distribution method and device based on MEC and related server | |
JP2013090072A (en) | Service provision system | |
CN101808119A (en) | Method and equipment for multiple storage array load balancing | |
EP3200432B1 (en) | Method for implementing session border controller pool, and session border controller pool | |
CN114900526A (en) | Load balancing method and system, computer storage medium and electronic device | |
CN113076212A (en) | Cluster management method, device and equipment and computer readable storage medium | |
KR20110063328A (en) | Remote Frazier Load (RCPC) Bind Service with Physical Interface Query and Selection | |
CN110535947B (en) | Storage device cluster configuration node switching method, device and equipment | |
CN107294845A (en) | VRRP load-balancing methods and device | |
CN101350772B (en) | Method for selecting line of router with multiple WAN interfaces, system and router | |
EP3435615B1 (en) | Network service implementation method, service controller, and communication system | |
CN111835684B (en) | Network isolation monitoring method and system for haproxy equipment | |
CN111385324A (en) | Data communication method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |