WO2020207148A1 - 一种负载均衡方法和装置 - Google Patents

一种负载均衡方法和装置 Download PDF

Info

Publication number
WO2020207148A1
WO2020207148A1 PCT/CN2020/077464 CN2020077464W WO2020207148A1 WO 2020207148 A1 WO2020207148 A1 WO 2020207148A1 CN 2020077464 W CN2020077464 W CN 2020077464W WO 2020207148 A1 WO2020207148 A1 WO 2020207148A1
Authority
WO
WIPO (PCT)
Prior art keywords
transponder
load
transponders
target
repeater
Prior art date
Application number
PCT/CN2020/077464
Other languages
English (en)
French (fr)
Inventor
黄琳
葛丽
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020207148A1 publication Critical patent/WO2020207148A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1021Server selection for load balancing based on client or server locations

Definitions

  • the embodiments of the present invention relate to, but are not limited to, the field of communications, and particularly refer to a load balancing method and device.
  • controllers and repeaters are deployed in a distributed manner.
  • the controller centrally controls multiple repeaters, and the repeaters are responsible for service processing and message forwarding.
  • the repeater and the controller are deployed separately, and the controller centrally manages the repeater, which is flexible to use and easy to maintain.
  • the load balancing strategy is generally a split method, while considering physical resources to avoid local optima.
  • VNF Virtual Network Feature
  • the physical resources and business resources of each VNF may be inconsistent. If the total value of resources is considered separately when load balancing is performed, without considering the use of effective resources, processing performance will be reduced.
  • the embodiment of the present invention provides a load balancing method and device, which can improve processing efficiency.
  • the embodiment of the present invention provides a load balancing method, including:
  • the embodiment of the present invention provides a load balancing device, including:
  • a determining module configured to determine the first target repeater according to the load situation of the first repeater, the load situation of other repeaters, and the physical position relationship between the first repeater and other repeaters;
  • the processing module is configured to generate shunt table information of the first target transponder, and deliver the shunt table information to all transponders.
  • An embodiment of the present invention provides a load balancing device, which includes a processor and a computer-readable storage medium.
  • the computer-readable storage medium stores instructions. When the instructions are executed by the processor, any one of the foregoing is implemented.
  • a method of load balancing is implemented.
  • the embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the foregoing load balancing methods are implemented.
  • Figure 1 is a schematic diagram of an NFV network structure according to an embodiment of the present invention.
  • Figure 2 is a flowchart of a load balancing method proposed by an embodiment of the present invention
  • FIG. 3 is a flowchart of a load balancing method proposed by another embodiment of the present invention.
  • Example 4 is a flowchart of the load balancing method proposed in Example 1 of the embodiment of the present invention.
  • Example 5 is a flowchart of the load balancing method proposed in Example 2 of the embodiment of the present invention.
  • FIG. 6 is a schematic diagram of the structural composition of a load balancing device according to another embodiment of the present invention.
  • FIG. 7 is a schematic diagram of the structural composition of a load balancing device according to another embodiment of the present invention.
  • the VNF controller ie C in Figure 1
  • the VNF repeater ie, Figure 1 F
  • the forwarder not only has the three-layer forwarding capability, but also has the service processing capability of a service processor (for example, a network address translation (NAT, Network Address Translation) service processor).
  • a service processor for example, a network address translation (NAT, Network Address Translation) service processor.
  • the controller needs to maintain the basic performance parameter table of the repeater and the repeater resource usage table of each repeater, and initialize the information in each table.
  • the repeater needs to maintain the distribution table and the VNF resource usage table.
  • the basic performance parameter table of the repeater includes but is not limited to the following parameters: device number, device Internet Protocol (IP, Internet Protocol) address, physical location identifier, and basic performance parameters of the virtual machine where the repeater is located.
  • the device number is the number of the virtual machine where the repeater is located
  • the basic performance parameters of the virtual machine where the repeater is located include at least one of the following: the number of central processing units (CPU, Center Process Unit), available memory, and effective forwarding capability (ie port Available bandwidth), CPU utilization.
  • the transponder resource usage table includes but is not limited to the following parameters: component number (the same as the device number, which is the number of the virtual machine where the transponder is located), the total capacity of the business that the transponder can carry, the business utilization rate, and the current business occupation
  • component number the same as the device number, which is the number of the virtual machine where the transponder is located
  • the total capacity of the business that the transponder can carry the business utilization rate
  • the current business occupation The resources of the virtual machine.
  • the resources of the virtual machine occupied by the current business include: memory and CPU.
  • the shunt table includes but is not limited to the following parameters: unique key value, component number, aging time, etc., and other business-related information (such as address pool utilization, session capacity, etc.).
  • the unique key value can be any information used to identify the data packet, for example, triples (protocol, source IP address, source port number) or quintuples (ie protocol, source IP address, source port number, destination IP Address, destination port number), etc.
  • the aging time is used to refresh the shunt table entries, so as to avoid the use of invalid shunt tables.
  • the shunt table can be aged, deleted, and updated according to business requirements.
  • the VNF resource usage table includes but is not limited to the following parameters: remaining business resources, resource utilization, resource utilization threshold, CPU usage, total CPU, CPU utilization, CPU utilization threshold, and services that need to be processed on a single CPU Amount, total memory, memory usage threshold, used memory value, remaining memory value, acceptable forwarding rate, number of forwarded packets per unit time, throughput (i.e. forwarding performance), throughput threshold, average resource Usage rate, resource usage error rate.
  • transponders are connected to the controller and registered successfully, and their respective parameters are reported (the parameters reported here include the parameters in the transponder basic performance parameter table and the transponder resource usage table above), and the controller initializes the basic performance parameters of the transponder Table and repeater resource usage table, the unique identifier of the repeater in the controller.
  • the controller monitors each transponder in real time. If the transponder is disconnected, the transponder is deleted from the transponder basic performance parameter table and the transponder resource usage table, and the registration information is cancelled.
  • the repeater regularly reports data to the controller, and the reported data includes the parameters in the repeater basic performance parameter table and the repeater resource usage table.
  • the controller regularly maintains the valid information of the repeater, and the valid information includes the parameters in the basic performance parameter table and the resource usage table of the repeater.
  • an embodiment of the present invention provides a load balancing method, including:
  • Step 200 Determine the first target repeater according to the load situation of the first repeater, the load situation of other repeaters, and the physical position relationship between the first repeater and the other repeaters.
  • the first target repeater may be determined when the instruction reported by the first repeater is received.
  • the reported instruction includes information related to the received traffic, or may not include any information, and is merely used as an instruction to notify that there is traffic that needs to be processed.
  • the first target repeater determined according to the load condition of the first repeater, the load condition of other repeaters, and the physical position relationship between the first repeater and the other repeaters includes at least one of the following:
  • the load condition of the first transponder does not meet the preset condition, and there is a second transponder whose load condition satisfies the preset condition among the other transponders, and the second transponder is in agreement with all
  • the first transponders are in different physical location ranges, one of the second transponders is selected as the first target transponder.
  • the embodiment of the present invention preferentially selects a transponder in the same physical location range as the first transponder as the first target transponder based on the principle of physical location proximity, fully considers the physical location between the transponders, and improves processing efficiency.
  • the physical location range can be set according to actual needs. It can be a larger range, such as a region, or a small range, such as an office building or a small area.
  • the implementation of the present invention The example does not limit the size of the physical location range.
  • the preset conditions include: the remaining memory is greater than the first threshold, the CPU utilization rate is less than the second threshold, the effective forwarding capability is greater than the third threshold, and the currently carried service capacity is less than the fourth threshold.
  • the embodiment of the present invention considers resource usage when performing load balancing, thereby improving processing performance.
  • the remaining memory can be the difference between the available memory in the basic performance parameter table of the repeater and the memory of the virtual machine occupied by the current service in the resource usage table of the repeater.
  • the CPU utilization and effective forwarding capacity can be determined from the basic performance parameters of the repeater. Obtained from the table, the current capacity of the service carried can be obtained according to the total capacity and service utilization of the transponder in the transponder resource usage table, such as the total capacity and service utilization of the transponder product.
  • selecting one of the third repeaters as the first target repeater includes:
  • one of the transponders is selected from the third transponders as the first target transponder.
  • the service capacity refers to the service volume currently carried by the third transponder.
  • multiple methods can be used to select one of the third transponders as the first target transponder according to the service capacity, effective forwarding capability, and CPU processing capability.
  • the following method can be used to achieve The following method is only an example, and the embodiment of the present invention does not exclude other implementation methods.
  • M free Mi sum ⁇ (M t -Mi malloc )
  • B i is the service remaining resource amount of the i-th transponder
  • Bi sum is the service amount currently carried on the i-th transponder
  • Bi ratio is the resource utilization rate of the i-th transponder
  • B t is the percentage value
  • setting resource utilization thresholds C i is the i th number of CPU used repeaters
  • Ci sum total number of the i-th transponders of the CPU Ci ratio for the i-th transponders of CPU utilization
  • C t is the percentage Value
  • the set CPU usage threshold PB i is the business volume that a single CPU can handle on the i-th transponder
  • Mi sum is the total memory of the i-th transponder
  • M t is the percentage value
  • Mi malloc is the memory value used by the i-th transponder
  • M free is the remaining memory value of the i-th transponder
  • Pi sum is the number of packets forwarded by the i-th transponder in unit time t
  • selecting one of the second repeaters as the first target repeater includes:
  • the method of selecting one of the repeaters as the first target repeater from the second repeaters is similar to the implementation of the method of selecting one of the repeaters as the first target repeater from the third repeaters, and will not be repeated here.
  • Step 202 Generate shunt table information of the first target transponder, and deliver the shunt table information to all transponders.
  • the shunt table information is a shunt table entry.
  • the embodiment of the present invention selects the first target transponder based on the physical location relationship, fully considers the physical location between the transponders, and improves the processing efficiency.
  • the method further includes:
  • Calculate the load value and load average of all forwarders determine the queue to be adjusted and the queue of the offloaded forwarder according to the load value and load average of all forwarders; wherein the queue to be adjusted includes all forwarders that need load balancing adjustment,
  • the queue of forwarders to be offloaded includes all forwarders that do not need to be adjusted for load balancing;
  • the second target transponder corresponding to the fourth transponder is determined; wherein, the second target transponder is one of the transponder queues to be offloaded Or multiple transponders;
  • the distribution table information is delivered to all transponders.
  • calculating the load value of the repeater includes:
  • the load value of the repeater is calculated according to the total service capacity, the number of CPUs, and the average forwarding rate.
  • multiple methods may be used to calculate the load value of the transponder according to the total service capacity, the number of CPUs, and the average forwarding rate, which is not limited in the embodiment of the present invention.
  • determining the second target repeater corresponding to the fourth repeater includes at least one of the following:
  • One or more transponders are selected as the second target transponders from the queue of the transponder to be offloaded in descending order of acceptable service volume.
  • transponders in the queue of the transponder to be split are not in the same physical location range as the fourth transponder, select one or more transponders from the queue of the transponder to be split in descending order of acceptable traffic As the second target repeater.
  • determining that the forwarder needs to perform load balancing adjustment according to the load value and the load average value of the forwarder includes any one of the following:
  • the difference between the load value of the transponder and the load average value is greater than or equal to a preset deviation value
  • the ratio of the difference between the load value of the transponder and the load average value to the load average value is greater than or equal to a preset ratio.
  • determining that the forwarder does not need to perform load balancing adjustment according to the load value and the load average value of the forwarder includes any one of the following:
  • the difference between the load value of the transponder and the load average value is less than a preset deviation value
  • the ratio of the difference between the load value of the transponder and the load average value to the load average value is less than a preset ratio.
  • the embodiment of the present invention performs load balancing adjustment based on the load balancing effect of the overall network, so that the overall network load balancing is optimal.
  • another embodiment of the present invention provides a load balancing method, including:
  • Step 300 When the flow is received, when the flow distribution table is not found according to the flow, the instruction is reported to the controller.
  • the reported instruction includes information related to the received traffic, or may not include any information, and is merely used as an instruction to notify that there is traffic that needs to be processed.
  • Step 301 Receive the distribution table information of the first target repeater, and update the distribution table according to the distribution table information.
  • the shunt table information is a shunt table entry.
  • the method when searching for a distribution table hit according to the traffic, the method further includes: processing the traffic according to the hit distribution table entry.
  • the processing of traffic includes at least one of the following: forwarding and business processing.
  • searching the distribution table according to the flow includes: according to the distribution granularity according to the flow (the distribution granularity refers to the element of the key value, if the key value is a triplet, then the distribution granularity includes the protocol, source IP address, and source port In other cases, it can be deduced by analogy) Generate a key value and use the key value to find the distribution table, that is, match the generated key value with the unique key value in the distribution table. If it matches, it will hit; if it fails, it will miss. .
  • this example proposes a load balancing method, including:
  • Step 400 The first forwarder receives the traffic, generates a key value according to the split granularity according to the traffic, and uses the generated key value to look up the split table.
  • the traffic is processed according to the hit split entry; when it is missed, Proceed to step 401.
  • the distribution granularity refers to the elements of the key value. If the key value is a triplet, then the distribution granularity includes the protocol, source IP address, source port number, and so on.
  • the generated key value is matched with the unique key value in the distribution table. If it matches, it will hit; if it fails, it will miss.
  • the processing of traffic includes at least one of the following: forwarding and business processing.
  • Step 401 The first transponder reports an instruction to the controller.
  • Step 402 The controller determines whether the first transponder meets the preset condition, and when the first transponder meets the preset condition, executes step 403; when the first transponder does not meet the preset condition, executes step 404.
  • the preset conditions include: the remaining memory is greater than the first threshold, the CPU utilization rate is less than the second threshold, the effective forwarding capability is greater than the third threshold, and the current carried service volume is less than the fourth threshold.
  • resource usage is considered when load balancing, thereby improving processing performance.
  • Step 403 The controller selects the first transponder as the first target transponder, and continues to perform step 408.
  • Step 404 The controller determines whether there is a second transponder that meets the preset condition, and when there is a second transponder that meets the preset condition, continue to perform step 405; when there is no second transponder that meets the preset condition, End this process.
  • Step 405 The controller determines whether there is at least one third transponder in the same physical location range as the first transponder in the second transponder, and when at least one of the second transponders exists in the same physical location range as the first transponder When the second repeater is in a different physical location range from the first repeater, step 406 is executed.
  • Step 406 The controller selects one of the third repeaters as the first target repeater, and continues to perform step 408.
  • the controller selects one of the third transponders as the first target transponder according to service capacity, effective forwarding capability, and CPU processing capability.
  • Step 407 The controller selects one of the second repeaters as the first target repeater, and continues to perform step 408.
  • the controller selects one of the second transponders as the first target transponder according to service capacity, effective forwarding capability, and CPU processing capability.
  • Step 408 The controller generates shunt table information of the first target repeater, and delivers the shunt table information to all repeaters.
  • Step 409 The forwarder updates the forwarding table according to the distribution table information.
  • this example proposes a load balancing method, including:
  • Step 500 The controller calculates the load value and load average value of all transponders.
  • the controller calculates the load value of the repeater according to the total service capacity, the number of CPUs, and the average forwarding rate.
  • Step 501 The controller determines whether the difference between the load value and the load average value of each transponder is greater than or equal to the preset deviation. When the difference between the load value and the load average value of the transponder is greater than or equal to the preset deviation, it is determined that the transponder needs to perform For load balancing adjustment, proceed to step 502; when the difference between the load value and the load average value of all forwarders is less than the preset deviation, it is determined that all forwarders do not need to perform load balancing adjustment, and the process ends.
  • Step 502 The controller puts forwarders that need load balancing adjustment into the queue to be adjusted, and puts forwarders that do not need load balancing adjustment into the queue of offloaded forwarders.
  • Step 503 For each transponder in the queue to be adjusted that needs load balancing adjustment, the controller determines whether there is a transponder in the queue to be offloaded that is in the same physical location range as the transponder that needs load balancing adjustment, if If it exists, continue to execute step 504; if it does not exist, continue to execute 506.
  • Step 504 The controller selects, from the queue of forwarders to be offloaded, one or more forwarders in the same physical location range as the forwarders that need load balancing adjustment as the second target forwarders.
  • Step 505 The controller judges whether the sum of the acceptable traffic of one or more transponders in the same physical location range as the transponder that needs load balancing adjustment is greater than or equal to the forwarding that needs load balancing adjustment. If it is, then continue to step 507; if not, in addition to the second target repeater selected in step 504, load balancing is performed from the queue of the to-be-offloaded repeater with the demand.
  • the adjusted transponders are not in the transponders within the same physical location range, and one or more transponders are selected as the second target transponders in descending order of acceptable service volume.
  • Step 506 The controller selects one or more transponders as the second target transponder from the queue of the transponder to be offloaded in descending order of acceptable service volume.
  • Step 507 The controller backs up the traffic that needs to be adjusted among the forwarders that need load balancing adjustment to the second target forwarder, and switches the traffic that needs to be adjusted among the forwarders that need load balancing adjustment to all Said second target forwarder, updates the branch table entry corresponding to the traffic to be adjusted in the branch table on the forwarder, deletes the branch table information of the forwarder that needs load balancing adjustment, and generates the branch of the second target forwarder Table information, distribute the shunt table information to all transponders.
  • FIG. 6 another embodiment of the present invention provides a load balancing device (such as a controller), including:
  • the determining module 602 is configured to determine the first target repeater according to the load situation of the first repeater, the load situation of other repeaters, and the physical position relationship between the first repeater and other repeaters;
  • the processing module 603 is configured to generate shunt table information of the first target transponder, and deliver the shunt table information to all transponders.
  • it further includes: a first communication module 601, configured to receive an instruction reported by the first repeater.
  • the reported instruction includes information related to the received traffic, or may not include any information, and is merely used as an instruction to notify that there is traffic that needs to be processed.
  • the shunt table information is a shunt table entry.
  • the determining module 602 is specifically configured to perform at least one of the following:
  • the load condition of the first transponder does not meet the preset condition, and there is a second transponder whose load condition satisfies the preset condition among the other transponders, and the second transponder is in agreement with all
  • the first transponders are in different physical location ranges, one of the second transponders is selected as the first target transponder.
  • the embodiment of the present invention preferentially selects a transponder in the same physical location range as the first transponder as the first target transponder based on the principle of physical location proximity, fully considers the physical location between the transponders, and improves processing efficiency.
  • the physical location range can be set according to actual needs. It can be a larger range, such as a region, or a small range, such as an office building or a small area.
  • the implementation of the present invention The example does not limit the size of the physical location range.
  • the preset conditions include: the remaining memory is greater than the first threshold, the CPU utilization rate is less than the second threshold, the effective forwarding capability is greater than the third threshold, and the currently carried service capacity is less than the fourth threshold.
  • the embodiment of the present invention considers resource usage when performing load balancing, thereby improving processing performance.
  • the remaining memory can be the difference between the available memory in the basic performance parameter table of the repeater and the memory of the virtual machine occupied by the current service in the resource usage table of the repeater.
  • the CPU utilization and effective forwarding capacity can be determined from the basic performance parameters of the repeater. Obtained from the table, the current capacity of the service carried can be obtained according to the total capacity and service utilization of the transponder in the transponder resource usage table, such as the total capacity and service utilization of the transponder product.
  • the processing module 602 is specifically configured to select one of the third repeaters as the first target repeater in the following manner:
  • one of the transponders is selected from the third transponders as the first target transponder.
  • the service capacity refers to the service volume currently carried by the third transponder.
  • the processing module 602 is specifically configured to select one of the second repeaters as the first target repeater in the following manner:
  • the embodiment of the present invention selects the first target transponder based on the physical location relationship, fully considers the physical location between the transponders, and improves the processing efficiency.
  • processing module 602 is further configured to:
  • Calculate the load value and load average of all forwarders determine the queue to be adjusted and the queue of the offloaded forwarder according to the load value and load average of all forwarders; wherein the queue to be adjusted includes all forwarders that need load balancing adjustment,
  • the queue of forwarders to be offloaded includes all forwarders that do not need to be adjusted for load balancing;
  • the second target transponder corresponding to the fourth transponder is determined; wherein, the second target transponder is one of the transponder queues to be offloaded Or multiple transponders;
  • the distribution table information is delivered to all transponders.
  • the processing module 602 is specifically configured to calculate the load value of the transponder in the following manner:
  • the load value of the repeater is calculated according to the total service capacity, the number of CPUs, and the average forwarding rate.
  • the processing module 602 is specifically configured to use at least one of the following methods to determine the second target repeater corresponding to the fourth repeater:
  • One or more transponders are selected as the second target transponders from the queue of the transponder to be offloaded in descending order of acceptable service volume.
  • transponders in the queue of the transponder to be split are not in the same physical location range as the fourth transponder, select one or more transponders from the queue of the transponder to be split in descending order of acceptable traffic As the second target repeater.
  • the processing module 602 is specifically configured to use any one of the following methods to determine that the forwarder needs to perform load balancing adjustment according to the load value and the load average value of the forwarder:
  • the difference between the load value of the transponder and the load average value is greater than or equal to a preset deviation value
  • the ratio of the difference between the load value of the transponder and the load average value to the load average value is greater than or equal to a preset ratio.
  • the processing module 602 is specifically configured to use any of the following methods to determine that the forwarder does not need to perform load balancing adjustment according to the load value and the load average value of the forwarder:
  • the difference between the load value of the transponder and the load average value is less than a preset deviation value
  • the ratio of the difference between the load value of the transponder and the load average value to the load average value is less than a preset ratio.
  • the embodiment of the present invention performs load balancing adjustment based on the load balancing effect of the overall network, so that the overall network load balancing is optimal.
  • a load balancing device such as a repeater
  • a load balancing device including:
  • the second communication module 701 is configured to receive the traffic, and report an instruction to the controller when searching for the shunt table according to the flow is missed; receive the shunt table information of the first target repeater;
  • the update module 702 is used to update the distribution table according to the distribution table information.
  • the reported instruction includes information related to the received traffic, or may not include any information, and is merely used as an instruction to notify that there is traffic that needs to be processed.
  • the shunt table information is a shunt table entry.
  • the second communication module 701 is further configured to: when searching the distribution table according to the traffic for a hit, process the traffic according to the hit distribution table entry.
  • the processing of traffic includes at least one of the following: forwarding and business processing.
  • the second communication module 701 is specifically configured to search the shunt table according to the flow in the following way: according to the flow according to the shunt granularity (the shunt granularity refers to the element of the key value, if the key value is a triple, then The distribution granularity includes protocol, source IP address, source port number, and so on in other cases) Generate a key value, use the key value to find the distribution table, that is, match the generated key value with the unique key value in the distribution table. If it matches, it hits; if it doesn't match, it misses.
  • the shunt granularity refers to the element of the key value, if the key value is a triple, then The distribution granularity includes protocol, source IP address, source port number, and so on in other cases
  • Another embodiment of the present invention provides a load balancing device, including a processor and a computer-readable storage medium.
  • the computer-readable storage medium stores instructions. When the instructions are executed by the processor, the foregoing Any load balancing method.
  • Another embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the foregoing load balancing methods are implemented.
  • An embodiment of the present invention includes: determining the first target repeater according to the load situation of the first repeater, the load situation of other repeaters, and the physical position relationship between the first repeater and the other repeaters; generating the first target
  • the shunt table information of the forwarders is delivered to all the forwarders.
  • the embodiment of the present invention selects the first target transponder based on the physical location relationship, fully considers the physical location between the transponders, and improves the processing efficiency.
  • the preset conditions include: the remaining memory is greater than the first threshold, the CPU utilization rate is less than the second threshold, the effective forwarding capability is greater than the third threshold, and the currently carried service capacity is less than the fourth threshold.
  • the method further includes: calculating the load value and load average value of all transponders; determining the queue to be adjusted and the transponder queue to be offloaded according to the load value and load average value of all the transponders;
  • the queue includes all forwarders that need to be adjusted for load balancing, and the queue of forwarders to be offloaded includes all forwarders that do not need to be adjusted for load balancing; for each fourth forwarder in the queue to be adjusted, determine the first The second target transponder corresponding to the four transponders; wherein, the second target transponder is one or more transponders in the queue of the transponder to be offloaded; and the traffic volume that needs to be adjusted in the fourth transponder Back up and switch to the second target transponder, delete the shunt table information of the fourth transponder, generate shunt table information of the second target transponder, and deliver the shunt table information to all transponders .
  • the embodiment of the present invention performs load balancing adjustment based on the load balancing effect of the
  • Such software may be distributed on a computer-readable medium
  • the computer-readable medium may include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium).
  • the term computer storage medium includes volatile and non-volatile memory implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data).
  • Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, tape, magnetic disk storage or other magnetic storage device, or Any other medium used to store desired information and that can be accessed by a computer.
  • communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种负载均衡方法和装置,包括:根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器;生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。

Description

一种负载均衡方法和装置
相关申请的交叉引用
本申请基于申请号为201910280669.3、申请日为2019年4月9日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本发明实施例涉及但不限于通讯领域,尤指一种负载均衡方法和装置。
背景技术
在网络功能虚拟化(NFV,Network Function Virtualization)网络架构中,控制器和转发器分布式部署,控制器集中控制多个转发器,转发器负责业务处理和报文转发。
目前基于NFV网络结构的负载均衡方法有如下优点:
1.转发器和控制器分别部署,控制器集中管理转发器,灵活使用,并易于维护。
2.通过负载均衡达到分布式处理效果,提高网络数据处理效率。
3.通过负载均衡方式提高资源利用率。
4.对物理链路上的负载均衡,使物理网络上的负载均衡,避免局部链路负荷大。
5.负载均衡策略一般是均分方法,同时考虑物理资源避免局部最优。
然而,目前基于NFV网络结构的负载均衡方法也具有如下缺点:
1.进行负载均衡时仅考虑虚拟资源而不关注物理资源的状态,例如两个虚拟网络功能(VNF,Virtual Network Feature)之间的物理位置可能导致局部链路上负荷大,甚至出现丢包或延时的情况,从而降低了处理效率。
2.每个VNF的物理资源、业务资源可能不一致,在进行负载均衡时如果单独考虑资源总值,而不考虑有效资源的使用情况,则会降低处理性能。
3.仅仅依靠单个转发器的负载评价进行分流,而没有考虑分流后整体网络的负载均衡效果,长期看也只是局部最优。
发明内容
本发明实施例提供了一种负载均衡方法和装置,能够提高处理效率。
本发明实施例提供了一种负载均衡方法,包括:
根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间 的物理位置关系确定第一目标转发器;
生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
本发明实施例提供了一种负载均衡装置,包括:
确定模块,用于根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器;
处理模块,用于生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
本发明实施例提供了一种负载均衡装置,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现上述任一种负载均衡方法。
本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种负载均衡方法的步骤。
本发明实施例的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明实施例而了解。本发明实施例的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。
附图说明
附图用来提供对本发明实施例技术方案的进一步理解,并且构成说明书的一部分,与本发明实施例的实施例一起用于解释本发明实施例的技术方案,并不构成对本发明实施例技术方案的限制。
图1为本发明实施例NFV网络结构的示意图;
图2为本发明一个实施例提出的负载均衡方法的流程图;
图3为本发明另一个实施例提出的负载均衡方法的流程图;
图4为本发明实施例的示例1提出的负载均衡方法的流程图;
图5为本发明实施例的示例2提出的负载均衡方法的流程图;
图6为本发明另一个实施例的负载均衡装置的结构组成示意图;
图7为本发明另一个实施例的负载均衡装置的结构组成示意图。
具体实施方式
下文中将结合附图对本发明实施例进行详细说明。需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互任意组合。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执 行所示出或描述的步骤。
在介绍本发明实施例的负载均衡方法之前,首先介绍NFV网络结构,如图1所示,在NFV网络架构中,VNF控制器(即图1中的C)和VNF转发器(即图1中的F)分别部署到不同的虚拟机上,转发器部署多个,控制器部署一个。转发器不仅有三层转发能力,还可以具有业务处理器(例如网络地址转换(NAT,Network Address Translation)业务处理器)的业务处理能力。
控制器需要维护每个转发器的转发器基本性能参数表和转发器资源使用表,并初始化各表中的信息,转发器需要维护分流表和VNF资源使用表。
其中,转发器基本性能参数表包括但不限于以下参数:设备编号、设备互联网协议(IP,Internet Protocol)地址、物理位置标识和转发器所在的虚拟机的基本性能参数。其中,设备编号即转发器所在虚拟机的编号,转发器所在的虚拟机基本性能参数包括以下至少之一:中央处理单元(CPU,Center Process Unit)个数、可用内存、有效转发能力(即端口可用带宽)、CPU利用率。
其中,转发器资源使用表包括但不限于以下参数:组件编号(与设备编号相同,为转发器所在虚拟机的编号)、转发器所能承载的业务总容量、业务利用率、当前业务所占用的虚拟机的资源。其中,当前业务所占用的虚拟机的资源包括:内存、CPU。
其中,分流表包括但不限于以下参数:唯一键值、组件编号、老化时间等,以及其他业务相关的信息(如地址池利用率、会话容量等)。其中,唯一键值可以是用于识别数据包的任何信息,例如,三元组(协议、源IP地址、源端口号)或五元组(即协议、源IP地址、源端口号、目的IP地址、目的端口号)等。其中,老化时间用于对分流表项进行刷新,以此来避免无效分流表的使用。
其中,分流表可以根据业务需求进行老化、删除、更新。
其中,VNF资源使用表包括但不限于以下参数:业务剩余资源量、资源利用率、资源利用率阈值、CPU使用数、CPU总数、CPU利用率、CPU利用率阈值、单CPU上需要处理的业务量、内存总量、内存使用率阈值、已使用的内存值、剩余内存值、可承受的转发速率、单位时间内转发报文的数量、吞吐量(即转发性能)、吞吐量阈值、平均资源使用率、资源使用误差率。
下面介绍转发器向控制器的注册流程。
(1)所有转发器接入控制器,并注册成功,上报各自参数(这里上报的参数包括上述转发器基本性能参数表和转发器资源使用表中的参数),控制器初始化转发器基本性能参数表和转发器资源使用表,转发器在控制器中的唯一标识。
(2)控制器实时监控各转发器,如转发器断连则将该转发器从转发器基本性能参数表和转发器资源使用表中删除,取消注册信息。
(3)转发器定时向控制器上报数据,上报的数据包括转发器基本性能参数表和转发器资源使用表中的参数。
(4)控制器定时维护转发器的有效信息,该有效信息包括转发器基本性能参数表和转发器资源使用表中的参数。
参见图2,本发明一个实施例提出了一种负载均衡方法,包括:
步骤200、根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器。
在本发明实施例中,可以在接收到第一转发器上报的指令时,确定第一目标转发器。
在本发明实施例中,上报的指令中包括接收到的流量的相关信息,也可以不包括任何信息,仅仅作为通知有流量需要处理的指令。
在本发明实施例中,根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器包括以下至少之一:
当所述第一转发器的负载情况满足预设条件时,选择所述第一转发器作为所述第一目标转发器;
当所述第一转发器的负载情况不满足所述预设条件,且所述其他转发器中存在负载情况满足所述预设条件的第二转发器,且所述第二转发器中存在至少一个与所述第一转发器处于同一物理位置范围的第三转发器时,从所述第三转发器中选择其中一个转发器作为第一目标转发器;
当所述第一转发器的负载情况不满足所述预设条件,且所述其他转发器中存在负载情况满足所述预设条件的第二转发器,且所述第二转发器均与所述第一转发器处于不同的物理位置范围时,从所述第二转发器中选择其中一个转发器作为所述第一目标转发器。
本发明实施例基于物理位置就近原则优先选择与第一转发器处于同一物理位置范围的转发器作为第一目标转发器,充分考虑了转发器之间的物理位置,提高了处理效率。
在本发明实施例中,物理位置范围可以根据实际需要设置,可以是一个较大的范围,例如一个区域,也可以是一个很小的范围,例如是一个办公楼、或一个小区,本发明实施例对物理位置范围的大小不作限定。
在本发明实施例中,预设条件包括:剩余内存大于第一阈值,且CPU利用率小于第二阈值,且有效转发能力大于第三阈值,且当前所承载的业务容量小于第四阈值。本发明实施例在进行负载均衡时考虑了资源的使用情况,从而提高了处理性能。其中,剩余内存可 以是转发器基本性能参数表中的可用内存和转发器资源使用表中的当前业务所占用的虚拟机的内存之差,CPU利用率和有效转发能力可以从转发器基本性能参数表中获得,当前所承载的业务容量可以根据转发器资源使用表中的转发器所能承载的业务总容量和业务利用率获得,如为转发器所能承载的业务总容量和业务利用率的乘积。
在本发明实施例中,从第三转发器中选择其中一个转发器作为第一目标转发器包括:
根据业务容量、有效转发能力、CPU处理能力从所述第三转发器中选择其中一个转发器作为所述第一目标转发器。
其中,业务容量是指第三转发器当前所承载的业务量。
具体的,可以采用多种方式实现根据业务容量、有效转发能力、CPU处理能力从所述第三转发器中选择其中一个转发器作为所述第一目标转发器,例如,可以采用以下方法来实现,以下方法只是一个示例,本发明实施例不排除其他的实现方法。
B i=Bi sum·(B t-Bi ratio)
C i=Ci sum·(C t-Ci ratio)
Figure PCTCN2020077464-appb-000001
M free=Mi sum·(M t-Mi malloc)
Figure PCTCN2020077464-appb-000002
Figure PCTCN2020077464-appb-000003
F i=T isum-T i
其中,B i为第i个转发器的业务剩余资源量,Bi sum为第i个转发器上当前承载的业务量,Bi ratio为第i个转发器的资源利用率,B t为百分比值,设定的资源利用率阈值,C i为第i个转发器的CPU使用数,Ci sum为第i个转发器的CPU总数,Ci ratio为第i个转发器的CPU利用率,C t为百分比值,设定的CPU使用率阈值,PB i为第i个转发器上单CPU可以处理的业务量,Mi sum为第i个转发器的内存总量,M t为百分比值,设定的内存使用率阈值,Mi malloc为第i个转发器已使用的内存值,M free为第i个转发器的剩余内存值,Pi sum为第i个转发器单位时间t内转发报文的个数,Ti为第i个转发器当前的吞吐量(即转发性能),T t为百分比,设定的吞吐量阈值,B adv_ratio为平均资源使用率,E ratio为资源使用误差率,n为所有接入控制器的转发器总数量,F i为第i个转发器当前可用的吞吐量(即有效转发能力)。
最优解过程:
条件1:M free>0,PB i>0;
条件2:F i>0;
1)存在满足条件1的转发器则执行3);
2)如不存在满足条件1的转发器,则令B i=Bi sum.(1-Bi ratio)。如B i=0,则无解,转6);如B i不等于0则执行3);
3)存在满足条件2的转发器(即第三转发器)则转5);不存在满足条件2的转发器则转4);
4)Ti>0,T i值越接近T t解越优;Ti<0则无解,转6);
5)PB i值越大,解越优。存在多个最优解选物理位置最近的一个;
6)最优解算法结束。
其中,从第二转发器中选择其中一个转发器作为第一目标转发器包括:
根据业务容量、有效转发能力、CPU处理能力从所述第二转发器中选择其中一个转发器作为所述第一目标转发器。
从第二转发器中选择其中一个转发器作为第一目标转发器与从第三转发器中选择其中一个转发器作为第一目标转发器的方法的实现类似,这里不再赘述。
步骤202、生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
在本发明实施例中,分流表信息即是一个分流表项。
本发明实施例基于物理位置关系选择第一目标转发器,充分考虑了转发器之间的物理位置,提高了处理效率。
在本发明另一个实施例中,该方法还包括:
计算所有转发器的负载值和负载均值;根据所有转发器的负载值和负载均值确定待调整队列和待分流转发器队列;其中,所述待调整队列包括所有需要进行负载均衡调整的转发器,所述待分流转发器队列包括所有不需要进行负载均衡调整的转发器;
对于所述待调整队列中的每一个第四转发器,确定所述第四转发器对应的第二目标转发器;其中,所述第二目标转发器为所述待分流转发器队列中的一个或多个转发器;
将所述第四转发器中需要调整的业务量备份并切换到所述第二目标转发器,删除所述第四转发器的分流表信息,生成所述第二目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
在本发明另一个实施例中,当所有转发器均不需要进行负载均衡调整时,结束本流程。
在本发明实施例中,计算转发器的负载值包括:
根据总业务容量、CPU个数、平均转发速率计算所述转发器的负载值。
具体的,可以采用多种方式实现根据总业务容量、CPU个数、平均转发速率计算所述转发器的负载值,本发明实施例对此不作限定。
在本发明实施例中,确定第四转发器对应的第二目标转发器包括以下至少之一:
从所述待分流转发器队列中选择与第四转发器处于同一物理位置范围的一个或多个转发器作为所述第二目标转发器;
从所述待分流转发器队列中与第四转发器不在同一物理位置范围的转发器中,按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器;
从所述待分流转发器队列中按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
具体的,当待分流转发器队列中存在一个或多个与第四转发器处于同一物理位置范围的转发器,且这些转发器可承载的业务量之和大于或等于第四转发器的需要调整的业务量时,选择待分流转发器队列中与第四转发器处于同一物理位置范围的一个或多个转发器作为所述第二目标转发器;
当待分流转发器队列中存在一个或多个与第四转发器处于同一物理位置范围的转发器,且这些转发器可承载的业务量之和小于第四转发器的需要调整的业务量时,选择待分流转发器队列中与第四转发器处于同一物理位置范围的一个或多个转发器,以及待分流转发器队列中与所述第四转发器不在同一物理位置范围的转发器中按照可承接业务量由大到小的顺序选择的一个或多个转发器作为所述第二目标转发器;
当待分流转发器队列中的转发器均与第四转发器不在同一物理位置范围时,从所述待分流转发器队列中按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
在本发明实施例中,根据转发器的负载值和负载均值确定转发器需要进行负载均衡调整包括以下任意一个:
所述转发器的负载值和所述负载均值之差大于或等于预设偏差值;
所述转发器的负载值和所述负载均值之差与所述负载均值的比值大于或等于预设比值。
在本发明实施例中,根据转发器的负载值和负载均值确定转发器不需要进行负载均衡调整包括以下任意一个:
所述转发器的负载值和所述负载均值之差小于预设偏差值;
所述转发器的负载值和所述负载均值之差与所述负载均值的比值小于预设比值。
本发明实施例基于整体网络的负载均衡效果进行负载均衡调整,使得整体网络负载均衡最优。
参见图3,本发明另一个实施例提出了一种负载均衡方法,包括:
步骤300、接收到流量,当根据流量查找分流表未命中时,向控制器上报指令。
在本发明实施例中,上报的指令中包括接收到的流量的相关信息,也可以不包括任何信息,仅仅作为通知有流量需要处理的指令。
步骤301、接收第一目标转发器的分流表信息,根据分流表信息更新分流表。
在本发明实施例中,分流表信息即是一个分流表项。
在本发明另一个实施例中,当根据流量查找分流表命中时,该方法还包括:根据命中的分流表项对流量进行处理。其中,对流量的处理包括以下至少之一:转发、业务处理。
在本发明实施例中,根据流量查找分流表包括:根据流量按照分流粒度(分流粒度即是指键值的元素,如果键值为三元组,那么分流粒度包括协议、源IP地址、源端口号,其他的情况以此类推)生成一个键值,使用键值查找分流表,也就是将生成的键值和分流表中的唯一键值进行匹配,匹配上则命中;匹配不上则未命中。
示例1
参见图4,本示例提出一种负载均衡方法,包括:
步骤400、第一转发器接收到流量,根据流量按照分流粒度生成一个键值,使用生成的键值查找分流表,当命中时,根据命中的分流表项对流量进行处理;当未命中时,继续执行步骤401。
本示例中,分流粒度即是指键值的元素,如果键值为三元组,那么分流粒度包括协议、源IP地址、源端口号,其他的情况以此类推。
本示例中,将生成的键值和分流表中的唯一键值进行匹配,匹配上则命中;匹配不上则未命中。
本示例中,对流量的处理包括以下至少之一:转发、业务处理。
步骤401、第一转发器向控制器上报指令。
步骤402、控制器判断第一转发器是否满足预设条件,当第一转发器满足预设条件时,执行步骤403;当第一转发器不满足预设条件时,执行步骤404。
本示例中,预设条件包括:剩余内存大于第一阈值,且CPU利用率小于第二阈值,且有效转发能力大于第三阈值,且当前承载的业务量小于第四阈值。本示例在进行负载均衡 时考虑了资源的使用情况,从而提高了处理性能。
步骤403、控制器选择所述第一转发器作为所述第一目标转发器,并继续执行步骤408。
步骤404、控制器判断是否存在满足预设条件的第二转发器,当存在满足预设条件的第二转发器时,继续执行步骤405;当不存在满足预设条件的第二转发器时,结束本流程。
步骤405、控制器判断第二转发器中是否存在至少一个与第一转发器处于同一物理位置范围的第三转发器,当第二转发器中存在至少一个与第一转发器处于同一物理位置范围的第三转发器时,执行步骤406;当第二转发器均与第一转发器处于不同的物理位置范围时,执行步骤407。
步骤406、控制器从第三转发器中选择其中一个转发器作为第一目标转发器,并继续执行步骤408。
本示例中,控制器根据业务容量、有效转发能力、CPU处理能力从所述第三转发器中选择其中一个转发器作为所述第一目标转发器。
步骤407、控制器从所述第二转发器中选择其中一个转发器作为所述第一目标转发器,并继续执行步骤408。
本示例中,控制器根据业务容量、有效转发能力、CPU处理能力从所述第二转发器中选择其中一个转发器作为所述第一目标转发器。
步骤408、控制器生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
步骤409、转发器根据分流表信息更新转发表。
实施例2
参见图5,本示例提出一种负载均衡方法,包括:
步骤500、控制器计算所有转发器的负载值和负载均值。
本示例中,控制器根据总业务容量、CPU个数、平均转发速率计算所述转发器的负载值。
步骤501、控制器判断每一个转发器的负载值和负载均值之差是否大于或等于预设偏差,当转发器的负载值和负载均值之差大于或等于预设偏差时,确定转发器需要进行负载均衡调整,继续执行步骤502;当所有转发器的负载值和负载均值之差均小于预设偏差时,确定所有转发器均不需要进行负载均衡调整,结束本流程。
步骤502、控制器将需要进行负载均衡调整的转发器放入待调整队列中,将不需要进行负载均衡调整的转发器放入待分流转发器队列中。
步骤503、对于待调整队列中的每一个需要进行负载均衡调整的转发器,控制器判断 待分流转发器队列中是否存在与需要进行负载均衡调整的转发器处于同一物理位置范围的转发器,如果存在,则继续执行步骤504;如果不存在,则继续执行506。
步骤504、控制器从所述待分流转发器队列中选择与所述需要进行负载均衡调整的转发器处于同一物理位置范围的一个或多个转发器作为所述第二目标转发器。
步骤505、控制器判断所选择的与所述需要进行负载均衡调整的转发器处于同一物理位置范围的一个或多个转发器的可承接业务量之和是否大于或等于需要进行负载均衡调整的转发器的需要调整业务量,如果是,则继续执行步骤507;如果不是,则除了步骤504选择的第二目标转发器之外,还从所述待分流转发器队列中与所述需要进行负载均衡调整的转发器不在同一物理位置范围的转发器中,按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
步骤506、控制器从所述待分流转发器队列中按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
步骤507、控制器将所述需要进行负载均衡调整的转发器中需要调整的业务量备份到所述第二目标转发器,将需要进行负载均衡调整的转发器中需要调整的业务量切换到所述第二目标转发器,更新转发器上的分流表中需要调整的业务量对应的分流表项,删除所述需要进行负载均衡调整的转发器的分流表信息,生成第二目标转发器的分流表信息,将分流表信息下发到所有转发器中。
参见图6,本发明另一个实施例提出了一种负载均衡装置(如控制器),包括:
确定模块602,用于根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器;
处理模块603,用于生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
在本发明另一个实施例中,还包括:第一通信模块601,用于接收到第一转发器上报的指令。
在本发明实施例中,上报的指令中包括接收到的流量的相关信息,也可以不包括任何信息,仅仅作为通知有流量需要处理的指令。
在本发明实施例中,分流表信息即是一个分流表项。
在本发明实施例中,确定模块602具体用于执行以下至少之一:
当所述第一转发器的负载情况满足预设条件时,选择所述第一转发器作为所述第一目标转发器;
当所述第一转发器的负载情况不满足所述预设条件,且所述其他转发器中存在负载情 况满足所述预设条件的第二转发器,且所述第二转发器中存在至少一个与所述第一转发器处于同一物理位置范围的第三转发器时,从所述第三转发器中选择其中一个转发器作为第一目标转发器;
当所述第一转发器的负载情况不满足所述预设条件,且所述其他转发器中存在负载情况满足所述预设条件的第二转发器,且所述第二转发器均与所述第一转发器处于不同的物理位置范围时,从所述第二转发器中选择其中一个转发器作为所述第一目标转发器。
本发明实施例基于物理位置就近原则优先选择与第一转发器处于同一物理位置范围的转发器作为第一目标转发器,充分考虑了转发器之间的物理位置,提高了处理效率。
在本发明实施例中,物理位置范围可以根据实际需要设置,可以是一个较大的范围,例如一个区域,也可以是一个很小的范围,例如是一个办公楼、或一个小区,本发明实施例对物理位置范围的大小不作限定。
在本发明实施例中,预设条件包括:剩余内存大于第一阈值,且CPU利用率小于第二阈值,且有效转发能力大于第三阈值,且当前所承载的业务容量小于第四阈值。本发明实施例在进行负载均衡时考虑了资源的使用情况,从而提高了处理性能。其中,剩余内存可以是转发器基本性能参数表中的可用内存和转发器资源使用表中的当前业务所占用的虚拟机的内存之差,CPU利用率和有效转发能力可以从转发器基本性能参数表中获得,当前所承载的业务容量可以根据转发器资源使用表中的转发器所能承载的业务总容量和业务利用率获得,如为转发器所能承载的业务总容量和业务利用率的乘积。
在本发明实施例中,处理模块602具体用于采用以下方式实现从第三转发器中选择其中一个转发器作为第一目标转发器:
根据业务容量、有效转发能力、CPU处理能力从所述第三转发器中选择其中一个转发器作为所述第一目标转发器。
其中,业务容量是指第三转发器当前所承载的业务量。
其中,处理模块602具体用于采用以下方式实现从第二转发器中选择其中一个转发器作为第一目标转发器:
根据业务容量、有效转发能力、CPU处理能力从所述第二转发器中选择其中一个转发器作为所述第一目标转发器。
本发明实施例基于物理位置关系选择第一目标转发器,充分考虑了转发器之间的物理位置,提高了处理效率。
在本发明另一个实施例中,处理模块602还用于:
计算所有转发器的负载值和负载均值;根据所有转发器的负载值和负载均值确定待调 整队列和待分流转发器队列;其中,所述待调整队列包括所有需要进行负载均衡调整的转发器,所述待分流转发器队列包括所有不需要进行负载均衡调整的转发器;
对于所述待调整队列中的每一个第四转发器,确定所述第四转发器对应的第二目标转发器;其中,所述第二目标转发器为所述待分流转发器队列中的一个或多个转发器;
将所述第四转发器中需要调整的业务量备份并切换到所述第二目标转发器,删除所述第四转发器的分流表信息,生成所述第二目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
在本发明另一个实施例中,当所有转发器均不需要进行负载均衡调整时,结束本流程。
在本发明实施例中,处理模块602具体用于采用以下方式实现计算转发器的负载值:
根据总业务容量、CPU个数、平均转发速率计算所述转发器的负载值。
在本发明实施例中,处理模块602具体用于采用以下至少之一方式实现确定第四转发器对应的第二目标转发器:
从所述待分流转发器队列中选择与第四转发器处于同一物理位置范围的一个或多个转发器作为所述第二目标转发器;
从所述待分流转发器队列中与第四转发器不在同一物理位置范围的转发器中,按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器;
从所述待分流转发器队列中按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
具体的,当待分流转发器队列中存在一个或多个与第四转发器处于同一物理位置范围的转发器,且这些转发器可承载的业务量之和大于或等于第四转发器的需要调整的业务量时,选择待分流转发器队列中与第四转发器处于同一物理位置范围的一个或多个转发器作为所述第二目标转发器;
当待分流转发器队列中存在一个或多个与第四转发器处于同一物理位置范围的转发器,且这些转发器可承载的业务量之和小于第四转发器的需要调整的业务量时,选择待分流转发器队列中与第四转发器处于同一物理位置范围的一个或多个转发器,以及待分流转发器队列中与所述第四转发器不在同一物理位置范围的转发器中按照可承接业务量由大到小的顺序选择的一个或多个转发器作为所述第二目标转发器;
当待分流转发器队列中的转发器均与第四转发器不在同一物理位置范围时,从所述待分流转发器队列中按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
在本发明实施例中,处理模块602具体用于采用以下方式任意一个实现根据转发器的 负载值和负载均值确定转发器需要进行负载均衡调整:
所述转发器的负载值和所述负载均值之差大于或等于预设偏差值;
所述转发器的负载值和所述负载均值之差与所述负载均值的比值大于或等于预设比值。
在本发明实施例中,处理模块602具体用于采用以下方式任意一个实现根据转发器的负载值和负载均值确定转发器不需要进行负载均衡调整:
所述转发器的负载值和所述负载均值之差小于预设偏差值;
所述转发器的负载值和所述负载均值之差与所述负载均值的比值小于预设比值。
本发明实施例基于整体网络的负载均衡效果进行负载均衡调整,使得整体网络负载均衡最优。
参见图7,本发明另一个实施例提出了一种负载均衡装置(如转发器),包括:
第二通信模块701,用于接收到流量,当根据流量查找分流表未命中时,向控制器上报指令;接收第一目标转发器的分流表信息;
更新模块702,用于根据分流表信息更新分流表。
在本发明实施例中,上报的指令中包括接收到的流量的相关信息,也可以不包括任何信息,仅仅作为通知有流量需要处理的指令。
在本发明实施例中,分流表信息即是一个分流表项。
在本发明另一个实施例中,第二通信模块701还用于:当根据流量查找分流表命中时,根据命中的分流表项对流量进行处理。其中,对流量的处理包括以下至少之一:转发、业务处理。
在本发明实施例中,第二通信模块701具体用于采用以下方式实现根据流量查找分流表:根据流量按照分流粒度(分流粒度即是指键值的元素,如果键值为三元组,那么分流粒度包括协议、源IP地址、源端口号,其他的情况以此类推)生成一个键值,使用键值查找分流表,也就是将生成的键值和分流表中的唯一键值进行匹配,匹配上则命中;匹配不上则未命中。
本发明另一个实施例提出了一种负载均衡装置,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现上述任一种负载均衡方法。
本发明另一个实施例提出了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种负载均衡方法的步骤。
本发明一个实施例包括:根据第一转发器的负载情况、其他转发器的负载情况、第一 转发器和其他转发器之间的物理位置关系确定第一目标转发器;生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。本发明实施例基于物理位置关系选择第一目标转发器,充分考虑了转发器之间的物理位置,提高了处理效率。
在另一个实施例中,预设条件包括:剩余内存大于第一阈值,且CPU利用率小于第二阈值,且有效转发能力大于第三阈值,且当前所承载的业务容量小于第四阈值。本发明实施例在进行负载均衡时考虑了资源的使用情况,从而提高了处理性能。
在另一个实施例中,该方法还包括:计算所有转发器的负载值和负载均值;根据所有转发器的负载值和负载均值确定待调整队列和待分流转发器队列;其中,所述待调整队列包括所有需要进行负载均衡调整的转发器,所述待分流转发器队列包括所有不需要进行负载均衡调整的转发器;对于所述待调整队列中的每一个第四转发器,确定所述第四转发器对应的第二目标转发器;其中,所述第二目标转发器为所述待分流转发器队列中的一个或多个转发器;将所述第四转发器中需要调整的业务量备份并切换到所述第二目标转发器,删除所述第四转发器的分流表信息,生成所述第二目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。本发明实施例基于整体网络的负载均衡效果进行负载均衡调整,使得整体网络负载均衡最优。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
虽然本发明实施例所揭露的实施方式如上,但所述的内容仅为便于理解本发明实施例 而采用的实施方式,并非用以限定本发明实施例。任何本发明实施例所属领域内的技术人员,在不脱离本发明实施例所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明实施例的专利保护范围,仍须以所附的权利要求书所界定的范围为准。

Claims (11)

  1. 一种负载均衡方法,包括:
    根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器;
    生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
  2. 根据权利要求1所述的方法,其中,所述根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器包括以下至少之一:
    当所述第一转发器的负载情况满足预设条件时,选择所述第一转发器作为所述第一目标转发器;
    当所述第一转发器的负载情况不满足所述预设条件,且所述其他转发器中存在负载情况满足所述预设条件的第二转发器,且所述第二转发器中存在至少一个与所述第一转发器处于同一物理位置范围的第三转发器时,从所述第三转发器中选择其中一个转发器作为第一目标转发器;
    当所述第一转发器的负载情况不满足所述预设条件,且所述其他转发器中存在负载情况满足所述预设条件的第二转发器,且所述第二转发器均与所述第一转发器处于不同的物理位置范围时,从所述第二转发器中选择其中一个转发器作为所述第一目标转发器。
  3. 根据权利要求2所述的方法,其中,所述预设条件包括:剩余内存大于第一阈值,且CPU利用率小于第二阈值,且有效转发能力大于第三阈值,且当前所承载的业务容量小于第四阈值。
  4. 根据权利要求2任意一项所述的方法,其中,所述从第二转发器中选择其中一个转发器作为第一目标转发器包括:
    根据业务容量、有效转发能力、CPU处理能力从所述第二转发器中选择其中一个转发器作为所述第一目标转发器;
    或者,所述从第三转发器中选择其中一个转发器作为第一目标转发器包括:
    根据业务容量、有效转发能力、CPU处理能力从所述第三转发器中选择其中一个转发器作为所述第一目标转发器。
  5. 根据权利要求1至4任意一项所述的方法,该方法还包括:
    计算所有转发器的负载值和负载均值;
    根据所有转发器的负载值和负载均值确定待调整队列和待分流转发器队列;其中,所 述待调整队列包括所有需要进行负载均衡调整的转发器,所述待分流转发器队列包括所有不需要进行负载均衡调整的转发器;
    对于所述待调整队列中的每一个第四转发器,确定所述第四转发器对应的第二目标转发器;其中,所述第二目标转发器为所述待分流转发器队列中的一个或多个转发器;
    将所述第四转发器中需要调整的业务量备份并切换到所述第二目标转发器,删除所述第四转发器的分流表信息,生成所述第二目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
  6. 根据权利要求5所述的方法,其中,所述计算转发器的负载值包括:
    根据总业务容量、CPU个数、平均转发速率计算所述转发器的负载值。
  7. 根据权利要求5所述的方法,其中,所述确定第四转发器对应的第二目标转发器包括以下至少之一:
    从所述待分流转发器队列中选择与所述第四转发器处于同一物理位置范围的一个或多个转发器作为所述第二目标转发器;
    从所述待分流转发器队列中与所述第四转发器不在同一物理位置范围的转发器中,按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器;
    从所述待分流转发器队列中按照可承接业务量由大到小的顺序选择一个或多个转发器作为所述第二目标转发器。
  8. 根据权利要求5所述的方法,其中,所述根据转发器的负载值和负载均值确定转发器需要进行负载均衡调整包括以下任意一个:
    所述转发器的负载值和所述负载均值之差大于或等于预设偏差值;
    所述转发器的负载值和所述负载均值之差与所述负载均值的比值大于或等于预设比值。
  9. 一种负载均衡装置,包括:
    确定模块,用于根据第一转发器的负载情况、其他转发器的负载情况、第一转发器和其他转发器之间的物理位置关系确定第一目标转发器;
    处理模块,用于生成所述第一目标转发器的分流表信息,将所述分流表信息下发到所有转发器中。
  10. 一种负载均衡装置,包括处理器和计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令被所述处理器执行时,实现如权利要求1至8任一项所述的负载均衡方法。
  11. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执 行时实现如权利要求1至8任一项所述的负载均衡方法的步骤。
PCT/CN2020/077464 2019-04-09 2020-03-02 一种负载均衡方法和装置 WO2020207148A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910280669.3A CN111800348A (zh) 2019-04-09 2019-04-09 一种负载均衡方法和装置
CN201910280669.3 2019-04-09

Publications (1)

Publication Number Publication Date
WO2020207148A1 true WO2020207148A1 (zh) 2020-10-15

Family

ID=72751832

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/077464 WO2020207148A1 (zh) 2019-04-09 2020-03-02 一种负载均衡方法和装置

Country Status (2)

Country Link
CN (1) CN111800348A (zh)
WO (1) WO2020207148A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806083B (zh) * 2021-09-06 2023-07-25 杭州迪普科技股份有限公司 一种处理聚合流数据的方法和装置
CN114422470A (zh) * 2021-12-27 2022-04-29 中国电信股份有限公司 地址处理方法、装置、电子设备及存储介质
CN117439953B (zh) * 2023-12-20 2024-03-26 珠海星云智联科技有限公司 等价成本多路径选择系统、方法、设备、集群以及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104270312A (zh) * 2014-09-25 2015-01-07 东北大学 支持流量优化和应用感知的中继路径分配系统及方法
CN104518993A (zh) * 2014-12-29 2015-04-15 华为技术有限公司 云化网络通信路径的分配方法、装置及系统
WO2015109803A1 (zh) * 2014-01-23 2015-07-30 中兴通讯股份有限公司 一种负荷均衡的方法及系统
CN106411768A (zh) * 2015-07-31 2017-02-15 中国电信股份有限公司 业务链资源调度方法和装置
CN107193638A (zh) * 2017-05-30 2017-09-22 南京邮电大学 一种基于多维环境感知的网络功能快速自适应迁移方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103596066B (zh) * 2013-11-28 2017-02-15 中国联合网络通信集团有限公司 一种数据处理方法及装置
CN104580526A (zh) * 2015-02-03 2015-04-29 浪潮电子信息产业股份有限公司 一种高性能Web服务网络中的就近访问负载均衡调度方法
CN107547597A (zh) * 2016-06-27 2018-01-05 中兴通讯股份有限公司 业务处理方法及装置
CN106790656B (zh) * 2017-01-19 2019-12-31 南京贝伦思网络科技股份有限公司 一种基于sdn的负载均衡装置及其方法
US20180302343A1 (en) * 2017-04-14 2018-10-18 Argela Yazilim ve Bilisim Teknolojileri San. ve Tic. A.S. System and method for convergence of software defined network (sdn) and network function virtualization (nfv)
CN107220108B (zh) * 2017-07-06 2020-06-30 山东超越数控电子股份有限公司 一种实现云数据中心负载均衡的方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015109803A1 (zh) * 2014-01-23 2015-07-30 中兴通讯股份有限公司 一种负荷均衡的方法及系统
CN104270312A (zh) * 2014-09-25 2015-01-07 东北大学 支持流量优化和应用感知的中继路径分配系统及方法
CN104518993A (zh) * 2014-12-29 2015-04-15 华为技术有限公司 云化网络通信路径的分配方法、装置及系统
CN106411768A (zh) * 2015-07-31 2017-02-15 中国电信股份有限公司 业务链资源调度方法和装置
CN107193638A (zh) * 2017-05-30 2017-09-22 南京邮电大学 一种基于多维环境感知的网络功能快速自适应迁移方法

Also Published As

Publication number Publication date
CN111800348A (zh) 2020-10-20

Similar Documents

Publication Publication Date Title
US11381507B2 (en) Virtual network device and related method
US20210336997A1 (en) Method and system for virtual machine aware policy management
WO2020207148A1 (zh) 一种负载均衡方法和装置
WO2018077238A1 (zh) 一种基于交换机的负载均衡系统及方法
US10534601B1 (en) In-service software upgrade of virtual router with reduced packet loss
US11036529B2 (en) Network policy implementation with multiple interfaces
US10320683B2 (en) Reliable load-balancer using segment routing and real-time application monitoring
US8676980B2 (en) Distributed load balancer in a virtual machine environment
US8825867B2 (en) Two level packet distribution with stateless first level packet distribution to a group of servers and stateful second level packet distribution to a server within the group
US9621642B2 (en) Methods of forwarding data packets using transient tables and related load balancers
US9979656B2 (en) Methods, systems, and computer readable media for implementing load balancer traffic policies
US20140369204A1 (en) Methods of load balancing using primary and stand-by addresses and related load balancers and servers
US20140372616A1 (en) Methods of forwarding/receiving data packets using unicast and/or multicast communications and related load balancers and servers
EP2587750A1 (en) Addressing the large flow problem for equal cost multi-path in the datacenter
WO2017025021A1 (zh) 一种处理流表的方法及装置
US10225232B2 (en) Method and system for idle mode transfer for load balancing across distributed data plane processing entities for mobile core network
US10693785B2 (en) Method and system for forwarding data, virtual load balancer, and readable storage medium
WO2012006894A1 (zh) 流业务负载分担方法和处理方法以及相应的设备和系统
CN106713378B (zh) 实现多个应用服务器提供服务的方法和系统
US11316916B2 (en) Packet processing method, related device, and computer storage medium
WO2014023098A1 (zh) 一种负载分担方法和流量转发设备
CN110611622B (zh) 用于负载均衡的方法、网络接口卡以及计算机可读介质
WO2023005745A1 (zh) 报文转发方法、装置及系统、计算机可读存储介质
CN112751766A (zh) 报文转发方法、装置及计算机存储介质
EP4111307A1 (en) Dynamic distributed local breakout determination

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20788377

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20788377

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20788377

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08/04/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20788377

Country of ref document: EP

Kind code of ref document: A1