[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2015131699A1 - Load balancing method and device - Google Patents

Load balancing method and device Download PDF

Info

Publication number
WO2015131699A1
WO2015131699A1 PCT/CN2015/071446 CN2015071446W WO2015131699A1 WO 2015131699 A1 WO2015131699 A1 WO 2015131699A1 CN 2015071446 W CN2015071446 W CN 2015071446W WO 2015131699 A1 WO2015131699 A1 WO 2015131699A1
Authority
WO
WIPO (PCT)
Prior art keywords
controller
switch
data
switches
packet
Prior art date
Application number
PCT/CN2015/071446
Other languages
French (fr)
Chinese (zh)
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 WO2015131699A1 publication Critical patent/WO2015131699A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/645Splitting route computation layer and forwarding layer, e.g. routing according to path computational element [PCE] or based on OpenFlow functionality

Definitions

  • the present invention relates to the field of communications, and in particular to a method and apparatus for load balancing.
  • SDN Software Defined Networks
  • OF Openflow
  • the SDN network consists of three parts: SDN controller, secure channel and SDN switch.
  • the SDN controller is a network control software designed according to the OpenFlow protocol, and is configured to manage data streams, configure network devices, formulate flow tables, and undertake communication between network services and network devices. There can be multiple controllers in a domain, but generally only one controller is in control and management state.
  • the SDN switch is controlled by the SDN controller, and the flow table defined by the controller is saved, and the flow table entry is queried to determine the processing mode of the packet, including forwarding, caching, submitting the controller, or discarding.
  • the secure channel under the OpenFlow protocol is used to connect the switch to the controller for communication.
  • each controller controls a certain number of switches, if the number of packet-in packets reported by a controller controlled by a controller is excessive or the number of flow tables delivered and the amount of OF information exchanged with the switch Too large will cause the controller to generate a large control flow at a certain time. This situation will make the controller become the bottleneck of the entire controller cluster to handle network traffic, affecting the performance of the entire controller cluster.
  • the switch on a controller reports a large number of packet-in packets (a special packet of the OpenFlow protocol, which is used to match the traffic on the fail or specify the matching traffic. , sent to the controller) or other OF (OpenFlow) messages, the controller may also send a large number of flow tables, while other controllers only receive a small number of packet-in messages and other OF messages, at this time the controller The number of flow tables issued is not large, which may cause some controllers to control overload, and some controllers are far from reaching control load saturation. In order to alleviate this situation, it is necessary to adjust the switches that are controlled by each controller at all times to realize load balancing of the controller at all times and improve the control performance of the entire controller cluster.
  • packet-in packets a special packet of the OpenFlow protocol, which is used to match the traffic on the fail or specify the matching traffic.
  • OF (OpenFlow) messages the controller may also send a large number of flow tables, while other controllers only receive a small number of packet-in messages and other OF messages, at this time the
  • the related technology only proposes to increase the shared storage area between multiple controllers to realize inter-controller communication, and does not implement controller load balancing. However, when the network traffic fluctuates greatly, the problem of uneven controller load has not been solved. .
  • the embodiment of the invention provides a load balancing method and device to solve at least the problem of uneven load of the cluster SDN controller in the related art.
  • a method for load balancing comprising: collecting data of characterization parameters of a plurality of switches controlled by each of the SDN controllers of the cluster software-defined network SDN controller; Determining, by the data of the characterization parameter of the switch, the data of the characterization parameter of the plurality of switches at a next moment; according to the estimated data of the plurality of switches at the next moment, the cluster SDN Each SDN controller of the controller performs load balancing.
  • the characterization parameter includes at least one of the following: a packet-in packet, a flow table number, and other OF messages.
  • estimating data of the characterization parameter of the plurality of switches at a next moment includes: estimating data of the characterization parameter of the plurality of switches at a next moment using a least squares method.
  • n is the number of times in the current statistical period
  • X is the timestamp corresponding to the time
  • Y is the value of the characterization parameter of each switch.
  • the data of the characterization parameter includes sample historical data of the characterization parameter and data of the characterization parameter at each moment in the current statistical period; and according to the data of the characterization parameters of the plurality of switches, the prediction is performed.
  • the data of the characterization parameters of the switches at the next moment includes: characterization according to the plurality of switches The sample historical data of the parameter and the data of the characterization parameter at each moment in the current statistical period, and the data of the characterization parameter of the plurality of switches at the next moment are estimated.
  • estimating data of the characterization parameter of the multiple switches at a next moment includes: estimating the characterization of the multiple switches according to data of the characterization parameters at each moment in a current statistical period The data of the parameter at the next moment; the sample historical data of the characterization parameter is averaged with the estimated data of the characterization parameter at the next moment.
  • performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment includes: estimating the multiple Calculating, by the data of the switch at the next moment, the ratio of the estimated value of each of the controllers to the historical maximum value of the corresponding parameter P YHi : calculating the total pre-control cluster for the characterization parameter The ratio of the estimate to the total maximum value P YHv : Compare P YHi with P YHv and adjust the controller controlled by the controller according to the result of the comparison.
  • P YHi is calculated by the following formula:
  • n is the number of switches managed by each controller
  • Y inext is an estimated value of the characterization parameters of each switch managed by the controller
  • H iymax is a historical maximum value of each characterization parameter of each switch managed by the controller
  • P YHv is calculated by the following formula:
  • m represents the number of controllers
  • n represents the number of switches controlled by each controller
  • Y inext is an estimated value of the characterization parameters of each switch managed by the controller
  • H iymax is the managed switch controller for the Characterizes the historical maximum of the parameter.
  • comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: setting a scaling factor for a plurality of different characterization parameters, wherein the scaling coefficient is set to represent each characterization parameter The proportion of the comparison process.
  • comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: for each controller, when the P YHi is greater than P YHv , calculating the switch that should be called, and according to The calculation result calls the switch; and/or, for each controller, when its P YHi is less than P YHv , the switch to be transferred is calculated, and is transferred to the switch according to the calculation result.
  • the switch that is to be input is calculated, and the switch is transferred according to the calculation result, including: calculating for the controller Set to B yisize and get B isize according to the previously set scale factor, where the scale factor is set to represent the proportion of the plurality of characterization parameters in the comparison process; the controller is arranged in descending order according to the value of B isize , and then Transfer to the switch according to the controller load.
  • the switch is sequentially loaded according to the controller load, and the switch is arranged in descending order according to the value of B inext of each switch to be transferred in the pool to be transferred, and the switch queue is set to be stored.
  • a load balancing apparatus comprising: a collection module configured to collect data of characterization parameters of a plurality of switches controlled by each of the SDN controllers of the cluster software defined network SDN controller And an estimation module configured to estimate data of the characterization parameter of the plurality of switches at a next moment according to data of the characterization parameters of the plurality of switches; and the load balancing module is configured to be configured according to the prediction The characterization parameters of the switches are load balanced at each of the SDN controllers of the cluster SDN controller at the next time.
  • the clustering software is used to define data of the characterization parameters of the plurality of switches controlled by each of the SDN controllers of the network SDN controller; and the plurality of switches are estimated according to the data of the characterization parameters of the plurality of switches. And characterizing the data of the parameter at the next moment; performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment.
  • FIG. 1 is a flow chart of a method of load balancing according to an embodiment of the present invention
  • FIG. 2 is a structural diagram of a device for load balancing according to an embodiment of the present invention
  • FIG. 3 is a block diagram showing the structure of an SDN controller in accordance with a preferred embodiment of the present invention.
  • FIG. 4 is a flow diagram of tuning a switch into a controller in accordance with a preferred embodiment of the present invention.
  • FIG. 5 is a flowchart of cluster controller load balancing scheduling according to a preferred embodiment of the present invention.
  • FIG. 6 is a schematic diagram of allocation of an intra-domain controller and a switch according to a preferred embodiment 1 of the present invention
  • Figure 7 is a diagram showing the allocation of intra-domain cascade controllers and switches in accordance with a preferred embodiment 3 of the present invention.
  • the related technology only proposes to increase the shared storage area between multiple controllers to realize inter-controller communication, and does not implement controller load balancing.
  • controller load balancing when the network traffic fluctuates greatly, the problem of uneven controller load has not been solved.
  • the problem is solved by the method of network traffic prediction and scheduling each controller to control the switch.
  • FIG. 1 is a flowchart of a method for load balancing according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps:
  • Step S102 collecting data of characterization parameters of multiple switches managed by each SDN controller of the cluster software defined network (SDN) controller;
  • Step S104 Estimating data of the characterization parameter of the multiple switches at a next moment according to data of the characterization parameters of the multiple switches;
  • Step S106 Perform load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment.
  • the data of the characterization parameters of the plurality of switches controlled by each SDN controller are collected through the foregoing steps, and the data at the next moment is estimated according to the collected data, and then according to the estimated characterization parameters.
  • the data of one moment is load-balanced to each SDN controller, thereby realizing the load balancing of the cluster SDN controller, solving the problem of uneven load of the cluster SDN controller in the related technology, and performing load balancing through the estimated data. It is highly achievable and improves the resource utilization efficiency of the cluster SDN controller.
  • the characterization parameter includes at least one of the following: a packet-in packet, a flow table number, and other OF messages.
  • estimating data of the characterization parameter of the plurality of switches at a next moment includes: estimating data of the characterization parameter of the plurality of switches at a next moment using a least squares method.
  • n is the number of times in the current statistical period
  • X is the timestamp corresponding to the time
  • Y is the value of the characterization parameter of each switch.
  • the data of the characterization parameter includes sample historical data of the characterization parameter and data of the characterization parameter at each moment in the current statistical period; and according to the data of the characterization parameters of the plurality of switches, the prediction is performed.
  • the data of the characterization parameters of the switches at the next moment includes: estimating the plurality of switches according to the sample historical data of the characterization parameters of the plurality of switches and the data of the characterization parameters at each moment in the current statistical period The data characterizing the parameter at the next moment.
  • estimating data of the characterization parameter of the multiple switches at a next moment includes: estimating the characterization of the multiple switches according to data of the characterization parameters at each moment in a current statistical period Reference Counting the data at the next moment; summing the sample historical data of the characterization parameters with the estimated data of the characterization parameters at the next moment.
  • performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment includes: estimating the multiple Calculating, by the data of the switch at the next moment, the ratio of the estimated value of each of the controllers to the historical maximum value of the corresponding parameter P YHi : calculating the total pre-control cluster for the characterization parameter The ratio of the estimate to the total maximum value P YHv : Compare P YHi with P YHv and adjust the controller controlled by the controller according to the result of the comparison.
  • P YHi is calculated by the following formula: Where n is the number of switches managed by each controller, and Y inext is an estimated value of the characterization parameters of each switch managed by the controller, and H iymax is a historical maximum value of each characterization parameter of each switch managed by the controller; and / or,
  • P YHv is calculated by the following formula: Wherein m represents the number of controllers, n represents the number of switches controlled by each controller, and Y inext is an estimated value of the characteristic parameters of each switch managed by the controller, and H iymax is the switch managed by the controller. Characterizes the historical maximum of the parameter. Among them, Y inext is the result y obtained by the least squares mathematical model.
  • comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: setting a scaling factor for a plurality of different characterization parameters, wherein the scaling coefficient is set to represent each characterization parameter The proportion of the comparison process.
  • comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: for each controller, when the P YHi is greater than P YHv , calculating the switch that should be called, and according to The calculation result calls the switch; and/or, for each controller, when its P YHi is less than P YHv , the switch to be transferred is calculated, and is transferred to the switch according to the calculation result.
  • the switch that is to be input is calculated, and the switch is transferred according to the calculation result, including: calculating for the controller Set to B yisize and get B isize according to the previously set scale factor, where the scale factor is set to represent the proportion of the plurality of characterization parameters in the comparison process; the controller is arranged in descending order according to the value of B isize , and then Transfer to the switch according to the controller load.
  • the switch is sequentially loaded according to the controller load, and the switch is arranged in descending order according to the value of B inext of each switch to be transferred in the pool to be transferred, and the switch queue is set to be stored.
  • a device for load balancing is also provided in the embodiment, and the device is configured to implement the foregoing embodiments and preferred embodiments, and details are not described herein.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 2 is a structural diagram of a device for load balancing according to an embodiment of the present invention. As shown in FIG. 2, the device includes: a collection module 22, an estimation module 24, and a load balancing module 26. The following describes each module in detail. :
  • the collecting module 22 is configured to collect data of the characterization parameters of the plurality of switches that are controlled by each of the SDN controllers of the cluster software-defined network SDN controller;
  • the estimating module 24 is connected to the collecting module 22, and is configured to be configured according to the multiple Determining, by the data of the characterization parameter of the switch, the data of the characterization parameter of the plurality of switches at a next moment;
  • the load balancing module 26 is connected to the estimation module 24 and configured to be based on the estimated plurality of switches
  • the characterization parameters are data of the next moment, and load balancing is performed on each SDN controller of the cluster SDN controller.
  • the following is a detailed description of the preferred embodiment.
  • the following preferred embodiments mainly describe the three types of the packet-in packet number, the outgoing flow table, and other OF information.
  • the preferred embodiment combines the foregoing. Embodiments and preferred embodiments thereof.
  • a method and apparatus for implementing load balancing optimization of an SDN controller are provided, that is, in a distributed SDN network controller cluster scenario, a packet-in packet received by the controller is proposed.
  • the number and the downstream flow table and other OF information are reasonably predicted and optimized, so that each controller achieves load balancing.
  • the preferred embodiment is mainly applied to an SDN network domain.
  • the packet_in message The number of flow tables and other OF messages are predicted by the data, and then averaged with the corresponding historical statistics to perform data synthesis, as a basis for adjusting the controller load, and dynamically adjusting the controllers controlled by the controller.
  • the preferred embodiment includes the following two parts, namely, adding a cluster controller scheduling device in the SDN controller and detailed implementation steps:
  • FIG. 3 is a structural block diagram of an SDN controller according to a preferred embodiment of the present invention. As shown in FIG. 3, a cluster controller scheduling device newly added to the SDN controller mainly includes the following four internal modules:
  • the information collection module collects packet-in packets, flow table numbers, and sample history data of other OF messages according to the sampling time period, or collects packet-in packets, flow table numbers, and other current switches of each switch. OF message data.
  • the time period may be a time stamp of the same time period of the week or a time stamp of the same time period of the same day in a few weeks, and is determined according to the actual use scenario.
  • Data processing module The data is comprehensively processed according to the packet-in, the number of flow tables, and other OF information statistics of each switch collected to obtain the desired data.
  • Dispatching module According to the comparison between the load pressure of each controller and the load pressure of the cluster controller obtained by the data processing module, the switches controlled by each controller are adjusted, so that the load pressure of each controller is balanced.
  • the slave-master (master-slave mechanism, also can be written as master-slave) mechanism is used to exchange the roles of each controller for the management switch.
  • the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
  • S2 Collecting sample information by using the information collection module in the cluster controller, which may be sample data of the same time period in a week, or sample data of the same time period on the same day in a few weeks, and determining sample data according to the actual application scenario. Collecting sample data information is accomplished by the following substeps:
  • F i includes: controller number, switch label, switch flow table statistics, time stamp
  • P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp
  • M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp.
  • the timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
  • the super node uses the data processing module in the controller to predict the number of packet-in packets reported by the switches under each controller in the next time interval, the number of flow tables sent by the controller, and others according to the mathematical model of the least squares method.
  • the OF message statistics are implemented by step S4, step S5, and step S6, respectively:
  • the super node reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • S4.2 If the number of complete packet-in packet statistics information of the timestamp is less than N, the S2 is cyclically executed until the packet-in packet statistics information set of the N timestamps is obtained.
  • the super node obtains information statistics P 1 , P 2 , ..., P N of the packet-in packets of the N time stamps for each switch.
  • P i ⁇ controller number, switch number, timestamp X, packet-in message statistics Y ⁇ .
  • the regression analysis is used to calculate the packet-in packet statistics P inext of each switch under the control of the next timestamp .
  • the calculation formula is as follows:
  • n represents the number of sample data
  • X is equivalent to the timestamp
  • Y is the statistical value of the packet-in packet number of each switch
  • the super node reads the flow table statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • N a number of timestamps N
  • the complete flow table statistics information set refers to flows on all different switches of the same controller with the same timestamp. Table statistics and timestamps are recent;
  • Equation 1-1 For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate the flow table statistics of each switch with the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3.
  • the super node reads, from the cluster distributed shared storage system, other OF interaction information (hereinafter referred to as other OF information) reported by each controller except for the packet_in, which is implemented by the following substeps:
  • N determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
  • Equation 1-1 For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3.
  • n is the number of switches managed by each controller. Then calculate the ratio of the total number of packet-in packets of the entire controller cluster to the total number of maximum packet-in packets, the ratio of the total estimated statistical flow table to the total maximum flow table statistics, and the total estimate.
  • the ratio of other OF message statistics to the total maximum OF message statistics is recorded as P PHv , P FHv and P MHv , namely:
  • n is the number of switches managed by each controller.
  • S8.3 is executed for each controller in descending order, and after execution is completed, S8.6 is executed.
  • the controllers that are controlled by the controller are arranged in ascending order to obtain a switch queue
  • S8.4.4 cumulatively calculate the total sum of B inext to be removed from the switch. If it is not greater than B osize , continue to execute S8.4.4, otherwise execute S8.4.5;
  • FIG. 4 is a flow chart of tuning a switch into a controller in accordance with a preferred embodiment of the present invention. The specific steps are shown in FIG.
  • S8.6 The controller uses an internal switching control module to reconstruct the corresponding switch to implement load balancing. This step is implemented by the following sub-steps:
  • S8.6.1 The supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the outgoing controller number and the number of the transferred controller and execute S8.6.2. Otherwise skip this element.
  • slave-master mechanism exchange implements switch scheduling; the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers.
  • the preferred embodiment proposes a solution to the cluster controller load imbalance phenomenon.
  • the core idea of the solution is to use the mathematical model of the least squares method to packet-in packets, flow table numbers and other switches of each switch in the future time.
  • the OF message is predicted, and the historical data of the same time period is taken as a reference, and the estimated value is averaged, and then the statistical information of each controller is obtained according to the new average value, and the statistical information of the controller and the historical maximum value are obtained.
  • the ratio is compared with the load pressure value of the entire controller cluster. When the network traffic jitter is large, the number of switches controlled by each controller is adjusted in time, so that all the controllers receive the packet-in packet and the delivered flow table.
  • FIG. 5 is a flowchart of a cluster controller load balancing scheduling according to a preferred embodiment of the present invention. The entire processing flow is shown in FIG. 5.
  • FIG. 6 is a schematic diagram of the allocation of controllers and switches in the domain according to the preferred embodiment 1 of the present invention.
  • the SDN controller nodes A, B, and C are distributed in the domain.
  • the switch controlled by the A controller node includes sw1, sw2, and sw3;
  • the switch controlled by the B controller node includes sw4 and sw5;
  • the switch controlled by the C controller node includes sw6, sw7, and sw8; combined with Table 1, Table 2, and Table 3, Tables 4, 5, 6, and 7 describe the preferred embodiment in detail.
  • the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
  • S2 Collecting sample information by using an information collection module in the cluster controller.
  • the sample data collected in this example is statistical information of different timestamps of a time period on a certain day of the week. At the same time, the actual measurement information in the period of the previous week is collected as a reference, so that the estimated information is closer to the actual value.
  • Collecting sample data information is accomplished by the following substeps:
  • F i includes: controller number, switch label, switch flow table statistics, time stamp
  • P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp
  • M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp.
  • the timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
  • the super node uses the data processing module in the controller to predict the number of packet-in packets reported by the switches in each controller and the number of flow tables sent by the controller to the switch in the next time interval according to the mathematical model of the least squares method.
  • OF messages are respectively implemented by step S4, step S5 and step S6:
  • the super node A reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • S4.2 The set of complete packet-in packet statistics information of the timestamp is less than five, and the S2 is cyclically executed until the packet-in packet statistics information set of the five timestamps is obtained, and the obtained packet-in report is obtained.
  • the statistics of the text are shown in Table 1;
  • Table 3 Average number of actual measured values and estimated values of packet-in packets in one week
  • the super node A reads the flow table statistics information reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • the super node reads the statistics of the OF interaction information (hereinafter referred to as other OF information), which is reported by each controller, except for the packet_in, from the cluster distributed shared storage system, and is implemented by the following substeps:
  • N determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
  • Equation 1-1 For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3.
  • S7.5 Calculate the list of switches that should be called out. This step is implemented by the following substeps:
  • the switches are arranged in descending order according to the size of the inbound switch pool B inext , and the switch queue is obtained;
  • S7.7 Reconfigure the corresponding switch to implement load balancing. This step is implemented by the following substeps:
  • the supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the number of the switch-out controller and the number of the switch-in controller and execute S7.7.2. Otherwise skip this element;
  • slave-master mechanism exchange implement switch scheduling;
  • the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers; Shown.
  • the SDN controller nodes A, B, and C are distributed in the domain.
  • the switch controlled by the A controller node includes sw1, sw2, and sw3;
  • the switch managed by the B controller node includes sw4 and sw5;
  • the switch managed by the C controller node includes sw6, sw7, and sw8; the preferred embodiment will be described in detail below.
  • the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
  • S2 Collecting sample information by using an information collection module in the cluster controller.
  • the sample data collected in this example is statistical information of different timestamps of a time period on a certain day of the week. At the same time, the actual measurement information in the period of the previous week is collected as a reference, so that the estimated information is closer to the actual value.
  • Collecting sample data information is accomplished by the following substeps:
  • F i includes: controller number, switch label, switch flow table statistics, time stamp
  • P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp
  • M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp.
  • the timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
  • the super node uses the data processing module in the controller to predict the number of packet-in packets reported by the switches in each controller and the number of flow tables sent by the controller to the switch in the next time interval according to the mathematical model of the least squares method.
  • OF messages are respectively implemented by step S4, step S5 and step S6:
  • the super node A reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • S4.2 If less than five complete packet-in packet statistics information collection time stamps are obtained, S2 is executed cyclically until a packet-in packet statistical information set of five timestamps is obtained.
  • the super node A reads the flow table statistics information reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • the super node obtains five time-stamped flow table statistics F 1 , F 2 , F 3 , F 4 , and F 5 for each switch, and obtains such data:
  • F i ⁇ controller number, switch number, timestamp X, flow table statistics Y ⁇ ;
  • the super node reads the statistics of the OF interaction information (hereinafter referred to as other OF information), which is reported by each controller, except for the packet_in, from the cluster distributed shared storage system, and is implemented by the following substeps:
  • N determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
  • Equation 1-1 For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3;
  • the pool of the switch to be emptied is set to be empty; the number of packet-in packets obtained by the five timestamps is calculated: P PH1 , P PH2 , and P PH3 ;
  • the table statistics are calculated: P FH1 , P FH2 and P FH3 ;
  • the other OF messages obtained by the 5 time stamps are statistically calculated: P MH1 , P MH2 and P MH3 ;
  • the calculation controller always estimates the received packets
  • the ratio of the number of -in packets to the total number of packet-in packets is P PHv ; the ratio of the total number of flow tables sent by the controller to the total number of flows is P FHv ;
  • the ratio of the estimated number of other OF messages to the total number of other largest OF messages is P MHv ;
  • S7.3, P i and P v are obtained according to the formulas 1-10 and 1-11, S7.4 is performed on each controller in descending order with reference to P i , and S7.7 is executed after the execution is completed.
  • S7.5 Calculate the list of switches that should be called out. This step is implemented by the following substeps:
  • the number of controlled switches is adjusted according to the packet_in packet of each switch received by the controller, the number of flow tables sent by the controller, and other OF message data. Available:
  • B osize ( 1-0.5 ) * (0.5 * B posize + 0.5 * B fosize ) + 0.5 * B mosize ;
  • B isize ( 1-0.5 ) * (0.5 * B pisize + 0.5 * B fisize ) + 0.5 * B misize ;
  • the switches are arranged in descending order according to the size of the inbound switch pool B inext , and the switch queue is obtained;
  • S7.7 Reconfigure the corresponding switch to implement load balancing. This step is implemented by the following substeps:
  • the supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the number of the switch-out controller and the number of the switch-in controller and execute S7.7.2. Otherwise skip this element;
  • slave-master mechanism exchange implement switch scheduling;
  • the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers.
  • FIG. 7 is a schematic diagram of the intra-domain cascade controller and switch allocation according to a preferred embodiment 3 of the present invention.
  • an SDN controller node A, B, C and a super controller node D are distributed in the domain.
  • the switch controlled by the A controller node includes sw1, sw2, and sw3;
  • the switch managed by the B controller node includes sw4 and sw5;
  • the switch managed by the C controller node includes sw6, sw7, and sw8; the preferred embodiment will be described in detail below.
  • the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
  • S2 Collecting sample information by using an information collection module in the cluster controller.
  • the sample data collected in this example is statistical information of different timestamps of a time period on a certain day of the week. At the same time, the actual measurement information in the period of the previous week is collected as a reference, so that the estimated information is closer to the actual value.
  • Collecting sample data information is accomplished by the following substeps:
  • F i includes: controller number, switch label, switch flow table statistics, time stamp
  • P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp
  • M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp.
  • the timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
  • the super node D uses the data processing module in the controller to predict the number of packet-in packets reported by the switches in each controller and the flow table sent by the controller to the switch in the next time interval according to the mathematical model of the least squares method.
  • the number and other OF messages are implemented by Step 4, Step 5 and Step 6 respectively:
  • the super node D reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • S4.2 If less than five complete packet-in packet statistics information collection time stamps are obtained, S2 is executed cyclically until a packet-in packet statistical information set of five timestamps is obtained.
  • the super node D reads the flow table statistics information reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • the super node obtains five time-stamped flow table statistics F 1 , F 2 , F 3 , F 4 , and F 5 for each switch, and obtains such data:
  • F i ⁇ controller number, switch number, timestamp X, flow table statistics Y ⁇ ;
  • the super node D reads the statistics of the OF interaction information (hereinafter referred to as other OF information) except for the packet_in reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
  • N determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
  • Equation 1-1 For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3;
  • the pool of the switch to be emptied is set to be empty; the number of packet-in packets obtained by the five timestamps is calculated: P PH1 , P PH2 , and P PH3 ;
  • the table statistics are calculated: P FH1 , P FH2 and P FH3 ;
  • the other OF messages obtained by the 5 time stamps are statistically calculated: P MH1 , P MH2 and P MH3 ;
  • the calculation controller always estimates the received packets
  • the ratio of the number of -in packets to the total number of packet-in packets is P PHv ; the ratio of the total number of flow tables sent by the controller to the total number of maximum flow tables is P FHv ;
  • the ratio of the estimated number of other OF messages to the total number of other largest OF messages is P MHv ;
  • S7.3, P i and P v are obtained according to the formulas 1-10 and 1-11, S7.4 is performed on each controller in descending order with reference to P i , and S7.7 is executed after the execution is completed.
  • S7.5 Calculate the list of switches that should be called out. This step is implemented by the following substeps:
  • the number of controlled switches is adjusted according to the packet_in packet of each switch received by the controller, the number of flow tables sent by the controller, and other OF message data. Available:
  • B osize ( 1-0.5 ) * (0.5 * B posize + 0.5 * B fosize ) + 0.5 * B mosize ;
  • B isize ( 1-0.5 ) * (0.5 * B pisize + 0.5 * B fisize ) + 0.5 * B misize ;
  • the switches are arranged in descending order according to the size of the inbound switch pool B inext , and the switch queue is obtained;
  • S7.7 Reconfigure the corresponding switch to implement load balancing. This step is implemented by the following substeps:
  • the supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the number of the switch-out controller and the number of the switch-in controller and execute S7.7.2. Otherwise skip this element
  • slave-master mechanism exchange implement switch scheduling;
  • the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers.
  • a software is provided that is configured to perform the technical solutions described in the above embodiments and preferred embodiments.
  • a storage medium in which the above software is stored, including but not limited to an optical disk, a floppy disk, a hard disk, an erasable memory, and the like.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the method and apparatus for load balancing provided by the embodiments of the present invention have the following beneficial effects: solving the problem of uneven load of the cluster SDN controller in the related art, and performing load balancing through the estimated data, the manner It is highly achievable and improves the resource utilization efficiency of the cluster SDN controller.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed are a load balancing method and device. The method comprises: collecting the data on the feature parameters of multiple exchangers controlled by each software defined network (SDN) controller in a clustered SDN; according to the data, estimating the data of the feature parameters of the multiple exchangers at the next time point; performing, according to the estimated data, load balancing for the SDN controllers in the clustered SDN. The present invention solves the problem in the prior art of load imbalance of controllers in a clustered SDN, and balances the load by using estimated data. The method is implementable and enhances the resources utilization rate for controllers in a clustered SDN.

Description

负载均衡的方法及装置Load balancing method and device 技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种负载均衡的方法及装置。The present invention relates to the field of communications, and in particular to a method and apparatus for load balancing.
背景技术Background technique
软件定义网络(Software Defined Networks,简称为SDN)技术最初是由美国斯坦福大学clean slate研究组提出的一种新型网络创新架构。其核心技术Openflow(简称为OF)协议通过将网络设备控制面与数据面分离开来的方式,实现了网络流量的灵活控制,为核心网络及应用的创新提供了良好的平台。Software Defined Networks (SDN) technology was originally a new network innovation architecture proposed by the Stanford University clean slate research group. Its core technology Openflow (referred to as OF) protocol realizes flexible control of network traffic by separating the control plane of the network device from the data plane, and provides a good platform for innovation of core network and application.
SDN网络由三部分组成:包括SDN控制器、安全通道和SDN交换机。SDN控制器是根据OpenFlow协议设计的网络控制软件,设置为管理数据流、配置网络设备、制定流表(Flow Table)、承担网络业务与网络设备间的通讯。一个域中可以有多个控制器,但一般只有一个控制器处在控制、管理状态。SDN交换机由SDN控制器管控,保存有控制器制定的流表,并通过查询流表表项来决定对报文的处理方式,包括转发、缓存、提交控制器或丢弃等。OpenFlow协议下的安全通道用来连接交换机和控制器,以供二者进行通信。The SDN network consists of three parts: SDN controller, secure channel and SDN switch. The SDN controller is a network control software designed according to the OpenFlow protocol, and is configured to manage data streams, configure network devices, formulate flow tables, and undertake communication between network services and network devices. There can be multiple controllers in a domain, but generally only one controller is in control and management state. The SDN switch is controlled by the SDN controller, and the flow table defined by the controller is saved, and the flow table entry is queried to determine the processing mode of the packet, including forwarding, caching, submitting the controller, or discarding. The secure channel under the OpenFlow protocol is used to connect the switch to the controller for communication.
随着SDN技术的发展,SDN控制器集群技术也得到了越来越多的应用。在SDN网络多控制器架构下,各个控制器控制一定数量的交换机,如果某个控制器管控的交换机上报的packet-in报文过多或者下发的流表数量及与交换机的OF交互信息量过大,将会导致该控制器在某时刻产生较大的控制流,这种情况将会使得该控制器成为整个控制器集群处理网络流量的瓶颈,影响整个控制器集群的性能。With the development of SDN technology, SDN controller cluster technology has also been used more and more. In the SDN network multi-controller architecture, each controller controls a certain number of switches, if the number of packet-in packets reported by a controller controlled by a controller is excessive or the number of flow tables delivered and the amount of OF information exchanged with the switch Too large will cause the controller to generate a large control flow at a certain time. This situation will make the controller become the bottleneck of the entire controller cluster to handle network traffic, affecting the performance of the entire controller cluster.
在网络流量波动较大时,某个控制器下的交换机会上报大量的packet-in报文(OpenFlow协议的一种专用报文,专门用来将未能匹配上的流量,或者指定匹配的流量,发送给控制器)或者其它OF(OpenFlow)消息,控制器也可能会下发大量流表,而其他的控制器只接收到少量的packet-in报文和其它OF消息,此时该控制器下发的流表数量也不多,这就可能导致某些控制器控制过载,而某些控制器远远未达到控制负载饱和状态。为了缓解这种情况的发生,需要时刻对各个控制器管控的交换机进行调整,时刻实现控制器的负载均衡,提高整个控制器集群的控制性能。 When the network traffic fluctuates greatly, the switch on a controller reports a large number of packet-in packets (a special packet of the OpenFlow protocol, which is used to match the traffic on the fail or specify the matching traffic. , sent to the controller) or other OF (OpenFlow) messages, the controller may also send a large number of flow tables, while other controllers only receive a small number of packet-in messages and other OF messages, at this time the controller The number of flow tables issued is not large, which may cause some controllers to control overload, and some controllers are far from reaching control load saturation. In order to alleviate this situation, it is necessary to adjust the switches that are controlled by each controller at all times to realize load balancing of the controller at all times and improve the control performance of the entire controller cluster.
相关技术仅仅提出了在多个控制器间增加共享存储区域来实现控制器间通信,并未实现控制器负载均衡,然而当网络流量波动较大时,出现控制器负载不均的问题尚未得到解决。The related technology only proposes to increase the shared storage area between multiple controllers to realize inter-controller communication, and does not implement controller load balancing. However, when the network traffic fluctuates greatly, the problem of uneven controller load has not been solved. .
针对相关技术中集群SDN控制器负载不均的问题,目前尚未提出有效的解决方案。In view of the problem of uneven load of the cluster SDN controller in the related art, an effective solution has not been proposed yet.
发明内容Summary of the invention
本发明实施例提供了一种负载均衡的方法及装置,以至少解决相关技术中集群SDN控制器负载不均的问题。The embodiment of the invention provides a load balancing method and device to solve at least the problem of uneven load of the cluster SDN controller in the related art.
根据本发明的一个实施例,提供了一种负载均衡的方法,包括:收集集群软件定义网络SDN控制器的每个SDN控制器中管控的多个交换机的表征参数的数据;根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡。According to an embodiment of the present invention, a method for load balancing is provided, comprising: collecting data of characterization parameters of a plurality of switches controlled by each of the SDN controllers of the cluster software-defined network SDN controller; Determining, by the data of the characterization parameter of the switch, the data of the characterization parameter of the plurality of switches at a next moment; according to the estimated data of the plurality of switches at the next moment, the cluster SDN Each SDN controller of the controller performs load balancing.
本实施例中,所述表征参数包括以下至少之一:packet-in报文、流表数和其他OF消息。In this embodiment, the characterization parameter includes at least one of the following: a packet-in packet, a flow table number, and other OF messages.
本实施例中,预估所述多个交换机的所述表征参数在下一时刻的数据包括:使用最小二乘法预估所述多个交换机的所述表征参数在下一时刻的数据。In this embodiment, estimating data of the characterization parameter of the plurality of switches at a next moment includes: estimating data of the characterization parameter of the plurality of switches at a next moment using a least squares method.
本实施例中,使用最小二乘法预估所述多个交换机的所述表征参数在下一时刻的数据包括:对每个交换机,使用如下最小二乘法数学模型计算得出所述每个交换机的所述表征参数在下一时刻的数据:y=α+β*x,其中x为所述表征参数在当前时刻的数据,y为所述表征参数在下一时刻的数据;参数α和β值按照如下公式计算:In this embodiment, estimating the data of the characterization parameters of the plurality of switches at the next moment by using a least squares method includes: calculating, for each switch, the following each of the switches using a mathematical model of least squares Describe the data of the parameter at the next moment: y = α + β * x, where x is the data of the characterization parameter at the current time, y is the data of the characterization parameter at the next moment; the parameters α and β are according to the following formula Calculation:
Figure PCTCN2015071446-appb-000001
Figure PCTCN2015071446-appb-000001
其中n为当前统计周期中的时刻个数,X为时刻对应的时间戳,Y为每个交换机的所述表征参数的值。Where n is the number of times in the current statistical period, X is the timestamp corresponding to the time, and Y is the value of the characterization parameter of each switch.
本实施例中,所述表征参数的数据包括表征参数的样本历史数据以及所述表征参数在当前统计周期中各个时刻的数据;根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据包括:根据所述多个交换机的表征 参数的样本历史数据以及所述表征参数在当前统计周期中各个时刻的数据,预估所述多个交换机的所述表征参数在下一时刻的数据。In this embodiment, the data of the characterization parameter includes sample historical data of the characterization parameter and data of the characterization parameter at each moment in the current statistical period; and according to the data of the characterization parameters of the plurality of switches, the prediction is performed. The data of the characterization parameters of the switches at the next moment includes: characterization according to the plurality of switches The sample historical data of the parameter and the data of the characterization parameter at each moment in the current statistical period, and the data of the characterization parameter of the plurality of switches at the next moment are estimated.
本实施例中,预估所述多个交换机的所述表征参数在下一时刻的数据包括:根据所述表征参数在当前统计周期中各个时刻的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;将所述表征参数的样本历史数据与预估的所述表征参数在下一时刻的数据求和取平均。In this embodiment, estimating data of the characterization parameter of the multiple switches at a next moment includes: estimating the characterization of the multiple switches according to data of the characterization parameters at each moment in a current statistical period The data of the parameter at the next moment; the sample historical data of the characterization parameter is averaged with the estimated data of the characterization parameter at the next moment.
本实施例中,根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡包括:根据预估的所述多个交换机的所述表征参数在下一时刻的数据,计算每个控制器对于所述表征参数的预估值与其对应的历史最大值的比值PYHi:计算整个控制器集群对于所述表征参数的总预估值与总最大值的比值PYHv:将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机。In this embodiment, performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment includes: estimating the multiple Calculating, by the data of the switch at the next moment, the ratio of the estimated value of each of the controllers to the historical maximum value of the corresponding parameter P YHi : calculating the total pre-control cluster for the characterization parameter The ratio of the estimate to the total maximum value P YHv : Compare P YHi with P YHv and adjust the controller controlled by the controller according to the result of the comparison.
本实施例中,PYHi通过以下公式计算:In this embodiment, P YHi is calculated by the following formula:
Figure PCTCN2015071446-appb-000002
其中n为各个控制器管控的交换机个数,Yinext为控制器管理的各个交换机对于所述表征参数的预估值,Hiymax为控制器管理的各个交换机对于所述表征参数的历史最大值;和/或,PYHv通过以下公式计算:
Figure PCTCN2015071446-appb-000002
Where n is the number of switches managed by each controller, and Y inext is an estimated value of the characterization parameters of each switch managed by the controller, and H iymax is a historical maximum value of each characterization parameter of each switch managed by the controller; And / or, P YHv is calculated by the following formula:
Figure PCTCN2015071446-appb-000003
其中m表示控制器个数,n表示各个控制器管控的交换机个数,Yinext为控制器管理的各个交换机对于所述表征参数的预估值,Hiymax为管理的各个交换机控制器对于所述表征参数的历史最大值。
Figure PCTCN2015071446-appb-000003
Wherein m represents the number of controllers, n represents the number of switches controlled by each controller, and Y inext is an estimated value of the characterization parameters of each switch managed by the controller, and H iymax is the managed switch controller for the Characterizes the historical maximum of the parameter.
本实施例中,将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机包括:对多个不同的表征参数设置比例系数,其中,所述比例系数设置为表示各个表征参数在比较过程中所占的比重。In this embodiment, comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: setting a scaling factor for a plurality of different characterization parameters, wherein the scaling coefficient is set to represent each characterization parameter The proportion of the comparison process.
本实施例中,将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机包括:对于各个控制器,当其PYHi大于PYHv时,计算应调出的交换机,并根据计算 结果调出交换机;和/或,对于各个控制器,当其PYHi小于PYHv时,计算应调入的交换机,并根据计算结果调入交换机。In this embodiment, comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: for each controller, when the P YHi is greater than P YHv , calculating the switch that should be called, and according to The calculation result calls the switch; and/or, for each controller, when its P YHi is less than P YHv , the switch to be transferred is calculated, and is transferred to the switch according to the calculation result.
本实施例中,计算应调出的交换机,并根据计算结果调出交换机包括:对于控制器计算
Figure PCTCN2015071446-appb-000004
设为Byosize,并根据之前设置的比例系数得到Bosize,其中所述比例系数设置为表示多个表征参数在比较过程中所占的比重;根据对每个交换机的预估数据得出Binext=Yinext;根据Binext的值对该控制器管控的交换机升序排列,获得交换机队列;从所述交换机队列中自上而下选择交换机,并累计计算要移出交换机的Binext总和,若不大于Bosize则继续选择交换机;将选择的待调动的交换机加入到待调动交换机池,其中所述待调动交换机池设置为存储待调动的交换机信息。
In this embodiment, the switch that is to be called out is calculated, and the switch is called according to the calculation result, including: calculating for the controller
Figure PCTCN2015071446-appb-000004
Set to B yosize and get B osize according to the previously set scale factor, where the scale factor is set to represent the proportion of the plurality of characterization parameters in the comparison process; B inext is obtained based on the estimated data for each switch =Y inext ; according to the value of B inext , the controllers controlled by the controller are arranged in ascending order to obtain the switch queue; the switch is selected from the top to the bottom of the switch queue, and the total number of B inext to be removed from the switch is calculated, if not greater than The B osize continues to select the switch; the selected switch to be mobilized is added to the pool to be mobilized, and the pool to be mobilized is set to store the switch information to be mobilized.
本实施例中,计算应入的交换机,并根据计算结果调入交换机包括:对于控制器计算
Figure PCTCN2015071446-appb-000005
设为Byisize,并根据之前设置的比例系数得到Bisize,其中所述比例系数设置为表示多个表征参数在比较过程中所占的比重;根据Bisize的值对控制器做降序排列,然后依次根据控制器负载调入交换机。
In this embodiment, the switch that is to be input is calculated, and the switch is transferred according to the calculation result, including: calculating for the controller
Figure PCTCN2015071446-appb-000005
Set to B yisize and get B isize according to the previously set scale factor, where the scale factor is set to represent the proportion of the plurality of characterization parameters in the comparison process; the controller is arranged in descending order according to the value of B isize , and then Transfer to the switch according to the controller load.
本实施例中,依次根据控制器负载调入交换机包括:根据待调动交换机池中各个待调动交换机的Binext的值对交换机做降序排列,获得交换机队列,其中所述待调动交换机池设置为存储待调动的交换机信息;针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直至最后一个交换机。In this embodiment, the switch is sequentially loaded according to the controller load, and the switch is arranged in descending order according to the value of B inext of each switch to be transferred in the pool to be transferred, and the switch queue is set to be stored. Switch information to be mobilized; for each controller, select the switch from top to bottom from the above queue, compare B inext with B isize respectively, and if B inext > B isize , select the next switch, if B inext < B isize , the transfer controller number of the element corresponding to the switch in the pool to be transferred is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last switch.
根据本发明的另一实施例,提供了一种负载均衡的装置,包括:收集模块,设置为收集集群软件定义网络SDN控制器的每个SDN控制器中管控的多个交换机的表征参数的数据;预估模块,设置为根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;负载均衡模块,设置为根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡。According to another embodiment of the present invention, there is provided a load balancing apparatus, comprising: a collection module configured to collect data of characterization parameters of a plurality of switches controlled by each of the SDN controllers of the cluster software defined network SDN controller And an estimation module configured to estimate data of the characterization parameter of the plurality of switches at a next moment according to data of the characterization parameters of the plurality of switches; and the load balancing module is configured to be configured according to the prediction The characterization parameters of the switches are load balanced at each of the SDN controllers of the cluster SDN controller at the next time.
通过本发明,采用收集集群软件定义网络SDN控制器的每个SDN控制器中管控的多个交换机的表征参数的数据;根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡 的方式,解决了相关技术中集群SDN控制器负载不均的问题,通过预估的数据进行负载均衡,该方式可实现性强,提升了集群SDN控制器的资源使用效率。According to the present invention, the clustering software is used to define data of the characterization parameters of the plurality of switches controlled by each of the SDN controllers of the network SDN controller; and the plurality of switches are estimated according to the data of the characterization parameters of the plurality of switches. And characterizing the data of the parameter at the next moment; performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment The solution solves the problem of uneven load of the cluster SDN controller in the related technology, and performs load balancing through the estimated data, which is highly implementable and improves the resource utilization efficiency of the cluster SDN controller.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是根据本发明实施例的负载均衡的方法的流程图;1 is a flow chart of a method of load balancing according to an embodiment of the present invention;
图2是根据本发明实施例的负载均衡的装置的结构款图;2 is a structural diagram of a device for load balancing according to an embodiment of the present invention;
图3是根据本发明优选实施例的SDN控制器的结构框图;3 is a block diagram showing the structure of an SDN controller in accordance with a preferred embodiment of the present invention;
图4是根据本发明优选实施例的将交换机调入控制器的流程图;4 is a flow diagram of tuning a switch into a controller in accordance with a preferred embodiment of the present invention;
图5是根据本发明优选实施例的集群控制器负载均衡调度流程图;FIG. 5 is a flowchart of cluster controller load balancing scheduling according to a preferred embodiment of the present invention; FIG.
图6是根据本发明优选实施例1的域内控制器及交换机分配示意图;6 is a schematic diagram of allocation of an intra-domain controller and a switch according to a preferred embodiment 1 of the present invention;
图7是根据本发明优选实施例3的域内层叠控制器及交换机分配示意图。Figure 7 is a diagram showing the allocation of intra-domain cascade controllers and switches in accordance with a preferred embodiment 3 of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
相关技术仅仅提出了在多个控制器间增加共享存储区域来实现控制器间通信,并未实现控制器负载均衡,然而当网络流量波动较大时,出现控制器负载不均的问题尚未得到解决,本实施例通过网络流量预测和调度各个控制器管控交换机的方法解决了该问题。The related technology only proposes to increase the shared storage area between multiple controllers to realize inter-controller communication, and does not implement controller load balancing. However, when the network traffic fluctuates greatly, the problem of uneven controller load has not been solved. In this embodiment, the problem is solved by the method of network traffic prediction and scheduling each controller to control the switch.
在本实施例中,提供了一种负载均衡的方法,图1是根据本发明实施例的负载均衡的方法的流程图,如图1所示,该方法包括如下步骤:In this embodiment, a method for load balancing is provided. FIG. 1 is a flowchart of a method for load balancing according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps:
步骤S102,收集集群软件定义网络(SDN)控制器的每个SDN控制器中管控的多个交换机的表征参数的数据; Step S102, collecting data of characterization parameters of multiple switches managed by each SDN controller of the cluster software defined network (SDN) controller;
步骤S104,根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;Step S104: Estimating data of the characterization parameter of the multiple switches at a next moment according to data of the characterization parameters of the multiple switches;
步骤S106,根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡。Step S106: Perform load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment.
本实施例通过上述步骤,对每个SDN控制器中管控的多个交换机的表征参数的数据进行收集,并根据收集的数据对下一时刻的数据进行预估,然后根据预估的表征参数下一时刻的数据对各个SDN控制器进行负载均衡,从而实现了集群SDN控制器的负载均衡,解决了相关技术中集群SDN控制器负载不均的问题,通过预估的数据进行负载均衡,该方式可实现性强,提升了集群SDN控制器的资源使用效率。In this embodiment, the data of the characterization parameters of the plurality of switches controlled by each SDN controller are collected through the foregoing steps, and the data at the next moment is estimated according to the collected data, and then according to the estimated characterization parameters. The data of one moment is load-balanced to each SDN controller, thereby realizing the load balancing of the cluster SDN controller, solving the problem of uneven load of the cluster SDN controller in the related technology, and performing load balancing through the estimated data. It is highly achievable and improves the resource utilization efficiency of the cluster SDN controller.
本实施例中,所述表征参数包括以下至少之一:packet-in报文、流表数和其他OF消息。In this embodiment, the characterization parameter includes at least one of the following: a packet-in packet, a flow table number, and other OF messages.
本实施例中,预估所述多个交换机的所述表征参数在下一时刻的数据包括:使用最小二乘法预估所述多个交换机的所述表征参数在下一时刻的数据。In this embodiment, estimating data of the characterization parameter of the plurality of switches at a next moment includes: estimating data of the characterization parameter of the plurality of switches at a next moment using a least squares method.
本实施例中,使用最小二乘法预估所述多个交换机的所述表征参数在下一时刻的数据包括:对每个交换机,使用如下最小二乘法数学模型计算得出所述每个交换机的所述表征参数在下一时刻的数据:y=α+β*x,其中x为所述表征参数在当前时刻的数据,y为所述表征参数在下一时刻的数据;参数α和β值按照如下公式计算:In this embodiment, estimating the data of the characterization parameters of the plurality of switches at the next moment by using a least squares method includes: calculating, for each switch, the following each of the switches using a mathematical model of least squares Describe the data of the parameter at the next moment: y = α + β * x, where x is the data of the characterization parameter at the current time, y is the data of the characterization parameter at the next moment; the parameters α and β are according to the following formula Calculation:
Figure PCTCN2015071446-appb-000006
Figure PCTCN2015071446-appb-000006
其中n为当前统计周期中的时刻个数,X为时刻对应的时间戳,Y为每个交换机的所述表征参数的值。Where n is the number of times in the current statistical period, X is the timestamp corresponding to the time, and Y is the value of the characterization parameter of each switch.
本实施例中,所述表征参数的数据包括表征参数的样本历史数据以及所述表征参数在当前统计周期中各个时刻的数据;根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据包括:根据所述多个交换机的表征参数的样本历史数据以及所述表征参数在当前统计周期中各个时刻的数据,预估所述多个交换机的所述表征参数在下一时刻的数据。In this embodiment, the data of the characterization parameter includes sample historical data of the characterization parameter and data of the characterization parameter at each moment in the current statistical period; and according to the data of the characterization parameters of the plurality of switches, the prediction is performed. The data of the characterization parameters of the switches at the next moment includes: estimating the plurality of switches according to the sample historical data of the characterization parameters of the plurality of switches and the data of the characterization parameters at each moment in the current statistical period The data characterizing the parameter at the next moment.
本实施例中,预估所述多个交换机的所述表征参数在下一时刻的数据包括:根据所述表征参数在当前统计周期中各个时刻的数据,预估所述多个交换机的所述表征参 数在下一时刻的数据;将所述表征参数的样本历史数据与预估的所述表征参数在下一时刻的数据求和取平均。In this embodiment, estimating data of the characterization parameter of the multiple switches at a next moment includes: estimating the characterization of the multiple switches according to data of the characterization parameters at each moment in a current statistical period Reference Counting the data at the next moment; summing the sample historical data of the characterization parameters with the estimated data of the characterization parameters at the next moment.
本实施例中,根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡包括:根据预估的所述多个交换机的所述表征参数在下一时刻的数据,计算每个控制器对于所述表征参数的预估值与其对应的历史最大值的比值PYHi:计算整个控制器集群对于所述表征参数的总预估值与总最大值的比值PYHv:将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机。In this embodiment, performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment includes: estimating the multiple Calculating, by the data of the switch at the next moment, the ratio of the estimated value of each of the controllers to the historical maximum value of the corresponding parameter P YHi : calculating the total pre-control cluster for the characterization parameter The ratio of the estimate to the total maximum value P YHv : Compare P YHi with P YHv and adjust the controller controlled by the controller according to the result of the comparison.
本实施例中,PYHi通过以下公式计算:
Figure PCTCN2015071446-appb-000007
其中n为各个控制器管控的交换机个数,Yinext为控制器管理的各个交换机对于所述表征参数的预估值,Hiymax为控制器管理的各个交换机对于所述表征参数的历史最大值;和/或,
In this embodiment, P YHi is calculated by the following formula:
Figure PCTCN2015071446-appb-000007
Where n is the number of switches managed by each controller, and Y inext is an estimated value of the characterization parameters of each switch managed by the controller, and H iymax is a historical maximum value of each characterization parameter of each switch managed by the controller; and / or,
PYHv通过以下公式计算:
Figure PCTCN2015071446-appb-000008
其中m表示控制器个数,n表示各个控制器管控的交换机个数,Yinext为控制器管理的各个交换机对于所述表征参数的预估值,Hiymax为控制器管理的各个交换机对于所述表征参数的历史最大值。其中,这里的Yinext即为通过最小二乘法数学模型计算获得的结果y。
P YHv is calculated by the following formula:
Figure PCTCN2015071446-appb-000008
Wherein m represents the number of controllers, n represents the number of switches controlled by each controller, and Y inext is an estimated value of the characteristic parameters of each switch managed by the controller, and H iymax is the switch managed by the controller. Characterizes the historical maximum of the parameter. Among them, Y inext is the result y obtained by the least squares mathematical model.
本实施例中,将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机包括:对多个不同的表征参数设置比例系数,其中,所述比例系数设置为表示各个表征参数在比较过程中所占的比重。In this embodiment, comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: setting a scaling factor for a plurality of different characterization parameters, wherein the scaling coefficient is set to represent each characterization parameter The proportion of the comparison process.
本实施例中,将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机包括:对于各个控制器,当其PYHi大于PYHv时,计算应调出的交换机,并根据计算结果调出交换机;和/或,对于各个控制器,当其PYHi小于PYHv时,计算应调入的交换机,并根据计算结果调入交换机。 In this embodiment, comparing P YHi with P YHv and adjusting the controller controlled by the controller according to the comparison result includes: for each controller, when the P YHi is greater than P YHv , calculating the switch that should be called, and according to The calculation result calls the switch; and/or, for each controller, when its P YHi is less than P YHv , the switch to be transferred is calculated, and is transferred to the switch according to the calculation result.
本实施例中,计算应调出的交换机,并根据计算结果调出交换机包括:对于控制器计算
Figure PCTCN2015071446-appb-000009
设为Byosize,并根据之前设置的比例系数得到Bosize,其中所述比例系数设置为表示多个表征参数在比较过程中所占的比重;根据对每个交换机的预估数据得出Binext=Yinext;根据Binext的值对该控制器管控的交换机升序排列,获得交换机队列;从所述交换机队列中自上而下选择交换机,并累计计算要移出交换机的Binext总和,若不大于Bosize则继续选择交换机;将选择的待调动的交换机加入到待调动交换机池,其中所述待调动交换机池设置为存储待调动的交换机信息。
In this embodiment, the switch that is to be called out is calculated, and the switch is called according to the calculation result, including: calculating for the controller
Figure PCTCN2015071446-appb-000009
Set to B yosize and get B osize according to the previously set scale factor, where the scale factor is set to represent the proportion of the plurality of characterization parameters in the comparison process; B inext is obtained based on the estimated data for each switch =Y inext ; according to the value of B inext , the controllers controlled by the controller are arranged in ascending order to obtain the switch queue; the switch is selected from the top to the bottom of the switch queue, and the total number of B inext to be removed from the switch is calculated, if not greater than The B osize continues to select the switch; the selected switch to be mobilized is added to the pool to be mobilized, and the pool to be mobilized is set to store the switch information to be mobilized.
本实施例中,计算应入的交换机,并根据计算结果调入交换机包括:对于控制器计算
Figure PCTCN2015071446-appb-000010
设为Byisize,并根据之前设置的比例系数得到Bisize,其中所述比例系数设置为表示多个表征参数在比较过程中所占的比重;根据Bisize的值对控制器做降序排列,然后依次根据控制器负载调入交换机。
In this embodiment, the switch that is to be input is calculated, and the switch is transferred according to the calculation result, including: calculating for the controller
Figure PCTCN2015071446-appb-000010
Set to B yisize and get B isize according to the previously set scale factor, where the scale factor is set to represent the proportion of the plurality of characterization parameters in the comparison process; the controller is arranged in descending order according to the value of B isize , and then Transfer to the switch according to the controller load.
本实施例中,依次根据控制器负载调入交换机包括:根据待调动交换机池中各个待调动交换机的Binext的值对交换机做降序排列,获得交换机队列,其中所述待调动交换机池设置为存储待调动的交换机信息;针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直至最后一个交换机。In this embodiment, the switch is sequentially loaded according to the controller load, and the switch is arranged in descending order according to the value of B inext of each switch to be transferred in the pool to be transferred, and the switch queue is set to be stored. Switch information to be mobilized; for each controller, select the switch from top to bottom from the above queue, compare B inext with B isize respectively, and if B inext > B isize , select the next switch, if B inext < B isize , the transfer controller number of the element corresponding to the switch in the pool to be transferred is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last switch.
对应于上述负载均衡方法,在本实施例中还提供了一种负载均衡的装置,该装置设置为实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。Corresponding to the load balancing method described above, a device for load balancing is also provided in the embodiment, and the device is configured to implement the foregoing embodiments and preferred embodiments, and details are not described herein. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图2是根据本发明实施例的负载均衡的装置的结构款图,如图2所示,该装置包括:收集模块22、预估模块24和负载均衡模块26,下面对各个模块进行详细说明:2 is a structural diagram of a device for load balancing according to an embodiment of the present invention. As shown in FIG. 2, the device includes: a collection module 22, an estimation module 24, and a load balancing module 26. The following describes each module in detail. :
收集模块22,设置为收集集群软件定义网络SDN控制器的每个SDN控制器中管控的多个交换机的表征参数的数据;预估模块24,与收集模块22相连,设置为根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;负载均衡模块26,与预估模块24相连,设置为根据预估的所述多个交换机 的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡。The collecting module 22 is configured to collect data of the characterization parameters of the plurality of switches that are controlled by each of the SDN controllers of the cluster software-defined network SDN controller; the estimating module 24 is connected to the collecting module 22, and is configured to be configured according to the multiple Determining, by the data of the characterization parameter of the switch, the data of the characterization parameter of the plurality of switches at a next moment; the load balancing module 26 is connected to the estimation module 24 and configured to be based on the estimated plurality of switches The characterization parameters are data of the next moment, and load balancing is performed on each SDN controller of the cluster SDN controller.
下面结合优选实施例进行说明,以下优选实施例主要以上述表征参数为packet-in报文数和下发流表及其他OF信息这三种类型为例进行详细说明,该优选实施例结合了上述实施例及其优选实施方式。The following is a detailed description of the preferred embodiment. The following preferred embodiments mainly describe the three types of the packet-in packet number, the outgoing flow table, and other OF information. The preferred embodiment combines the foregoing. Embodiments and preferred embodiments thereof.
在以下优选实施例中,提供了一种实现SDN控制器负载均衡优化的方法和装置,即在分布式SDN网络控制器集群场景中,提出了一种对控制器接收到的packet-in报文数和下发流表及其他OF信息进行合理预测并进行优化,使得各个控制器实现负载均衡。In the following preferred embodiments, a method and apparatus for implementing load balancing optimization of an SDN controller are provided, that is, in a distributed SDN network controller cluster scenario, a packet-in packet received by the controller is proposed. The number and the downstream flow table and other OF information are reasonably predicted and optimized, so that each controller achieves load balancing.
本优选实施例主要应用于SDN网络域内,该域内有多个控制器,每个控制器管控一定数量的交换机,对于每一个交换机只有一个控制器处于管控状态,其它处于备用状态,根据packet_in消息、流表数量和其它OF消息的数据预测,然后与相应的历史统计数据做平均,进行数据综合,作为调整优化控制器负载的依据,并动态调整控制器管控的交换机。该优选实施例包含如下两部分内容,分别是在SDN控制器中新增集群控制器调度装置和详细实施步骤:The preferred embodiment is mainly applied to an SDN network domain. There are multiple controllers in the domain. Each controller controls a certain number of switches. For each switch, only one controller is in the control state, and the other is in the standby state. According to the packet_in message, The number of flow tables and other OF messages are predicted by the data, and then averaged with the corresponding historical statistics to perform data synthesis, as a basis for adjusting the controller load, and dynamically adjusting the controllers controlled by the controller. The preferred embodiment includes the following two parts, namely, adding a cluster controller scheduling device in the SDN controller and detailed implementation steps:
集群控制器调度装置:图3是根据本发明优选实施例的SDN控制器的结构框图,如图3所示,在SDN控制器中新增了集群控制器调度装置主要包含以下四个内部模块:Cluster controller scheduling device: FIG. 3 is a structural block diagram of an SDN controller according to a preferred embodiment of the present invention. As shown in FIG. 3, a cluster controller scheduling device newly added to the SDN controller mainly includes the following four internal modules:
信息收集模块:根据采样时间周期收集管控的每个交换机的packet-in报文、流表数和其他OF消息的样本历史数据或者收集当前每个交换机的packet-in报文、流表数和其他OF消息数据。时间周期可以是一周内每天相同时段的时间戳也可以是几周内同一天同一时段的时间戳,根据实际使用场景确定。The information collection module collects packet-in packets, flow table numbers, and sample history data of other OF messages according to the sampling time period, or collects packet-in packets, flow table numbers, and other current switches of each switch. OF message data. The time period may be a time stamp of the same time period of the week or a time stamp of the same time period of the same day in a few weeks, and is determined according to the actual use scenario.
数据处理模块:主要根据收集的每个交换机的packet-in、流表数和其他OF信息统计采用相关算法进行数据综合处理,获取期望的数据。Data processing module: The data is comprehensively processed according to the packet-in, the number of flow tables, and other OF information statistics of each switch collected to obtain the desired data.
调度模块:根据数据处理模块得出的每个控制器的负载压力与集群控制器负载压力的对比,调整每个控制器管控的交换机,使得各个控制器负载压力均衡。Dispatching module: According to the comparison between the load pressure of each controller and the load pressure of the cluster controller obtained by the data processing module, the switches controlled by each controller are adjusted, so that the load pressure of each controller is balanced.
切换模块:根据各个控制器对管控的交换机的调度结果,采用slave-master(主从机制,也可以写为master-slave)机制调换各个控制器对于管控交换机的角色。Switching module: According to the scheduling result of each controller to the controlled switch, the slave-master (master-slave mechanism, also can be written as master-slave) mechanism is used to exchange the roles of each controller for the management switch.
基于上述结构,本优选实施例的实现步骤如下: Based on the above structure, the implementation steps of the preferred embodiment are as follows:
S1,集群控制器调度开始:控制器设置packet-in数量的历史最大值为Hipmax、流表数的历史最大值为Hifmax和其它OF消息的历史最大值为Himmax,并分别设为0。S1, the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
S2,采用集群控制器中的信息收集模块收集样本信息,可以是一周内每天相同时段的样本数据,也可以是几周内同一天同一时段的样本数据,根据实际应用场景确定样本数据。收集样本数据信息由以下子步骤实现:S2: Collecting sample information by using the information collection module in the cluster controller, which may be sample data of the same time period in a week, or sample data of the same time period on the same day in a few weeks, and determining sample data according to the actual application scenario. Collecting sample data information is accomplished by the following substeps:
S2.1,在相同的时间间隔内,由集群中的超级节点发起所管控集群的控制器的信息收集命令;集群中所有控制器开始向其管控的交换机收集packet-in报文个数和统计流表数量及其他OF信息;S2.1: In the same time interval, the super node in the cluster initiates an information collection command of the controller of the controlled cluster; all controllers in the cluster start collecting packet-in packets and statistics from the switch that is controlled by the cluster. Number of flow tables and other OF information;
S2.2,当控制器收集到所有管控交换机的统计信息,开始向集群分布式共享存储系统发送流表、packet_in和其他OF消息的统计信息,分别记为Fi、Pi和Mi,其中Fi包括:控制器编号,交换机标号,交换机流表统计,时间戳;Pi包括:控制器编号、交换机标号、交换机上送的packet-in报文数、时间戳;Mi包括:控制器编号、交换机标号、交换机与控制器除packet_in之外的其他OF信息、时间戳。所述时间戳是指收集到所有管控交换机的应答消息的时刻。所有信息会作为历史参考或及时预测使用。S2.2, when the controller collects statistics of all the management switches, starts to send statistics of the flow table, packet_in, and other OF messages to the cluster distributed shared storage system, and records them as F i , P i , and M i , respectively. F i includes: controller number, switch label, switch flow table statistics, time stamp; P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp; M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp. The timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
S3,超级节点使用控制器中的数据处理模块根据最小二乘法的数学模型预测下一个时间间隔内各个控制器下的交换机上报的packet-in报文数、控制器下发的流表数和其它OF消息统计,分别通过步骤S4、步骤S5和步骤S6来实现:S3, the super node uses the data processing module in the controller to predict the number of packet-in packets reported by the switches under each controller in the next time interval, the number of flow tables sent by the controller, and others according to the mathematical model of the least squares method. The OF message statistics are implemented by step S4, step S5, and step S6, respectively:
S4,根据时间戳,超级节点从集群分布式共享存储系统中读取每个控制器上报的packet-in报文统计信息,通过以下子步骤来实现:S4: According to the timestamp, the super node reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S4.1,这里确定时间戳个数N,即尝试获取N个时间戳的完整packet-in报文统计信息集合;所述完整packet-in报文统计信息集合是指同一控制器同一时间戳的所有不同的交换机上报的packet-in报文统计信息且时间戳是最近的;S4.1, where the number of timestamps N is determined, that is, a complete packet-in packet statistics information set that attempts to acquire N timestamps; the complete packet-in packet statistics information set refers to the same timestamp of the same controller. Packet-in packet statistics reported by all the switches and the timestamp is the most recent;
S4.2若获取时间戳的完整packet-in报文统计信息集合不到N个,循环执行S2,直到获取到N个时间戳的packet-in报文统计信息集合;S4.2: If the number of complete packet-in packet statistics information of the timestamp is less than N, the S2 is cyclically executed until the packet-in packet statistics information set of the N timestamps is obtained.
S4.3,根据上述packet-in报文统计信息集合,超级节点针对每个交换机累计获得N个时间戳的packet-in报文的信息统计P1、P2、……、PN,即获得了这样的数据:Pi={控制器编号、交换机编号、时间戳X、packet-in报文统计信息Y}。 S4.3, according to the packet-in packet statistics information set, the super node obtains information statistics P 1 , P 2 , ..., P N of the packet-in packets of the N time stamps for each switch. Such data: P i = {controller number, switch number, timestamp X, packet-in message statistics Y}.
S4.4,若上述N个时间戳的控制器的packet-in报文信息统计最大的那一个大于控制器的历史packet-in报文统计Hipmax,则
Figure PCTCN2015071446-appb-000011
Figure PCTCN2015071446-appb-000012
S4.4. If the packet with the highest packet-in packet information of the N timestamps is greater than the historical packet-in packet statistics of the controller , the ipmax is
Figure PCTCN2015071446-appb-000011
Figure PCTCN2015071446-appb-000012
S4.5,对集群控制器管控下的每个交换机,使用最小二乘法数学模型:S4.5, using a least squares mathematical model for each switch under the control of the cluster controller:
y=α+β*x,                      (式1-1)y=α+β*x, (Equation 1-1)
通过回归分析计算得出下一个时间戳的各个控制器管控下每个交换机的packet-in报文统计信息Pinext,计算公式如下:The regression analysis is used to calculate the packet-in packet statistics P inext of each switch under the control of the next timestamp . The calculation formula is as follows:
Figure PCTCN2015071446-appb-000013
       (式1-2)
Figure PCTCN2015071446-appb-000013
(Formula 1-2)
Figure PCTCN2015071446-appb-000014
       (式1-3)
Figure PCTCN2015071446-appb-000014
(Formula 1-3)
其中:n代表样本数据个数,X相当于时间戳,Y为每个交换机的packet-in报文个数统计值,分别求出参数α和β值,然后预估下一时刻交换机的packet-in报文信息。Where: n represents the number of sample data, X is equivalent to the timestamp, and Y is the statistical value of the packet-in packet number of each switch, and the parameters α and β are respectively obtained, and then the packet of the switch at the next moment is estimated. In message information.
S4.6,为了使得预估值更加接近实际值,根据样本数据的取样周期,实际测量前几个周期内该时间戳交换机的packet-in报文数量的实际值,然后与预估值求和取平均,得到更加精确的预估值。S4.6, in order to make the estimated value closer to the actual value, according to the sampling period of the sample data, actually measure the actual value of the number of packet-in packets of the timestamp switch in the first few cycles, and then sum with the estimated value. Take the average to get a more accurate estimate.
S5,根据时间戳,超级节点从集群分布式共享存储系统中读取每个控制器上报的流表统计信息,通过以下子步骤来实现:S5. According to the timestamp, the super node reads the flow table statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S5.1,确定时间戳个数N,即尝试获取N个时间戳的完整流表统计信息集合;所述完整流表统计信息集合是指同一控制器同一时间戳的所有不同的交换机上的流表统计信息且时间戳是最近的;S5.1, determining a number of timestamps N, that is, a complete flow table statistics information set that attempts to acquire N timestamps; the complete flow table statistics information set refers to flows on all different switches of the same controller with the same timestamp. Table statistics and timestamps are recent;
S5.2,若获取时间戳的完整流表统计信息集合不到N个,循环执行S2,直到获取到N个时间戳的流表统计信息集合; S5.2, if less than N sets of complete flow table statistics information of the timestamp are obtained, performing S2 cyclically until obtaining a flow table statistical information set of N timestamps;
S5.3,根据上述流表统计信息集合,超级节点针对每个交换机累计获得N个时间戳的流表统计信息F1、F2、……、FN,即获得了这样的数据:Fi={控制器编号、交换机编号、时间戳X、流表统计Y}。S5.3. According to the foregoing flow table statistics information set, the super node obtains N time-stamped flow table statistics F 1 , F 2 , . . . , F N for each switch, that is, obtains such data: F i = {controller number, switch number, timestamp X, flow table statistics Y}.
S5.4,若上述N个时间戳的控制器流表统计最大的那一个大于控制器的历史流表统计Hifmax,则
Figure PCTCN2015071446-appb-000015
S5.4, if the one of the N timestamps of the controller flow table statistics is greater than the controller's historical flow table statistics H ifmax , then
Figure PCTCN2015071446-appb-000015
S5.5,对集群控制器中各控制器管控的每个交换机,使用最小二乘法数学模型(见式1-1)通过回归分析计算得出下一时间戳的各个交换机的流表统计信息Finext,计算公式见式1-2和式1-3。S5.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate the flow table statistics of each switch with the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3.
S5.6,为了使得预估值更加接近实际值,根据样本数据的取样周期,取实际测量前几个周期内该时间戳交换机的流表统计信息的实际值,然后与预估值求和取平均,得到更加精确的预估值。S5.6, in order to make the estimated value closer to the actual value, according to the sampling period of the sample data, take the actual value of the flow table statistical information of the time stamp switch in the first few cycles of the actual measurement, and then sum with the estimated value On average, get a more accurate estimate.
S6,根据时间戳,超级节点从集群分布式共享存储系统中读取每个控制器上报的除packet_in之外的其他OF交互信息(以后简称其他OF信息),通过以下子步骤来实现:S6. According to the timestamp, the super node reads, from the cluster distributed shared storage system, other OF interaction information (hereinafter referred to as other OF information) reported by each controller except for the packet_in, which is implemented by the following substeps:
S6.1,确定时间戳个数N,即尝试获取N个时间戳的完整其他OF信息统计集合;所述完整其它OF信息集合是指同一控制器同一时间戳的所有不同的交换机与控制器的除packet_in之外的所有OF交互统计信息且时间戳是最近的;S6.1, determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
S6.2,若获取时间戳的完整其它OF信息统计集合不到N个,循环执行S2,直到获取到N个时间戳的其它OF信息统计集合;S6.2, if less than N complete sets of other OF information statistics are obtained, the S2 is executed cyclically until the other OF information statistics sets of the N timestamps are obtained;
S6.3,根据上述其它OF信息统计集合,超级节点针对每个交换机累计获得N个时间戳的其它OF信息统计M1、M2、……、MN,即获得了这样的数据:Mi={控制器编号、交换机编号、时间戳X、其它信息统计Y}。S6.3. According to the foregoing other information collection set of OF information, the super node accumulates other OF information statistics M 1 , M 2 , . . . , M N of N time stamps for each switch, that is, obtains such data: M i = {controller number, switch number, timestamp X, other information statistics Y}.
S6.4,若上述N个时间戳的控制器其它OF信息统计最大的那一个大于控制器的历史其它OF信息统计Himmax,则
Figure PCTCN2015071446-appb-000016
S6.4. If the other one of the N timestamps has the largest OF information, the larger one is greater than the history of the controller, and the other OF information statistics H immax , then
Figure PCTCN2015071446-appb-000016
S6.5,对集群控制器中各控制器管控的每个交换机,使用最小二乘法数学模型(见式1-1)通过回归分析计算得出下一时间戳的各个交换机的其它OF统计信息Minext,计算公式见式1-2和式1-3。 S6.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3.
S6.6,为了使得预估值更加接近实际值,根据样本数据的取样周期,取实际测量前几个周期内该时间戳交换机的其它OF统计信息的实际值,然后与预估值求和取平均,得到更加精确的预估值。S6.6, in order to make the estimated value closer to the actual value, according to the sampling period of the sample data, take the actual value of the other OF statistical information of the timestamp switch in the first few cycles of the actual measurement, and then sum with the estimated value. On average, get a more accurate estimate.
S7,根据对控制器在某一时刻的packet-in报文个数和流表统计信息及其它OF信息的预估,分别计算各个控制器对于packet-in和流表统计及其它OF信息的预估值与其对应的历史最大值的比值,分别记为PPHi、PFHi和PMHi,即:S7, according to the estimation of the number of packet-in packets and the flow table statistics and other OF information of the controller at a certain time, respectively, calculate the pre-preparation of each controller for the packet-in and flow table statistics and other OF information. The ratio of the valuation to its corresponding historical maximum is recorded as P PHi , P FHi and P MHi , respectively:
Figure PCTCN2015071446-appb-000017
            (式1-4)
Figure PCTCN2015071446-appb-000017
(Formula 1-4)
Figure PCTCN2015071446-appb-000018
            (式1-5)
Figure PCTCN2015071446-appb-000018
(Equation 1-5)
Figure PCTCN2015071446-appb-000019
            (式1-6)
Figure PCTCN2015071446-appb-000019
(Equation 1-6)
其中,n表示各个控制器管控的交换机个数。然后再计算整个控制器集群总预估的packet-in报文个数与总最大packet-in报文个数的比值、总预估的统计流表与总最大流表统计的比值和总预估的其它OF消息统计与总最大OF消息统计的比值,分别记为PPHv、PFHv和PMHv,即:Where n is the number of switches managed by each controller. Then calculate the ratio of the total number of packet-in packets of the entire controller cluster to the total number of maximum packet-in packets, the ratio of the total estimated statistical flow table to the total maximum flow table statistics, and the total estimate. The ratio of other OF message statistics to the total maximum OF message statistics is recorded as P PHv , P FHv and P MHv , namely:
Figure PCTCN2015071446-appb-000020
              (式1-7)
Figure PCTCN2015071446-appb-000020
(Equation 1-7)
Figure PCTCN2015071446-appb-000021
              (式1-8)
Figure PCTCN2015071446-appb-000021
(Equation 1-8)
Figure PCTCN2015071446-appb-000022
              (式1-9)
Figure PCTCN2015071446-appb-000022
(Equation 1-9)
其中,m表示控制器个数,n表示各个控制器管控的交换机个数。Where m is the number of controllers and n is the number of switches managed by each controller.
S8,根据实际数据计算得出PPHi、PFHi和PMHi,分别与计算得出的PPHv、PFHv和PMHv进行比较,根据比较的结果大小控制器使用内部调度模块调整各个控制器管控的交换机,实现负载均衡,该步骤通过以下子步骤来实现:S8, calculating P PHi , P FHi and P MHi according to actual data, respectively comparing with the calculated P PHv , P FHv and P MHv , according to the comparison result size controller using internal scheduling module to adjust each controller control The switch implements load balancing. This step is implemented by the following substeps:
S8.1,要待调动交换机池设为空,待调动交换机池装载这样的元素EF::={转出控制器编号,交换机编号,交换机流表统计数,转入控制器编号};EP::={转出控制器编号,交换机编号,packet-in报文数,转入控制器编号};EM::={转出控制器编号,交换机编号,其它OF消息统计数,转入控制器编号}。S8.1, to be mobilized, the switch pool is set to be empty, and the switch pool is to be loaded with such elements EF::={transfer controller number, switch number, switch flow table statistics, transfer to controller number}; EP: :={Transfer controller number, switch number, packet-in packet number, transfer to controller number}; EM::={transfer controller number, switch number, other OF message statistics, transfer to controller Numbering}.
S8.2,根据集群控制器的具体应用场景,设置比例系数x、y,设置为表征是根据packet-in报文数还是流表数或者其它OF消息统计数量来调整各个控制器管控的交换机,以达到各个控制器负载均衡的目的。得出以下公式:S8.2. Set the scaling factor x and y according to the specific application scenario of the cluster controller, and set the metric to adjust the switch controlled by each controller according to the packet-in packet number or the flow table number or other OF message statistics. In order to achieve the purpose of load balancing of each controller. The following formula is obtained:
Pi=(1-y)*(x*PPHi+(1-x)*PMHi)+y*PFHi      (式1-10)P i =(1-y)*(x*P PHi +(1-x)*P MHi )+y*P FHi (Formula 1-10)
Pv=(1-y)*(x*PPHv+(1-x)*PMHv)+y*PFHv      (式1-11)P v =(1-y)*(x*P PHv +(1-x)*P MHv )+y*P FHv (Formula 1-11)
其中:0<=x<=1,0<=y<=1;Where: 0<=x<=1, 0<=y<=1;
参照Pi以降序对各个控制器执行S8.3,执行完毕后执行S8.6。Referring to P i , S8.3 is executed for each controller in descending order, and after execution is completed, S8.6 is executed.
S8.3,对于各个控制器,当其Pi大于Pv时,执行8.4,否则执行S8.5。S8.3, for each controller, when its P i is greater than P v , 8.4 is performed, otherwise S8.5 is performed.
S8.4,计算应调出的交换机列表,该步骤通过以下子步骤来实现:S8.4, calculating the list of switches that should be called out, this step is implemented by the following sub-steps:
S8.4.1,对于控制器分别计算
Figure PCTCN2015071446-appb-000023
设为Bposize
Figure PCTCN2015071446-appb-000024
设为Bfosize
Figure PCTCN2015071446-appb-000025
设为Bmosize,则根据之前设置的比例系数可得:
S8.4.1, separately calculated for the controller
Figure PCTCN2015071446-appb-000023
Set to B posize ,
Figure PCTCN2015071446-appb-000024
Set to B fosize ,
Figure PCTCN2015071446-appb-000025
Set to B mosize , according to the scale factor previously set:
Bosize=(1-y)*(x*Bposize+(1-x)*Bmosize)+y*Bfosize     (式1-12) B osize =(1-y)*(x*B posize +(1-x)*B mosize )+y*B fosize (Equation 1-12)
其中0<=x<=1,0<=y<=1;Where 0<=x<=1, 0<=y<=1;
S8.4.2,根据对每个交换机的预估数据得出以下公式:S8.4.2, based on the estimated data for each switch, the following formula is obtained:
Binext=(1-y)*(x*Pinext+(1-x)*Minext)+y*Finext    (式1-13)B inext =(1-y)*(x*P inext +(1-x)*M inext )+y*F inext (Equation 1-13)
根据Binext多少对该控制器管控的交换机升序排列,获得交换机队列;According to B inext, the controllers that are controlled by the controller are arranged in ascending order to obtain a switch queue;
S8.4.3,从上述队列中自上而下选择交换机;S8.4.3, selecting a switch from top to bottom from the above queue;
S8.4.4,累计计算要移出交换机的Binext总和,若不大于Bosize则继续执行S8.4.4,否则执行S8.4.5;S8.4.4, cumulatively calculate the total sum of B inext to be removed from the switch. If it is not greater than B osize , continue to execute S8.4.4, otherwise execute S8.4.5;
S8.4.5,将这些待调动的交换机编号,连同控制器编号,Binext加入到待调动交换机池,其中转入控制器编号为空。S8.4.5, the number of the switch to be transferred, together with the controller number, B inext is added to the pool to be transferred, where the number of the transferred controller is null.
S8.5,计算应调入的交换机列表,该步骤通过以下子步骤来实现:S8.5, calculating the list of switches to be tuned, this step is implemented by the following sub-steps:
S8.5.1,对于控制器分别计算
Figure PCTCN2015071446-appb-000026
设为Bpisize
Figure PCTCN2015071446-appb-000027
设为Bfisize
Figure PCTCN2015071446-appb-000028
设为Bmisize。则根据之前设置的比例系数可得:
S8.5.1, calculated separately for the controller
Figure PCTCN2015071446-appb-000026
Set to B pisize ,
Figure PCTCN2015071446-appb-000027
Set to B fisize ,
Figure PCTCN2015071446-appb-000028
Set to B misize . According to the previously set scale factor can be obtained:
Bisize=(1-y)*(x*Bpisize+(1-x)*Bmisize)+y*Bfisize    (式1-14)B isize =(1-y)*(x*B pisize +(1-x)*B misize )+y*B fisize (Equation 1-14)
其中0<=x<=1,0<=y<=1。Where 0<=x<=1, 0<=y<=1.
S8.5.2,根据Bisize大小对控制器做降序排列,然后依次根据控制器负载调入交换机,具体由以下子步骤实现:S8.5.2, sorting the controllers in descending order according to the size of Bize , and then transferring them to the switch according to the load of the controller, which is implemented by the following substeps:
S8.5.2.1,根据待调动交换机池Binext大小对交换机做降序排列,获得交换机队列。S8.5.2.1: The switches are arranged in descending order according to the size of the inbound switch pool B inext to obtain the switch queue.
S8.5.2.2,针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直到检查到最后一个交换机,图4是根据本发明优选实施例的将交换机调入控制器的流程图,具体步骤见图4所示。 S8.5.2.2, for each controller, select the switch from top to bottom from the above queue, compare B inext with B isize respectively, and if B inext >B isize , select the next switch, if B inext < B isize , the transfer controller number of the element corresponding to the switch in the pool to be transferred is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last check is checked. Switch, FIG. 4 is a flow chart of tuning a switch into a controller in accordance with a preferred embodiment of the present invention. The specific steps are shown in FIG.
S8.6,控制器采用内部的切换控制模块重构对应交换机,实现负载均衡,该步骤通过以下子步骤来实现:S8.6: The controller uses an internal switching control module to reconstruct the corresponding switch to implement load balancing. This step is implemented by the following sub-steps:
S8.6.1,超级节点对待调动交换机池中每一元素,若转入控制器编号不为空,则向转出控制器编号对应的交换机和转入控制器编号转移交换机命令并执行S8.6.2,否则略过此元素。S8.6.1: The supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the outgoing controller number and the number of the transferred controller and execute S8.6.2. Otherwise skip this element.
S8.6.2,依据slave-master机制调换,实现交换机调度;所述slave-master机制调换由OpenFlow协议设定,设置为改变多控制器控制时不同控制器的角色。S8.6.2, according to the slave-master mechanism exchange, implements switch scheduling; the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers.
S9,本次调度结束,下一时间间隔重复执行S2。S9, the scheduling ends, and S2 is repeatedly executed at the next time interval.
本优选实施例针对集群控制器负载不均衡现象提出了一种解决方案,解决方案的核心思想是采用最小二乘法的数学模型,对未来时刻各个交换机的packet-in报文、流表数和其它OF消息进行预测,并取同样时间周期的历史数据为参考,与预估值求平均,然后根据新的平均值求得每个控制器的统计信息,控制器的统计信息与历史统计最大值的比值与整个控制器集群的负载压力值做比较,在网络流量抖动较大时,及时调整各个控制器管控的交换机个数,使得所有控制器接收到的packet-in报文、下发的流表和与交换机交互的其它OF消息达到均衡状态,提高整个控制器集群的控制性能。图5是根据本发明优选实施例的集群控制器负载均衡调度流程图,整个处理流程如图5所示。The preferred embodiment proposes a solution to the cluster controller load imbalance phenomenon. The core idea of the solution is to use the mathematical model of the least squares method to packet-in packets, flow table numbers and other switches of each switch in the future time. The OF message is predicted, and the historical data of the same time period is taken as a reference, and the estimated value is averaged, and then the statistical information of each controller is obtained according to the new average value, and the statistical information of the controller and the historical maximum value are obtained. The ratio is compared with the load pressure value of the entire controller cluster. When the network traffic jitter is large, the number of switches controlled by each controller is adjusted in time, so that all the controllers receive the packet-in packet and the delivered flow table. The other OF messages interacting with the switch reach an equilibrium state, improving the control performance of the entire controller cluster. FIG. 5 is a flowchart of a cluster controller load balancing scheduling according to a preferred embodiment of the present invention. The entire processing flow is shown in FIG. 5.
实施例1:Example 1:
图6是根据本发明优选实施例1的域内控制器及交换机分配示意图,如图6所示为例,域内分布有SDN控制器节点A、B、C。A控制器节点管控的交换机包括sw1、sw2和sw3;B控制器节点管控的交换机包括sw4和sw5;C控制器节点管控的交换机包括sw6、sw7和sw8;结合表1、表2、表3、表4、表5、表6、表7详细描述本优选实施例。FIG. 6 is a schematic diagram of the allocation of controllers and switches in the domain according to the preferred embodiment 1 of the present invention. As shown in FIG. 6, the SDN controller nodes A, B, and C are distributed in the domain. The switch controlled by the A controller node includes sw1, sw2, and sw3; the switch controlled by the B controller node includes sw4 and sw5; the switch controlled by the C controller node includes sw6, sw7, and sw8; combined with Table 1, Table 2, and Table 3, Tables 4, 5, 6, and 7 describe the preferred embodiment in detail.
S1,集群控制器调度开始:控制器设置packet-in数量的历史最大值为Hipmax、流表数的历史最大值为Hifmax和其它OF消息的历史最大值为Himmax,并分别设为0。S1, the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
S2,采用集群控制器中信息收集模块收集样本信息,本实例采集的样本数据为一周内某天一个时间段不同时间戳的统计信息。同时采集之前一周内该时段内的实际测量信息作为参考,使得预估信息更加接近实际值。收集样本数据信息由以下子步骤实现: S2: Collecting sample information by using an information collection module in the cluster controller. The sample data collected in this example is statistical information of different timestamps of a time period on a certain day of the week. At the same time, the actual measurement information in the period of the previous week is collected as a reference, so that the estimated information is closer to the actual value. Collecting sample data information is accomplished by the following substeps:
S2.1,在相同的时间间隔内,由集群中的超级节点发起所管控集群的控制器的信息收集命令;集群所有控制器A,B,C开始向其管控的交换机收集packet-in报文个数和统计向每个交换机下发的流表数及其它OF消息;S2.1: In the same time interval, the information collection command of the controller of the controlled cluster is initiated by the super node in the cluster; all controllers A, B, and C of the cluster start collecting packet-in packets from the switches that are controlled by the cluster. Number and statistics of the number of flow tables and other OF messages sent to each switch;
S2.2,当控制器收集到所有管控交换机的统计信息,开始向集群分布式共享存储系统发送流表、packet_in和其他OF消息的统计信息,分别记为Fi、Pi和Mi,其中Fi包括:控制器编号,交换机标号,交换机流表统计,时间戳;Pi包括:控制器编号、交换机标号、交换机上送的packet-in报文数、时间戳;Mi包括:控制器编号、交换机标号、交换机与控制器除packet_in之外的其他OF信息、时间戳。所述时间戳是指收集到所有管控交换机的应答消息的时刻。所有信息会作为历史参考或及时预测使用。S2.2, when the controller collects statistics of all the management switches, starts to send statistics of the flow table, packet_in, and other OF messages to the cluster distributed shared storage system, and records them as F i , P i , and M i , respectively. F i includes: controller number, switch label, switch flow table statistics, time stamp; P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp; M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp. The timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
S3,超级节点使用控制器中的数据处理模块根据最小二乘法的数学模型预测下一个时间间隔内各个控制器下的交换机上报的packet-in报文数、控制器向交换机下发的流表数及其它OF消息,分别通过步骤S4、步骤S5和步骤S6来实现:S3, the super node uses the data processing module in the controller to predict the number of packet-in packets reported by the switches in each controller and the number of flow tables sent by the controller to the switch in the next time interval according to the mathematical model of the least squares method. And other OF messages are respectively implemented by step S4, step S5 and step S6:
S4,根据时间戳,超级节点A从集群分布式共享存储系统中读取每个控制器上报的packet-in报文统计信息,通过以下子步骤来实现:S4: According to the timestamp, the super node A reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S4.1,这里取时间戳个数N=5,即尝试获取5个时间戳的完整packet-in报文统计信息集合;所述完整packet-in报文统计信息集合是指同一控制器同一时间戳的所有不同的交换机上报的packet-in报文统计信息且时间戳是最近的;S4.1, where the number of timestamps is N=5, that is, the complete packet-in packet statistics information set of 5 timestamps is obtained; the complete packet-in packet statistics information set refers to the same controller at the same time. Packet-in packet statistics reported by all the different switches and the timestamp is the most recent;
S4.2,获取时间戳的完整packet-in报文统计信息集合不到5个,循环执行S2,直到获取到5个时间戳的packet-in报文统计信息集合,所获取的packet-in报文统计信息如表1所示;S4.2: The set of complete packet-in packet statistics information of the timestamp is less than five, and the S2 is cyclically executed until the packet-in packet statistics information set of the five timestamps is obtained, and the obtained packet-in report is obtained. The statistics of the text are shown in Table 1;
表1:packet-in报文初始个数统计表 Table 1: Initial statistics of packet-in packets
Figure PCTCN2015071446-appb-000029
Figure PCTCN2015071446-appb-000029
S4.3,根据上述packet-in报文统计信息集合,超级节点针对每个交换机累计获得5个时间戳的packet-in报文的信息统计P1、P2、P3、P4、P5,即获得了这样的数据:Pi={控制器编号、交换机编号、时间戳X、packet-in报文统计信息Y}。S4.3. According to the packet-in packet statistics information set, the super node obtains information statistics of the packet-in packets of five timestamps for each switch, P 1 , P 2 , P 3 , P 4 , and P 5 . That is, such data is obtained: P i = {controller number, switch number, time stamp X, packet-in message statistics Y}.
S4.4,若上述5个时间戳的控制器中packet-in报文信息统计总和最大的那一个大于控制器的历史packet-in报文统计Hipmax,则
Figure PCTCN2015071446-appb-000030
Figure PCTCN2015071446-appb-000031
S4.4. If the sum of the packet-in packet statistics in the controller of the five timestamps is greater than the historical packet-in packet statistics of the controller , H ipmax ,
Figure PCTCN2015071446-appb-000030
Figure PCTCN2015071446-appb-000031
S4.5,对集群控制器管控下的每个交换机,使用式1-1的最小二乘法数学模型,并根据公式1-2和1-3计算得出下一个时间戳的各个交换机的packet-in报文统计信息Pinext,预测结果如表2所示。S4.5. For each switch under the control of the cluster controller, the least squares mathematical model of Equation 1-1 is used, and the packets of each switch of the next timestamp are calculated according to formulas 1-2 and 1-3. In packet statistics P inext , the prediction results are shown in Table 2.
表2预测的packet-in报文T6时刻的报文数量The number of packets predicted by packet-in packet T6 in Table 2
Figure PCTCN2015071446-appb-000032
Figure PCTCN2015071446-appb-000032
S4.6,为了使得预估值更加接近实际值,取一周内该时间戳的接收到的packet-in报文数量实际测量值,与预估值求和取平均,结果如表3所示;S4.6. In order to make the estimated value closer to the actual value, the actual measured value of the received packet-in packet of the timestamp in one week is taken, and the estimated value is summed and averaged, and the result is shown in Table 3.
表3一周内packet-in报文数实际测量值与预估值的平均值Table 3 Average number of actual measured values and estimated values of packet-in packets in one week
Figure PCTCN2015071446-appb-000033
Figure PCTCN2015071446-appb-000033
S5,根据时间戳,超级节点A从集群分布式共享存储系统中读取每个控制器上报的流表统计信息,通过以下子步骤来实现:S5. According to the timestamp, the super node A reads the flow table statistics information reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S5.1,这里取时间戳个数N=5,即尝试获取5个时间戳的完整流表统计信息集合;所述完整流表统计信息集合是指同一控制器同一时间戳向所有不同的交换机下发的流表统计信息且时间戳是最近的;S5.1, where the number of timestamps is N=5, that is, a complete flow table statistics information set of 5 timestamps is attempted; the complete flow table statistics information set refers to the same timestamp of the same controller to all the different switches. The flow table statistics delivered and the timestamp is the most recent;
S5.2,若获取时间戳的完整流表统计信息集合不到5个,循环执行S2,直到获取到5个时间戳的流表统计信息集合;S5.2, if less than 5 sets of complete flow table statistics information of the timestamp are obtained, S2 is executed cyclically until a flow table statistical information set of 5 timestamps is obtained;
S5.3,根据上述流表统计信息集合,超级节点针对每个交换机累计获得5个时间戳的流表统计F1、F2、F3、F4、F5,即获得了这样的数据:Fi={控制器编号、交换机编号、时间戳X、流表统计Y}。 S5.3. According to the flow table statistics information set, the super node obtains five time-stamped flow table statistics F 1 , F 2 , F 3 , F 4 , and F 5 for each switch, and obtains such data: F i = {controller number, switch number, timestamp X, flow table statistics Y}.
S5.4,若上述5个时间戳的控制器流量中流表统计总和最大的那一个大于控制器的历史流表统计Hifmax,则
Figure PCTCN2015071446-appb-000034
S5.4, if the sum of the flow table statistics in the above five timestamps is greater than the controller's historical flow table statistics H ifmax , then
Figure PCTCN2015071446-appb-000034
S5.5,对集群控制器中各控制器管控的每个交换机,使用式1-1的最小二乘法数学模型,并根据公式1-2和1-3计算得出下一时间戳的各个交换机的流表统计信息FinextS5.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model of Equation 1-1, and calculate the switches of the next timestamp according to Equations 1-2 and 1-3. Flow table statistics F inext ;
S5.6,为了使得预估值更加接近实际值,取一周内该时间戳的流表统计实际测量值,与预估值求和取平均;S5.6, in order to make the estimated value closer to the actual value, take the flow table of the time stamp within one week to calculate the actual measured value, and sum the average with the estimated value;
S6,根据时间戳,超级节点从集群分布式共享存储系统中读取每个控制器上报的除packet_in之外的其他OF交互信息统计(以后简称其他OF信息),通过以下子步骤来实现:S6. According to the timestamp, the super node reads the statistics of the OF interaction information (hereinafter referred to as other OF information), which is reported by each controller, except for the packet_in, from the cluster distributed shared storage system, and is implemented by the following substeps:
S6.1,确定时间戳个数N,即尝试获取N个时间戳的完整其他OF信息统计集合;所述完整其它OF信息集合是指同一控制器同一时间戳的所有不同的交换机与控制器的除packet_in之外的所有OF交互统计信息且时间戳是最近的;S6.1, determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
S6.2,若获取时间戳的完整其它OF信息统计集合不到N个,循环执行S2,直到获取到N个时间戳的其它OF信息统计集合;S6.2, if less than N complete sets of other OF information statistics are obtained, the S2 is executed cyclically until the other OF information statistics sets of the N timestamps are obtained;
S6.3,根据上述其它OF信息统计集合,超级节点针对每个交换机累计获得N个时间戳的其它OF信息统计M1、M2、……、MN,即获得了这样的数据:Mi={控制器编号、交换机编号、时间戳X、其它OF信息统计Y}。S6.3. According to the foregoing other information collection set of OF information, the super node accumulates other OF information statistics M 1 , M 2 , . . . , M N of N time stamps for each switch, that is, obtains such data: M i = {controller number, switch number, timestamp X, other OF information statistics Y}.
S6.4,若上述N个时间戳的控制器其它OF信息统计最大的那一个大于控制器的历史其它OF信息统计Himmax,则
Figure PCTCN2015071446-appb-000035
S6.4. If the other one of the N timestamps has the largest OF information, the larger one is greater than the history of the controller, and the other OF information statistics H immax , then
Figure PCTCN2015071446-appb-000035
S6.5,对集群控制器中各控制器管控的每个交换机,使用最小二乘法数学模型(见式1-1)通过回归分析计算得出下一时间戳的各个交换机的其它OF统计信息Minext,计算公式见式1-2和式1-3。S6.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3.
S6.6,为了使得预估值更加接近实际值,根据样本数据的取样周期,取实际测量前几个周期内该时间戳交换机的其它OF统计信息的实际值,然后与预估值求和取平均,得到更加精确的预估值。 S6.6, in order to make the estimated value closer to the actual value, according to the sampling period of the sample data, take the actual value of the other OF statistical information of the timestamp switch in the first few cycles of the actual measurement, and then sum with the estimated value. On average, get a more accurate estimate.
S7,根据实际数据使用公式1-4、1-5和1-6计算得出PPHi、PFHi和PMHi,分别与通过公式1-7、1-8和1-9计算得出的PPHv、PFHv和PMHv进行比较,根据比较的结果大小调整各个控制器管控的交换机,实现负载均衡,该步骤通过以下子步骤来实现:S7, P PHi , P FHi and P MHi are calculated according to the actual data using Equations 1-4, 1-5 and 1-6, respectively, and P calculated by Equations 1-7, 1-8 and 1-9, respectively. PHv , P FHv and P MHv are compared, and the switches controlled by each controller are adjusted according to the comparison result to implement load balancing. This step is implemented by the following sub-steps:
S7.1,本实施例假设系数x=1,y=0,即根据每个交换机上报的packet_in报文为依据,来调整管控的交换机个数;S7.1, the embodiment assumes that the coefficient x=1, y=0, that is, according to the packet_in message reported by each switch, the number of controlled switches is adjusted;
S7.2,要待调动交换机池设为空;通过获取到的5个时间戳的packet-in报文数计算得到:PPH1=1.09,PPH2=0.39,PPH3=1.11;计算控制器总预估接收到的packet-in报文数与总最大packet-in报文数之比PPHv=0.95;控制器的负载压力表分别为表4所示。上述待调动交换机池装载这样的元素EP::={转出控制器编号,交换机编号,packet-in报文数,转入控制器编号}。S7.2, the buffer pool to be mobilized is set to null; the number of packet-in packets obtained by the five timestamps is calculated: P PH1 = 1.09, P PH2 = 0.39, P PH3 = 1.11; The ratio of the number of received packet-in packets to the total number of maximum packet-in packets is estimated to be P PHv = 0.95; the load pressure gauges of the controller are shown in Table 4. The above-mentioned to-be-switched switch pool loads such elements EP::={transfer controller number, switch number, packet-in packet number, and transfer to controller number}.
表4根据packet-in报文得出的控制器负载压力表Table 4 Controller load pressure gauge based on packet-in message
控制器编号Controller number AA BB CC 求和Summation
预测流量Forecast traffic 7575 1313 6262 150150
控制器最大流量Controller maximum flow 6969 3333 5656 158158
PPHi P PHi 1.091.09 0.390.39 1.111.11 0.950.95
S7.3,根据公式1-10和1-11可得Pi=PPHi,Pv=PPHv,参照Pi以降序对各个控制器执行S7.4,执行完毕后执行S7.7。S7.3, according to the formulas 1-10 and 1-11, P i = P PHi , P v = P PHv , P S is performed on each controller in descending order with reference to P i , and S7.7 is executed after execution is completed.
S7.4,对于各个控制器,当其Pi大于Pv时,执行S7.5,否则执行S7.6;S7.4, for each controller, when its P i is greater than P v , S7.5 is performed, otherwise S7.6 is performed;
S7.5,计算应调出的交换机列表,该步骤通过以下子步骤来实现:S7.5: Calculate the list of switches that should be called out. This step is implemented by the following substeps:
S7.5.1,本实施是按照控制器收到的各个交换机的packet_in报文数据为依据,来调整管控的交换机个数,根据公式1-12可得:Bosize=1*BposizeS7.5.1. This implementation adjusts the number of managed switches according to the packet_in packet data of each switch received by the controller. According to formula 1-12, B osize =1*B posize ;
S7.5.2,然后根据公式1-13计算Binext,根据Binext多对该控制器管控的交换机升序排列,获得交换机队列;S7.5.2, and then calculate B inext according to the formula 1-13, according to the B inext , the controllers controlled by the controller are arranged in ascending order to obtain the switch queue;
S7.5.3,从上述队列中自上而下选择交换机; S7.5.3, selecting a switch from top to bottom from the above queue;
S7.5.4,累计计算要移出交换机Binext总和,若不大于Bosize则继续执行S7.5.4,否则执行S7.5.5;S7.5.4, the cumulative calculation should be removed from the switch B inext sum, if not greater than B osize then continue to execute S7.5.4, otherwise execute S7.5.5;
S7.5.5,将这些待调动的交换机编号,连同控制器编号,Binext加入到待调动交换机池,其中转入控制器编号为空,此时获得的待掉动列表如表5所示;S7.5.5, the number of the switch to be transferred, together with the controller number, B inext is added to the pool to be transferred, wherein the number of the transferred controller is empty, and the list to be dropped is obtained as shown in Table 5;
表5实例1调整前控制器资源共享区域待调动池表Table 5 Table 1 Before the adjustment, the controller resource sharing area to be mobilized
Figure PCTCN2015071446-appb-000036
Figure PCTCN2015071446-appb-000036
S7.6,计算应调入的交换机列表,该步骤通过以下子步骤来实现:S7.6, calculating the list of switches to be transferred, this step is implemented by the following sub-steps:
S7.6.1,本实施例是按照控制器收到的各个交换机上报的packet_in报文数据为依据,来调整管控的交换机个数,根据公式1-14可得Bisize=1*BpisizeS7.6.1, in this embodiment, according to the packet_in packet data reported by each switch received by the controller, the number of the controlled switches is adjusted, and B isize =1*B pisize according to the formula 1-14;
S7.6.2,根据Bisize大小对控制器做降序排列,然后依次根据控制器负载调入交换机,具体由以下子步骤实现:S7.6.2, in descending order of the controller according to the size of B isize , and then transferred to the switch according to the load of the controller, which is implemented by the following substeps:
S7.6.2.1,根据待调动交换机池Binext大小对交换机做降序排列,获得交换机队列;S7.6.2.1, the switches are arranged in descending order according to the size of the inbound switch pool B inext , and the switch queue is obtained;
S7.6.2.2,针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直到检查到最后一个交换机,具体步骤见流程图4所示,此时获得的待掉动列表如表6所示;S7.6.2.2, for each controller, select the switch from top to bottom from the above queue, compare B inext with B isize respectively, and if B inext >B isize , select the next switch, if B inext < B isize , the transfer controller number of the element corresponding to the switch in the pool to be transferred is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last check is checked. For the specific steps, see the flowchart shown in Figure 4. The list to be dropped obtained at this time is shown in Table 6.
表6实例1调整后控制器资源共享区域待调动池表 Table 6 Table 1 to be adjusted after the controller resource sharing area to be mobilized
Figure PCTCN2015071446-appb-000037
Figure PCTCN2015071446-appb-000037
S7.7,重构对应交换机,实现负载均衡,该步骤通过以下子步骤来实现:S7.7: Reconfigure the corresponding switch to implement load balancing. This step is implemented by the following substeps:
S7.7.1,超级节点对待调动交换机池中每一元素,若转入控制器编号不为空,则向转出控制器编号对应的交换机和转入控制器编号转移交换机命令并执行S7.7.2,否则略过此元素;In S7.7.1, the supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the number of the switch-out controller and the number of the switch-in controller and execute S7.7.2. Otherwise skip this element;
S7.7.2,依据slave-master机制调换,实现交换机调度;所述slave-master机制调换由OpenFlow协议设定,设置为改变多控制器控制时不同控制器的角色;结束后的流量状态如表7所示。S7.7.2, according to the slave-master mechanism exchange, implement switch scheduling; the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers; Shown.
表7实例1中根据packet_in报文调整后各控制器负载压力表Table 7 in Table 1 according to the packet_in message adjusted after each controller load pressure gauge
Figure PCTCN2015071446-appb-000038
Figure PCTCN2015071446-appb-000038
S8,本次调度结束,下一时间间隔重复执行S2。S8, the current scheduling ends, and S2 is repeatedly executed at the next time interval.
实施例2:Example 2:
以图6为例,域内分布有SDN控制器节点A、B、C。A控制器节点管控的交换机包括sw1、sw2和sw3;B控制器节点管控的交换机包括sw4和sw5;C控制器节点管控的交换机包括sw6、sw7和sw8;下面开始详细描述本优选实施例。Taking FIG. 6 as an example, the SDN controller nodes A, B, and C are distributed in the domain. The switch controlled by the A controller node includes sw1, sw2, and sw3; the switch managed by the B controller node includes sw4 and sw5; and the switch managed by the C controller node includes sw6, sw7, and sw8; the preferred embodiment will be described in detail below.
S1,集群控制器调度开始:控制器设置packet-in数量的历史最大值为Hipmax、流表数的历史最大值为Hifmax和其它OF消息的历史最大值为Himmax,并分别设为0。 S1, the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
S2,采用集群控制器中信息收集模块收集样本信息,本实例采集的样本数据为一周内某天一个时间段不同时间戳的统计信息。同时采集之前一周内该时段内的实际测量信息作为参考,使得预估信息更加接近实际值。收集样本数据信息由以下子步骤实现:S2: Collecting sample information by using an information collection module in the cluster controller. The sample data collected in this example is statistical information of different timestamps of a time period on a certain day of the week. At the same time, the actual measurement information in the period of the previous week is collected as a reference, so that the estimated information is closer to the actual value. Collecting sample data information is accomplished by the following substeps:
S2.1,在相同的时间间隔内,由集群中的超级节点发起所管控集群的控制器的信息收集命令;集群所有控制器A,B,C开始向其管控的交换机收集packet-in报文个数和统计向每个交换机下发的流表数及其它OF消息;S2.1: In the same time interval, the information collection command of the controller of the controlled cluster is initiated by the super node in the cluster; all controllers A, B, and C of the cluster start collecting packet-in packets from the switches that are controlled by the cluster. Number and statistics of the number of flow tables and other OF messages sent to each switch;
S2.2,当控制器收集到所有管控交换机的统计信息,开始向集群分布式共享存储系统发送流表、packet_in和其他OF消息的统计信息,分别记为Fi、Pi和Mi,其中Fi包括:控制器编号,交换机标号,交换机流表统计,时间戳;Pi包括:控制器编号、交换机标号、交换机上送的packet-in报文数、时间戳;Mi包括:控制器编号、交换机标号、交换机与控制器除packet_in之外的其他OF信息、时间戳。所述时间戳是指收集到所有管控交换机的应答消息的时刻。所有信息会作为历史参考或及时预测使用。S2.2, when the controller collects statistics of all the management switches, starts to send statistics of the flow table, packet_in, and other OF messages to the cluster distributed shared storage system, and records them as F i , P i , and M i , respectively. F i includes: controller number, switch label, switch flow table statistics, time stamp; P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp; M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp. The timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
S3,超级节点使用控制器中的数据处理模块根据最小二乘法的数学模型预测下一个时间间隔内各个控制器下的交换机上报的packet-in报文数、控制器向交换机下发的流表数及其它OF消息,分别通过步骤S4、步骤S5和步骤S6来实现:S3, the super node uses the data processing module in the controller to predict the number of packet-in packets reported by the switches in each controller and the number of flow tables sent by the controller to the switch in the next time interval according to the mathematical model of the least squares method. And other OF messages are respectively implemented by step S4, step S5 and step S6:
S4,根据时间戳,超级节点A从集群分布式共享存储系统中读取每个控制器上报的packet-in报文统计信息,通过以下子步骤来实现:S4: According to the timestamp, the super node A reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S4.1,这里取时间戳个数N=5,即尝试获取5个时间戳的完整packet-in报文统计信息集合;所述完整packet-in报文统计信息集合是指同一控制器同一时间戳的所有不同的交换机上报的packet-in报文统计信息且时间戳是最近的;S4.1, where the number of timestamps is N=5, that is, the complete packet-in packet statistics information set of 5 timestamps is obtained; the complete packet-in packet statistics information set refers to the same controller at the same time. Packet-in packet statistics reported by all the different switches and the timestamp is the most recent;
S4.2,若获取时间戳的完整packet-in报文统计信息集合不到5个,循环执行S2,直到获取到5个时间戳的packet-in报文统计信息集合;S4.2: If less than five complete packet-in packet statistics information collection time stamps are obtained, S2 is executed cyclically until a packet-in packet statistical information set of five timestamps is obtained.
S4.3,根据上述packet-in报文统计信息集合,超级节点针对每个交换机累计获得5个时间戳的packet-in报文的信息统计P1、P2、P3、P4、P5,即获得了这样的数据:Pi={控制器编号、交换机编号、时间戳X、packet-in报文统计信息Y}; S4.3. According to the packet-in packet statistics information set, the super node obtains information statistics of the packet-in packets of five timestamps for each switch, P 1 , P 2 , P 3 , P 4 , and P 5 . , that is, obtain such data: P i = {controller number, switch number, time stamp X, packet-in message statistics Y};
S4.4,若上述5个时间戳的控制器中packet-in报文信息统计总和最大的那一个大于控制器的历史packet-in报文统计Hipmax,则
Figure PCTCN2015071446-appb-000039
Figure PCTCN2015071446-appb-000040
S4.4. If the sum of the packet-in packet statistics in the controller of the five timestamps is greater than the historical packet-in packet statistics of the controller , H ipmax ,
Figure PCTCN2015071446-appb-000039
Figure PCTCN2015071446-appb-000040
S4.5,对集群控制器管控下的每个交换机,使用式1-1的最小二乘法数学模型,并根据公式1-2和1-3计算得出下一个时间戳的各个交换机的packet-in报文统计信息PinextS4.5. For each switch under the control of the cluster controller, use the least squares mathematical model of Equation 1-1, and calculate the packet of each switch of the next timestamp according to Equations 1-2 and 1-3. In message statistics information P inext ;
S4.6,为了使得预估值更加接近实际值,取一周内该时间戳的接收到的packet-in报文数量实际测量值,与预估值求和取平均。In S4.6, in order to make the estimated value closer to the actual value, the actual measured value of the received packet-in packet of the timestamp in one week is taken, and the estimated value is summed and averaged.
S5,根据时间戳,超级节点A从集群分布式共享存储系统中读取每个控制器上报的流表统计信息,通过以下子步骤来实现:S5. According to the timestamp, the super node A reads the flow table statistics information reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S5.1,这里取时间戳个数N=5,即尝试获取5个时间戳的完整流表统计信息集合;所述完整流表统计信息集合是指同一控制器同一时间戳向所有不同的交换机下发的流表统计信息且时间戳是最近的;S5.1, where the number of timestamps is N=5, that is, a complete flow table statistics information set of 5 timestamps is attempted; the complete flow table statistics information set refers to the same timestamp of the same controller to all the different switches. The flow table statistics delivered and the timestamp is the most recent;
S5.2,若获取时间戳的完整流表统计信息集合不到5个,循环执行S2,直到获取到5个时间戳的流表统计信息集合;S5.2, if less than 5 sets of complete flow table statistics information of the timestamp are obtained, S2 is executed cyclically until a flow table statistical information set of 5 timestamps is obtained;
S5.3,根据上述流表统计信息集合,超级节点针对每个交换机累计获得5个时间戳的流表统计F1、F2、F3、F4、F5,即获得了这样的数据:Fi={控制器编号、交换机编号、时间戳X、流表统计Y};S5.3. According to the flow table statistics information set, the super node obtains five time-stamped flow table statistics F 1 , F 2 , F 3 , F 4 , and F 5 for each switch, and obtains such data: F i = {controller number, switch number, timestamp X, flow table statistics Y};
S5.4,若上述5个时间戳的控制器流量中流表统计总和最大的那一个大于控制器的历史流表统计Hifmax,则
Figure PCTCN2015071446-appb-000041
S5.4, if the sum of the flow table statistics in the above five timestamps is greater than the controller's historical flow table statistics H ifmax , then
Figure PCTCN2015071446-appb-000041
S5.5,对集群控制器中各控制器管控的每个交换机,使用式1-1的最小二乘法数学模型,并根据公式1-2和1-3计算得出下一时间戳的各个交换机的流表统计信息FinextS5.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model of Equation 1-1, and calculate the switches of the next timestamp according to Equations 1-2 and 1-3. Flow table statistics F inext ;
S5.6,为了使得预估值更加接近实际值,取一周内该时间戳的流表统计实际测量值,与预估值求和取平均。 S5.6, in order to make the estimated value closer to the actual value, take the flow table of the time stamp within one week to calculate the actual measured value, and sum the estimated value to average.
S6,根据时间戳,超级节点从集群分布式共享存储系统中读取每个控制器上报的除packet_in之外的其他OF交互信息统计(以后简称其他OF信息),通过以下子步骤来实现:S6. According to the timestamp, the super node reads the statistics of the OF interaction information (hereinafter referred to as other OF information), which is reported by each controller, except for the packet_in, from the cluster distributed shared storage system, and is implemented by the following substeps:
S6.1,确定时间戳个数N,即尝试获取N个时间戳的完整其他OF信息统计集合;所述完整其它OF信息集合是指同一控制器同一时间戳的所有不同的交换机与控制器的除packet_in之外的所有OF交互统计信息且时间戳是最近的;S6.1, determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
S6.2,若获取时间戳的完整其它OF信息统计集合不到N个,循环执行S2,直到获取到N个时间戳的其它OF信息统计集合;S6.2, if less than N complete sets of other OF information statistics are obtained, the S2 is executed cyclically until the other OF information statistics sets of the N timestamps are obtained;
S6.3,根据上述其它OF信息统计集合,超级节点针对每个交换机累计获得N个时间戳的其它OF信息统计M1、M2、……、MN,即获得了这样的数据:Mi={控制器编号、交换机编号、时间戳X、其它OF信息统计Y}。S6.3. According to the foregoing other information collection set of OF information, the super node accumulates other OF information statistics M 1 , M 2 , . . . , M N of N time stamps for each switch, that is, obtains such data: M i = {controller number, switch number, timestamp X, other OF information statistics Y}.
S6.4,若上述N个时间戳的控制器其它OF信息统计最大的那一个大于控制器的历史其它OF信息统计Himmax,则
Figure PCTCN2015071446-appb-000042
S6.4. If the other one of the N timestamps has the largest OF information, the larger one is greater than the history of the controller, and the other OF information statistics H immax , then
Figure PCTCN2015071446-appb-000042
S6.5,对集群控制器中各控制器管控的每个交换机,使用最小二乘法数学模型(见式1-1)通过回归分析计算得出下一时间戳的各个交换机的其它OF统计信息Minext,计算公式见式1-2和式1-3;S6.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3;
S6.6,为了使得预估值更加接近实际值,根据样本数据的取样周期,取实际测量前几个周期内该时间戳交换机的其它OF统计信息的实际值,然后与预估值求和取平均,得到更加精确的预估值。S6.6, in order to make the estimated value closer to the actual value, according to the sampling period of the sample data, take the actual value of the other OF statistical information of the timestamp switch in the first few cycles of the actual measurement, and then sum with the estimated value. On average, get a more accurate estimate.
S7,根据实际数据使用公式1-4、1-5和1-6计算得出PPHi、PFHi和PMHi,分别与通过公式1-7、1-8和1-9计算得出的PPHv、PFHv和PMHv进行比较,根据比较的结果大小调整各个控制器管控的交换机,实现负载均衡,该步骤通过以下子步骤来实现:S7, P PHi , P FHi and P MHi are calculated according to the actual data using Equations 1-4, 1-5 and 1-6, respectively, and P calculated by Equations 1-7, 1-8 and 1-9, respectively. PHv , P FHv and P MHv are compared, and the switches controlled by each controller are adjusted according to the comparison result to implement load balancing. This step is implemented by the following sub-steps:
S7.1,本实施例假设系数x=0.5,y=0.5,即同时根据每个交换机上报的packet_in报文、每个交换机下发的流表和其它OF消息为依据,来调整管控的交换机个数;S7.1, this embodiment assumes that the coefficient x=0.5, y=0.5, that is, according to the packet_in message reported by each switch, the flow table sent by each switch, and other OF messages, the managed switches are adjusted. number;
S7.2,要待调动交换机池设为空;通过获取到的5个时间戳的packet-in报文数计算得到:PPH1、PPH2和PPH3;通过获取到的5个时间戳的流表统计数计算得到:PFH1、PFH2和PFH3;通过获取到的5个时间戳的其它OF消息统计计算得到:PMH1、PMH2和PMH3;计算控制器总预估接收到的packet-in报文数与总最大packet-in报文数之比为 PPHv;计算控制器总预估下发的流表数与总最大下发流表数之比为PFHv;计算控制器总预估的其它OF消息数与总最大其它OF消息数之比为PMHv;上述待调动交换机池装载这样的元素EP::={转出控制器编号,交换机编号,packet-in报文数,转入控制器编号};EF::={转出控制器编号,交换机编号,流表数,转入控制器编号};EM::={转出控制器编号,交换机编号,其它OF消息数,转入控制器编号};S7.2, the pool of the switch to be emptied is set to be empty; the number of packet-in packets obtained by the five timestamps is calculated: P PH1 , P PH2 , and P PH3 ; The table statistics are calculated: P FH1 , P FH2 and P FH3 ; the other OF messages obtained by the 5 time stamps are statistically calculated: P MH1 , P MH2 and P MH3 ; the calculation controller always estimates the received packets The ratio of the number of -in packets to the total number of packet-in packets is P PHv ; the ratio of the total number of flow tables sent by the controller to the total number of flows is P FHv ; The ratio of the estimated number of other OF messages to the total number of other largest OF messages is P MHv ; the above-mentioned to-be-switched switch pool loads such elements EP::={transfer controller number, switch number, packet-in packet number, Transfer to controller number}; EF::={transfer controller number, switch number, flow table number, transfer to controller number}; EM::={transfer controller number, switch number, other OF messages , transfer to controller number};
S7.3,根据公式1-10和1-11可得Pi和Pv,参照Pi以降序对各个控制器执行S7.4,执行完毕后执行S7.7。S7.3, P i and P v are obtained according to the formulas 1-10 and 1-11, S7.4 is performed on each controller in descending order with reference to P i , and S7.7 is executed after the execution is completed.
S7.4,对于各个控制器,当其Pi大于Pv时,执行S7.5,否则执行S7.6;S7.4, for each controller, when its P i is greater than P v , S7.5 is performed, otherwise S7.6 is performed;
S7.5,计算应调出的交换机列表,该步骤通过以下子步骤来实现:S7.5: Calculate the list of switches that should be called out. This step is implemented by the following substeps:
S7.5.1,本实施是同时按照控制器收到的各个交换机的packet_in报文、控制器下发的流表数和其它OF消息数据为依据,来调整管控的交换机个数,根据公式1-12可得:S7.5.1. In this implementation, the number of controlled switches is adjusted according to the packet_in packet of each switch received by the controller, the number of flow tables sent by the controller, and other OF message data. Available:
Bosize=(1-0.5)*(0.5*Bposize+0.5*Bfosize)+0.5*BmosizeB osize = ( 1-0.5 ) * (0.5 * B posize + 0.5 * B fosize ) + 0.5 * B mosize ;
S7.5.2,然后根据公式1-13计算Binext,根据Binext多对该控制器管控的交换机升序排列,获得交换机队列;S7.5.2, and then calculate B inext according to the formula 1-13, according to the B inext , the controllers controlled by the controller are arranged in ascending order to obtain the switch queue;
S7.5.3,从上述队列中自上而下选择交换机;S7.5.3, selecting a switch from top to bottom from the above queue;
S7.5.4,累计计算要移出交换机Binext总和,若不大于Bosize则继续执行S7.5.4,否则执行7.5.5;S7.5.4, the cumulative calculation should be removed from the switch B inext sum, if it is not greater than B osize , continue to execute S7.5.4, otherwise execute 7.5.5;
S7.5.5,将这些待调动的交换机编号,连同控制器编号,Binext加入到待调动交换机池,其中转入控制器编号为空;S7.5.5, adding the number of the switch to be transferred, together with the controller number, B inext to the pool of the switch to be transferred, wherein the number of the transferred controller is empty;
S7.6,计算应调入的交换机列表,该步骤通过以下子步骤来实现:S7.6, calculating the list of switches to be transferred, this step is implemented by the following sub-steps:
S7.6.1,本实施例是同时按照控制器收到的各个交换机上报的packet_in报文、控制器下发的流表数和其它OF消息数据为依据,来调整管控的交换机个数,根据公式1-14可得S7.6.1, in this embodiment, according to the packet_in message reported by each switch received by the controller, the number of flow tables sent by the controller, and other OF message data, the number of controlled switches is adjusted according to formula 1. -14 available
Bisize=(1-0.5)*(0.5*Bpisize+0.5*Bfisize)+0.5*BmisizeB isize = ( 1-0.5 ) * (0.5 * B pisize + 0.5 * B fisize ) + 0.5 * B misize ;
S7.6.2,根据Bisize大小对控制器做降序排列,然后依次根据控制器负载调入交换机,具体由以下子步骤实现:S7.6.2, in descending order of the controller according to the size of B isize , and then transferred to the switch according to the load of the controller, which is implemented by the following substeps:
S7.6.2.1,根据待调动交换机池Binext大小对交换机做降序排列,获得交换机队列;S7.6.2.1, the switches are arranged in descending order according to the size of the inbound switch pool B inext , and the switch queue is obtained;
S7.6.2.2,针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直到检查到最后一个交换机,具体步骤见流程图4所示。S7.6.2.2, for each controller, select the switch from top to bottom from the above queue, compare B inext with B isize respectively, and if B inext >B isize , select the next switch, if B inext < B isize , the transfer controller number of the element corresponding to the switch in the pool to be transferred is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last check is checked. Switch, the specific steps are shown in Figure 4.
S7.7,重构对应交换机,实现负载均衡,该步骤通过以下子步骤来实现:S7.7: Reconfigure the corresponding switch to implement load balancing. This step is implemented by the following substeps:
S7.7.1,超级节点对待调动交换机池中每一元素,若转入控制器编号不为空,则向转出控制器编号对应的交换机和转入控制器编号转移交换机命令并执行S7.7.2,否则略过此元素;In S7.7.1, the supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the number of the switch-out controller and the number of the switch-in controller and execute S7.7.2. Otherwise skip this element;
S7.7.2,依据slave-master机制调换,实现交换机调度;所述slave-master机制调换由OpenFlow协议设定,设置为改变多控制器控制时不同控制器的角色。S7.7.2, according to the slave-master mechanism exchange, implement switch scheduling; the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers.
S8,本次调度结束,下一时间间隔重复执行S2。S8, the current scheduling ends, and S2 is repeatedly executed at the next time interval.
实施例3:Example 3:
图7是根据本发明优选实施例3的域内层叠控制器及交换机分配示意图,如图7所示为例,域内分布有SDN控制器节点A、B、C和超级控制器节点D。A控制器节点管控的交换机包括sw1、sw2和sw3;B控制器节点管控的交换机包括sw4和sw5;C控制器节点管控的交换机包括sw6、sw7和sw8;下面开始详细描述本优选实施例。FIG. 7 is a schematic diagram of the intra-domain cascade controller and switch allocation according to a preferred embodiment 3 of the present invention. As shown in FIG. 7, an SDN controller node A, B, C and a super controller node D are distributed in the domain. The switch controlled by the A controller node includes sw1, sw2, and sw3; the switch managed by the B controller node includes sw4 and sw5; and the switch managed by the C controller node includes sw6, sw7, and sw8; the preferred embodiment will be described in detail below.
S1,集群控制器调度开始:控制器设置packet-in数量的历史最大值为Hipmax、流表数的历史最大值为Hifmax和其它OF消息的历史最大值为Himmax,并分别设为0。S1, the cluster controller scheduling starts: the controller sets the historical maximum value of the packet-in number to H ipmax , the historical maximum value of the flow table number is H ifmax and the historical maximum value of other OF messages is H immax , and are respectively set to 0. .
S2,采用集群控制器中信息收集模块收集样本信息,本实例采集的样本数据为一周内某天一个时间段不同时间戳的统计信息。同时采集之前一周内该时段内的实际测量信息作为参考,使得预估信息更加接近实际值。收集样本数据信息由以下子步骤实现: S2: Collecting sample information by using an information collection module in the cluster controller. The sample data collected in this example is statistical information of different timestamps of a time period on a certain day of the week. At the same time, the actual measurement information in the period of the previous week is collected as a reference, so that the estimated information is closer to the actual value. Collecting sample data information is accomplished by the following substeps:
S2.1,在相同的时间间隔内,由集群中的超级节点发起所管控集群的控制器的信息收集命令;集群所有控制器A,B,C开始向其管控的交换机收集packet-in报文个数和统计向每个交换机下发的流表数及其它OF消息;S2.1: In the same time interval, the information collection command of the controller of the controlled cluster is initiated by the super node in the cluster; all controllers A, B, and C of the cluster start collecting packet-in packets from the switches that are controlled by the cluster. Number and statistics of the number of flow tables and other OF messages sent to each switch;
S2.2,当控制器收集到所有管控交换机的统计信息,开始向集群分布式共享存储系统发送流表、packet_in和其他OF消息的统计信息,分别记为Fi、Pi和Mi,其中Fi包括:控制器编号,交换机标号,交换机流表统计,时间戳;Pi包括:控制器编号、交换机标号、交换机上送的packet-in报文数、时间戳;Mi包括:控制器编号、交换机标号、交换机与控制器除packet_in之外的其他OF信息、时间戳。所述时间戳是指收集到所有管控交换机的应答消息的时刻。所有信息会作为历史参考或及时预测使用。S2.2, when the controller collects statistics of all the management switches, starts to send statistics of the flow table, packet_in, and other OF messages to the cluster distributed shared storage system, and records them as F i , P i , and M i , respectively. F i includes: controller number, switch label, switch flow table statistics, time stamp; P i includes: controller number, switch label, packet-in packet number sent by the switch, time stamp; M i includes: controller Number, switch label, switch and controller other than the packet_in OF information, timestamp. The timestamp refers to the moment when the response message of all the management switches is collected. All information will be used as a historical reference or timely forecast.
S3,超级节点D使用控制器中的数据处理模块根据最小二乘法的数学模型预测下一个时间间隔内各个控制器下的交换机上报的packet-in报文数、控制器向交换机下发的流表数及其它OF消息,分别通过步骤4、步骤5和步骤6来实现:S3, the super node D uses the data processing module in the controller to predict the number of packet-in packets reported by the switches in each controller and the flow table sent by the controller to the switch in the next time interval according to the mathematical model of the least squares method. The number and other OF messages are implemented by Step 4, Step 5 and Step 6 respectively:
S4,根据时间戳,超级节点D从集群分布式共享存储系统中读取每个控制器上报的packet-in报文统计信息,通过以下子步骤来实现:S4: According to the timestamp, the super node D reads the packet-in packet statistics reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S4.1,这里取时间戳个数N=5,即尝试获取5个时间戳的完整packet-in报文统计信息集合;所述完整packet-in报文统计信息集合是指同一控制器同一时间戳的所有不同的交换机上报的packet-in报文统计信息且时间戳是最近的;S4.1, where the number of timestamps is N=5, that is, the complete packet-in packet statistics information set of 5 timestamps is obtained; the complete packet-in packet statistics information set refers to the same controller at the same time. Packet-in packet statistics reported by all the different switches and the timestamp is the most recent;
S4.2,若获取时间戳的完整packet-in报文统计信息集合不到5个,循环执行S2,直到获取到5个时间戳的packet-in报文统计信息集合;S4.2: If less than five complete packet-in packet statistics information collection time stamps are obtained, S2 is executed cyclically until a packet-in packet statistical information set of five timestamps is obtained.
S4.3,根据上述packet-in报文统计信息集合,超级节点针对每个交换机累计获得5个时间戳的packet-in报文的信息统计P1、P2、P3、P4、P5,即获得了这样的数据:Pi={控制器编号、交换机编号、时间戳X、packet-in报文统计信息Y};S4.3. According to the packet-in packet statistics information set, the super node obtains information statistics of the packet-in packets of five timestamps for each switch, P 1 , P 2 , P 3 , P 4 , and P 5 . , that is, obtain such data: P i = {controller number, switch number, time stamp X, packet-in message statistics Y};
S4.4,若上述5个时间戳的控制器中packet-in报文信息统计总和最大的那一个大于控制器的历史packet-in报文统计Hipmax,则
Figure PCTCN2015071446-appb-000043
Figure PCTCN2015071446-appb-000044
S4.4. If the sum of the packet-in packet statistics in the controller of the five timestamps is greater than the historical packet-in packet statistics of the controller , H ipmax ,
Figure PCTCN2015071446-appb-000043
Figure PCTCN2015071446-appb-000044
S4.5,对集群控制器管控下的每个交换机,使用式1-1的最小二乘法数学模型,并根据公式1-2和1-3计算得出下一个时间戳的各个交换机的packet-in报文统计信息PinextS4.5. For each switch under the control of the cluster controller, use the least squares mathematical model of Equation 1-1, and calculate the packet of each switch of the next timestamp according to Equations 1-2 and 1-3. In message statistics information P inext ;
S4.6,为了使得预估值更加接近实际值,取一周内该时间戳的接收到的packet-in报文数量实际测量值,与预估值求和取平均。In S4.6, in order to make the estimated value closer to the actual value, the actual measured value of the received packet-in packet of the timestamp in one week is taken, and the estimated value is summed and averaged.
S5,根据时间戳,超级节点D从集群分布式共享存储系统中读取每个控制器上报的流表统计信息,通过以下子步骤来实现:S5. According to the timestamp, the super node D reads the flow table statistics information reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S5.1,这里取时间戳个数N=5,即尝试获取5个时间戳的完整流表统计信息集合;所述完整流表统计信息集合是指同一控制器同一时间戳向所有不同的交换机下发的流表统计信息且时间戳是最近的;S5.1, where the number of timestamps is N=5, that is, a complete flow table statistics information set of 5 timestamps is attempted; the complete flow table statistics information set refers to the same timestamp of the same controller to all the different switches. The flow table statistics delivered and the timestamp is the most recent;
S5.2,若获取时间戳的完整流表统计信息集合不到5个,循环执行S2,直到获取到5个时间戳的流表统计信息集合;S5.2, if less than 5 sets of complete flow table statistics information of the timestamp are obtained, S2 is executed cyclically until a flow table statistical information set of 5 timestamps is obtained;
S5.3,根据上述流表统计信息集合,超级节点针对每个交换机累计获得5个时间戳的流表统计F1、F2、F3、F4、F5,即获得了这样的数据:Fi={控制器编号、交换机编号、时间戳X、流表统计Y};S5.3. According to the flow table statistics information set, the super node obtains five time-stamped flow table statistics F 1 , F 2 , F 3 , F 4 , and F 5 for each switch, and obtains such data: F i = {controller number, switch number, timestamp X, flow table statistics Y};
S5.4,若上述5个时间戳的控制器流量中流表统计总和最大的那一个大于控制器的历史流表统计Hifmax,则
Figure PCTCN2015071446-appb-000045
S5.4, if the sum of the flow table statistics in the above five timestamps is greater than the controller's historical flow table statistics H ifmax , then
Figure PCTCN2015071446-appb-000045
S5.5,对集群控制器中各控制器管控的每个交换机,使用式1-1的最小二乘法数学模型,并根据公式1-2和1-3计算得出下一时间戳的各个交换机的流表统计信息FinextS5.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model of Equation 1-1, and calculate the switches of the next timestamp according to Equations 1-2 and 1-3. Flow table statistics F inext ;
S5.6,为了使得预估值更加接近实际值,取一周内该时间戳的流表统计实际测量值,与预估值求和取平均。S5.6, in order to make the estimated value closer to the actual value, take the flow table of the time stamp within one week to calculate the actual measured value, and sum the estimated value to average.
S6,根据时间戳,超级节点D从集群分布式共享存储系统中读取每个控制器上报的除packet_in之外的其他OF交互信息统计(以后简称其他OF信息),通过以下子步骤来实现:S6. According to the timestamp, the super node D reads the statistics of the OF interaction information (hereinafter referred to as other OF information) except for the packet_in reported by each controller from the cluster distributed shared storage system, and implements the following substeps:
S6.1,确定时间戳个数N,即尝试获取N个时间戳的完整其他OF信息统计集合;所述完整其它OF信息集合是指同一控制器同一时间戳的所有不同的交换机与控制器的除packet_in之外的所有OF交互统计信息且时间戳是最近的;S6.1, determining the number of timestamps N, that is, a complete set of other OF information statistics that attempts to acquire N timestamps; the complete other OF information set refers to all the different switches and controllers of the same controller with the same timestamp. All OF interaction statistics except packet_in and the timestamp is the most recent;
S6.2,若获取时间戳的完整其它OF信息统计集合不到N个,循环执行S2,直到获取到N个时间戳的其它OF信息统计集合; S6.2, if less than N complete sets of other OF information statistics are obtained, the S2 is executed cyclically until the other OF information statistics sets of the N timestamps are obtained;
S6.3,根据上述其它OF信息统计集合,超级节点针对每个交换机累计获得N个时间戳的其它OF信息统计M1、M2、……、MN,即获得了这样的数据:Mi={控制器编号、交换机编号、时间戳X、其它OF信息统计Y}。S6.3. According to the foregoing other information collection set of OF information, the super node accumulates other OF information statistics M 1 , M 2 , . . . , M N of N time stamps for each switch, that is, obtains such data: M i = {controller number, switch number, timestamp X, other OF information statistics Y}.
S6.4,若上述N个时间戳的控制器其它OF信息统计最大的那一个大于控制器的历史其它OF信息统计Himmax,则
Figure PCTCN2015071446-appb-000046
S6.4. If the other one of the N timestamps has the largest OF information, the larger one is greater than the history of the controller, and the other OF information statistics H immax , then
Figure PCTCN2015071446-appb-000046
S6.5,对集群控制器中各控制器管控的每个交换机,使用最小二乘法数学模型(见式1-1)通过回归分析计算得出下一时间戳的各个交换机的其它OF统计信息Minext,计算公式见式1-2和式1-3;S6.5. For each switch managed by each controller in the cluster controller, use the least squares mathematical model (see Equation 1-1) to calculate and calculate other OF statistics of each switch of the next timestamp by regression analysis. Inext , the formula is shown in Equation 1-2 and Equation 1-3;
S6.6,为了使得预估值更加接近实际值,根据样本数据的取样周期,取实际测量前几个周期内该时间戳交换机的其它OF统计信息的实际值,然后与预估值求和取平均,得到更加精确的预估值。S6.6, in order to make the estimated value closer to the actual value, according to the sampling period of the sample data, take the actual value of the other OF statistical information of the timestamp switch in the first few cycles of the actual measurement, and then sum with the estimated value. On average, get a more accurate estimate.
S7,根据实际数据使用公式1-4、1-5和1-6计算得出PPHi、PFHi和PMHi,分别与通过公式1-7、1-8和1-9计算得出的PPHv、PFHv和PMHv进行比较,根据比较的结果大小调整各个控制器管控的交换机,实现负载均衡,该步骤通过以下子步骤来实现:S7, P PHi , P FHi and P MHi are calculated according to the actual data using Equations 1-4, 1-5 and 1-6, respectively, and P calculated by Equations 1-7, 1-8 and 1-9, respectively. PHv , P FHv and P MHv are compared, and the switches controlled by each controller are adjusted according to the comparison result to implement load balancing. This step is implemented by the following sub-steps:
S7.1,本实施例假设系数x=0.5,y=0.5,即同时根据每个交换机上报的packet_in报文、每个交换机下发的流表和其它OF消息为依据,来调整管控的交换机个数;S7.1, this embodiment assumes that the coefficient x=0.5, y=0.5, that is, according to the packet_in message reported by each switch, the flow table sent by each switch, and other OF messages, the managed switches are adjusted. number;
S7.2,要待调动交换机池设为空;通过获取到的5个时间戳的packet-in报文数计算得到:PPH1、PPH2和PPH3;通过获取到的5个时间戳的流表统计数计算得到:PFH1、PFH2和PFH3;通过获取到的5个时间戳的其它OF消息统计计算得到:PMH1、PMH2和PMH3;计算控制器总预估接收到的packet-in报文数与总最大packet-in报文数之比为PPHv;计算控制器总预估下发的流表数与总最大下发流表数之比为PFHv;计算控制器总预估的其它OF消息数与总最大其它OF消息数之比为PMHv;上述待调动交换机池装载这样的元素EP::={转出控制器编号,交换机编号,packet-in报文数,转入控制器编号};EF::={转出控制器编号,交换机编号,流表数,转入控制器编号};EM::={转出控制器编号,交换机编号,其它OF消息数,转入控制器编号};S7.2, the pool of the switch to be emptied is set to be empty; the number of packet-in packets obtained by the five timestamps is calculated: P PH1 , P PH2 , and P PH3 ; The table statistics are calculated: P FH1 , P FH2 and P FH3 ; the other OF messages obtained by the 5 time stamps are statistically calculated: P MH1 , P MH2 and P MH3 ; the calculation controller always estimates the received packets The ratio of the number of -in packets to the total number of packet-in packets is P PHv ; the ratio of the total number of flow tables sent by the controller to the total number of maximum flow tables is P FHv ; The ratio of the estimated number of other OF messages to the total number of other largest OF messages is P MHv ; the above-mentioned to-be-switched switch pool loads such elements EP::={transfer controller number, switch number, packet-in packet number, Transfer to controller number}; EF::={transfer controller number, switch number, flow table number, transfer to controller number}; EM::={transfer controller number, switch number, other OF messages , transfer to controller number};
S7.3,根据公式1-10和1-11可得Pi和Pv,参照Pi以降序对各个控制器执行S7.4,执行完毕后执行S7.7。S7.3, P i and P v are obtained according to the formulas 1-10 and 1-11, S7.4 is performed on each controller in descending order with reference to P i , and S7.7 is executed after the execution is completed.
S7.4,对于各个控制器,当其Pi大于Pv时,执行S7.5,否则执行S7.6; S7.4, for each controller, when its P i is greater than P v , S7.5 is performed, otherwise S7.6 is performed;
S7.5,计算应调出的交换机列表,该步骤通过以下子步骤来实现:S7.5: Calculate the list of switches that should be called out. This step is implemented by the following substeps:
S7.5.1,本实施是同时按照控制器收到的各个交换机的packet_in报文、控制器下发的流表数和其它OF消息数据为依据,来调整管控的交换机个数,根据公式1-12可得:S7.5.1. In this implementation, the number of controlled switches is adjusted according to the packet_in packet of each switch received by the controller, the number of flow tables sent by the controller, and other OF message data. Available:
Bosize=(1-0.5)*(0.5*Bposize+0.5*Bfosize)+0.5*BmosizeB osize = ( 1-0.5 ) * (0.5 * B posize + 0.5 * B fosize ) + 0.5 * B mosize ;
S7.5.2,然后根据公式1-13计算Binext,根据Binext多对该控制器管控的交换机升序排列,获得交换机队列;S7.5.2, and then calculate B inext according to the formula 1-13, according to the B inext , the controllers controlled by the controller are arranged in ascending order to obtain the switch queue;
S7.5.3,从上述队列中自上而下选择交换机;S7.5.3, selecting a switch from top to bottom from the above queue;
S7.5.4,累计计算要移出交换机Binext总和,若不大于Bosize则继续执行S7.5.4,否则执行S7.5.5;S7.5.4, the cumulative calculation should be removed from the switch B inext sum, if not greater than B osize then continue to execute S7.5.4, otherwise execute S7.5.5;
S7.5.5,将这些待调动的交换机编号,连同控制器编号,Binext加入到待调动交换机池,其中转入控制器编号为空;S7.5.5, adding the number of the switch to be transferred, together with the controller number, B inext to the pool of the switch to be transferred, wherein the number of the transferred controller is empty;
S7.6,计算应调入的交换机列表,该步骤通过以下子步骤来实现:S7.6, calculating the list of switches to be transferred, this step is implemented by the following sub-steps:
S7.6.1,本实施例是同时按照控制器收到的各个交换机上报的packet_in报文、控制器下发的流表数和其它OF消息数据为依据,来调整管控的交换机个数,根据公式1-14可得;S7.6.1, in this embodiment, according to the packet_in message reported by each switch received by the controller, the number of flow tables sent by the controller, and other OF message data, the number of controlled switches is adjusted according to formula 1. -14 available;
Bisize=(1-0.5)*(0.5*Bpisize+0.5*Bfisize)+0.5*BmisizeB isize = ( 1-0.5 ) * (0.5 * B pisize + 0.5 * B fisize ) + 0.5 * B misize ;
S7.6.2,根据Bisize大小对控制器做降序排列,然后依次根据控制器负载调入交换机,具体由以下子步骤实现:S7.6.2, in descending order of the controller according to the size of B isize , and then transferred to the switch according to the load of the controller, which is implemented by the following substeps:
S7.6.2.1,根据待调动交换机池Binext大小对交换机做降序排列,获得交换机队列;S7.6.2.1, the switches are arranged in descending order according to the size of the inbound switch pool B inext , and the switch queue is obtained;
S7.6.2.2,针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直到检查到最后一个交换机,具体步骤见流程图4所示。S7.6.2.2, for each controller, select the switch from top to bottom from the above queue, compare B inext with B isize respectively, and if B inext >B isize , select the next switch, if B inext < B isize , the transfer controller number of the element corresponding to the switch in the pool to be transferred is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last check is checked. Switch, the specific steps are shown in Figure 4.
S7.7,重构对应交换机,实现负载均衡,该步骤通过以下子步骤来实现: S7.7: Reconfigure the corresponding switch to implement load balancing. This step is implemented by the following substeps:
S7.7.1,超级节点对待调动交换机池中每一元素,若转入控制器编号不为空,则向转出控制器编号对应的交换机和转入控制器编号转移交换机命令并执行S7.7.2,否则略过此元素In S7.7.1, the supernode shall transfer each element in the switch pool. If the number of the transferred controller is not empty, transfer the switch command to the switch corresponding to the number of the switch-out controller and the number of the switch-in controller and execute S7.7.2. Otherwise skip this element
S7.7.2,依据slave-master机制调换,实现交换机调度;所述slave-master机制调换由OpenFlow协议设定,设置为改变多控制器控制时不同控制器的角色。S7.7.2, according to the slave-master mechanism exchange, implement switch scheduling; the slave-master mechanism exchange is set by the OpenFlow protocol, and is set to change the role of different controllers when controlling multiple controllers.
S8,本次调度结束,下一时间间隔重复执行S2。S8, the current scheduling ends, and S2 is repeatedly executed at the next time interval.
在另外一个实施例中,还提供了一种软件,该软件设置为执行上述实施例及优选实施例中描述的技术方案。In another embodiment, a software is provided that is configured to perform the technical solutions described in the above embodiments and preferred embodiments.
在另外一个实施例中,还提供了一种存储介质,该存储介质中存储有上述软件,该存储介质包括但不限于光盘、软盘、硬盘、可擦写存储器等。In another embodiment, a storage medium is also provided, in which the above software is stored, including but not limited to an optical disk, a floppy disk, a hard disk, an erasable memory, and the like.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
如上所述,本发明实施例提供的一种负载均衡的方法及装置,具有以下有益效果:解决了相关技术中集群SDN控制器负载不均的问题,通过预估的数据进行负载均衡,该方式可实现性强,提升了集群SDN控制器的资源使用效率。 As described above, the method and apparatus for load balancing provided by the embodiments of the present invention have the following beneficial effects: solving the problem of uneven load of the cluster SDN controller in the related art, and performing load balancing through the estimated data, the manner It is highly achievable and improves the resource utilization efficiency of the cluster SDN controller.

Claims (14)

  1. 一种负载均衡的方法,包括:A method of load balancing, including:
    收集集群软件定义网络SDN控制器的每个SDN控制器中管控的多个交换机的表征参数的数据;Collecting data of characterization parameters of a plurality of switches controlled by each of the SDN controllers of the cluster software defined network SDN controller;
    根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;Estimating data of the characterization parameters of the plurality of switches at a next moment according to data of the characterization parameters of the plurality of switches;
    根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡。And performing load balancing on each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment.
  2. 根据权利要求1所述的方法,其中,所述表征参数包括以下至少之一:packet-in报文、流表数和其他OF消息。The method of claim 1, wherein the characterization parameters comprise at least one of: a packet-in message, a flow table number, and other OF messages.
  3. 根据权利要求1所述的方法,其中,预估所述多个交换机的所述表征参数在下一时刻的数据包括:The method of claim 1, wherein estimating data of the characterization parameters of the plurality of switches at a next moment comprises:
    使用最小二乘法预估所述多个交换机的所述表征参数在下一时刻的数据。The data of the characterization parameters of the plurality of switches at the next moment is estimated using a least squares method.
  4. 根据权利要求3所述的方法,其中,使用最小二乘法预估所述多个交换机的所述表征参数在下一时刻的数据包括:The method of claim 3, wherein estimating data of the characterization parameters of the plurality of switches at a next moment using a least squares method comprises:
    对每个交换机,使用如下最小二乘法数学模型计算得出所述每个交换机的所述表征参数在下一时刻的数据:y=α+β*x,其中x为所述表征参数在当前时刻的数据,y为所述表征参数在下一时刻的数据;参数α和β值按照如下公式计算:For each switch, the data of the characterization parameter of each switch at the next moment is calculated using the following least squares mathematical model: y = α + β * x, where x is the characterization parameter at the current time Data, y is the data of the characterized parameter at the next moment; the parameters α and β are calculated according to the following formula:
    Figure PCTCN2015071446-appb-100001
    Figure PCTCN2015071446-appb-100002
    Figure PCTCN2015071446-appb-100001
    Figure PCTCN2015071446-appb-100002
    其中n为当前统计周期中的时刻个数,X为时刻对应的时间戳,Y为每个交换机的所述表征参数的值。Where n is the number of times in the current statistical period, X is the timestamp corresponding to the time, and Y is the value of the characterization parameter of each switch.
  5. 根据权利要求1所述的方法,其中,所述表征参数的数据包括表征参数的样本历史数据以及所述表征参数在当前统计周期中各个时刻的数据;根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据包括: The method of claim 1, wherein the data characterizing the parameter comprises sample history data characterizing the parameter and data of the characterizing parameter at each moment in the current statistical period; data according to the characterizing parameters of the plurality of switches Estimating the data of the characterization parameters of the plurality of switches at the next moment includes:
    根据所述多个交换机的表征参数的样本历史数据以及所述表征参数在当前统计周期中各个时刻的数据,预估所述多个交换机的所述表征参数在下一时刻的数据。And estimating, according to the sample historical data of the characterization parameters of the multiple switches and the data of the characterization parameters at each moment in the current statistical period, the data of the characterization parameters of the multiple switches at the next moment.
  6. 根据权利要求5所述的方法,其中,预估所述多个交换机的所述表征参数在下一时刻的数据包括:The method of claim 5, wherein estimating data of the characterization parameters of the plurality of switches at a next moment comprises:
    根据所述表征参数在当前统计周期中各个时刻的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;Estimating, according to the data of each time in the current statistical period, the data of the plurality of switches at the next moment;
    将所述表征参数的样本历史数据与预估的所述表征参数在下一时刻的数据求和取平均。The sample history data of the characterization parameter is summed with the estimated data of the characterization parameter at the next moment.
  7. 根据权利要求1所述的方法,其中,根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡包括:The method according to claim 1, wherein load balancing the respective SDN controllers of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment comprises:
    根据预估的所述多个交换机的所述表征参数在下一时刻的数据,计算每个控制器对于所述表征参数的预估值与其对应的历史最大值的比值PYHiCalculating, according to the estimated data of the plurality of switches, the data of the plurality of switches at a next moment, calculating a ratio P YHi of the estimated value of each of the characterization parameters to a corresponding historical maximum value of each controller:
    计算整个控制器集群对于所述表征参数的总预估值与总最大值的比值PYHvCalculating a ratio P YHv of the total estimated value of the entire controller cluster to the total estimated value and the total maximum value:
    将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机。P YHi is compared with P YHv , and the controller controlled by the controller is adjusted according to the result of the comparison.
  8. 根据权利要求7所述的方法,其中,The method of claim 7 wherein
    PYHi通过以下公式计算:P YHi is calculated by the following formula:
    Figure PCTCN2015071446-appb-100003
    其中n为各个控制器管控的交换机个数,Yinext为控制器管理的各个交换机对于所述表征参数的预估值,Hiymax为控制器管理的各个交换机对于所述表征参数的历史最大值;和/或,
    Figure PCTCN2015071446-appb-100003
    Where n is the number of switches managed by each controller, and Y inext is an estimated value of the characterization parameters of each switch managed by the controller, and H iymax is a historical maximum value of each characterization parameter of each switch managed by the controller; and / or,
    PYHv通过以下公式计算: P YHv is calculated by the following formula:
    Figure PCTCN2015071446-appb-100004
    其中m表示控制器个数,n表示各个控制器管控的交换机个数,Yinext为控制器管理的各个交换机对于所述表征参数的预估值,Hiymax为控制器管理的各个交换机对于所述表征参数的历史最大值。
    Figure PCTCN2015071446-appb-100004
    Wherein m represents the number of controllers, n represents the number of switches controlled by each controller, and Y inext is an estimated value of the characteristic parameters of each switch managed by the controller, and H iymax is the switch managed by the controller. Characterizes the historical maximum of the parameter.
  9. 根据权利要求7所述的方法,其中,将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机包括:The method according to claim 7, wherein comparing the P YHi with the P YHv and adjusting the controller controlled by the controller according to the result of the comparison comprises:
    对多个不同的表征参数设置比例系数,其中,所述比例系数设置为表示各个表征参数在比较过程中所占的比重。A scaling factor is set for a plurality of different characterization parameters, wherein the scaling factor is set to represent a proportion of each characterization parameter in the comparison process.
  10. 根据权利要求7所述的方法,其中,将PYHi与PYHv进行比较,并根据比较的结果调整控制器管控的交换机包括:The method according to claim 7, wherein comparing the P YHi with the P YHv and adjusting the controller controlled by the controller according to the result of the comparison comprises:
    对于各个控制器,当其PYHi大于PYHv时,计算应调出的交换机,并根据计算结果调出交换机;和/或,For each controller, when its P YHi is greater than P YHv , calculate the switch that should be called out, and call out the switch according to the calculation result; and/or,
    对于各个控制器,当其PYHi小于PYHv时,计算应调入的交换机,并根据计算结果调入交换机。For each controller, when its P YHi is less than P YHv , calculate the switch that should be transferred and transfer it to the switch according to the calculation result.
  11. 根据权利要求10所述的方法,其中,计算应调出的交换机,并根据计算结果调出交换机包括:The method of claim 10, wherein calculating the switch that should be invoked and calling the switch according to the calculation result comprises:
    对于控制器计算
    Figure PCTCN2015071446-appb-100005
    设为Byosize,并根据之前设置的比例系数得到Bosize,其中所述比例系数设置为表示多个表征参数在比较过程中所占的比重;
    For controller calculation
    Figure PCTCN2015071446-appb-100005
    Set to B yosize and obtain B osize according to the previously set scale factor, wherein the scale factor is set to indicate the proportion of the plurality of characterization parameters in the comparison process;
    根据对每个交换机的预估数据得出Binext=YinextAccording to the estimated data for each switch, B inext =Y inext ;
    根据Binext的值对该控制器管控的交换机升序排列,获得交换机队列;According to the value of B inext , the controllers controlled by the controller are arranged in ascending order to obtain a switch queue;
    从所述交换机队列中自上而下选择交换机,并累计计算要移出交换机的Binext总和,若不大于Bosize则继续选择交换机;Selecting a switch from top to bottom from the switch queue, and cumulatively calculating a total of B inext to be removed from the switch, and if not greater than B osize , continuing to select the switch;
    将选择的待调动的交换机加入到待调动交换机池,其中所述待调动交换机池设置为存储待调动的交换机信息。The switch to be transferred is added to the switch pool to be mobilized, and the pool to be mobilized is set to store switch information to be mobilized.
  12. 根据权利要求10所述的方法,其中,计算应入的交换机,并根据计算结果调入交换机包括: The method according to claim 10, wherein calculating the switch to be entered and transferring the switch according to the calculation result comprises:
    对于控制器计算
    Figure PCTCN2015071446-appb-100006
    设为Byisize,并根据之前设置的比例系数得到Bisize,其中所述比例系数设置为表示多个表征参数在比较过程中所占的比重;
    For controller calculation
    Figure PCTCN2015071446-appb-100006
    Set to B yisize and obtain B isize according to the previously set scale factor, wherein the scale factor is set to indicate the proportion of the plurality of characterization parameters in the comparison process;
    根据Bisize的值对控制器做降序排列,然后依次根据控制器负载调入交换机。The controller is sorted in descending order according to the value of B isize , and then transferred to the switch according to the controller load.
  13. 根据权利要求12所述的方法,其中,依次根据控制器负载调入交换机包括:The method of claim 12, wherein sequentially switching the switch according to the controller load comprises:
    根据待调动交换机池中各个待调动交换机的Binext的值对交换机做降序排列,获得交换机队列,其中所述待调动交换机池设置为存储待调动的交换机信息;The switches are arranged in descending order according to the value of B inext of each switch to be transferred in the switch pool to be mobilized, and the switch queue is set to store the switch information to be mobilized;
    针对每一个控制器,从上述队列中自上而下选择交换机,分别将Binext与Bisize进行比较,若Binext>Bisize,则选择下一个交换机,若Binext<Bisize,则将待调动交换机池中与这个交换机对应的元素的转入控制器编号设为本控制器编号,同时Bisize=Bisize-Binext,然后检查下一个交换机,直至最后一个交换机。For each controller, select the switch from top to bottom from the above queue, compare B inext and B isize respectively, if B inext >B isize , select the next switch, if B inext <B isize , it will be The transfer controller number of the element corresponding to the switch in the switch pool is set to the local controller number, and B isize =B isize -B inext , and then the next switch is checked until the last switch.
  14. 一种负载均衡的装置,包括:A load balancing device comprising:
    收集模块,设置为收集集群软件定义网络SDN控制器的每个SDN控制器中管控的多个交换机的表征参数的数据;a collection module configured to collect data of characterization parameters of a plurality of switches controlled by each of the SDN controllers of the cluster software defined network SDN controller;
    预估模块,设置为根据所述多个交换机的表征参数的数据,预估所述多个交换机的所述表征参数在下一时刻的数据;The estimating module is configured to estimate data of the characterization parameter of the plurality of switches at a next moment according to data of the characterization parameters of the plurality of switches;
    负载均衡模块,设置为根据预估的所述多个交换机的所述表征参数在下一时刻的数据,对所述集群SDN控制器的各个SDN控制器进行负载均衡。 The load balancing module is configured to load balance each SDN controller of the cluster SDN controller according to the estimated data of the plurality of switches at the next moment.
PCT/CN2015/071446 2014-10-17 2015-01-23 Load balancing method and device WO2015131699A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410555510.5 2014-10-17
CN201410555510.5A CN105577729B (en) 2014-10-17 2014-10-17 Load balancing method and device

Publications (1)

Publication Number Publication Date
WO2015131699A1 true WO2015131699A1 (en) 2015-09-11

Family

ID=54054547

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/071446 WO2015131699A1 (en) 2014-10-17 2015-01-23 Load balancing method and device

Country Status (2)

Country Link
CN (1) CN105577729B (en)
WO (1) WO2015131699A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685170A (en) * 2019-10-18 2021-04-20 伊姆西Ip控股有限责任公司 Dynamic optimization of backup strategies
CN114826923A (en) * 2021-01-27 2022-07-29 华中科技大学 Network rigidity evaluation method of SDN network

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3472973B1 (en) * 2016-06-20 2021-09-08 Telefonaktiebolaget LM Ericsson (PUBL) Method and device for determining resource utilization
CN106330558A (en) * 2016-08-31 2017-01-11 哈尔滨工业大学(威海) Controller load prediction system and method applied to software defined network
CN110024340B (en) * 2016-10-25 2021-10-15 极进网络公司 Near-uniform load balancing in visibility networks via use of prediction
CN106941456B (en) * 2017-05-17 2019-08-30 华中科技大学 The load-balancing method and system of plane are controlled in a kind of software defined network
CN107425987B (en) * 2017-09-12 2019-11-01 中国联合网络通信集团有限公司 A kind of Switch control method, apparatus and system
CN114338537B (en) * 2021-12-29 2024-01-19 安徽大学 SDN load balancing dual-weight switch migration method and system based on prediction

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731307A (en) * 2013-12-30 2014-04-16 浙江大学 Method for standardized data surface dynamic reconstruction for multiple services
CN103795805A (en) * 2014-02-27 2014-05-14 中国科学技术大学苏州研究院 Distributed server load balancing method based on SDN
CN104065585A (en) * 2014-07-16 2014-09-24 福州大学 Method for dynamically adjusting load of controller in software-defined network

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030074449A1 (en) * 2001-10-12 2003-04-17 Rory Smith Bandwidth allocation in a synchronous transmission network for packet oriented signals
US9210615B2 (en) * 2012-09-17 2015-12-08 Brocade Communications Systems, Inc. Method and system for elastic and resilient 3G/4G mobile packet networking for subscriber data flow using virtualized switching and forwarding
CN103929333A (en) * 2014-05-08 2014-07-16 陈桂芳 Implementation method for SDN controller pool
CN104092774B (en) * 2014-07-23 2018-03-09 新华三技术有限公司 Control method and device are established in software defined network connection
CN104065509B (en) * 2014-07-24 2017-07-11 大连理工大学 A kind of SDN multi-controller dispositions methods for reducing management load overhead

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731307A (en) * 2013-12-30 2014-04-16 浙江大学 Method for standardized data surface dynamic reconstruction for multiple services
CN103795805A (en) * 2014-02-27 2014-05-14 中国科学技术大学苏州研究院 Distributed server load balancing method based on SDN
CN104065585A (en) * 2014-07-16 2014-09-24 福州大学 Method for dynamically adjusting load of controller in software-defined network

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685170A (en) * 2019-10-18 2021-04-20 伊姆西Ip控股有限责任公司 Dynamic optimization of backup strategies
CN112685170B (en) * 2019-10-18 2023-12-08 伊姆西Ip控股有限责任公司 Dynamic optimization of backup strategies
CN114826923A (en) * 2021-01-27 2022-07-29 华中科技大学 Network rigidity evaluation method of SDN network
CN114826923B (en) * 2021-01-27 2023-04-28 华中科技大学 Network stiffness evaluation method of SDN (software defined network)

Also Published As

Publication number Publication date
CN105577729B (en) 2020-09-29
CN105577729A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
WO2015131699A1 (en) Load balancing method and device
Noormohammadpour et al. Datacenter traffic control: Understanding techniques and tradeoffs
CN1643860A (en) Method and arrangement for dinamic allocation of network resources
Paganini et al. Network stability under alpha fair bandwidth allocation with general file size distribution
Gurvich et al. Overflow networks: Approximations and implications to call center outsourcing
WO2015154483A1 (en) Network traffic balancing method and super controller
CN113946436B (en) Resource pre-scheduling method based on load balancing
CN116302578A (en) QoS (quality of service) constraint stream application delay ensuring method and system
CN102420741B (en) The method of dispatching communication flow and device in based on the equipment of ATCA
Borst et al. Fluid limits for bandwidth-sharing networks in overload
Mirtchev Packet-level link capacity evaluation for IP networks
Vlahakis et al. Aimd scheduling and resource allocation in distributed computing systems
Bramson et al. Proportional switching in first-in, first-out networks
Martin et al. Network slicing for deterministic latency
Jung et al. Revisiting stochastic loss networks: Structures and algorithms
CN106447302A (en) Intelligent order distributing method
Olsen et al. Qrp01-5: Quantitative analysis of access strategies to remote information in network services
CN104202263A (en) Equitable distribution method of bandwidth resources of multi-tenant data center
Schulz et al. End-to-end latency distribution in future mobile communication networks
Iversen Reversible fair scheduling: the teletraffic theory revisited
Iversen The internet erlang formula
Li et al. On optimal routing in overloaded parallel queues
Bekker et al. Performance of TCP-friendly streaming sessions in the presence of heavy-tailed elastic flows
Ying et al. Buffer overflow asymptotics for multiplexed regulated traffic
WO2006067770A1 (en) A network analysis tool

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: 15759066

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: 15759066

Country of ref document: EP

Kind code of ref document: A1