# A Game Model and Fault Recovery Algorithm for SDN Multi-Domain
## 3 Reliability Game-Enhanced Model for SDN Multi-Domain Controllers
The constructed game model is based on the following assumptions: (1) each controller has the same processing capability, and there is no variability between requests from different switches; (2) during normal operation, the local controller makes independent decisions. When a controller fails, the out-of-control switches within its domain become bargaining chips in the game, prompting the selection of a target controller with sufficient remaining capacity to join the game. Participants in the game must also consider the propagation delay of the controllers and the cost of migration to maximize their respective interests. Definition 2: The mapping matrix \(M_{i,j}\) represents the mapping relationship between switchjand controllerwithin the control domain, as shown in Equation (2). \[M_{i,j}=\left\{ \begin{array}{ll}1,\ v_{j}\ \text{is\ mapped\ to\ }c_{i}\\ 0,\ v_{j}\ \text{is\ not\ mapped\ to\ }c_{i}\end{array} \right. \tag{2}\]  
To ensure the accurate execution of SDN controller routing strategies, it is necessary for controllers to exchange their port status tables and mapping matrices. The switching strategy designed in this paper are as follows: (1) switch the routing table during network initialization to achieve global consistency; (2) send global update information when routing information in the control domain changes; and (3) in case of packet loss, set the timeout resend strategy. If no confirmation message is received within the set time, the port state table and mapping matrix are retransmitted. Definition 3: The remaining capacity \(R_{i}\) of a controller is defined as the difference between the expected maximum reception rate of the controller within the control domain and the actual request rate of the switches. The calculation method for the remaining capacity \(R_{i}\) of each controller is shown in Equation (3)._  
\[R_{i}=\epsilon_{i}-\sum_{j}\partial_{j}M_{i,j} \tag{3}\]  
_where \(\epsilon_{i}\) represents the expected maximum reception rate of controller \(i\), and \(\partial_{j}\) denotes the actual request rate of switch \(j\)._  
**Definition 4**. : _Controller game domain (CGD) is a decision-making unit that the system autonomously constructs when a controller in the network fails to determine the migration of out-of-control switches through normal controller game. CGD in SDN consists of a set of out-of-control switches and neighboring normal controllers involved in decision-making. The controller game domain is denoted as Equation (4)._  
\[CGD=\left\{c_{k}^{i},\ v_{c_{k}^{i}}^{j}\right\},\ \ i=(1\sim m),\ \ j=(1\sim n),\ \ k=(1\sim q) \tag{4}\]  
For example, as shown in Figure 0(a), in a multi-domain controller system with five SDN controllers and multiple switches forming three control domains, if controller \(c_{3}\) fails at a certain moment, as illustrated in Figure 0(b), the switches within control domain \(q_{2}\) will become out of control. At this point, the neighboring controllers of \(c_{3}\) and the out-of-control switches will together form the controller game domain \(CGD_{1}\), shown as Equation (5). \[CGD_{1}=\left\{c_{1}^{i},\ c_{3}^{i},\ v_{c_{1}^{i}}^{j},\ v_{c_{3}^{i}}^{j}\right\} \tag{5}\]  
In SDN, the initiation of game activities and the formation of game domains are prompted by the detection of a failed controller. This controller can be an effective one within the same domain or a neighboring one, referred to as the game-initiating controller. Each controller is assumed to participate in only one game activity at a time to ensure isolation between different controller game domains. If there is only a single controller within the control domain and it fails, it will directly notify the neighboring ones to perform fault detection and recovery. When there are two or more controllers in the control domain, if one fails, others can quickly detect it. The out-of-control switches within the domain will then be taken over by the functioning controllers, which may lead to excessive load on those controllers.