# An Efficient Dynamic Load Balancing Scheme Based on Nash Bargaining in SDN
## 2 Analysis and Modeling
### Problem Analysis  
SDN is a new network architecture with programmable functions and a separate forwarding plane and control plane. It is mainly divided into three layers: the data layer, the control layer, and the application layer. Based on the three-tier architecture of the SDN, the controller can control and manage the SDN switch through the South interface (such as the OpenFlow protocol [19]) and provide programmable support to the application layer through the north interface.  
The OpenFlow protocol provides more solutions for controller load imbalance. The OpenFlow protocol is a standard protocol used for the interaction information between the controller and the SDN switch. The general OpenFlow 1.3 protocol presently supports three message types: controller-switch message (such as Role-Request), asynchronous message (such as Packet-In), and symmetric message (such as Echo request). At the same time, OpenFlow requires that the controller has three roles for each switch: equal, master, and slave [20]. The default role of the controller is equal. Controllers in the equal role can receive all asynchronous messages from the switch. The controller can request to be a slave through Role-Request. The slave controller can only read the connected switch (i.e., read-only). The controller can also request to assume the master role of the switch. The controller with the master role is similar to the equal role controller and can fully access the switch. However, the switch guarantees that only one controller in the master role can be connected.  
The definition of the three roles of the controller in OpenFlow ensures the security of the network. Once the master controller fails or overloads, the managed switch can be migrated to the slave controller to avoid controller outages. As shown in Figure 1, the traffic in control domain 2 surges, causing controller \(c_{2}\) to be the overload controller. Based on the idea of switch migration, switch \(s_{6}\) in control domain 2 can be migrated to the slave controller (i.e., \(c_{1}\), \(c_{3}\), and \(c_{4}\)). However, \(s_{6}\) is not connected to all intra-domain switches in control domain 4. In fact, the migration of \(s_{6}\) to \(c_{4}\) is only the ideal situation, as it is impossible to achieve migration in a real network. Therefore, considering the connectivity between the actual network topology nodes, switch \(s_{6}\) can only be migrated to slave controller \(c_{1}\) or \(c_{3}\)How to choose the optimal network remapping state based on the connectivity of nodes is the critical problem to be solved in this paper. It is assumed that after the two performance indicators of load balancing and migration cost are optimized according to the algorithm in this paper, the overload controller \(c_{2}\) chooses \(s_{6}\) to migrate to controller \(c_{1}\) to relieve its load pressure. Controller \(c_{2}\) first installs flow rules to \(s_{6}\), and then \(s_{6}\) forwards migration requests to controller \(c_{1}\) through \(s_{2}\). Finally, \(c_{1}\) accepts the migration request, changes the slave role to master, and the main controller of \(s_{6}\) is converted from \(c_{1}\) to \(c_{2}\) to complete the migration operation.