CN112311907B - 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
- CN112311907B CN112311907B CN202011296892.6A CN202011296892A CN112311907B CN 112311907 B CN112311907 B CN 112311907B CN 202011296892 A CN202011296892 A CN 202011296892A CN 112311907 B CN112311907 B CN 112311907B
- Authority
- CN
- China
- Prior art keywords
- address
- virtual
- arp request
- target
- network port
- 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.)
- Active
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; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service; if yes, responding to the ARP request by using the network port configured with the IP address of the target network segment; the target network segment is a network segment of a target virtual IP address; if not, responding to the ARP request by using the network port for configuring the target virtual IP address. According to the method and the device, the response to the ARP request can be realized on the premise of decoupling the virtual IP and the network port, and the operability of the load balancing equipment is improved. The application also discloses load balancing equipment, electronic equipment and a storage medium, which have the beneficial effects.
Description
Technical Field
The present invention 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 the process of configuring a virtual service, all virtual IPs on the virtual service are typically configured on a load-balanced portal. However, in the actual scene, the total number of the virtual IP configurations of the users is hundreds to thousands, so that the virtual IP configuration quantity of each network port is huge, and the maintenance of the load balancing equipment is not facilitated.
In order to simplify the user configuration, there has been a decoupling of virtual IP from the portal in the related art. However, at present, more and more users wish to monitor the state of the virtual service in real time by pinging the IP of the virtual service, and the current load balancing device can ping only if the virtual IP is configured on the internet access.
Therefore, how to implement the response to the ARP request on the premise of decoupling the virtual IP from the network port, and to improve the operability of the load balancing device are technical problems that a person skilled in the art needs to solve at present.
Disclosure of Invention
The invention aims to provide an ARP request response method, load balancing equipment, electronic equipment and storage medium, which can realize the response to an ARP request on the premise of decoupling a virtual IP and a network port and improve the operability and maintainability of the load balancing equipment.
In order to solve the above technical problems, the present application provides an ARP request response method, applied to load balancing equipment, including:
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 virtual IP configuration information; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service;
if yes, responding to the ARP request by using a network port configured with the IP address of the target network segment; wherein the target network segment is a network segment of the target virtual IP address;
if not, responding to the ARP request by using the network port configured with the target virtual IP address.
Optionally, before responding to the ARP request with the network port configured with the 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 inquiring the routing system;
if yes, executing the operation of responding to the ARP request by using the network port configured with the IP address of the target network segment;
if not, responding to the ARP request by using all network ports.
Optionally, before responding to the ARP request with the network port configured with the target virtual IP address, the method further includes:
judging whether a network port for configuring the target virtual IP address exists or not through a query routing system;
if yes, executing the operation of responding to the ARP request by using the network port configured with the target virtual IP address;
if not, refusing to respond to the ARP request.
Optionally, before receiving the ARP request, the method further includes:
configuring virtual IP addresses of a plurality of same network segments for each virtual service in the load balancing equipment;
and configuring the corresponding floating IP address of the same network segment for the network port according to the virtual IP address configured by each virtual service.
Optionally, after detecting the primary-standby switching of the load balancing device, the method further includes:
and performing ARP broadcasting corresponding to the active-standby switching by configuring the network port of the floating IP address of the same network segment.
Optionally, the method further comprises:
if the 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;
and returning the ICMP response to the sending end 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 includes:
if the current states of all the target virtual services are normal states, constructing the ICMP response;
or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; and the preset condition is that the target virtual service is the virtual service designated by the ICMP request.
The application also provides a load balancing device, which comprises:
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; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service;
the first response module is used for responding to the ARP request by using the network port 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 a network segment of the target virtual IP address;
and the second response module is used for responding to 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 also provides a storage medium having stored thereon a computer program which, when executed, implements the steps performed by the ARP request response method described above.
The application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps executed by 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 the ARP request response method 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 virtual IP configuration information; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service; if yes, responding to the ARP request by using a network port configured with the IP address of the target network segment; wherein the target network segment is a network segment of the target virtual IP address; if not, responding to the ARP request by using the network port configured with the target virtual IP address.
After receiving the ARP request, the method determines a target virtual IP address corresponding to the ARP request, and the load balancing equipment 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 target virtual IP address is successfully matched with the stored virtual IP address, and the ARP request can be responded by using a network port configured with the IP address of the target network segment; if the target virtual IP address is not stored in the virtual IP configuration information, the ARP request can be responded by using the network port configured with the target virtual IP address. The application provides a response scheme for ARP requests on the premise of decoupling the virtual IP and the network port, and can improve the operability and maintainability of load balancing equipment. The application also provides a load balancing device, an electronic device and a storage medium, which have the beneficial effects and are not described herein.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
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 flow chart of a method for responding to ICMP requests according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a load balancing device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of 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 apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a flowchart of an ARP request response method according to an embodiment of the present application.
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 a network port of the load balancing equipment, namely: the virtual IP address corresponding to the virtual service may not be configured on the portal.
Before this step, there may be an operation that the client or the router sends an ARP (Address Resolution Protocol ) request, and after receiving the ARP request, the load balancing device may parse 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, to the client or the router, the MAC address corresponding to the target virtual IP address using a specific network port.
S102: judging whether the target virtual IP address is a preset IP address in the virtual IP configuration information; if yes, go to S103; if not, entering S104;
the virtual IP configuration information may be information stored in the load balancing device, and the preset IP address in the virtual IP configuration information is an IP address configured on the virtual service. The process of constructing virtual IP configuration information is as follows: when configuring the virtual service, automatically generating virtual IP configuration information according to all filled virtual IP addresses of the virtual service, and loading the virtual IP configuration information into a memory. The user can view the virtual IP configuration information at the configuration interface.
The ARP request belongs to a broadcast message, and theoretically, all network ports accessed to the switch can receive the ARP request, at the moment, the device 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. If the same virtual IP exists, the same network segment route judging operation of S103 is executed, if no network port of the same network segment exists, all network ports receiving ARP respond to the ARP request, and if the network port of the same network segment exists, the network port of the same network segment can be utilized to respond to the ARP request.
S103: responding to the ARP request by using a network port configured with the IP address of the target network segment;
the step is based on the existence of the IP address of the target network segment 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 queried, and the network port is used for responding to the ARP request. The following operations may be present prior to this step: and judging whether the first target network port is configured with the IP address of the same network segment as the target virtual IP address through the query routing system. The same network segment route judgment can ensure that the ARP request only responds from the network port configured with the same network segment as the virtual IP.
By the ARP request response mode of the step, each network port can be configured with only one IP address, and all virtual IP addresses are not required to be bound with the network port. And responding to the ARP request by using the network port configured with the IP address of the target network segment, so that the virtual IP address and the network port can be decoupled to obtain the MAC address corresponding to the virtual IP address, and further the communication between the client and the virtual IP address is realized.
S104: responding to the ARP request by using the network port configured with the target virtual IP address.
The step is based on that the IP address of the target network segment does not exist in the virtual IP configuration information, at this time, the load balancing device can respond to the ARP request only when the IP address which is completely the same as the target virtual IP address is configured by the network port, otherwise, the load balancing device has ARP spoofing. Therefore, the step can inquire the network port configuring the target virtual IP address when the IP address of the target network segment does not exist in the virtual IP configuration information, and respond to the ARP request by utilizing the network port. 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 configuration operation of a user.
In this embodiment, after receiving the ARP request, the target virtual IP address corresponding to the ARP request may be determined, and the load balancing device may store the IP address in the virtual IP configuration information in advance, so as to determine whether the virtual IP configuration information stores the target virtual IP address. If the target virtual IP address is stored in the virtual IP configuration information, the target virtual IP address is successfully matched with the stored virtual IP address, and the ARP request can be responded by using a network port configured with the IP address of the target network segment; if the target virtual IP address is not stored in the virtual IP configuration information, the ARP request can be responded by using the network port configured with the target virtual IP address. The embodiment provides a response scheme for ARP requests on the premise of decoupling the virtual IP and the network port, and can improve the operability and maintainability of load balancing equipment.
As a possible implementation, before S103 responds to the ARP request with the portal configured with the IP address of the target network segment, the following operations may also exist: judging whether a network port for configuring the IP address of the target network segment exists or not by inquiring the routing system; if yes, executing an operation corresponding to S103; if not, responding to the ARP request by using all network ports.
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 exist: judging whether a network port for configuring the target virtual IP address exists or not through a query routing system; if yes, executing an operation corresponding to S104; if not, refusing to respond to the ARP request.
Combining the two possible implementations with the embodiment corresponding to fig. 1 may obtain a new ARP request response method, please refer to fig. 2, fig. 2 is a flowchart of another ARP request response method provided by the embodiment of the present application, and the 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 pre-stored virtual IP address is the same as a target virtual IP address; if yes, go to S203; if not, the process proceeds to S206.
S203: judging whether a first target network port is configured with an IP address of the same network segment as the target virtual IP address through a query routing system; if yes, go to S204; if not, the process proceeds to S205.
S204: detecting whether an inlet link of a first target network port is consistent with a routed link; if the first target network port is consistent with the first target network port, responding to the ARP request; if not, the ARP request is not responded.
S205: and responding to the ARP request by utilizing all the network ports.
S206: judging whether a second target network port is configured with an IP address which is identical to the target virtual IP address or not through a query routing system; if yes, go to S207; if not, the process proceeds to S208.
S207: and responding to the ARP request by using the second target network port.
S208: the ARP request is not responded to.
Through the response mode of the ARP request, after the virtual IP address and the network port are decoupled, the response of the virtual IP address to the ARP request from any network port can be realized, so that the client can access the virtual service normally. According to the embodiment, the use scene of the user is fully considered, the decoupling implementation scheme and ICMP behavior of the virtual IP and the network port are designed in detail, the IP configuration quantity of the network port of the user can be greatly reduced, the requirement that the user monitors the virtual service which is not coupled with the network port through the virtual IP can be met, and the operability and maintainability are ensured. 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 user experience is ensured.
As a further introduction to 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 of 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 the virtual service, such as: 192.168.0.1, 192.168.0.6 and 192.168.0.8. The embodiment can also configure the corresponding floating IP address of the same network segment for the network port according to the virtual IP address configured by each virtual service.
When the load balancing device performs primary-backup switching under the condition of dual-mode or cluster, the load balancing device which rises the primary (i.e. switches to the primary device) can broadcast a 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 broadcast ARP, the switch MAC is frequently refreshed (i.e. the MAC address corresponding to the virtual IP address is frequently refreshed), which may trigger the switch protection mechanism, so that the traffic accessing the virtual IP address is blocked, and the virtual service traffic is interrupted. Based on the above-mentioned problems, in this embodiment, when the network port IP of the load balancing device of the host exists and the IP of the same network segment as the virtual IP, the network port only responds to the gratuitous ARP broadcast, so that the virtual IP address may only correspond to one MAC address, and the situation of interruption of the virtual service flow is avoided.
As can be seen from the above analysis, in this embodiment, after detecting the active-standby switching of the load balancing device, ARP broadcasting corresponding to the active-standby switching is also performed by configuring the network port of the floating IP address of the same network segment. Therefore, when the virtual service configures the virtual IP under a plurality of same network segments, the virtual service can avoid the interruption of the flow of the virtual service caused by active/standby switching by only configuring one floating IP with the same network segment on the network port and ensuring that the floating IP and the virtual service take effect on the same equipment.
As a further introduction to the corresponding embodiment of fig. 1, this embodiment may also respond to ICMP (Internet Control Message Protocol, control message protocol) requests in the following manner in order to feed back the health status of the virtual service to the client.
Referring to fig. 3, fig. 3 is a flowchart of a response method of an ICMP request provided in an embodiment of the present application, where the embodiment describes a process of responding to an ICMP request on the premise that a virtual IP address is decoupled from a network port of a load balancing device, and the process specifically may 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 virtual IP configuration information by utilizing a PRERROUTING process;
step 3: if the matching is successful, a marked connection tracking instruction is sent 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 an ICMP response is constructed according to the current state of the target virtual service.
Step 4: the local_in process sends an ICMP response to the local_out process.
Step 5: the local_OUT process tracks and searches the route information according to ICMP response matching reverse connection;
step 6: the POSTROUTING process returns ICMP responses to the client in a symmetrical route or an asymmetrical route mode.
After receiving the ICMP request, the above embodiment performs matching using the virtual IP configuration information, and if matching is successful, detects the health status of the virtual service, and responds to the ICMP request. 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, constructing the ICMP response; or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; and the preset condition is that the target virtual service is the virtual service designated by the ICMP request. That is, when a virtual IP address corresponds to a plurality of virtual services, ICMP may be responded to when all the virtual services corresponding to the virtual IP address are on, or ICMP may be responded to when any one of the virtual IP addresses is on. In the process of responding to the ICMP request, if the load balancing equipment starts a symmetrical route, responding from a network port into which the ICMP request enters; if the load balancing equipment does not start the symmetrical route, the ICMP request can be responded according to a preset network port by inquiring a routing table. The embodiment realizes the ping function of the virtual IP, and the response of the ping packet is proxied by the application layer without sinking to the kernel, thereby improving the operability and the maintainability of the virtual service and the response speed of the ping packet.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a load balancing device according to an embodiment of the present application;
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; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service;
the first response module 300 is configured to respond to the ARP request with the network port 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 a network segment of the target virtual IP address;
the second response module 400 is configured to respond to the ARP request with 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.
In this embodiment, after receiving the ARP request, the target virtual IP address corresponding to the ARP request may be determined, and the load balancing device may store the IP address in the virtual IP configuration information in advance, so as to determine whether the virtual IP configuration information stores the target virtual IP address. If the target virtual IP address is stored in the virtual IP configuration information, the target virtual IP address is successfully matched with the stored virtual IP address, and the ARP request can be responded by using a network port configured with the IP address of the target network segment; if the target virtual IP address is not stored in the virtual IP configuration information, the ARP request can be responded by using the network port configured with the target virtual IP address. The embodiment provides a response scheme for ARP requests on the premise of decoupling the virtual IP and the network port, and can improve the operability and maintainability of load balancing equipment.
Further, the method further comprises the following steps:
the network segment judging module is used for judging whether the network port configuring the IP address of the target network segment exists or not by inquiring the routing system before responding to the ARP request by utilizing the network port configuring the IP address of the target network segment; if yes, starting a workflow corresponding to the first response module 300; if not, responding to the ARP request by using all network ports.
Further, the method further comprises the following steps:
the IP judging module is used for judging whether the network port configured with the target virtual IP address exists or not by inquiring the routing system before responding to the ARP request by utilizing the network 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 further 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 the ARP request; and the virtual IP address configuration module is also used for configuring the corresponding floating IP address of the same network segment for the network port according to the virtual IP address configured by each virtual service.
Further, the method further comprises the following steps:
and the broadcasting module is used for carrying out ARP broadcasting corresponding to the primary-backup switching through configuring the network port of the floating IP address of the same network segment after the primary-backup switching of the load balancing equipment is detected.
Further, the method further comprises the following steps:
the IP matching module is used for matching the IP address corresponding to the ICMP request with the virtual IP configuration information if the ICMP request is received;
the ICMP response construction module is used for determining a target virtual service according to the IP address corresponding to the ICMP request if the matching is successful, and constructing an ICMP response according to the current state of the target virtual service;
and the response return module is used for returning 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 construction module constructs an ICMP response according to the current state of the target virtual services, where the process includes: if the current states of all the target virtual services are normal states, constructing the ICMP response; or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; and the preset condition is that the target virtual service is the virtual service designated by the ICMP request.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
The present application also provides a storage medium having stored thereon a computer program which, when executed, performs the steps provided by the above embodiments. The storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The application also 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 in the foregoing embodiments when calling the computer program in the memory. Of course the electronic device may also include various network interfaces, power supplies, etc.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. The ARP request response method is characterized by being applied to load balancing equipment, wherein virtual services are deployed in the load balancing equipment, each virtual service has a corresponding virtual IP address, the virtual IP address corresponding to the virtual service is decoupled from a network port of the load balancing equipment, and the ARP request response method 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 virtual IP configuration information; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service;
if yes, responding to the ARP request by using a network port configured with the IP address of the target network segment; wherein the target network segment is a network segment of the target virtual IP address;
if not, responding to the ARP request by using the network port configured with the target virtual IP address.
2. The ARP request response method according to claim 1, further comprising, before responding to the ARP request with a portal configured with an IP address of a target network segment:
judging whether a network port for configuring the IP address of the target network segment exists or not by inquiring the routing system;
if yes, executing the operation of responding to the ARP request by using the network port configured with the IP address of the target network segment;
if not, responding to the ARP request by using all network ports.
3. The ARP request response method according to claim 1, further comprising, before responding to the ARP request with the portal configured with the target virtual IP address:
judging whether a network port for configuring the target virtual IP address exists or not through a query routing system;
if yes, executing the operation of responding to the ARP request by using the network port configured with the target virtual IP address;
if not, refusing to respond to the ARP request.
4. The ARP request response method according to claim 1, further comprising, prior to receiving the ARP request:
configuring virtual IP addresses of a plurality of same network segments for each virtual service in the load balancing equipment;
and configuring the corresponding floating IP address of the same network segment for the network port according to the virtual IP address configured by each virtual service.
5. The ARP request response method according to claim 4, further comprising, after detecting the load balancing device active-standby switch:
and performing ARP broadcasting corresponding to the active-standby switching by configuring the network port of the floating IP address of the same network segment.
6. The ARP request response method according to claim 1, further comprising:
if the 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;
and returning the ICMP response to the sending end of the ICMP request.
7. The ARP request response method according to claim 6, wherein when the number of the target virtual services is greater than 1, constructing an ICMP response according to a current state of the target virtual service, comprises:
if the current states of all the target virtual services are normal states, constructing the ICMP response;
or if the current state of the target virtual service meeting the preset condition is a normal state, constructing the ICMP response; and the preset condition is that the target virtual service is the virtual service designated by the ICMP request.
8. A load balancing device, wherein a virtual service is deployed in the load balancing device, each virtual service has a corresponding virtual IP address, and the virtual IP address corresponding to the virtual service is decoupled from a network port of the load balancing device, the load balancing device comprising:
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; wherein, the preset IP address in the virtual IP configuration information is the IP address configured on the virtual service;
the first response module is used for responding to the ARP request by using the network port 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 a network segment of the target virtual IP address;
and the second response module is used for responding to 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 and a processor, the memory having stored therein a computer program, the processor implementing the steps of the ARP request response method according to any of claims 1 to 7 when the computer program in the memory is invoked by the processor.
10. A storage medium having stored therein computer executable instructions which when loaded and executed by a processor implement 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 CN112311907A (en) | 2021-02-02 |
CN112311907B true 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) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112804377B (en) * | 2021-04-08 | 2021-07-06 | 紫光恒越技术有限公司 | Data query method, electronic equipment, server, storage equipment and gateway equipment |
CN114079636B (en) * | 2021-10-25 | 2024-11-29 | 深信服科技股份有限公司 | Flow processing method, switch, soft load device and storage medium |
CN114760266B (en) * | 2022-03-01 | 2023-06-09 | 烽台科技(北京)有限公司 | Virtual address generation method and device and computer equipment |
US12199940B1 (en) | 2023-06-14 | 2025-01-14 | International Business Machines Corporation | Address resolution protocol based deployment |
US11968169B1 (en) | 2023-06-14 | 2024-04-23 | International Business Machines Corporation | Domain name 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 |
Also Published As
Publication number | Publication date |
---|---|
CN112311907A (en) | 2021-02-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112311907B (en) | ARP request response method, load balancing equipment and related device | |
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 | |
CN107078969B (en) | Realize computer equipment, the system and method for load balancing | |
US9331977B2 (en) | High availability for cloud-based services | |
US9525648B2 (en) | Method for acquiring physical address of virtual machine | |
US9438679B2 (en) | Method, apparatus, name server and system for establishing FCOE communication connection | |
EP2949080B1 (en) | Load balancing among servers in a multi-data center environment | |
US20120102192A1 (en) | Network system | |
CN101171821A (en) | System, network device, method and computer program product for active load balancing using nodes of a cluster as authoritative domain name servers | |
CN105827747A (en) | Website access method, client and server within local area network | |
CN104618243A (en) | Routing method, device and system, and gateway scheduling method and device | |
CN101242306A (en) | Method, system, device and server for automatic discovery of network device | |
CN112217859A (en) | Load balancing method, system, mobile terminal and storage medium | |
CN103581351B (en) | The method and apparatus of network access | |
CN103428229A (en) | Data center system and device and method for providing service | |
CN102368789A (en) | Method and system for connecting dual-stack terminal to network | |
CN101808119A (en) | Method and equipment for multiple storage array load balancing | |
JP2010103695A (en) | Cluster system, cluster server and cluster control method | |
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 | |
CN110535947B (en) | Storage device cluster configuration node switching method, device and equipment | |
CN111193778A (en) | Method, device, equipment and medium for WEB service load balancing | |
CN103795584A (en) | Client side identity detection method and gateway | |
CN103327482B (en) | Terminal and network method for handover control |
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 |