# A Game Model and Fault Recovery Algorithm for SDN Multi-Domain
## 3 Reliability Game-Enhanced Model for SDN Multi-Domain Controllers
Therefore, it is necessary to appropriately reduce the number of switches assigned to them, marking some of them  
Figure 1: Multi-domain controller architecture diagram. as out-of-control and notifying neighboring controllers to establish a game domain, thus entering the fault recovery phase. This situation is similar to handling the failure of a single-controller control domain. Therefore, this paper focuses on the activities within a single-controller game domain. **Definition 5**. : _The switch migration cost \(P_{t}\) represents the total cost associated with the migration of an out-of-control switch from the selected target controller to the establishment of a new reliable channel. This cost specifically includes two components: the channel creation cost \(P_{s}\) and the data migration cost \(P_{f}\):_  
(1) \(P_{s}\): When a switch transitions to a new controller, it needs to establish a control channel with the new controller. This process includes sending a request to establish a connection with the new controller and reporting the switch's state information, such as flow tables and port states, to the new controller. Once the request is accepted, the switch receives new flow table rules or maintains existing rules and continues to forward data traffic. Thus, the cost of creating the new channel \(P_{s}\) is calculated in two phases: In the first phase, after determining the switch \(v_{j}\) to be migrated, \(v_{j}\) needs to send a connection establishment request to the target migration controller \(c_{i}\) through the game-initiating controller. In the second phase, after \(c_{i}\) accepts the request, the cost of information exchange during the process of directly establishing the channel between \(v_{j}\) and \(c_{i}\) includes the cost of message authentication and the overhead of establishing the channel between the controller and the switch. The calculation method is shown in Equation (6). \[P_{s}=\big{(}\tau_{q}\cdot Tq+\tau_{c}\big{)}\cdot\frac{RTT_{i,j}}{h(i,j)} \tag{6}\]  
In the first phase, \(\tau_{q}\) represents the packet size of the request sent by the game-initiating controller, and \(Tq\) is the number of times that \(v_{j}\) sends a connection establishment request. In order to ensure the authentication process of secure communication, the authentication method based on TLS security protocol [23] is adopted to verify the identity of the controller and switch involved. In the second phase, \(\tau_{c}\) denotes the average packet size during the establishment of the channel between the controller and the switch, \(RTT_{i,j}\) is the round-trip time delay from controller \(i\) to switch \(j\), and \(h(i,j)\) represents the hop count, indicating the number of hops a packet takes from controller \(i\) to switch \(j\) within the current game domain. (2) \(P_{f}\): The data migration cost occurs after \(v_{j}\) establishes a new channel with \(c_{i}\). The controller \(c_{i}\) needs to send the flow rules within the domain to the switch \(v_{j}\). The calculation method for the migration cost \(P_{f}\) is shown in Equation (7), where \(\tau_{rule}\) represents the average size of the flow_mod packet. \[P_{f}=\tau_{rule}\cdot h(i,j)\cdot M_{i,j} \tag{7}\]  
Therefore, the calculation method for the switch migration cost \(P_{t}\) is given in Equation (8), where \(a_{s}\) and \(a_{f}\) are the weights corresponding to the channel establishment cost and the migration cost, respectively. \[P_{t}=a_{s}*P_{s}+a_{f}*P_{f} \tag{8}\]  
In this paper, the framework of a non-cooperative game is adopted when constructing game models and designing algorithms. Each controller is treated as a player with the goal of optimizing the mapping between switches and controllers throughout the game to maximize their respective utility functions. The game here involves incomplete information, that is, each controller and switch have asymmetrical state information of other nodes. Eachcontroller can only obtain the state of its own managed nodes but cannot fully understand the state of others. **Definition 6**.