A multi-flow path load balancing method and device for a service provider
By combining the customization method of wildcard mask and policy routing, the data source address is divided into multiple groups of IP addresses and group rotation is performed. This solves the problem of multiple traffic paths not being fully utilized in the existing technology and achieves high efficiency. traffic forwarding and equipment economic benefits.
Patent Information
- Application Number
- CN202410968942.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-19
AI Technical Summary
In the existing traffic forwarding mechanism, when there are multiple traffic paths at the egress of service providers such as China Mobile, China Unicom, and Telecom, some manufacturers' policy routing custom forwarding policies only support redirection to one next hop, resulting in that the outbound traffic can only go through On one path, the traffic path is idle, egress bandwidth resources are wasted, and the forwarding efficiency and equipment economic benefits are low.
By combining wildcard masks and customizing policy routing, the IP addresses corresponding to the data source address are divided into multiple groups of different IP addresses. Each group of IP addresses corresponds to a main traffic path, and each group of IP addresses is grouped. Round robin is stored in the policy routing table of the switch to implement multi-path forwarding of traffic to ensure utilization of all paths and fault tolerance.
Make full use of all traffic paths, improve forwarding efficiency and economic benefits of equipment, improve network performance and response speed, ensure that normal forwarding is completed through the backup path when the main path fails, and improve the reliability of the forwarding strategy.
Smart Images

Figure CN118509376B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network distribution, and in particular relates to a multi-flow path load balancing method and device for a service provider. Background Art
[0002] A traffic path refers to the route a data packet takes from source to destination within a network. The next hop is a specific concept within the traffic path, referring to the next immediate destination address or device that a data packet will reach after traveling from the current device (such as a router). In a routing table, each route entry typically contains the destination network and the next hop address pointing to that network. Based on this information in the routing table, the router determines the next hop address for the data packet and, in turn, how to forward the data packet.
[0003] The business server forwards the received business request to different service providers according to the established mapping relationship through the router according to the access control list. The service provider usually has multiple traffic paths for receiving traffic data.
[0004] However, in the existing traffic forwarding mechanism, even when there are multiple traffic paths at the egress of service providers such as China Mobile, China Unicom, and China Telecom, some manufacturers' policy routing, that is, custom forwarding policies, only support redirection to a single next hop, resulting in outgoing traffic only being able to take one path. This leads to a large number of idle traffic paths, a waste of egress bandwidth resources, and low forwarding efficiency and equipment economic benefits. Summary of the Invention
[0005] In view of the above shortcomings of the existing technology, the purpose of the invention is to provide a multi-traffic path load balancing method and device for a service provider, which can fully utilize the service provider's traffic path for traffic forwarding, greatly improve the forwarding efficiency and equipment utilization, and improve the economic benefits of the infrastructure.
[0006] A first aspect of the present invention provides a multi-traffic path load balancing method for a service provider, which is applied to a load balancing system, wherein the load balancing system includes a service server and a service provider connected via a switch. The method includes:
[0007] S1, obtains the service provider's traffic path and the source address of the data request sent by the business server;
[0008] S2, combined with the wildcard mask, divides the IP addresses corresponding to the data source addresses evenly according to the number of variable bit values of the wildcard mask in a customized way according to policy routing, obtaining multiple groups of different IP addresses. Each group of IP addresses corresponds to a primary traffic path, where the number of variable bit values of the wildcard mask is equal to the number of traffic paths, and the number of intervals between adjacent host addresses in each group of IP addresses is the number of variable bit values.
[0009] S3, rotating each group of IP addresses, and using each group of IP addresses after rotation as a backup traffic path for each primary traffic path, wherein the IP address of the backup traffic path is different from that of the primary traffic path;
[0010] S4, storing the IP address corresponding to the data source address and the corresponding primary traffic path and backup traffic path in the policy routing table of the switch;
[0011] S5: Redirect the source address of the data request from the service server to the corresponding traffic path of the service provider according to the policy routing table.
[0012] Furthermore, service providers include telecommunication service providers, unicom service providers and mobile service providers.
[0013] Furthermore, the number of traffic paths is an even number.
[0014] Furthermore, S2 specifically includes:
[0015] S201, matching wildcard masks with the same number of variable bits according to the number of traffic paths, wherein the difference between the decimal numbers of the variable bits of each wildcard mask is 1;
[0016] S202, evenly dividing the IP address according to the wildcard mask to obtain a plurality of different primary IP addresses, wherein the interval between adjacent host addresses in the divided primary IP addresses is 1;
[0017] S203, the host address of each primary IP address is sequentially superimposed with a variable number of bits until the host address is greater than the decimal number 255, and a new IP address is obtained each time the superposition is performed. The primary IP address and the new IP address form a group of IP addresses.
[0018] Furthermore, the group rotation is a reverse group rotation, that is, each group of IP addresses is arranged in reverse order according to the host address and then redistributed to each backup traffic path.
[0019] A second aspect of the present invention provides a multi-traffic path load balancing device for a service provider, which is applied to a load balancing system. The load balancing system includes a service server and a service provider connected via a switch. The device is used to implement the multi-traffic path load balancing method for a service provider according to any one of the first aspects. The device includes:
[0020] An acquisition module, used to obtain the traffic path of the service provider and the source address of the data request sent by the business server;
[0021] An equalization module is used to combine the wildcard mask and evenly divide the IP addresses corresponding to the data source addresses according to the number of variable bit values of the wildcard mask in a customized manner according to policy routing, thereby obtaining multiple groups of different IP addresses, each group of IP addresses corresponding to a main traffic path, wherein the number of variable bit values of the wildcard mask is equal to the number of traffic paths, and the number of intervals between adjacent host addresses in each group of IP addresses is the number of variable bit values;
[0022] A rotation module is used to rotate each group of IP addresses and use each group of IP addresses after rotation as a backup traffic path for each primary traffic path, wherein the IP address of the backup traffic path is different from that of the primary traffic path;
[0023] A storage module is used to store the IP address corresponding to the data source address and the corresponding primary traffic path and backup traffic path in the policy routing table of the switch;
[0024] The redirection module is used to redirect the source address of the data request of the business server to the corresponding traffic path of the service provider according to the policy routing table.
[0025] Furthermore, service providers include telecommunication service providers, unicom service providers and mobile service providers.
[0026] Furthermore, the number of traffic paths is an even number.
[0027] Furthermore, the equal distribution module is specifically used to:
[0028] S201, matching wildcard masks with the same number of variable bits according to the number of traffic paths, wherein the difference between the decimal numbers of the variable bits of each wildcard mask is 1;
[0029] S202, evenly dividing the IP address according to the wildcard mask to obtain a plurality of different primary IP addresses, wherein the interval between adjacent host addresses in the divided primary IP addresses is 1;
[0030] S203, the host address of each primary IP address is sequentially superimposed with the number of variable bit values until the host address is greater than the decimal number 255, and a new IP address is obtained each time the superposition is performed. The primary IP address and the new IP address form a group of IP addresses.
[0031] Furthermore, the group rotation is a reverse group rotation, that is, each group of IP addresses is arranged in reverse order according to the host address and then redistributed to each backup traffic path.
[0032] A third aspect of the present invention provides a multi-traffic path load balancing system for a service provider, comprising: a memory and one or more processors.
[0033] One or more application programs are stored in the memory, and the one or more application programs are suitable for being executed by one or more processors to implement the multi-traffic path load balancing method for a service provider of the first aspect.
[0034] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which can be loaded and executed by a processor to implement the multi-traffic path load balancing method for a service provider according to the first aspect.
[0035] The beneficial effects of the present invention are as follows:
[0036] The method and device of the present invention, combined with a wildcard mask, divide the IP address corresponding to the data source address according to the variable bit number of the wildcard mask in a customized manner of policy routing to obtain multiple groups of different IP addresses, each group of IP addresses corresponds to a main traffic path, and the number of variable bits of the wildcard mask is equal to the number of traffic paths. In this way, the source address can be divided into multiple IP addresses with the same traffic path and saved to the policy routing table. When a business request occurs, the traffic will be automatically redirected and forwarded to the service provider through different IP addresses, which can make full use of all traffic paths, greatly improve forwarding efficiency, and improve the economic benefits of basic equipment. In addition, in order to avoid possible failures of a single main traffic path, each group of IP addresses is grouped and rotated, and each group of IP addresses after rotation is used as a backup traffic path for each main traffic path. Even if the main traffic path fails, normal redirection and forwarding can be completed through rotation, thereby improving the reliability of the forwarding strategy. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are only for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. Throughout the drawings, the same reference numerals represent the same components. Obviously, the drawings described below are only some of the embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings.
[0038] Figure 1 A flow chart of a multi-traffic path load balancing method for a service provider provided in an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the structure of a load balancing system provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the structure of a static three-wire machine room outlet multi-flow path provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the structure of a multi-flow path load balancing device for a service provider provided by an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of the structure of another load balancing system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the scope of protection of the present invention.
[0044] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0045] In the description of the present invention, it should be noted that, unless otherwise expressly specified and limited, the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second" and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. The terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be a communication between the internal parts of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0046] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with certain aspects of the present invention, as detailed in the appended claims.
[0047] The present invention proposes a multi-traffic path load balancing method and device for a service provider, in order to solve the problem in the existing traffic forwarding mechanism that even when there are multiple traffic paths at the outlets of service providers such as China Mobile, China Unicom, and China Telecom, some manufacturers' policy routing, i.e., customized forwarding strategies, only support redirection to one next hop, resulting in outgoing traffic only being able to take one path, a large number of traffic paths being idle, a waste of outlet bandwidth resources, and low forwarding efficiency and equipment economic benefits.
[0048] Method Example
[0049] Reference Manual Figure 1 , shows a flow chart of a multi-traffic path load balancing method for a service provider provided by an embodiment of the present invention.
[0050] Reference Manual Figure 2 , shows a structural diagram of a load balancing system provided by an embodiment of the present invention.
[0051] An embodiment of the present invention provides a multi-flow path load balancing method for a service provider, which is applied to a load balancing system. The load balancing system includes a business server and a service provider connected via a switch.
[0052] Among them, the business server forwards the traffic through the service provider's traffic path through the switch. The service provider usually has multiple traffic paths, but due to the customized method of policy routing, it can often only be forwarded through one traffic path. By modifying the policy routing method and making full use of each traffic path, the switch can complete the uniform forwarding of traffic in an orderly manner, thereby improving traffic forwarding efficiency.
[0053] Methods include:
[0054] Specifically, the method includes steps S1 to S5.
[0055] S1, obtain the service provider's traffic path and the source address of the data request sent by the business server.
[0056] The data source address indicates the source of the data packet, that is, where the data packet comes from.
[0057] In a possible implementation, the service provider includes a telecommunications service provider, a Unicom service provider, and a mobile service provider.
[0058] In a possible implementation manner, the number of flow paths is an even number.
[0059] It's important to note that traffic load balancing across an even number of paths is based on the even splitting property of binary systems and the need to simplify routing management. This not only ensures uniform traffic distribution but also helps improve network device efficiency and maximize egress utilization. In practice, ensuring even distribution of network traffic across all egresses can significantly improve network performance and responsiveness. Specifically, core switches can flexibly apply wildcard rules to evenly divide IP segments into 2 (odd-even), 4, 8, or 16 groups, thereby redirecting traffic evenly across 2, 4, 8, or 16 paths. Flexible IP+mask matching logic allows even splitting of IP segments across any even number of paths, achieving load balancing and increasing egress utilization from a maximum of 50% to 100%.
[0060] S2, combined with the wildcard mask, divides the IP address corresponding to the data source address evenly according to the number of variable bit values of the wildcard mask in a customized way of policy routing, obtaining multiple groups of different IP addresses, each group of IP addresses corresponding to a main traffic path.
[0061] The number of variable bits in the wildcard mask equals the number of traffic paths, and the number of intervals between adjacent host addresses in each IP address group equals the number of variable bits. It's important to note that this process utilizes custom policy-based routing (PBR). Unlike traditional forwarding based on IP packet destination address lookup in the routing table, PBR forwards packets according to user-defined policies. This customized policy can be defined based on characteristics such as packet source, application, protocol, and packet length. Packets are forwarded preferentially based on the configured PBR, thus providing significant networking flexibility.
[0062] A wildcard mask is a special type of mask, the opposite of a subnet mask. In the binary representation of a wildcard mask, bits marked "1" are called "variable bits," while bits marked "0" are "fixed bits" or "matching bits." The settings of these bits determine which parts of the IP address require an exact match and which parts can be ignored. In a wildcard mask, each bit set to "1" indicates that the corresponding IP address bit can have any value, meaning that a match does not need to be performed on these bits. This allows network devices to ignore these bits when processing IP addresses, allowing a wider range of addresses to be matched. Variable bits provide flexibility, allowing a single rule to apply to multiple IP addresses. A switch uses a wildcard mask in conjunction with the source or destination address to identify a matching address range. The wildcard mask tells the switch which bits in the IP address to examine to determine a match. This address mask can determine the range of IP addresses using only two 32-bit numbers: the IP address and its wildcard mask.
[0063] The host address is the last byte of the IP address. The IP address is divided into the "network address" and "host address" based on the subnet mask. The subnet mask defines the boundary between the network and host portions. The network portion identifies a specific network, while the host portion identifies a specific device within that network. For example, on a typical home or small business network (such as 192.168.1.0 / 24), the subnet mask is usually 255.255.255.0. This means that the first three digits of the IP address (192.168.1) represent the network address, while the last digit (0-255) represents the specific device on the network, or the host address.
[0064] Specifically, in network configuration, using wildcard masks to implement policy routing is a highly customized method for controlling data flow and processing network traffic. The key feature of a wildcard mask lies in its variable bits (bits marked as "1"), which represent portions of an IP address that can be ignored, allowing any possible combination of values in those bits. When combined with a wildcard mask for policy routing, the number of variable bits determines how a larger IP address range is divided into multiple subgroups. The IP address range of each subgroup is evenly distributed to different network traffic paths based on the wildcard mask settings.
[0065] Specifically, if the number of variable bit values in the wildcard mask is equal to the number of traffic paths to be configured, this means that each path will receive traffic from specific IP groups that are obtained by appropriately dividing the IP address range according to the variable bits in the wildcard mask. For example, if there are four traffic paths and the wildcard mask has two variable bits, the entire IP address range will be divided into four groups, each of which contains all possible address combinations that vary at the variable positions specified by the wildcard mask. The number of adjacent host address intervals in each group of IP addresses is determined by the number of these variable bits. This allocation ensures that each path can equally handle network traffic within the corresponding group, thereby achieving effective load balancing and improving overall network efficiency. In this way, each path can be utilized to the maximum extent, improving the efficiency of network resource use and overall network performance.
[0066] In a possible implementation, S2 specifically includes:
[0067] A wildcard mask with the same number of variable bits is matched based on the number of traffic paths, where the decimal difference between the variable bits of each wildcard mask is 1.
[0068] For example, when there are four egress paths, use the wildcard (reverse mask) 0.0.0.3 to match 3.3.3.0, .1, .2, and .3 respectively, dividing the IP addresses in the network segment 3.3.3.x / 24 into four evenly distributed groups. According to each IP address, that is, 3.3.3.x / 24, the x is a variable bit, that is, there are four paths that match four wildcard masks, namely 0.0.0.0, 0.0.0.1, 0.0.0.2, and 0.0.0.3. The interval between 0, 1, 2, and 3 in each wildcard mask is 1 in decimal.
[0069] The IP address is evenly divided according to the wildcard mask to obtain multiple different primary IP addresses, wherein the interval number between adjacent host addresses in the divided primary IP addresses is 1.
[0070] Taking the example of four paths in the computer room, four wildcard masks and IP addresses are matched to obtain four IP addresses as the main traffic paths, namely 3.3.3.0, 3.3.3.1, 3.3.3.2 and 3.3.3.3. For the convenience of description, they are named primary IP addresses. The interval between each adjacent host address, that is, the IP address, is 1, that is, the difference between the variable bits is 1.
[0071] The host address of each primary IP address is sequentially superimposed with the number of variable bit values until the host address is greater than the decimal number 255. A new IP address is obtained each time it is superimposed. The primary IP address and the new IP address form a group of IP addresses.
[0072] Specifically, taking a data center with four paths as an example, the maximum number of variable bits can reach 255 decimal. Therefore, based on the primary IP address, each primary IP address is sequentially added with 4 variable bits, up to 255, to form four groups of IP addresses. Flexible wildcard mask matching rules are designed to group traffic. Packets sent by servers (i.e., service servers) to different egress points (i.e., traffic paths) carry different source address segments. For example, for a telecommunications service provider, the core switch configures source address-based policy routing to redirect source IP addresses in the 3.3.3.x / 24 network segment to the telecommunications egress. When there are four egress paths, the wildcard (inverse mask) 0.0.0.3 is used to match 3.3.3.0, .1, .2, and .3, evenly dividing the IP addresses in the 3.3.3.x / 24 network segment into four groups. Each group of traffic is redirected to a specific path, achieving load balancing across the four paths. Utilizing the service provider's traffic paths improves bandwidth utilization, enhances hardware cost-effectiveness, and accelerates request processing.
[0073] S3: Perform group rotation on each group of IP addresses, and use each group of IP addresses after rotation as a backup traffic path for each primary traffic path.
[0074] The backup traffic path has a different IP address from the primary traffic path.
[0075] A backup traffic path, also known as a backup next hop, is a predefined alternative path or device that takes over traffic if the original traffic path, also known as the primary path, or device fails. When you configure a backup next hop for each traffic path, the system automatically switches to the backup path based on pre-defined rules (such as a rotation policy). This automatic switchover ensures uninterrupted network service even if the primary path fails.
[0076] It should be noted that the primary and backup traffic paths + IP address rotation solve the reliability problem of redirecting traffic to a fixed exit after IP address grouping. On the basis of high bandwidth utilization, the backup next hop of the policy routing is configured, that is, the IP address group is rotated and configured as the backup next hop, thereby achieving high traffic reliability.
[0077] In a possible implementation, the group rotation is a reverse group rotation, that is, each group of IP addresses is arranged in reverse order according to the host address and then redistributed to each backup traffic path.
[0078] S4: Store the IP address corresponding to the data source address and the corresponding primary traffic path and backup traffic path into the policy routing table of the switch.
[0079] S5: Redirect the source address of the data request from the service server to the corresponding traffic path of the service provider according to the policy routing table.
[0080] Reference Manual Figure 3 , shows a structural schematic diagram of a static three-wire computer room outlet multi-flow path provided by an embodiment of the present invention.
[0081] In order to describe the content of this program more clearly, Figure 3 As shown, taking telecommunications service providers as an example, Figure 3 China Telecom service provider has four traffic paths. Through the policy routing and group rotation method of this solution, during the IP address matching process, the submask is 3.3.3.x / 24, the wildcard mask is 0.0.0.3, and the service network segment provided by the server to telecom users is IP3, namely 3.3.3.x / 24. The message sent by the server to the telecom exit carries the source address IP3. The core switch redirects the source address 3.3.3.x / 24 network segment to the telecom exit by configuring source address-based policy routing. Through the access control list wildcard rule design, the traffic of the IP3 network segment is divided into four parts: 3.3.3.0, 4, 8, 12, ...; 3.3.3.1, 5,9,13,…; 3.3.3.2,6,10,14,…; 3.3.3.3,7,11,15,…; Each IP address corresponds to a primary traffic path, and traffic is evenly redirected to each next hop, that is, each traffic path, according to the assigned IP address. In order to improve the fault tolerance of the system, the group rotation method is to rearrange all IP addresses in reverse order and assign them to the original primary traffic path as the backup traffic path of the primary traffic path. When the primary traffic path fails, the backup traffic path is directly enabled for packet forwarding. Among them, the primary traffic path (also often called the primary path or preferred path) refers to the network path that network traffic normally passes through first. Figure 3 In the IP1: 1.1.1.X / 24 is the mobile service network segment; IP2: 2.2.2.X / 24 is the China Unicom service network segment; IP3: 3.3.3.X / 24 is the China Telecom service network segment. Figure 3 It can be seen intuitively that this policy routing method can greatly improve the efficiency and reliability of message forwarding, and can complete more message data forwarding under the same equipment, thereby improving the economic benefits of the equipment.
[0082] Taking four traffic paths as an example, Table 1 shows an example of IP grouping and rotation of the primary traffic path and the backup traffic path in the telecommunications service provider state.
[0083]
[0084] Table 1
[0085] As shown in Table 1, the core switch matches traffic through an ACL (access control list). This involves converting IP addresses into binary and matching them with wildcards (reverse masks) to identify the corresponding traffic. As shown in Table 1, when there are four egress paths, the wildcard (reverse mask) 0.0.0.3 is used to match XXX0, .1, .2, and .3, respectively. The IP addresses within the network segment 3.3.3.x / 24 are evenly divided into four groups, each group of traffic is redirected to a path, and rules 1 through 4 are used to load balance traffic across the four paths, effectively improving packet forwarding efficiency and reliability.
[0086] This flexible IP+mask matching logic and policy routing configuration not only improves the network's load balancing capabilities, but also significantly enhances network reliability and fault recovery capabilities. By ensuring that all traffic paths are fully utilized and that backup solutions are available in the event of any path failure, the performance and responsiveness of the entire network can be significantly improved. This is crucial for providing continuous and uninterrupted network services, especially in data centers, cloud service providers, and large enterprise network environments.
[0087] The beneficial effects of the present invention are as follows:
[0088] The method and device of the present invention, combined with a wildcard mask, divide the IP address corresponding to the data source address according to the variable bit number of the wildcard mask in a customized manner of policy routing to obtain multiple groups of different IP addresses, each group of IP addresses corresponds to a main traffic path, and the number of variable bits of the wildcard mask is equal to the number of traffic paths. In this way, the source address can be divided into multiple IP addresses with the same traffic path and saved to the policy routing table. When a business request occurs, the traffic will be automatically redirected and forwarded to the service provider through different IP addresses, which can make full use of all traffic paths, greatly improve forwarding efficiency, and improve the economic benefits of basic equipment. In addition, in order to avoid possible failures of a single main traffic path, each group of IP addresses is grouped and rotated, and each group of IP addresses after rotation is used as a backup traffic path for each main traffic path. Even if the main traffic path fails, normal redirection and forwarding can be completed through rotation, thereby improving the reliability of the forwarding strategy.
[0089] Device embodiment
[0090] Reference Manual Figure 4 , shows a structural diagram of a multi-flow path load balancing device of a service provider provided by an embodiment of the present invention.
[0091] Another specific embodiment of the present invention discloses a multi-traffic path load balancing device for a service provider, which is applied to a load balancing system. The load balancing system includes a service server and a service provider connected via a switch. The multi-traffic path load balancing method for a service provider according to any one of the method embodiments is implemented. The multi-traffic path load balancing device 20 for a service provider includes:
[0092] An acquisition module 201 is configured to acquire a traffic path of a service provider and a source address of a data request sent by a service server;
[0093] An equalization module 202 is configured to equally divide the IP addresses corresponding to the data source addresses according to the number of variable bits in the wildcard mask in accordance with a custom policy routing method, in combination with the wildcard mask, to obtain multiple groups of different IP addresses, each group of IP addresses corresponding to a primary traffic path, wherein the number of variable bits in the wildcard mask is equal to the number of traffic paths, and the number of intervals between adjacent host addresses in each group of IP addresses is the number of variable bit values;
[0094] A rotation module 203 is configured to rotate each group of IP addresses and use each group of IP addresses after rotation as a backup traffic path for each primary traffic path, wherein the backup traffic path has a different IP address from the primary traffic path;
[0095] The storage module 204 is configured to store the IP address corresponding to the data source address and the corresponding primary traffic path and backup traffic path in the policy routing table of the switch;
[0096] The redirection module 205 is configured to redirect the source address of the data request from the service server to the corresponding traffic path of the service provider according to the policy routing table.
[0097] In a possible implementation, the service provider includes a telecommunications service provider, a Unicom service provider, and a mobile service provider.
[0098] In a possible implementation manner, the number of flow paths is an even number.
[0099] In a possible implementation, the equal distribution module is specifically configured to:
[0100] Matches a wildcard mask with the same number of variable bits as the number of traffic paths, where the decimal difference between the variable bits of each wildcard mask is 1;
[0101] The IP address is evenly divided according to the wildcard mask to obtain multiple different primary IP addresses, wherein the interval between adjacent host addresses in the divided primary IP addresses is 1;
[0102] The host address of each primary IP address is sequentially superimposed with a variable number of bits until the host address is greater than the decimal number 255. A new IP address is obtained each time it is superimposed. The primary IP address and the new IP address form a group of IP addresses.
[0103] In a possible implementation, the group rotation is a reverse group rotation, that is, each group of IP addresses is arranged in reverse order according to the host address and then redistributed to each backup traffic path.
[0104] The device provided in the embodiment of the present invention can implement each process and step in the above method embodiment, and can obtain the same or similar technical effects. To avoid repetition, the present invention will not go into details.
[0105] The beneficial effects of the present invention are as follows:
[0106] The method and device of the present invention, combined with a wildcard mask, divide the IP address corresponding to the data source address according to the variable bit number of the wildcard mask in a customized manner of policy routing to obtain multiple groups of different IP addresses, each group of IP addresses corresponds to a main traffic path, and the number of variable bits of the wildcard mask is equal to the number of traffic paths. In this way, the source address can be divided into multiple IP addresses with the same traffic path and saved to the policy routing table. When a business request occurs, the traffic will be automatically redirected and forwarded to the service provider through different IP addresses, which can make full use of all traffic paths, greatly improve forwarding efficiency, and improve the economic benefits of basic equipment. In addition, in order to avoid possible failures of a single main traffic path, each group of IP addresses is grouped and rotated, and each group of IP addresses after rotation is used as a backup traffic path for each main traffic path. Even if the main traffic path fails, normal redirection and forwarding can be completed through rotation, thereby improving the reliability of the forwarding strategy.
[0107] System Example
[0108] Reference Manual Figure 5 , shows a structural diagram of a multi-flow path load balancing system of a service provider provided by an embodiment of the present invention.
[0109] The present invention proposes a multi-traffic path load balancing system 30 for a service provider, comprising: a memory 303 and one or more processors 301 .
[0110] One or more application programs are stored in the memory 303 , and the one or more application programs are suitable for being executed by the one or more processors 301 to implement the multi-traffic path load balancing method for a service provider in the method embodiment.
[0111] The multi-traffic path load balancing system 30 of a service provider includes a processor 301 and a memory 303 . The processor 301 and the memory 303 are connected, for example, via a bus 302 .
[0112] The structure of the multi-traffic path load balancing system 30 of the service provider does not constitute a limitation to the embodiment of the present invention.
[0113] Processor 301 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. Processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0114] Bus 302 may include a path for transmitting information between the aforementioned components. Bus 302 may be a PCI bus or an EISA bus, for example. Bus 302 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figure shows only one thick line, but this does not indicate that there is only one bus or only one type of bus.
[0115] The memory 303 can be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0116] Computer readable storage medium embodiments
[0117] The present invention provides a computer-readable storage medium having a computer program stored thereon. The computer program can be loaded and executed by a processor according to the multi-traffic path load balancing method for a service provider described in the first aspect.
[0118] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation plans of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, and is not a limitation on the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0119] Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and such modifications or replacements do not deviate from the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be covered by the scope of protection of the present invention.
Claims
1. A multi-flow path load balancing method for a service provider, characterized in that: Applied to a load balancing system, wherein the load balancing system includes a business server and a service provider connected via a switch, the method includes: S1, obtaining the traffic path of the service provider and the source address of the data request sent by the business server; S2, in combination with the wildcard mask, divide the IP address corresponding to the data source address equally according to the number of variable bit values of the wildcard mask in a custom manner of policy routing, to obtain multiple groups of different IP addresses, each group of IP addresses corresponds to a main traffic path, wherein the number of variable bit values of the wildcard mask is equal to the number of traffic paths, and the number of intervals between adjacent host addresses in each group of IP addresses is the number of variable bit values; S3, rotating each group of IP addresses, and using each group of IP addresses after the rotation as a backup traffic path of each main traffic path, wherein the backup traffic path has a different IP address from the main traffic path; S4, storing the IP address corresponding to the data source address and the corresponding primary traffic path and backup traffic path in the policy routing table of the switch; S5, redirecting the source address of the data request of the business server to the corresponding traffic path of the service provider according to the policy routing table.
2. A multi-flow path load balancing method for a service provider according to claim 1, characterized in that: The service providers include telecommunication service providers, unicom service providers and mobile service providers.
3. A multi-flow path load balancing method for a service provider according to claim 1, characterized in that: The number of the flow paths is an even number.
4. A multi-flow path load balancing method for a service provider according to claim 1, characterized in that: The S2 specifically includes: Matching a wildcard mask with the same number of variable bits according to the number of the traffic paths, wherein the difference between the decimal numbers of the variable bits of each wildcard mask is 1; According to the wildcard mask, the IP address is evenly divided to obtain a plurality of different primary IP addresses, wherein the interval number of adjacent host addresses in the primary IP addresses after the division is 1; The host address of each primary IP address is sequentially superimposed with the number of variable bit values until the host address is greater than the decimal number 255, and a new IP address is obtained each time the superposition is performed. The primary IP address and the new IP address form a group of IP addresses.
5. The multi-flow path load balancing method of a service provider according to claim 1, characterized in that: The group rotation is a reverse group rotation, that is, each group of IP addresses is arranged in reverse order according to the host address and then redistributed to each backup traffic path.
6. A multi-flow path load balancing device for a service provider, characterized in that: Applied to a load balancing system, wherein the load balancing system includes a business server and a service provider connected by a switch, and is used to implement a multi-flow path load balancing method for a service provider according to any one of claims 1 to 5, the device comprising: An acquisition module, used to acquire the traffic path of the service provider and the source address of the data request received by the business server; An equalization module, for equally dividing the IP address corresponding to the data source address according to the number of variable bit values of the wildcard mask in a custom manner of policy routing in combination with a wildcard mask, to obtain multiple groups of different IP addresses, each group of IP addresses corresponding to a main traffic path, wherein the number of variable bit values of the wildcard mask is equal to the number of traffic paths, and the number of intervals between adjacent host addresses in each group of IP addresses is the number of variable bit values; A rotation module, used to perform group rotation on each group of IP addresses, and use each group of IP addresses after rotation as a backup traffic path for each main traffic path, wherein the backup traffic path has a different IP address from the main traffic path; A storage module, used to store the IP address corresponding to the data source address and the corresponding primary traffic path and backup traffic path into the policy routing table of the switch; A redirection module is used to redirect the source address of the data request of the business server to the corresponding traffic path of the service provider according to the policy routing table.
7. A multi-flow path load balancing device for a service provider according to claim 6, characterized in that: The service providers include telecommunication service providers, unicom service providers and mobile service providers.
8. The multi-flow path load balancing device of a service provider according to claim 6, characterized in that: The number of the flow paths is an even number.
9. The multi-flow path load balancing device of a service provider according to claim 6, characterized in that: The equal distribution module is specifically used for: Matching a wildcard mask with the same number of variable bits according to the number of the traffic paths, wherein the difference between the decimal numbers of the variable bits of each wildcard mask is 1; According to the wildcard mask, the IP address is evenly divided to obtain a plurality of different primary IP addresses, wherein the interval number of adjacent host addresses in the primary IP addresses after the division is 1; The variable bit quantity is sequentially added to the host address of each primary IP address until the host address is greater than the decimal number 255, and a new IP address is obtained each time the addition is performed. The primary IP address and the new IP address form a group of IP addresses.
10. The multi-flow path load balancing device of a service provider according to claim 6, characterized in that: The group rotation is a reverse group rotation, that is, each group of IP addresses is arranged in reverse order according to the host address and then redistributed to each backup traffic path.
