Method and system for load balancing server to access real server across subnets

By configuring the DR mode in the load balancing server and utilizing SDN network technology, cross-subnet request forwarding is realized, solving the problems of load balancing server deployment limitations and performance bottlenecks in the existing technology, and achieving a high-performance and flexible load balancing solution.

CN119945980APending Publication Date: 2025-05-06UNICLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411834120.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Existing load balancing servers have deployment limitations and performance bottlenecks when accessing real servers across subnets.

Method used

By configuring the DR mode in the load balancing server and using SDN network technology to statically configure the MAC address of the real server, cross-subnet request forwarding is achieved, breaking through the deployment restrictions of the same subnet, improving deployment flexibility, and reducing the performance burden of the load balancing server.

Benefits of technology

It realizes the flexibility and high-performance forwarding of load balancing servers to access real servers across subnets, avoiding the problem of load balancing servers becoming a bottleneck in the system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119945980A_ABST
    Figure CN119945980A_ABST
Patent Text Reader

Abstract

The invention provides a method for a load balancing server to access a real server across subnets, which comprises the following steps: a client sends a request to the load balancing server, a source IP of a data message of the request is a CIP, and a destination IP is a VIP; the load balancing server is configured to be in a DR mode, an MAC address of a rear-end real server is statically configured to the load balancing server, and the load balancing server transmits a request message source address to the real server after receiving a request; wherein the unvarnished transmission operation at least comprises cross-subnet request forwarding; and the real server processes the received request message and sends a processed response message to the client CIP. The method is based on the DR mode, the limitation that the load balancing server and the real server must be deployed in the same subnet is broken through, the SDN network technology is used, the client is allowed to deploy the real server in any subnet of the VPC, and the deployment flexibility is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of cloud computing technology, and in particular, relates to a method and system for a load balancing server to access a real server across subnets. Background Art

[0002] Server Load Balance (SLB) is one of the essential cloud products for cloud vendors, and more and more Internet services need to perform data analysis based on the client source IP, so whether SLB can transparently transmit the source IP becomes more and more important. Currently, the four-layer SLB commonly uses four modes: DR, NAT, FULL NAT and TUNNEL:

[0003] In DR (Direct Routing) mode, SLB changes the destination MAC of the client request message to the MAC of the Real Server and then forwards it to the RS (Real Server). The source IP address and the destination IP address remain unchanged. Therefore, although DR mode can meet the scenario of transparent transmission of the source IP, it also requires that the SLB and the Real Server must be in the same network segment, which limits the scenario.

[0004] In NAT mode, SLB changes the destination IP address of the client request message to the IP address of the Real Server and then forwards it to the RealServer. Although it can carry the client source IP address, both package in and package out need to pass through SLB, so the performance of SLB will become a system bottleneck.

[0005] In FULL NAT mode, SLB changes the destination IP of the client request message to the IP of the Real Server, and changes the source IP to the VIP of SLB before forwarding it to the Real Server. At this time, the client source IP cannot be transparently transmitted.

[0006] In TUNNEL mode, SLB uses the client request message as the inner layer data, adds another layer of IP encapsulation on the outside, and sends it to the Real Server, where the source IP is the VIP and the destination IP is the IP of the Real Server. Although the source IP can also be transmitted across network segments, the tunnel configuration needs to be performed in the tenant's virtual machine, that is, the Real Server, which is not conducive to operation and maintenance management, and involves data security issues of the tenant's virtual machine. Summary of the invention

[0007] In view of this, the present application aims to propose a method and system for a load balancing server to access a real server across subnets, so as to solve at least one of the above problems.

[0008] To achieve the above purpose, the technical solution of this application is implemented as follows:

[0009] In a first aspect, the present application provides a method for a load balancing server to access a real server across subnets, comprising:

[0010] The client sends a request to the load balancing server, where the source IP of the requested data packet is CIP and the destination IP is VIP;

[0011] The load balancing server is configured in DR mode, and the MAC address of the backend real server is statically configured in the load balancing server. After receiving the request, the load balancing server transparently transmits the source address of the request message to the real server; wherein the transparent transmission operation at least includes cross-subnet request forwarding;

[0012] The real server processes the received request message and sends the processed response message to the client CIP.

[0013] In a second aspect, based on the same inventive concept, the present application also provides a system for a load balancing server to access a real server across subnets, including:

[0014] The request sending module is configured to send a request from a client to a load balancing server, wherein the source IP of the requested data message is CIP and the destination IP is VIP;

[0015] The request forwarding module is configured such that the load balancing server is configured in DR mode, the MAC address of the backend real server is statically configured in the load balancing server, and after the load balancing server receives the request, the source address of the request message is transparently transmitted to the real server; wherein the transparent transmission operation at least includes cross-subnet request forwarding;

[0016] The request processing module is configured to cause the real server to process the received request message and send the processed response message to the client CIP.

[0017] In a third aspect, based on the same inventive concept, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.

[0018] In a fourth aspect, based on the same inventive concept, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in the first aspect.

[0019] Compared with the prior art, the method and system for a load balancing server to access a real server across subnets described in this application has the following beneficial effects:

[0020] The present application describes a method and system for a load balancing server to access a real server across subnets. The method is based on the DR mode, breaks through the restriction that the load balancing server and the real server must be deployed in the same subnet, and uses SDN network technology to allow customers to deploy the real server in any subnet of the VPC, thereby enhancing deployment flexibility. Compared with the use of NAT mode to achieve source address transparent transmission, the load balancing server in the present application only needs to distribute the message to the real server, and the real server sends the response packet directly to the customer without having to bypass the load balancing server. High-performance forwarding is completed while transparently transmitting the source IP. Therefore, the load balancing server in the present application is no longer a bottleneck for system performance, providing flexibility for the cloud network. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0022] Figure 1 A flow chart of a method for a load balancing server to access a real server across subnets according to an embodiment of the present application;

[0023] Figure 2 This is a schematic diagram of the route for the DR mode load balancing server to access the real server across subnets described in the embodiment of the present application;

[0024] Figure 3 A schematic diagram of a system structure in which a load balancing server accesses a real server across subnets according to an embodiment of the present application;

[0025] Figure 4 This is a schematic diagram of the hardware structure of the electronic device described in the embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0027] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0028] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0029] See also Figure 1 As shown, this embodiment provides a method for a load balancing server to access a real server across subnets, which specifically includes the following steps:

[0030] Step S101: The client sends a request to the load balancing server, wherein the source IP of the requested data message is CIP and the destination IP is VIP.

[0031] Step S102, the load balancing server is configured in DR mode, and the MAC address of the backend real server is statically configured in the load balancing server. After receiving the request, the load balancing server transparently transmits the source address of the request message to the real server; wherein the transparent transmission operation at least includes cross-subnet request forwarding.

[0032] In step S103, the real server processes the received request message and sends the processed response message to the client CIP.

[0033] The method described in this embodiment is based on the DR mode, breaking through the restriction that the load balancing server and the real server must be deployed in the same subnet, and using SDN network (software defined network) technology to allow customers to deploy the real server in any subnet of the VPC, thereby enhancing deployment flexibility. Compared with using the NAT mode to achieve source address transparent transmission, the load balancing server in this application only needs to distribute the message to the real server, and the real server sends the response packet directly to the customer, without having to bypass the load balancing server, and completes high-performance forwarding while transparently transmitting the source IP. Therefore, under this application, the load balancing server is no longer a bottleneck for system performance, providing flexibility for the cloud network.

[0034] Specifically, in this embodiment, if Figure 2 As shown, in order to implement the load balancing server (SLB, the following contents are described as SLB) in DR mode to access the real server (RS, the following contents are described as RS) across subnets, this embodiment is implemented in the following steps. It should be noted that SLB and RS can be deployed in any subnet within the VPC, but cannot be deployed across VPCs. The specific steps are as follows;

[0035] 1. The client sends a request to the SLB. The source IP of the requested data packet is CIP and the destination IP is VIP.

[0036] 2. SLB is configured in DR mode, and the MAC address of the RS is statically configured in the SLB. After receiving the request, the SLB selects an RS according to the load balancing algorithm. The SLB modifies the destination MAC address of the request message to the MAC address of the selected RS and sends the message to the SDN network.

[0037] It should be noted that the destination IP of the message is VIP, but there are multiple RSs in the backend. It cannot be sent to the specified RS based on VIP, and can only be forwarded through the destination MAC.

[0038] 3. If the RS and SLB are in the same subnet, the message is forwarded at Layer 2, that is, it is sent directly to the RS based on the MAC.

[0039] 4. If the RS is in another subnet, the present invention needs to change the Layer 2 forwarding logic of the virtual switch logicalswitch in the subnet where the RS is located, and change the processing method of the unknown MAC from the usual discarding to forwarding to the virtual router logical router;

[0040] 5. When the request message arrives at the virtual router, the normal router first checks the destination MAC of the message. If it is the router MAC, it will enter the three-layer forwarding process. If not, it will be discarded.

[0041] In this embodiment, by adding a VPC_MAC table on the logical router, the correspondence between the MAC of all virtual machines in the VPC and the subnet outbound interface thereof is recorded in the table. If the solution is limited to SLB, only RS can be recorded.

[0042] When the destination MAC of the request message is not the router MAC, the VPC_MAC table on the virtual router is searched and the request message is sent to the subnet virtual switch where the RS is located.

[0043] 6. After the virtual switch in the subnet where the RS virtual machine is located receives the request message forwarded by the virtual router, it forwards it to the RS according to the destination MAC of the message;

[0044] 7. The loopback interface in RS is configured with the IP address of VIP, and this address is not published to the SDN network, that is, in the SDN network, VIP is only the address of the SLB master virtual machine. RS receives the request message, the destination MAC is its own MAC, and VIP is the local loopback interface IP. RS processes this request and directly responds to the client CIP. The message is no longer forwarded to SLB, completing high-performance SLB transparent transmission.

[0045] In this embodiment, the load balancing service system architecture includes the following sub-modules:

[0046] Client: Initiates a request to access the VIP and specified port of the SLB.

[0047] SLB: Configure it to DR mode, statically configure the MAC address of the RS in it, and transparently transmit the source address of the request message to the RS.

[0048] Logical switch: The packets with unknown MAC addresses need to be forwarded to the logical router during Layer 2 forwarding.

[0049] Logical router: Added VPC_MAC forwarding table, which records the correspondence between the MAC addresses of all virtual machines in the VPC and the outbound interfaces of their subnets. The request message can be forwarded to the logical switch of the specified subnet based on the destination MAC address of the request message.

[0050] RS: Provides real business services to clients, but does not accept direct access from clients. Traffic needs to be forwarded through the load balancing service and its listener. It can be deployed in different subnets within the same VPC as SLB.

[0051] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0052] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, an embodiment of the present application further provides a system for a load balancing server to access a real server across subnets.

[0053] like Figure 3 As shown, the system for a load balancing server to access a real server across subnets includes:

[0054] The request sending module 11 is configured to send a request from a client to a load balancing server, wherein the source IP of the requested data message is CIP and the destination IP is VIP;

[0055] The request forwarding module 12 is configured such that the load balancing server is configured in DR mode, the MAC address of the backend real server is statically configured in the load balancing server, and after the load balancing server receives the request, the source address of the request message is transparently transmitted to the real server; wherein the transparent transmission operation at least includes cross-subnet request forwarding;

[0056] The request processing module 13 is configured for the real server to process the received request message and send the processed response message to the client CIP.

[0057] For the convenience of description, the above system is described by dividing the functions into various modules. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0058] The system of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0059] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, an embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any of the above embodiments is implemented.

[0060] Figure 4 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0061] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0062] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0063] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0064] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0065] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0066] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0067] The electronic device of the above embodiment is used to implement the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0068] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method described in any of the above embodiments.

[0069] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0070] The computer instructions stored in the storage medium of the above embodiments are used to enable the computer to execute the method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0071] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0072] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0073] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0074] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A method for a load balancing server to access a real server across subnets, characterized in that: include: The client sends a request to the load balancing server, where the source IP of the requested data packet is CIP and the destination IP is VIP; The load balancing server is configured in DR mode, and the MAC address of the backend real server is statically configured in the load balancing server. After receiving the request, the load balancing server transparently transmits the source address of the request message to the real server; wherein the transparent transmission operation at least includes cross-subnet request forwarding; The real server processes the received request message and sends the processed response message to the client CIP.

2. The method according to claim 1, characterized in that: After receiving the request, the load balancing server selects a real server according to the load balancing algorithm, modifies the destination MAC address of the request message to the MAC address of the selected real server, and forwards the message through the SDN network; In response to the real server and the load balancing server being located in different subnets, changing the layer 2 forwarding logic of the logical switch of the subnet where the real server is located, and changing the processing mode of the unknown MAC from discarding to forwarding to the logical router; The request message reaches the logical router, and a VPC_MAC table is added to the logical router to record the correspondence between the MAC addresses of all virtual machines in the VPC and the outbound interfaces of their subnets in the table; After the logical switch in the subnet where the real server virtual machine is located receives the request message forwarded by the logical router, it forwards it to the real server according to the destination MAC address of the message.

3. The method according to claim 2, characterized in that: In response to the destination MAC of the request message not being the router MAC address, the VPC_MAC table on the logical router is searched again, and after finding the address, the request message is sent to the subnet logical switch where the real server is located.

4. The method according to claim 2, characterized in that: In response to the real server and the load balancing server being located in the same subnet, the request message is forwarded to the real server through the layer 2 network.

5. The method according to claim 1, characterized in that: The loopback interface in the real server is configured with the IP address of the VIP, and the address is not published to the SDN network.

6. A system for a load balancing server to access a real server across subnets, characterized in that: include: The request sending module is configured to send a request from a client to a load balancing server, wherein the source IP of the requested data message is CIP and the destination IP is VIP; The request forwarding module is configured such that the load balancing server is configured in DR mode, the MAC address of the backend real server is statically configured in the load balancing server, and after the load balancing server receives the request, the source address of the request message is transparently transmitted to the real server; wherein the transparent transmission operation at least includes cross-subnet request forwarding; The request processing module is configured to process the received request message by the real server and send the processed response message to the client CIP.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.

8. A non-transitory computer-readable storage medium, characterized in that: in, The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 5.