# An Efficient Dynamic Load Balancing Scheme Based on Nash Bargaining in SDN
## 2 Analysis and Modeling
### Model Construction
#### 2.2.2 Migration Cost  
Although switch migration can effectively balance the load, it inevitably produces an additional migration overhead. The overload controller issues a migration command to the intra-domain switch and installs the migration rule to the switch to be migrated. Then the switch forwards the rule to the target controller through the devices of other management domains to issue a migration request. The switch migration cost generated by this process is mainly composed of the switch communication cost and the migration request cost.  
1. Switch communication cost  
The communication cost of the switch mainly refers to the normal communication cost generated by the data to be migrated by the switch through the devices in different domains reaching the target controller. The communication cost of the switch can be expressed as:  
\[p_{s_{k}}^{com}=\theta[(\underset{k=1}{\overset{N}{\sum}}x_{ki}d_{ki})+( \underset{k=1}{\overset{N}{\sum}}x_{ki}d_{kj})]. \tag{8}\]  
where \(\theta\) represents the average transmission rate of the switch communication, \(d_{ki}\) represents the hop count between the switch \(s_{k}\) to be migrated and the overload controller \(c_{i}\), and \(d_{kj}\) represents the hop count between the switch \(s_{k}\) to be migrated and the target controller \(c_{j}\).  
2. Migration request cost  
The cost of sending migration requests through the shortest path to the radial target controller is mainly related to the minimum hops, data transmission rate between the switch to be migrated and the target controller, as shown in Equation (9),  
\[p_{s_{k}}^{req}=\theta(\underset{k=1}{\overset{N}{\sum}}x_{ki}+\underset{k= 1}{\overset{N}{\sum}}x_{kj})(\text{min}d_{kj}). \tag{9}\]where \(\text{min}d_{kj}\) represents the minimum hop count between the switch \(s_{k}\) to be migrated and the target controller \(c_{j}\).  
The switch migration cost is a linear sum of the switch communication cost and the migration request cost and is represented as  
\[p_{s_{k}}=p_{s_{k}}^{cum}+p_{s_{k}}^{req}. \tag{10}\]  
The migration cost of the SDN control plane may be composed of the migration cost of multiple switches, which is expressed as the cost of changing the mapping state between the switch and the controller to a better network topology state. If the adjusted network mapping relationship is \(X=\left[x_{k}\right]_{M\times N}\), then the total cost of the network from state \(X^{\prime}=\left[x^{\prime}{}_{ki}\right]_{M\times N}\) to \(X=\left[x_{ki}\right]_{M\times N}\) is  
\[Cost=\sum_{k=1}^{N}m_{k}p_{s_{k}}. \tag{11}\]  
where \(m_{k}\) denotes whether the switch \(s_{k}\) has migrated and satisfies  
\[m_{k}=\begin{cases}0&x^{\prime}_{ki}=x_{kj}=1,and\ i=j\\ 1&x^{\prime}_{ki}=x_{kj}=1,and\ i\
eq j\end{cases} \tag{12}\]  
To change the network mapping relationship through switch migration and promote the scalability of the control plane, we need to optimize the performance of two aspects: on the one hand, to improve the controller load balance; on the other hand, to reduce the switch's migration cost. Since these are two conflicting goals, optimizing one of these goals will inevitably impair the performance of the other. Based on this, a multi-objective model can be expressed as  
\[\begin{cases}\max&LBD\\ \min&Cost\end{cases} \tag{13}\]  
\[L_{j}\leq\delta_{j}\omega_{j};\ 1\leq j\leq\text{M} \tag{14}\]  
\[x_{kj}\in\{0,1\};\ 1\leq\text{k}\leq\text{N},1\leq j\leq\text{M} \tag{15}\]  
\[\sum_{j=1}^{M}x_{kj}=1;\ \forall s_{k}\in S \tag{16}\]  
where \(\delta_{j}\) indicates the threshold factor of controller \(c_{j}\). The constraint condition (14) indicates that the load of each controller must not exceed the threshold after the switch is migrated; constraint condition (15) indicates the mapping relationship after the switch is migrated; constraint (16) indicates that a switch can only have one master controller.