# Dynamic SDN Controller Load Balancing
## 6 Simulations  
We simulated a network, with several clusters and one super controller. The controllers are randomly deployed over the network. The number of flows (the controller load) of each controller is also randomly chosen. The purpose of the simulation is to show that our DCC algorithm (see Section 5.4) meets the difference bound (defined in Section 5.5), and the number of replacements bound while providing better results than the fixed clustering method. The simulator we used has been developed with Visual Studio environment in.Net. This simulator enables to choose the number of controllers, the distance between each of them and the loads on each controller. In order to consider a global topology, the simulator enables also to perform a random deployment of the controllers and to allocate random load on each controller. We used this latter option to generate each scenario in the following figures. First we begin by showing that the bound for the \(s(t)\) function is met. We used 30 controllers divided into five clusters. We ran 60 different scenarios. In each scenario, we used a random topology, and random controllers' loads. Figure 6 shows the optimality bound (Equation (15)), which appears as a dashed line, and the actual results for the differences achieved after all replacements. For each cluster, we chose randomly a minimalNumber in the range [20,10,000], and set the controllers' loads for this cluster randomly in a range of [minimalNumber, innerBalance]. We set the innerBalance to 40. X In such a way, we get unbalance between clusters, and a balance in each cluster. The balance in each cluster simulated the master operation. The innerBalance set the quality of the balance inside the cluster. Our algorithm balanced the load between clusters and showed the different results that indicate the quality of the balance. The distances between controllers were randomly chosen in a range of [1,100]. We ran these simulations with different clusters size of: 2, 3, 5, 10 and 15. The results showed that when the cluster size increases, the distance of the different bound from the actual bound also increases. We can also see that when the cluster size is too big (15) or too small (2), the final results are less balanced. The reason is because too small of cluster size does not contain enough controllers for flexible balancing, and too big a cluster size does not allow flexibility between clusters since it decreases the number of clusters. We got similar results when running 50 controllers with cluster sizes: 2, 5, 10, 25. As the number of controllers increases, the distance between the difference bound and the actual difference increases. This is because the bound is calculated according to the worst case scenario. Figure 7 shows the increase in distance between the actual difference distance from the difference bound when the number of controllers increases. The results are for five controllers in a cluster with 50 network scenarios. \begin{table}
\begin{tabular}{c c c} \hline Algorithm 1 & Find Masters & \(O(M\cdot K)\) \\ \hline Heuristic 1 & Distance Initialization & \(O(M^{2})\) \\ \hline Heuristic 2 & Load Initialization & \(O(max(M\cdot\lg M,M\cdot K))\) \\ \hline Procedure 1 & Replacements & \(O(M^{2})\) \\ \hline Algorithm 2 & General DCC & \(O(M^{3})\) \\ \hline \end{tabular}
\end{table} 
Table 3: Time Complexity of heuristics and algorithm used for Dynamic Controllers Clustering (DCC). We now refer to the number of replacements required. As shown in Figure 8, the actual replacement number is lower than the bound. The results are for 30 controllers and 10 clusters over 40 different network scenarios (as explained above for Figure 6). The number of clusters affects the number of replacements. As the number of clusters increases, the number of replacements increases. Figure 9 shows the average number of replacements over the 30 network configurations, with 100 controllers, where the number of clusters increases. Figure 8: Replacements bound and actual number of replacements.