# Load Balancing of SDN Controller for Migration Optimization Based on Metaheuristics

Authors: Congcong Min
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

With the existing power SDN network architecture, the improved switches migration algorithm is put forward. Through the advantages of the ant colony algorithm and genetic algorithm fusion, the migration process is optimized, and the fusion algorithm in switches uses the operation, such as restrictions in advance and pruning algorithm efficiency to eventually apply migration under multiple controllers to the switch. The efficiency and stability of switch migration under multicontroller are improved, and the performance of the RYU controller is compared with other algorithms. The results of the algorithm and performance comparison test show that the improved ant colony algorithm is reduced by 12.5% and 1.5%, which is a comparison of response delay; the accuracy of the migration operation of the algorithm can make full use of the resources of the controller and achieve the purpose of improving the migration efficiency and load balancing among multiple controllers.


---

## Body

## 1. Related Work

In the new network architecture of SDN, load balancing between multiple controllers is realized by switch migration. During switch migration, the first problem to be solved is how to migrate the switch the fastest without losing data. To solve this problem, Haller et al. mentioned the seamless migration mode, that is, the switch is connected to two controllers at the same time, and the roles of the two controllers are changed at the same time, so as to achieve rapid data migration. However, for the existing SDN network, and due to the instantaneous network traffic, controllers in the same cluster may not only be overloaded with one controller but may be overloaded with two or more controllers at the same time [1, 2]. In this case, no matter how efficiently the switch migration is performed, the stability of the network cannot be restored quickly. Therefore, a switch migration optimization algorithm is proposed. Classical optimization algorithms include nearby selection algorithms [3], genetic algorithms [4–6], immune particle swarm optimization algorithms, and so on [5–8].Among them, the nearby migration algorithm is to select the controller with the lowest migration cost as the target controller for migration by calculating the path between the global controller and the overload controller when the controller overload is detected. This method is fast, but when multiple controllers are overloaded at the same time, two or more controllers may migrate to one controller, resulting in a secondary overload of the target controller. In this case, one switch migration cannot complete load balancing, and multiple switches are required to achieve load balancing. To solve this problem, both genetic algorithm and improved particle swarm optimization (PSO) have been improved [9–11]. However, due to the complexity of particle swarm optimization and genetic algorithm and the problem of long calculation time under single controller overload, there is still a lot of research direction in the optimization of switch migration algorithm. The classical optimization algorithm tries to solve the load balancing of multicontrol architecture by unified scheduling in the control plane, which has achieved good results. In view of the actual situation of existing algorithms and switch migration process, heuristic algorithms, such as ant colony algorithm and genetic algorithm, have very good advantages in computing speed and resource consumption [12, 13]. However, both ant colony algorithm and genetic algorithm have exposed many shortcomings in the course of many years of practice. Ant colony algorithm has fast global search ability, but poor local search ability, while genetic algorithm has good local search ability but poor global search ability. In this regard, the research focus of this paper is to integrate the ant colony algorithm and genetic algorithm and improve the actual application scenarios under the SDN architecture, so as to improve the performance of SDN and maintain the load balancing of SDN.


## 2. Traditional Ant Colony Algorithm

At present, the ant colony algorithm has been used in the path planning of AGV vehicles. In application, it can be divided into three parts: foraging, movement, and pheromone rules. Foraging rules are used to determine the impassable locations, which depends on the set tabu list, and then the ant’s current location is added to it [14–16].Movement rules are used to determine the ant’s transition probability in different nodes, which needs to use heuristic functions and pheromone concentrations. If there are no movable nodes obtained, the current search process ends. In addition, in order to improve the search ability of the algorithm, the roulette method is introduced to ensure that all nodes can be selected. The formulas of transition probability are as follows [17]:(1)pijkt=τijtα×ηjtβ∑s⊂allowedkτistα×ηjtβ,j∈allowedk,0,j∉allowedk,ηj=1dj,dj=Jx−Ex2+Jy−Ey2,wherea and β are the important factors of pheromone and heuristic function, respectively. k represents an ant. Moreover, pijkt and allowedk represent the transition probability and corresponding set of k at the lower node respectively. ηjt represents the heuristic function, which is related to the distance dj between endpoint E and node j, and τijt represents the pheromone concentration transferred at nodes i and j.For the pheromone rule, pheromones in the path do not increase with the ant’s release, but some of them volatilize. After multiple loops, the updated formula of pheromone in the path is as follows [18]:(2)τijt+1=1−ρτij+∑k=1mΔτijk,where m represents the number of ants and ρ represents the volatilization factor of pheromone, which takes values between 0 and 1. Furthermore, Δτijk represents the pheromone left by ant k in the iteration, whose form is as follows [19]:(3)Δτijk=QLk,kth ant goes from nodeito nodej,Q,Others,where Lk represents the total length of the ant’s path and Q means a constant.


## 3. Switch Migration Algorithm Based on Improved Ant Colony

Combined with the previous analysis, the basic principle of the ant colony algorithm has been defined. This algorithm has some advantages in convergence and local search, but there are also some obvious shortages, which embodies that the global search ability is poor. And, for large network architecture, the generation of initial pheromone takes a long time occupying the algorithm more than 60% of the total execution time, which reduces the efficiency significantly. On the other hand, genetic algorithm is also widely used to solve optimization problems. The algorithm has good global search ability, but it is difficult to maintain high convergence when the network scale is large. Considering the above problems comprehensively, the two algorithms mentioned above can be combined in the new SDN network architecture, which makes up for the shortcomings of the single algorithm. The advantages of the two algorithms can be given full play; thus, the effect of load balancing is improved. In addition, SDN is a cloud computing method that can realize network configuration by programming controller, so as to fundamentally solve the problem of decentralized and complex static architecture in traditional networks, which improves the performance and processing efficiency of the network. However, the current network requires greater flexibility and simple troubleshooting. SDN realizes centralized and unified control of the network through the control plane, thus greatly improving the performance of the network. Therefore, this study attempts to optimize the load balancing problem of SDN under the control plane through the ant colony algorithm.As can be seen, the ant colony algorithm and genetic algorithm are integrated to design an improved ant colony switch migration algorithm. The parameters of the algorithm are optimized to improve the effect of load balancing.


### 3.1. Load Balancing Strategy of Migration Algorithm

Analyzing the problems in the fusion algorithm, the optimization strategy is proposed, which is embodied in the selection of switch and target controller. Given thatC=c,1c2,…,cM represents all controller nodes in G of the SDN area and S=s1,s2,…,sN represents the set of switches. The control relation between the two is expressed as F=fijM×N, where when ci controls sj, there is fij=1, and when other cases occur, there is fij=0. ci can be used as the source node or the target node. If ∀ci∈c and it is overloaded, ci needs to be migrated, and the controller is the source node. When ci receives the migrated computer, the corresponding controller is the target node. If the number of migration switches and overloaded controllers is N and M, respectively, ci can obtain the number of current requests rij of switch sj. Meanwhile, the controller is used to load, and the load comes from multiple sources, including memory, CPU utilization Umem, Ucpu, and number of switches N. The specific formula is shown as follows.


#### 3.1.1. Migration Time

The controller’s resource utilizationUc, the current CPU utilization Ucpu, the current memory utilization Umem, and the network bandwidth utilization Unet are taken as main performance parameters, wherein the controller’s resource utilization is expressed by the percentage of all switch requests under the current controller and the maximum request volume accepted by the controller.SetThreshold (Uc, Ucpu, Umem, and Unet) as the triggering policy. Within a period T, ci collects parameters once and compares them with matched load characteristic thresholds (ucth, ucpth, umth, and unth). If a parameter is greater than the maximum threshold for several consecutive times, the controller ci is considered to be overloaded, and the switch must be migrated. If none of the parameters is higher than the threshold, the controller is considered to be idle, and the switch can be migrated in.


#### 3.1.2. Switch Selection

In this paper, the probability formula is used to select switches, and the switch selection probabilitypij is shown in the following formula:(4)pij=exp−rij/μij∑j∈siexp−rij/μij,where rij is the number of flow requests from sj to ci, μij is the hop number between sj and ci, and Si is the set of sj controlled by ci.Assume thatX is the load volume that exceeds the overload controller ci and a is the load of the switch in set S. Only when n, the number of switches migrated by the overload controller, meets the condition ∑i=1naj>X can flow requests be processed in time in this area.


#### 3.1.3. Selection of Target Controller

After the migration controller and migration switch are determined, this paper mainly uses the improved ant colony algorithm to select the appropriate immigration controller. Firstly, for the immigration controller, the more the idle resources, the higher the probability of occurrence in the process of crossover and mutation, and the higher the probability of eventually appearing in the initial pheromone set of the ant colony algorithm. Secondly, the larger the hop number between the migration controller and the immigration controller, the longer the communication time between the two controllers, and the smaller the number of ants appearing on the path. Therefore, the functionvij for searching the target controller in the improved ant colony algorithm is defined as follows:(5)vij=rijμisdij1−μis,where rij is the number of flow requests from sj to ci, μij is the hop number between sj and ci, and Si is the set of sj controlled by ci.Thus, to solve the switch migration problem is to solve a typical traveling salesman problem of the ant colony algorithm.


### 3.2. Solving Migration Problem

At present, the ant colony algorithm has been widely used to solve optimization problems. The characteristics of the algorithm are high convergence, strong concurrency, good local search performance, and so on. In principle, the method is designed mainly according to the ants foraging rule in nature, and the optimal path is obtained through positive feedback, namely the optimal solution to the problem. In addition to this algorithm, genetic algorithm is also widely used to solve optimization problems. Genetic algorithm has strong global search ability, randomness, and rapidity. The algorithm is designed according to the law of evolution in nature, and high-quality offspring can be generated through crossover, mutation, and other ways. On this basis, the optimal solution can be obtained by coding.However, there are some problems in the application of the above two algorithms. On the one hand, the efficiency of the ant colony algorithm is low in the initial search, although it will be improved in the process of pheromone accumulation. On the other hand, the convergence of the genetic algorithm is fast in the initial search, but it will decrease significantly in the later stage. Thus, after fusing the two algorithms, the advantages of the two algorithms can be given full play, which can keep high efficiency while obtaining the optimization results. At present, there are many researches in this field, and different methods have been formed. The common fusion strategies are divided into two categories: firstly, a genetic algorithm is used to get the initial pheromone solution, and then it is applied to the ant colony algorithm to get the optimal solution. Secondly, the genetic operation is added to the ant colony algorithm to diversify the solutions. After analysis, the second strategy is finally adopted in this paper.


#### 3.2.1. Algorithm Design and Implementation

Adopting coded parameters is the significant difference between the genetic algorithm and other algorithms. Therefore, when using a genetic algorithm, the first is to determine the appropriate codingG, which generally is binary coding. Besides this method, tree code or volume number code can also be adopted. In addition, when using the ant colony algorithm, it often needs to transform the problem to be solved. Only after it is transformed into the traveling merchant problem can it be solved.The above factors are considered in the design of the fusion algorithm. For example, for the ant colony algorithm, there are only two selection paths for each node except the last node. And ant pheromone distribution is used to solve the continuous calculation problem. After analysis, for the genetic algorithm, the binary coding method is adopted. On this basis, the fusion of two algorithms is carried out.At present, some scholars have studied the fusion of two algorithms and put forward different fusion strategies, which can be generally divided into two categories. The first one is that the ant colony algorithm takes a higher proportion of the whole algorithm, and the genetic algorithm serves as an auxiliary part. The second is the opposite, with a higher proportion of genetic algorithms and ant colony algorithms as auxiliary.A genetic algorithm (binary coding) and ant colony algorithm (double subsequent nodes) can be used to design a fusion algorithm. The first algorithm needs to adopt the genetic algorithm firstly and then uses the ant colony algorithm. Specifically, the initial solution set is firstly obtained by the genetic algorithm, and then it is input into the ant colony algorithm as the initial pheromone path; thus, the optimal solution is further calculated. The second algorithm mainly uses the ant colony algorithm. Adding genetic and mutation operations to the ant colony algorithm is helpful for the improvement of global optimization ability. Considering various factors, the second algorithm is finally selected in this paper.In the research, the fusion algorithm is used to solve the load balancing problem of multiple controllers, which needs to transform the problem first. And using a cross way to combine the original paths can make the algorithm achieve higher global search ability. Finally, the pheromone concentration of a new path needs to be updated. In the fusion algorithm, the selection and mutation of a genetic algorithm are introduced. In the crossover process, the intersection position between the ant colony algorithm path and genetic algorithm should be selected randomly, and then the corresponding new path can be obtained by selecting the crossover.The basic principle of path crossing is shown in Figure1.Figure 1
Operation principle of path crossing.When ants pass by, a pheromone is left over in each path, which is updated by pheromone concentration in the algorithm.Here,Knot−jj=1,…,r,i=0,1 represents the migration path of j,i, and each node has two migration nodes, which are Next−knot−0 andNext−knot−1, respectively. The connected edge is represented as edgej,i,1. Thus, the formulas of a pheromone update are as follows:(6)τj,i,1t+1=ρτj,i,1t+Δτj,i,1,Δτj,i,1=∑k=1mτj,i,1k,Δτj,i,1k=QFkx1,x2,…,xn,When  the  kth  ant  passes  by  the  edge,0,Otherwise,where m represents the number of ants, Fkx1,x2,…,xn represents the final obtained optimal solution, and Δτj,i,1k represents the pheromone concentration increased in edgej,i,ij during the movement of ants. The probability formula of ant selecting subsequent nodes is as follows:(7)pj,i,ijk=τj,i,ijαηj,i,ijkβτj,i,0αηj,i,0kβ+τj,i,1αηj,i,1kβ.where τj,i,0 and τj,i,1 represent the pheromone concentration of Edgej,i,0 and Edgej,i,1, respectively. ηj,i,0,ηj,i,1 represent the visibility function of the two edges. α and β are the coefficients associated with node selection.


#### 3.2.2. Specific Solution Steps

The improved algorithm is described as follows:(1)
Initialize related parametersα,β,ρ, and so on of ant colony algorithm(2)
Calculate iteratively(3)
Whilet< iteration period c, output the final optimal solutionThe improved ant colony algorithm is applied to the load balancing problem of SDN, which can ensure the dynamic selection of migration objects. However, if the scale of network topology is large, it cannot maintain a high convergence rate. Therefore, the genetic algorithm can be introduced to solve the above problems effectively, so as to further improve the global search ability and convergence performance of the algorithm.For the problem of load balancing, it is difficult to migrate each switch to other switches randomly due to the influence of the subdomain division of the controller. Therefore, pruning is carried out for the genetic algorithm to ensure that ant paths are all in the subdomain. The specific process is as follows: firstly, the pruning is carried out by the genetic algorithm to obtain the initial pheromone. Then the ant colony algorithm is used for processing, and the global optimal solution is obtained by an iterative method. In this way, the optimal migration path can be obtained. The fusion algorithm designed in this paper, namely, the GA-ACO algorithm, is as follows:(1)
Related parameters of the improved ant colony algorithm(2)
Path crossover probabilityPc(3)
Perform improved ant colony algorithm(4)
Whilet< iteration period c, output the results


## 3.1. Load Balancing Strategy of Migration Algorithm

Analyzing the problems in the fusion algorithm, the optimization strategy is proposed, which is embodied in the selection of switch and target controller. Given thatC=c,1c2,…,cM represents all controller nodes in G of the SDN area and S=s1,s2,…,sN represents the set of switches. The control relation between the two is expressed as F=fijM×N, where when ci controls sj, there is fij=1, and when other cases occur, there is fij=0. ci can be used as the source node or the target node. If ∀ci∈c and it is overloaded, ci needs to be migrated, and the controller is the source node. When ci receives the migrated computer, the corresponding controller is the target node. If the number of migration switches and overloaded controllers is N and M, respectively, ci can obtain the number of current requests rij of switch sj. Meanwhile, the controller is used to load, and the load comes from multiple sources, including memory, CPU utilization Umem, Ucpu, and number of switches N. The specific formula is shown as follows.


### 3.1.1. Migration Time

The controller’s resource utilizationUc, the current CPU utilization Ucpu, the current memory utilization Umem, and the network bandwidth utilization Unet are taken as main performance parameters, wherein the controller’s resource utilization is expressed by the percentage of all switch requests under the current controller and the maximum request volume accepted by the controller.SetThreshold (Uc, Ucpu, Umem, and Unet) as the triggering policy. Within a period T, ci collects parameters once and compares them with matched load characteristic thresholds (ucth, ucpth, umth, and unth). If a parameter is greater than the maximum threshold for several consecutive times, the controller ci is considered to be overloaded, and the switch must be migrated. If none of the parameters is higher than the threshold, the controller is considered to be idle, and the switch can be migrated in.


### 3.1.2. Switch Selection

In this paper, the probability formula is used to select switches, and the switch selection probabilitypij is shown in the following formula:(4)pij=exp−rij/μij∑j∈siexp−rij/μij,where rij is the number of flow requests from sj to ci, μij is the hop number between sj and ci, and Si is the set of sj controlled by ci.Assume thatX is the load volume that exceeds the overload controller ci and a is the load of the switch in set S. Only when n, the number of switches migrated by the overload controller, meets the condition ∑i=1naj>X can flow requests be processed in time in this area.


### 3.1.3. Selection of Target Controller

After the migration controller and migration switch are determined, this paper mainly uses the improved ant colony algorithm to select the appropriate immigration controller. Firstly, for the immigration controller, the more the idle resources, the higher the probability of occurrence in the process of crossover and mutation, and the higher the probability of eventually appearing in the initial pheromone set of the ant colony algorithm. Secondly, the larger the hop number between the migration controller and the immigration controller, the longer the communication time between the two controllers, and the smaller the number of ants appearing on the path. Therefore, the functionvij for searching the target controller in the improved ant colony algorithm is defined as follows:(5)vij=rijμisdij1−μis,where rij is the number of flow requests from sj to ci, μij is the hop number between sj and ci, and Si is the set of sj controlled by ci.Thus, to solve the switch migration problem is to solve a typical traveling salesman problem of the ant colony algorithm.


## 3.1.1. Migration Time

The controller’s resource utilizationUc, the current CPU utilization Ucpu, the current memory utilization Umem, and the network bandwidth utilization Unet are taken as main performance parameters, wherein the controller’s resource utilization is expressed by the percentage of all switch requests under the current controller and the maximum request volume accepted by the controller.SetThreshold (Uc, Ucpu, Umem, and Unet) as the triggering policy. Within a period T, ci collects parameters once and compares them with matched load characteristic thresholds (ucth, ucpth, umth, and unth). If a parameter is greater than the maximum threshold for several consecutive times, the controller ci is considered to be overloaded, and the switch must be migrated. If none of the parameters is higher than the threshold, the controller is considered to be idle, and the switch can be migrated in.


## 3.1.2. Switch Selection

In this paper, the probability formula is used to select switches, and the switch selection probabilitypij is shown in the following formula:(4)pij=exp−rij/μij∑j∈siexp−rij/μij,where rij is the number of flow requests from sj to ci, μij is the hop number between sj and ci, and Si is the set of sj controlled by ci.Assume thatX is the load volume that exceeds the overload controller ci and a is the load of the switch in set S. Only when n, the number of switches migrated by the overload controller, meets the condition ∑i=1naj>X can flow requests be processed in time in this area.


## 3.1.3. Selection of Target Controller

After the migration controller and migration switch are determined, this paper mainly uses the improved ant colony algorithm to select the appropriate immigration controller. Firstly, for the immigration controller, the more the idle resources, the higher the probability of occurrence in the process of crossover and mutation, and the higher the probability of eventually appearing in the initial pheromone set of the ant colony algorithm. Secondly, the larger the hop number between the migration controller and the immigration controller, the longer the communication time between the two controllers, and the smaller the number of ants appearing on the path. Therefore, the functionvij for searching the target controller in the improved ant colony algorithm is defined as follows:(5)vij=rijμisdij1−μis,where rij is the number of flow requests from sj to ci, μij is the hop number between sj and ci, and Si is the set of sj controlled by ci.Thus, to solve the switch migration problem is to solve a typical traveling salesman problem of the ant colony algorithm.


## 3.2. Solving Migration Problem

At present, the ant colony algorithm has been widely used to solve optimization problems. The characteristics of the algorithm are high convergence, strong concurrency, good local search performance, and so on. In principle, the method is designed mainly according to the ants foraging rule in nature, and the optimal path is obtained through positive feedback, namely the optimal solution to the problem. In addition to this algorithm, genetic algorithm is also widely used to solve optimization problems. Genetic algorithm has strong global search ability, randomness, and rapidity. The algorithm is designed according to the law of evolution in nature, and high-quality offspring can be generated through crossover, mutation, and other ways. On this basis, the optimal solution can be obtained by coding.However, there are some problems in the application of the above two algorithms. On the one hand, the efficiency of the ant colony algorithm is low in the initial search, although it will be improved in the process of pheromone accumulation. On the other hand, the convergence of the genetic algorithm is fast in the initial search, but it will decrease significantly in the later stage. Thus, after fusing the two algorithms, the advantages of the two algorithms can be given full play, which can keep high efficiency while obtaining the optimization results. At present, there are many researches in this field, and different methods have been formed. The common fusion strategies are divided into two categories: firstly, a genetic algorithm is used to get the initial pheromone solution, and then it is applied to the ant colony algorithm to get the optimal solution. Secondly, the genetic operation is added to the ant colony algorithm to diversify the solutions. After analysis, the second strategy is finally adopted in this paper.


### 3.2.1. Algorithm Design and Implementation

Adopting coded parameters is the significant difference between the genetic algorithm and other algorithms. Therefore, when using a genetic algorithm, the first is to determine the appropriate codingG, which generally is binary coding. Besides this method, tree code or volume number code can also be adopted. In addition, when using the ant colony algorithm, it often needs to transform the problem to be solved. Only after it is transformed into the traveling merchant problem can it be solved.The above factors are considered in the design of the fusion algorithm. For example, for the ant colony algorithm, there are only two selection paths for each node except the last node. And ant pheromone distribution is used to solve the continuous calculation problem. After analysis, for the genetic algorithm, the binary coding method is adopted. On this basis, the fusion of two algorithms is carried out.At present, some scholars have studied the fusion of two algorithms and put forward different fusion strategies, which can be generally divided into two categories. The first one is that the ant colony algorithm takes a higher proportion of the whole algorithm, and the genetic algorithm serves as an auxiliary part. The second is the opposite, with a higher proportion of genetic algorithms and ant colony algorithms as auxiliary.A genetic algorithm (binary coding) and ant colony algorithm (double subsequent nodes) can be used to design a fusion algorithm. The first algorithm needs to adopt the genetic algorithm firstly and then uses the ant colony algorithm. Specifically, the initial solution set is firstly obtained by the genetic algorithm, and then it is input into the ant colony algorithm as the initial pheromone path; thus, the optimal solution is further calculated. The second algorithm mainly uses the ant colony algorithm. Adding genetic and mutation operations to the ant colony algorithm is helpful for the improvement of global optimization ability. Considering various factors, the second algorithm is finally selected in this paper.In the research, the fusion algorithm is used to solve the load balancing problem of multiple controllers, which needs to transform the problem first. And using a cross way to combine the original paths can make the algorithm achieve higher global search ability. Finally, the pheromone concentration of a new path needs to be updated. In the fusion algorithm, the selection and mutation of a genetic algorithm are introduced. In the crossover process, the intersection position between the ant colony algorithm path and genetic algorithm should be selected randomly, and then the corresponding new path can be obtained by selecting the crossover.The basic principle of path crossing is shown in Figure1.Figure 1
Operation principle of path crossing.When ants pass by, a pheromone is left over in each path, which is updated by pheromone concentration in the algorithm.Here,Knot−jj=1,…,r,i=0,1 represents the migration path of j,i, and each node has two migration nodes, which are Next−knot−0 andNext−knot−1, respectively. The connected edge is represented as edgej,i,1. Thus, the formulas of a pheromone update are as follows:(6)τj,i,1t+1=ρτj,i,1t+Δτj,i,1,Δτj,i,1=∑k=1mτj,i,1k,Δτj,i,1k=QFkx1,x2,…,xn,When  the  kth  ant  passes  by  the  edge,0,Otherwise,where m represents the number of ants, Fkx1,x2,…,xn represents the final obtained optimal solution, and Δτj,i,1k represents the pheromone concentration increased in edgej,i,ij during the movement of ants. The probability formula of ant selecting subsequent nodes is as follows:(7)pj,i,ijk=τj,i,ijαηj,i,ijkβτj,i,0αηj,i,0kβ+τj,i,1αηj,i,1kβ.where τj,i,0 and τj,i,1 represent the pheromone concentration of Edgej,i,0 and Edgej,i,1, respectively. ηj,i,0,ηj,i,1 represent the visibility function of the two edges. α and β are the coefficients associated with node selection.


### 3.2.2. Specific Solution Steps

The improved algorithm is described as follows:(1)
Initialize related parametersα,β,ρ, and so on of ant colony algorithm(2)
Calculate iteratively(3)
Whilet< iteration period c, output the final optimal solutionThe improved ant colony algorithm is applied to the load balancing problem of SDN, which can ensure the dynamic selection of migration objects. However, if the scale of network topology is large, it cannot maintain a high convergence rate. Therefore, the genetic algorithm can be introduced to solve the above problems effectively, so as to further improve the global search ability and convergence performance of the algorithm.For the problem of load balancing, it is difficult to migrate each switch to other switches randomly due to the influence of the subdomain division of the controller. Therefore, pruning is carried out for the genetic algorithm to ensure that ant paths are all in the subdomain. The specific process is as follows: firstly, the pruning is carried out by the genetic algorithm to obtain the initial pheromone. Then the ant colony algorithm is used for processing, and the global optimal solution is obtained by an iterative method. In this way, the optimal migration path can be obtained. The fusion algorithm designed in this paper, namely, the GA-ACO algorithm, is as follows:(1)
Related parameters of the improved ant colony algorithm(2)
Path crossover probabilityPc(3)
Perform improved ant colony algorithm(4)
Whilet< iteration period c, output the results


## 3.2.1. Algorithm Design and Implementation

Adopting coded parameters is the significant difference between the genetic algorithm and other algorithms. Therefore, when using a genetic algorithm, the first is to determine the appropriate codingG, which generally is binary coding. Besides this method, tree code or volume number code can also be adopted. In addition, when using the ant colony algorithm, it often needs to transform the problem to be solved. Only after it is transformed into the traveling merchant problem can it be solved.The above factors are considered in the design of the fusion algorithm. For example, for the ant colony algorithm, there are only two selection paths for each node except the last node. And ant pheromone distribution is used to solve the continuous calculation problem. After analysis, for the genetic algorithm, the binary coding method is adopted. On this basis, the fusion of two algorithms is carried out.At present, some scholars have studied the fusion of two algorithms and put forward different fusion strategies, which can be generally divided into two categories. The first one is that the ant colony algorithm takes a higher proportion of the whole algorithm, and the genetic algorithm serves as an auxiliary part. The second is the opposite, with a higher proportion of genetic algorithms and ant colony algorithms as auxiliary.A genetic algorithm (binary coding) and ant colony algorithm (double subsequent nodes) can be used to design a fusion algorithm. The first algorithm needs to adopt the genetic algorithm firstly and then uses the ant colony algorithm. Specifically, the initial solution set is firstly obtained by the genetic algorithm, and then it is input into the ant colony algorithm as the initial pheromone path; thus, the optimal solution is further calculated. The second algorithm mainly uses the ant colony algorithm. Adding genetic and mutation operations to the ant colony algorithm is helpful for the improvement of global optimization ability. Considering various factors, the second algorithm is finally selected in this paper.In the research, the fusion algorithm is used to solve the load balancing problem of multiple controllers, which needs to transform the problem first. And using a cross way to combine the original paths can make the algorithm achieve higher global search ability. Finally, the pheromone concentration of a new path needs to be updated. In the fusion algorithm, the selection and mutation of a genetic algorithm are introduced. In the crossover process, the intersection position between the ant colony algorithm path and genetic algorithm should be selected randomly, and then the corresponding new path can be obtained by selecting the crossover.The basic principle of path crossing is shown in Figure1.Figure 1
Operation principle of path crossing.When ants pass by, a pheromone is left over in each path, which is updated by pheromone concentration in the algorithm.Here,Knot−jj=1,…,r,i=0,1 represents the migration path of j,i, and each node has two migration nodes, which are Next−knot−0 andNext−knot−1, respectively. The connected edge is represented as edgej,i,1. Thus, the formulas of a pheromone update are as follows:(6)τj,i,1t+1=ρτj,i,1t+Δτj,i,1,Δτj,i,1=∑k=1mτj,i,1k,Δτj,i,1k=QFkx1,x2,…,xn,When  the  kth  ant  passes  by  the  edge,0,Otherwise,where m represents the number of ants, Fkx1,x2,…,xn represents the final obtained optimal solution, and Δτj,i,1k represents the pheromone concentration increased in edgej,i,ij during the movement of ants. The probability formula of ant selecting subsequent nodes is as follows:(7)pj,i,ijk=τj,i,ijαηj,i,ijkβτj,i,0αηj,i,0kβ+τj,i,1αηj,i,1kβ.where τj,i,0 and τj,i,1 represent the pheromone concentration of Edgej,i,0 and Edgej,i,1, respectively. ηj,i,0,ηj,i,1 represent the visibility function of the two edges. α and β are the coefficients associated with node selection.


## 3.2.2. Specific Solution Steps

The improved algorithm is described as follows:(1)
Initialize related parametersα,β,ρ, and so on of ant colony algorithm(2)
Calculate iteratively(3)
Whilet< iteration period c, output the final optimal solutionThe improved ant colony algorithm is applied to the load balancing problem of SDN, which can ensure the dynamic selection of migration objects. However, if the scale of network topology is large, it cannot maintain a high convergence rate. Therefore, the genetic algorithm can be introduced to solve the above problems effectively, so as to further improve the global search ability and convergence performance of the algorithm.For the problem of load balancing, it is difficult to migrate each switch to other switches randomly due to the influence of the subdomain division of the controller. Therefore, pruning is carried out for the genetic algorithm to ensure that ant paths are all in the subdomain. The specific process is as follows: firstly, the pruning is carried out by the genetic algorithm to obtain the initial pheromone. Then the ant colony algorithm is used for processing, and the global optimal solution is obtained by an iterative method. In this way, the optimal migration path can be obtained. The fusion algorithm designed in this paper, namely, the GA-ACO algorithm, is as follows:(1)
Related parameters of the improved ant colony algorithm(2)
Path crossover probabilityPc(3)
Perform improved ant colony algorithm(4)
Whilet< iteration period c, output the results


## 4. Simulation Experiment and Performance Analysis

### 4.1. Construction of Simulation Environment

In the simulation process, Open vSwitch 1.4.6, Zookeeper 3.4.5, and so on are used. The hardware should ensure that the processor is Intel I7, and hard disk and memory are not less than 500 G and 12 G, respectively. Software configuration is Windows 10 system, and the virtual machine is VMware.In addition, the number of OVS switches and controllers used in the simulation is 12 and 4, respectively, and the processing performance of each controller is different. The load threshold of the controller ismaxucth,ucpth,umth,unth=0.9,0.9,0.85,0.95, and the sampling period is 10 s. In the simulation, the data flow speed of the switch is improved step by step, and the response delay of the controller, the resource utilization ratio, and other indicators are recorded and analyzed.Analyzing the application effect of improved ant colony algorithm to compare with proximity migration algorithm, its influence on load balancing is discussed.


### 4.2. Parameter Setting of Improved Ant Colony Algorithm

The application effect of the ant colony algorithm will be affected by the parameter setting. If the parameter setting is not reasonable, the effectiveness of the algorithm will be inevitably reduced. In this paper, the effects of various parameters are analyzed, including hormone volatility coefficientρ, heuristic factor α and β, ant number m, and so on. The influence of each parameter is discussed, and the relevant parameters are reasonably set, which makes the improved algorithm can play a better role in the load balancing.


#### 4.2.1. Setting of Hormone Volatility Coefficient

The global update method is adopted, and the form ofΔτijkt is as follows:(8)Δτijkt=Qcostij,The path that antKpassing through nodeiand nodejin a loop,0,Otherwise,where there are two nodes i and j. costij represents the overhead of i and j. ρ and 1−ρ represent the volatility coefficient and retention coefficient of hormones, respectively. The improved algorithm still has problems of falling into local optimum and low convergence speed, which is directly related to the rationality of setting ρ.Hormone volatility coefficientρ is an important parameter that if it is not set or set unreasonable, the application effect of the fusion algorithm will be adversely affected. Specifically, if the parameter is not set, the subsequent nodes may still have paths that do not belong to alternative paths due to the influence of crossover operations, thus affecting the convergence of the algorithm. If this parameter is too small, the volatility speed of the hormone is significantly reduced. At this time, it is difficult for the pheromones in the path to forming a large difference so the global optimal solution cannot be achieved. However, if this parameter is too large, the pheromone in the path volatilizes quickly, which increases the randomness of the ant’s selection of subsequent nodes and reduces the convergence of the algorithm. Therefore, it is necessary to determine the hormone volatility coefficient in an appropriate way, and the specific process is shown as follows.To research the setting of hormone volatility coefficientρ, the first is to set relevant parameters. The expected factors are set as α=1 and β=2. The number of ants is set as M=5. Given that p=1, ρ is 0.1, 0.3, 0.5, 0.7, or 0.9, and the influence of ρ on the performance of the improved ant colony algorithm is changed. After each parameter is set, iteration begins. If the difference between the maximum vmax of hormone concentration and the minimum vmin in each path exceeds 10%, the iteration process can be ended. The final results are shown in Figure 2.Figure 2
Influence of hormone volatility coefficient on the improved ant colony algorithm.The relationship between the iteration number and the hormone volatility coefficient is shown in Figure3.Figure 3
Relationship between pheromone volatility coefficientρ and iterations.As can be seen, there is a positive correlation between the number of iterations and the hormone volatility coefficient on the whole. If the hormone volatility coefficient is higher, it means the number of iterations also is higher. In this case, the influence of hormones on path selection is small, but it affects the convergence of the algorithm. When the value of the volatility coefficient is small, although the number of iterations is small, the convergence speed is improved. The algorithm is prone to local convergence; thus, the global optimal solution ultimately cannot be obtained.Combined with the above analysis, when determining the hormone volatility coefficient, the convergence of the algorithm and the global search ability should be taken into consideration. Here, the hormone volatility coefficient is appropriately set between 0.3 and 0.5 to ensure the stability and convergence of the algorithm. At the same time, the global optimization result can be obtained. After the above analysis, the hormone volatility coefficient is finally set as 0.3.


#### 4.2.2. Setting of Heuristic Factorsα and β

Pheromone heuristic factorsα and β mainly express the role of the improved algorithm in ants’ path search, which represent the hormone-dependent size and preference coefficient of path selection, respectively. When the former is larger, it means that the randomness of the ant’s path selection is small, and the ant is more inclined to choose the path previously traveled. In this case, it is easy to lead to local convergence, and it is difficult to obtain the global optimal solution. When the latter is large, it indicates that the ant has a higher probability to choose the local shortest path at a node. Although the convergence speed can be improved, the problem of local optimization also exists. Therefore, it is necessary to set the two reasons, so as to meet the requirements of convergence and optimization.To solve the load balancing problem of SDN architecture, the network scale is usually high. It is necessary to ensure that ants can achieve a certain random search ability in the path search process and meet the requirements of convergence, which will have a great impact on the application effect of the whole algorithm. Therefore, it is necessary to keep a balance between the certainty and randomness of the search, so as to improve the performance of the algorithm.According to the above analysis, the heuristic factor can be set reasonably in combination with the previous simulation. During the simulation process, the hormone volatility coefficient is set as 0.3, and then several groups of heuristic factors are set. The relationship between the algorithm performance and the combination of heuristic factors is verified by simulation. Moreover, the influence of the combination of heuristic factors is discussed; thus, the optimal value of the heuristic factor is determined. The iteration number of different combinations of heuristic factors obtained in the simulation is shown in Figure4.Figure 4
Iterations of heuristic factorsα and β under different combinations.It can be seen from Figure 4 that when the combination of heuristic factors is different, the corresponding number of iterations changes significantly. When both pheromone heuristic factorsα and β are high, the roles of the two are different. The former makes the ant excessively depend on the pheromone concentration to determine the moving path. The latter makes the ant more dependent on the positive feedback and is easy to obtain the local optimal solution. When both are small, the former significantly reduces the dependence of ant on hormone concentration and basically did not use hormone concentration information when determining the path. The latter increases the randomness of path search, which leads to more redundant paths and lower convergence speed, making it difficult to obtain the optimal path. Taking into account the above factors, it is appropriate to set the two to 1 and 2, respectively.


#### 4.2.3. Setting of the Number of Ants

The improved ant colony algorithm needs to obtain the optimal solution from the solution set, which requires the participation of all ants. And the optimal solution can be obtained by iteration. Since each ant will search for an optimal solution, the solution obtained by all ants can form a solution set, so the number of ants will inevitably affect the algorithm performance. If the number is large, the global search ability of the algorithm is stronger, which improves the reliability of the algorithm significantly. However, there may be many invalid paths in the solution set, which reduces the convergence speed and affects the algorithm performance to a certain extent. If the number is too small, it is difficult to maintain a high global search capability, and only a local optimal solution can be obtained.To solve the above problems, it is necessary to set the number of ants reasonably. Here, the previous simulation method is adopted to determine the number of ants. The first is to set the hormone volatility coefficient and two heuristic factors, which are 0.3, 1, and 2, respectively. The second is to set multiple ant numbers for comparison, and the number of ants is 2, 4, 6, 8, and 12. The optimal number is determined according to its influence on algorithm performance. The final results are shown in Figure5.Figure 5
Iterations under different ant numbers.According to the information in the table, there is a negative correlation between the number of ants and the corresponding number of iterations. When the number of ants is small, the corresponding solution set is relatively small, while the number of iterations is large. If the network scale is large, the global optimal solution cannot be obtained. When the number of ants is large, the search performance is improved. However, when the network is complex, some invalid paths are easily introduced, which affects the convergence. After comprehensive consideration, the number of ants is finally set to 8.To sum up, the number of antsM = 8, pheromone heuristic factor α = 1, expected value heuristic factor β = 2, and hormone volatilization coefficient ρ = 0.3.


### 4.3. Optimization Results

#### 4.3.1. Comparison of Resource Utilization Rate of Controller

The migration efficiency of the switch is directly affected by the utilization rate of the controller and can represent the load balancing degree of the controller to a certain extent. Set different load states for each controller, where 1 and 2 are overload and 3 and 4 are light load. Then send data packets to each controller to analyze the changes in resource utilization rate. It is necessary to ensure that controller resources are properly used so that the overload controller can recover.The calculation formula of the resource utilization rate of controller is as follows:(9)Uc=UiUmax,where Ui and Umax need to be obtained in certain ways, among which the former is queried by the Zookeeper module and the latter is obtained based on experimental data. According to existing studies, memory resource utilization is related to many factors. Under the condition that the number of switches and network structure remain unchanged, resource loss in packet-in message processing is an important influencing factor, which is involved in the controller overload. That is, the controller occupies too many resources, affecting functions and performance and making it difficult to process requests in a timely manner. In this paper, experiments are carried out to solve this problem. Furthermore, on the basis of improving packet-in transmission rate to simulate overload, the application effects of different migration algorithms can be analyzed. The final experimental results are shown in the following Figure 6.Figure 6
Comparison diagram of resource utilization rate.It can be seen that controllers are always overloaded before the migration. There are three control strategies used to implement the migration [20–22]. And resource utilization is at a normal level to avoid overload problems. The variance of the proximity migration algorithm, ant colony algorithm, and GA-ACO algorithm are 0.0196, 0.0054, and 0.0041, respectively.The results show that compared with the other two strategies, the proximity migration strategy has obvious disadvantages in achieving load balancing. And, after analysis, it is found that the strategy adopts the principle of proximity during migration. Although it is relatively simple and reduces the delay, it is easy to cause secondary overload. The other two algorithms can effectively avoid the above problems, and both can select the controller for migration according to the load conditions, so as to meet the requirements of load balancing.


#### 4.3.2. Comparison of Response Delay

In load algorithm evaluation, the response delay index is generally used to evaluate controller performance. If the index is small, it means that high performance can be achieved. In this part, detection and analysis are carried out for this indicator, and specifically, the Cbench tool is used to obtain the response delay according to the time difference between the sent packet-in and the received Flow-MOds.To measure and compare the response delays of the three algorithms, set controllers 1 and 2 to be overloaded, and the rest to be a light load. A total of 50 tests are carried out, and the mean value is calculated as the final response delay to ensure the reliability of the test results. The final results are shown in Figure7.Figure 7
Comparison of response delay.According to the information in the above figure, there are certain differences in the response delay of the three algorithms, among which compared with the proximity migration and ant colony algorithms, the improved ant colony algorithm is reduced by 12.5% and 1.5%, respectively. If the migration strategy is not adopted when the controller is overloaded, it is difficult for the controller to process subsequent package-in requests in a timely manner, which ultimately reduces the performance of the controller.If the load is not large, compared with the other two algorithms, the proximity migration algorithm has the smallest response delay. After analysis, the response delay is related to the processing speed of the controller and the distance of switches. And, compared with the other two algorithms, the complexity of the proximity migration algorithm is relatively low; thus, the response delay is small.If the load is heavy, there may be an overloading problem of multiple controllers in the network. At this time, the use of proximity is difficult to meet the requirements, which easily lead to an increase in a response delay. The use of the ant colony algorithm can easily lead to misjudgment of the number of overload controllers, resulting in migration redundancy problems, which will also prolong the response delay. The use of the improved ant colony algorithm has obvious advantages, which not only controls the response delay at a reasonable level but also reduces the network load and improves the rationality of controller resource utilization.When the message generation rate exceeds 45 packet/ms, all controllers are basically in an overload state. In this case, to meet the requirements of load balancing, other controllers must be added.


#### 4.3.3. Comparison of Migration Time

Migration time is an important index, which reflects the migration efficiency of the controller. In the process of migration, the controller is divided into two parts, namely the master controller and the slave controller. The former has only one controller, and the latter can have multiple controllers. The requirements of migration can be met by adjusting the master and slave controllers.Figure8 is the specific process of switch migration, in which the role needs to be changed to a peer role through controller C2. After the target controller C2 becomes a peer controller, it begins to receive the information sent by C1 and begins the migration process. Then C2 receives the information from S, and after C1 sends the flow table, C2 issues a request to change to the master controller and updates the distributed data. After the above operations are complete, the migration process is completed.Figure 8
Switch migration process.The time of a migration can be expressed as the time interval between two role requests: role request-Equal and role response-Master. If multiple controllers are loaded during this period, migrate multiple switches to meet load balancing requirements. In this paper, the average time in multiple migrations is calculated, and the final results are shown in Figure9.Figure 9
Comparison of controller migration time.As can be seen from the figure, significant segmentation points appear around 35 packets/ms, which are mainly related to the load flow limitation of delay and migration time. If the load flow is small, the improved ant colony algorithm has a longer migration time than the other two algorithms. To analyze this phenomenon, the main reason is that the number of migration switches and controllers is relatively small. In addition, load balancing can be realized through simple methods such as proximity migration and so on, and the efficiency is high.When the load is too heavy, the controller overload is more significant, resulting in more switch migrations. If only one switch is migrated each time, the migration time and communication cost will be increased. The improved ant colony algorithm can solve the above problems; thus, more switches can be migrated each time, and the convergence speed is high, which can efficiently achieve the goal of load balancing.


## 4.1. Construction of Simulation Environment

In the simulation process, Open vSwitch 1.4.6, Zookeeper 3.4.5, and so on are used. The hardware should ensure that the processor is Intel I7, and hard disk and memory are not less than 500 G and 12 G, respectively. Software configuration is Windows 10 system, and the virtual machine is VMware.In addition, the number of OVS switches and controllers used in the simulation is 12 and 4, respectively, and the processing performance of each controller is different. The load threshold of the controller ismaxucth,ucpth,umth,unth=0.9,0.9,0.85,0.95, and the sampling period is 10 s. In the simulation, the data flow speed of the switch is improved step by step, and the response delay of the controller, the resource utilization ratio, and other indicators are recorded and analyzed.Analyzing the application effect of improved ant colony algorithm to compare with proximity migration algorithm, its influence on load balancing is discussed.


## 4.2. Parameter Setting of Improved Ant Colony Algorithm

The application effect of the ant colony algorithm will be affected by the parameter setting. If the parameter setting is not reasonable, the effectiveness of the algorithm will be inevitably reduced. In this paper, the effects of various parameters are analyzed, including hormone volatility coefficientρ, heuristic factor α and β, ant number m, and so on. The influence of each parameter is discussed, and the relevant parameters are reasonably set, which makes the improved algorithm can play a better role in the load balancing.


### 4.2.1. Setting of Hormone Volatility Coefficient

The global update method is adopted, and the form ofΔτijkt is as follows:(8)Δτijkt=Qcostij,The path that antKpassing through nodeiand nodejin a loop,0,Otherwise,where there are two nodes i and j. costij represents the overhead of i and j. ρ and 1−ρ represent the volatility coefficient and retention coefficient of hormones, respectively. The improved algorithm still has problems of falling into local optimum and low convergence speed, which is directly related to the rationality of setting ρ.Hormone volatility coefficientρ is an important parameter that if it is not set or set unreasonable, the application effect of the fusion algorithm will be adversely affected. Specifically, if the parameter is not set, the subsequent nodes may still have paths that do not belong to alternative paths due to the influence of crossover operations, thus affecting the convergence of the algorithm. If this parameter is too small, the volatility speed of the hormone is significantly reduced. At this time, it is difficult for the pheromones in the path to forming a large difference so the global optimal solution cannot be achieved. However, if this parameter is too large, the pheromone in the path volatilizes quickly, which increases the randomness of the ant’s selection of subsequent nodes and reduces the convergence of the algorithm. Therefore, it is necessary to determine the hormone volatility coefficient in an appropriate way, and the specific process is shown as follows.To research the setting of hormone volatility coefficientρ, the first is to set relevant parameters. The expected factors are set as α=1 and β=2. The number of ants is set as M=5. Given that p=1, ρ is 0.1, 0.3, 0.5, 0.7, or 0.9, and the influence of ρ on the performance of the improved ant colony algorithm is changed. After each parameter is set, iteration begins. If the difference between the maximum vmax of hormone concentration and the minimum vmin in each path exceeds 10%, the iteration process can be ended. The final results are shown in Figure 2.Figure 2
Influence of hormone volatility coefficient on the improved ant colony algorithm.The relationship between the iteration number and the hormone volatility coefficient is shown in Figure3.Figure 3
Relationship between pheromone volatility coefficientρ and iterations.As can be seen, there is a positive correlation between the number of iterations and the hormone volatility coefficient on the whole. If the hormone volatility coefficient is higher, it means the number of iterations also is higher. In this case, the influence of hormones on path selection is small, but it affects the convergence of the algorithm. When the value of the volatility coefficient is small, although the number of iterations is small, the convergence speed is improved. The algorithm is prone to local convergence; thus, the global optimal solution ultimately cannot be obtained.Combined with the above analysis, when determining the hormone volatility coefficient, the convergence of the algorithm and the global search ability should be taken into consideration. Here, the hormone volatility coefficient is appropriately set between 0.3 and 0.5 to ensure the stability and convergence of the algorithm. At the same time, the global optimization result can be obtained. After the above analysis, the hormone volatility coefficient is finally set as 0.3.


### 4.2.2. Setting of Heuristic Factorsα and β

Pheromone heuristic factorsα and β mainly express the role of the improved algorithm in ants’ path search, which represent the hormone-dependent size and preference coefficient of path selection, respectively. When the former is larger, it means that the randomness of the ant’s path selection is small, and the ant is more inclined to choose the path previously traveled. In this case, it is easy to lead to local convergence, and it is difficult to obtain the global optimal solution. When the latter is large, it indicates that the ant has a higher probability to choose the local shortest path at a node. Although the convergence speed can be improved, the problem of local optimization also exists. Therefore, it is necessary to set the two reasons, so as to meet the requirements of convergence and optimization.To solve the load balancing problem of SDN architecture, the network scale is usually high. It is necessary to ensure that ants can achieve a certain random search ability in the path search process and meet the requirements of convergence, which will have a great impact on the application effect of the whole algorithm. Therefore, it is necessary to keep a balance between the certainty and randomness of the search, so as to improve the performance of the algorithm.According to the above analysis, the heuristic factor can be set reasonably in combination with the previous simulation. During the simulation process, the hormone volatility coefficient is set as 0.3, and then several groups of heuristic factors are set. The relationship between the algorithm performance and the combination of heuristic factors is verified by simulation. Moreover, the influence of the combination of heuristic factors is discussed; thus, the optimal value of the heuristic factor is determined. The iteration number of different combinations of heuristic factors obtained in the simulation is shown in Figure4.Figure 4
Iterations of heuristic factorsα and β under different combinations.It can be seen from Figure 4 that when the combination of heuristic factors is different, the corresponding number of iterations changes significantly. When both pheromone heuristic factorsα and β are high, the roles of the two are different. The former makes the ant excessively depend on the pheromone concentration to determine the moving path. The latter makes the ant more dependent on the positive feedback and is easy to obtain the local optimal solution. When both are small, the former significantly reduces the dependence of ant on hormone concentration and basically did not use hormone concentration information when determining the path. The latter increases the randomness of path search, which leads to more redundant paths and lower convergence speed, making it difficult to obtain the optimal path. Taking into account the above factors, it is appropriate to set the two to 1 and 2, respectively.


### 4.2.3. Setting of the Number of Ants

The improved ant colony algorithm needs to obtain the optimal solution from the solution set, which requires the participation of all ants. And the optimal solution can be obtained by iteration. Since each ant will search for an optimal solution, the solution obtained by all ants can form a solution set, so the number of ants will inevitably affect the algorithm performance. If the number is large, the global search ability of the algorithm is stronger, which improves the reliability of the algorithm significantly. However, there may be many invalid paths in the solution set, which reduces the convergence speed and affects the algorithm performance to a certain extent. If the number is too small, it is difficult to maintain a high global search capability, and only a local optimal solution can be obtained.To solve the above problems, it is necessary to set the number of ants reasonably. Here, the previous simulation method is adopted to determine the number of ants. The first is to set the hormone volatility coefficient and two heuristic factors, which are 0.3, 1, and 2, respectively. The second is to set multiple ant numbers for comparison, and the number of ants is 2, 4, 6, 8, and 12. The optimal number is determined according to its influence on algorithm performance. The final results are shown in Figure5.Figure 5
Iterations under different ant numbers.According to the information in the table, there is a negative correlation between the number of ants and the corresponding number of iterations. When the number of ants is small, the corresponding solution set is relatively small, while the number of iterations is large. If the network scale is large, the global optimal solution cannot be obtained. When the number of ants is large, the search performance is improved. However, when the network is complex, some invalid paths are easily introduced, which affects the convergence. After comprehensive consideration, the number of ants is finally set to 8.To sum up, the number of antsM = 8, pheromone heuristic factor α = 1, expected value heuristic factor β = 2, and hormone volatilization coefficient ρ = 0.3.


## 4.2.1. Setting of Hormone Volatility Coefficient

The global update method is adopted, and the form ofΔτijkt is as follows:(8)Δτijkt=Qcostij,The path that antKpassing through nodeiand nodejin a loop,0,Otherwise,where there are two nodes i and j. costij represents the overhead of i and j. ρ and 1−ρ represent the volatility coefficient and retention coefficient of hormones, respectively. The improved algorithm still has problems of falling into local optimum and low convergence speed, which is directly related to the rationality of setting ρ.Hormone volatility coefficientρ is an important parameter that if it is not set or set unreasonable, the application effect of the fusion algorithm will be adversely affected. Specifically, if the parameter is not set, the subsequent nodes may still have paths that do not belong to alternative paths due to the influence of crossover operations, thus affecting the convergence of the algorithm. If this parameter is too small, the volatility speed of the hormone is significantly reduced. At this time, it is difficult for the pheromones in the path to forming a large difference so the global optimal solution cannot be achieved. However, if this parameter is too large, the pheromone in the path volatilizes quickly, which increases the randomness of the ant’s selection of subsequent nodes and reduces the convergence of the algorithm. Therefore, it is necessary to determine the hormone volatility coefficient in an appropriate way, and the specific process is shown as follows.To research the setting of hormone volatility coefficientρ, the first is to set relevant parameters. The expected factors are set as α=1 and β=2. The number of ants is set as M=5. Given that p=1, ρ is 0.1, 0.3, 0.5, 0.7, or 0.9, and the influence of ρ on the performance of the improved ant colony algorithm is changed. After each parameter is set, iteration begins. If the difference between the maximum vmax of hormone concentration and the minimum vmin in each path exceeds 10%, the iteration process can be ended. The final results are shown in Figure 2.Figure 2
Influence of hormone volatility coefficient on the improved ant colony algorithm.The relationship between the iteration number and the hormone volatility coefficient is shown in Figure3.Figure 3
Relationship between pheromone volatility coefficientρ and iterations.As can be seen, there is a positive correlation between the number of iterations and the hormone volatility coefficient on the whole. If the hormone volatility coefficient is higher, it means the number of iterations also is higher. In this case, the influence of hormones on path selection is small, but it affects the convergence of the algorithm. When the value of the volatility coefficient is small, although the number of iterations is small, the convergence speed is improved. The algorithm is prone to local convergence; thus, the global optimal solution ultimately cannot be obtained.Combined with the above analysis, when determining the hormone volatility coefficient, the convergence of the algorithm and the global search ability should be taken into consideration. Here, the hormone volatility coefficient is appropriately set between 0.3 and 0.5 to ensure the stability and convergence of the algorithm. At the same time, the global optimization result can be obtained. After the above analysis, the hormone volatility coefficient is finally set as 0.3.


## 4.2.2. Setting of Heuristic Factorsα and β

Pheromone heuristic factorsα and β mainly express the role of the improved algorithm in ants’ path search, which represent the hormone-dependent size and preference coefficient of path selection, respectively. When the former is larger, it means that the randomness of the ant’s path selection is small, and the ant is more inclined to choose the path previously traveled. In this case, it is easy to lead to local convergence, and it is difficult to obtain the global optimal solution. When the latter is large, it indicates that the ant has a higher probability to choose the local shortest path at a node. Although the convergence speed can be improved, the problem of local optimization also exists. Therefore, it is necessary to set the two reasons, so as to meet the requirements of convergence and optimization.To solve the load balancing problem of SDN architecture, the network scale is usually high. It is necessary to ensure that ants can achieve a certain random search ability in the path search process and meet the requirements of convergence, which will have a great impact on the application effect of the whole algorithm. Therefore, it is necessary to keep a balance between the certainty and randomness of the search, so as to improve the performance of the algorithm.According to the above analysis, the heuristic factor can be set reasonably in combination with the previous simulation. During the simulation process, the hormone volatility coefficient is set as 0.3, and then several groups of heuristic factors are set. The relationship between the algorithm performance and the combination of heuristic factors is verified by simulation. Moreover, the influence of the combination of heuristic factors is discussed; thus, the optimal value of the heuristic factor is determined. The iteration number of different combinations of heuristic factors obtained in the simulation is shown in Figure4.Figure 4
Iterations of heuristic factorsα and β under different combinations.It can be seen from Figure 4 that when the combination of heuristic factors is different, the corresponding number of iterations changes significantly. When both pheromone heuristic factorsα and β are high, the roles of the two are different. The former makes the ant excessively depend on the pheromone concentration to determine the moving path. The latter makes the ant more dependent on the positive feedback and is easy to obtain the local optimal solution. When both are small, the former significantly reduces the dependence of ant on hormone concentration and basically did not use hormone concentration information when determining the path. The latter increases the randomness of path search, which leads to more redundant paths and lower convergence speed, making it difficult to obtain the optimal path. Taking into account the above factors, it is appropriate to set the two to 1 and 2, respectively.


## 4.2.3. Setting of the Number of Ants

The improved ant colony algorithm needs to obtain the optimal solution from the solution set, which requires the participation of all ants. And the optimal solution can be obtained by iteration. Since each ant will search for an optimal solution, the solution obtained by all ants can form a solution set, so the number of ants will inevitably affect the algorithm performance. If the number is large, the global search ability of the algorithm is stronger, which improves the reliability of the algorithm significantly. However, there may be many invalid paths in the solution set, which reduces the convergence speed and affects the algorithm performance to a certain extent. If the number is too small, it is difficult to maintain a high global search capability, and only a local optimal solution can be obtained.To solve the above problems, it is necessary to set the number of ants reasonably. Here, the previous simulation method is adopted to determine the number of ants. The first is to set the hormone volatility coefficient and two heuristic factors, which are 0.3, 1, and 2, respectively. The second is to set multiple ant numbers for comparison, and the number of ants is 2, 4, 6, 8, and 12. The optimal number is determined according to its influence on algorithm performance. The final results are shown in Figure5.Figure 5
Iterations under different ant numbers.According to the information in the table, there is a negative correlation between the number of ants and the corresponding number of iterations. When the number of ants is small, the corresponding solution set is relatively small, while the number of iterations is large. If the network scale is large, the global optimal solution cannot be obtained. When the number of ants is large, the search performance is improved. However, when the network is complex, some invalid paths are easily introduced, which affects the convergence. After comprehensive consideration, the number of ants is finally set to 8.To sum up, the number of antsM = 8, pheromone heuristic factor α = 1, expected value heuristic factor β = 2, and hormone volatilization coefficient ρ = 0.3.


## 4.3. Optimization Results

### 4.3.1. Comparison of Resource Utilization Rate of Controller

The migration efficiency of the switch is directly affected by the utilization rate of the controller and can represent the load balancing degree of the controller to a certain extent. Set different load states for each controller, where 1 and 2 are overload and 3 and 4 are light load. Then send data packets to each controller to analyze the changes in resource utilization rate. It is necessary to ensure that controller resources are properly used so that the overload controller can recover.The calculation formula of the resource utilization rate of controller is as follows:(9)Uc=UiUmax,where Ui and Umax need to be obtained in certain ways, among which the former is queried by the Zookeeper module and the latter is obtained based on experimental data. According to existing studies, memory resource utilization is related to many factors. Under the condition that the number of switches and network structure remain unchanged, resource loss in packet-in message processing is an important influencing factor, which is involved in the controller overload. That is, the controller occupies too many resources, affecting functions and performance and making it difficult to process requests in a timely manner. In this paper, experiments are carried out to solve this problem. Furthermore, on the basis of improving packet-in transmission rate to simulate overload, the application effects of different migration algorithms can be analyzed. The final experimental results are shown in the following Figure 6.Figure 6
Comparison diagram of resource utilization rate.It can be seen that controllers are always overloaded before the migration. There are three control strategies used to implement the migration [20–22]. And resource utilization is at a normal level to avoid overload problems. The variance of the proximity migration algorithm, ant colony algorithm, and GA-ACO algorithm are 0.0196, 0.0054, and 0.0041, respectively.The results show that compared with the other two strategies, the proximity migration strategy has obvious disadvantages in achieving load balancing. And, after analysis, it is found that the strategy adopts the principle of proximity during migration. Although it is relatively simple and reduces the delay, it is easy to cause secondary overload. The other two algorithms can effectively avoid the above problems, and both can select the controller for migration according to the load conditions, so as to meet the requirements of load balancing.


### 4.3.2. Comparison of Response Delay

In load algorithm evaluation, the response delay index is generally used to evaluate controller performance. If the index is small, it means that high performance can be achieved. In this part, detection and analysis are carried out for this indicator, and specifically, the Cbench tool is used to obtain the response delay according to the time difference between the sent packet-in and the received Flow-MOds.To measure and compare the response delays of the three algorithms, set controllers 1 and 2 to be overloaded, and the rest to be a light load. A total of 50 tests are carried out, and the mean value is calculated as the final response delay to ensure the reliability of the test results. The final results are shown in Figure7.Figure 7
Comparison of response delay.According to the information in the above figure, there are certain differences in the response delay of the three algorithms, among which compared with the proximity migration and ant colony algorithms, the improved ant colony algorithm is reduced by 12.5% and 1.5%, respectively. If the migration strategy is not adopted when the controller is overloaded, it is difficult for the controller to process subsequent package-in requests in a timely manner, which ultimately reduces the performance of the controller.If the load is not large, compared with the other two algorithms, the proximity migration algorithm has the smallest response delay. After analysis, the response delay is related to the processing speed of the controller and the distance of switches. And, compared with the other two algorithms, the complexity of the proximity migration algorithm is relatively low; thus, the response delay is small.If the load is heavy, there may be an overloading problem of multiple controllers in the network. At this time, the use of proximity is difficult to meet the requirements, which easily lead to an increase in a response delay. The use of the ant colony algorithm can easily lead to misjudgment of the number of overload controllers, resulting in migration redundancy problems, which will also prolong the response delay. The use of the improved ant colony algorithm has obvious advantages, which not only controls the response delay at a reasonable level but also reduces the network load and improves the rationality of controller resource utilization.When the message generation rate exceeds 45 packet/ms, all controllers are basically in an overload state. In this case, to meet the requirements of load balancing, other controllers must be added.


### 4.3.3. Comparison of Migration Time

Migration time is an important index, which reflects the migration efficiency of the controller. In the process of migration, the controller is divided into two parts, namely the master controller and the slave controller. The former has only one controller, and the latter can have multiple controllers. The requirements of migration can be met by adjusting the master and slave controllers.Figure8 is the specific process of switch migration, in which the role needs to be changed to a peer role through controller C2. After the target controller C2 becomes a peer controller, it begins to receive the information sent by C1 and begins the migration process. Then C2 receives the information from S, and after C1 sends the flow table, C2 issues a request to change to the master controller and updates the distributed data. After the above operations are complete, the migration process is completed.Figure 8
Switch migration process.The time of a migration can be expressed as the time interval between two role requests: role request-Equal and role response-Master. If multiple controllers are loaded during this period, migrate multiple switches to meet load balancing requirements. In this paper, the average time in multiple migrations is calculated, and the final results are shown in Figure9.Figure 9
Comparison of controller migration time.As can be seen from the figure, significant segmentation points appear around 35 packets/ms, which are mainly related to the load flow limitation of delay and migration time. If the load flow is small, the improved ant colony algorithm has a longer migration time than the other two algorithms. To analyze this phenomenon, the main reason is that the number of migration switches and controllers is relatively small. In addition, load balancing can be realized through simple methods such as proximity migration and so on, and the efficiency is high.When the load is too heavy, the controller overload is more significant, resulting in more switch migrations. If only one switch is migrated each time, the migration time and communication cost will be increased. The improved ant colony algorithm can solve the above problems; thus, more switches can be migrated each time, and the convergence speed is high, which can efficiently achieve the goal of load balancing.


## 4.3.1. Comparison of Resource Utilization Rate of Controller

The migration efficiency of the switch is directly affected by the utilization rate of the controller and can represent the load balancing degree of the controller to a certain extent. Set different load states for each controller, where 1 and 2 are overload and 3 and 4 are light load. Then send data packets to each controller to analyze the changes in resource utilization rate. It is necessary to ensure that controller resources are properly used so that the overload controller can recover.The calculation formula of the resource utilization rate of controller is as follows:(9)Uc=UiUmax,where Ui and Umax need to be obtained in certain ways, among which the former is queried by the Zookeeper module and the latter is obtained based on experimental data. According to existing studies, memory resource utilization is related to many factors. Under the condition that the number of switches and network structure remain unchanged, resource loss in packet-in message processing is an important influencing factor, which is involved in the controller overload. That is, the controller occupies too many resources, affecting functions and performance and making it difficult to process requests in a timely manner. In this paper, experiments are carried out to solve this problem. Furthermore, on the basis of improving packet-in transmission rate to simulate overload, the application effects of different migration algorithms can be analyzed. The final experimental results are shown in the following Figure 6.Figure 6
Comparison diagram of resource utilization rate.It can be seen that controllers are always overloaded before the migration. There are three control strategies used to implement the migration [20–22]. And resource utilization is at a normal level to avoid overload problems. The variance of the proximity migration algorithm, ant colony algorithm, and GA-ACO algorithm are 0.0196, 0.0054, and 0.0041, respectively.The results show that compared with the other two strategies, the proximity migration strategy has obvious disadvantages in achieving load balancing. And, after analysis, it is found that the strategy adopts the principle of proximity during migration. Although it is relatively simple and reduces the delay, it is easy to cause secondary overload. The other two algorithms can effectively avoid the above problems, and both can select the controller for migration according to the load conditions, so as to meet the requirements of load balancing.


## 4.3.2. Comparison of Response Delay

In load algorithm evaluation, the response delay index is generally used to evaluate controller performance. If the index is small, it means that high performance can be achieved. In this part, detection and analysis are carried out for this indicator, and specifically, the Cbench tool is used to obtain the response delay according to the time difference between the sent packet-in and the received Flow-MOds.To measure and compare the response delays of the three algorithms, set controllers 1 and 2 to be overloaded, and the rest to be a light load. A total of 50 tests are carried out, and the mean value is calculated as the final response delay to ensure the reliability of the test results. The final results are shown in Figure7.Figure 7
Comparison of response delay.According to the information in the above figure, there are certain differences in the response delay of the three algorithms, among which compared with the proximity migration and ant colony algorithms, the improved ant colony algorithm is reduced by 12.5% and 1.5%, respectively. If the migration strategy is not adopted when the controller is overloaded, it is difficult for the controller to process subsequent package-in requests in a timely manner, which ultimately reduces the performance of the controller.If the load is not large, compared with the other two algorithms, the proximity migration algorithm has the smallest response delay. After analysis, the response delay is related to the processing speed of the controller and the distance of switches. And, compared with the other two algorithms, the complexity of the proximity migration algorithm is relatively low; thus, the response delay is small.If the load is heavy, there may be an overloading problem of multiple controllers in the network. At this time, the use of proximity is difficult to meet the requirements, which easily lead to an increase in a response delay. The use of the ant colony algorithm can easily lead to misjudgment of the number of overload controllers, resulting in migration redundancy problems, which will also prolong the response delay. The use of the improved ant colony algorithm has obvious advantages, which not only controls the response delay at a reasonable level but also reduces the network load and improves the rationality of controller resource utilization.When the message generation rate exceeds 45 packet/ms, all controllers are basically in an overload state. In this case, to meet the requirements of load balancing, other controllers must be added.


## 4.3.3. Comparison of Migration Time

Migration time is an important index, which reflects the migration efficiency of the controller. In the process of migration, the controller is divided into two parts, namely the master controller and the slave controller. The former has only one controller, and the latter can have multiple controllers. The requirements of migration can be met by adjusting the master and slave controllers.Figure8 is the specific process of switch migration, in which the role needs to be changed to a peer role through controller C2. After the target controller C2 becomes a peer controller, it begins to receive the information sent by C1 and begins the migration process. Then C2 receives the information from S, and after C1 sends the flow table, C2 issues a request to change to the master controller and updates the distributed data. After the above operations are complete, the migration process is completed.Figure 8
Switch migration process.The time of a migration can be expressed as the time interval between two role requests: role request-Equal and role response-Master. If multiple controllers are loaded during this period, migrate multiple switches to meet load balancing requirements. In this paper, the average time in multiple migrations is calculated, and the final results are shown in Figure9.Figure 9
Comparison of controller migration time.As can be seen from the figure, significant segmentation points appear around 35 packets/ms, which are mainly related to the load flow limitation of delay and migration time. If the load flow is small, the improved ant colony algorithm has a longer migration time than the other two algorithms. To analyze this phenomenon, the main reason is that the number of migration switches and controllers is relatively small. In addition, load balancing can be realized through simple methods such as proximity migration and so on, and the efficiency is high.When the load is too heavy, the controller overload is more significant, resulting in more switch migrations. If only one switch is migrated each time, the migration time and communication cost will be increased. The improved ant colony algorithm can solve the above problems; thus, more switches can be migrated each time, and the convergence speed is high, which can efficiently achieve the goal of load balancing.


## 5. Conclusion

As can be seen from the above studies, the advantages of the genetic algorithm and ant colony algorithm are integrated, which improves the performance of SDN to a certain extent. It is concluded that when solving the problem that multiple controllers are overloaded simultaneously, there are obvious advantages in processing time effect and complexity. The reason for the above results is that the advantages of the ant colony algorithm and genetic algorithm in global and local optimization are fully utilized to greatly improve the efficiency of SDN load optimization so that the overall network can better handle the load, and the dual purposes of migration and load balancing between multiple controllers are finally achieved. The innovation of this research is to regard the SDN load balancing problem as a traveling salesman problem and solve it with an improved ant colony algorithm, so as to greatly optimize the SDN network load and improve the operation efficiency of the network.



---

*Source: 1169648-2022-07-13.xml*