# A Game Model and Fault Recovery Algorithm for SDN Multi-Domain
## 4 SDN-MARA Algorithm
### Design of the SDN-MARA Algorithm
#### 4.3.3 Game-Enhanced Dynamic Mapping Algorithm for Switches and Target Controllers
For each particle in decision domains A\({}_{\text{i}}\) and B\({}_{\text{i}}\): If \(\text{f}_{\text{avg}}(\text{A}_{\text{i}})>\text{f}_{\text{avg}}(\text{B}_{ \text{i}})\) and \(\text{f}_{\text{gb}}(\text{A}_{\text{i}})>\text{f}_{\text{gb}}(\text{B}_{ \text{i}})\): If \(\text{O}(\text{A}_{\text{i}})>\text{f}_{\text{gb}}(\text{A}_{\text{i}})\): Update \(\text{O}(\text{A}_{\text{i}})\) If \(\text{O}(\text{A}_{\text{i}})>\text{f}_{\text{gb}}(\text{A}_{\text{i}})\): Update \(\text{O}(\text{A}_{\text{i}})\) Else if \(\text{f}_{\text{avg}}(\text{A}_{\text{i}})<\text{f}_{\text{avg}}(\text{B}_{ \text{i}})\) and \(\text{f}_{\text{gb}}(\text{A}_{\text{i}})<\text{f}_{\text{gb}}(\text{B}_{ \text{i}})\): \(\text{f}_{\text{gb}}(\text{A}_{\text{i}})=\text{f}_{\text{gb}}(\text{B}_{ \text{i}})\) Else: Update position and speed of particles in A\({}_{\text{i}}\) and B\({}_{\text{i}}\) using Equations (11) and (12)
5. Establish mapping between the k-th switch and target controller
6. Repeat Step 3 to Step 5 for all switches
7. Update target controller set until all migrating switches are mapped
8. Output mapping relationship E\({}_{1}\)
```

**Algorithm 3**GEDM Algorithm for Determining the Mapping Relationship between Out-of-Control Switches and Target Controllers

#### 4.3.4 Out-of-Control Switch Migration Algorithm

After re-establishing the mapping relationship, fault recovery is carried out, which involves rebuilding control domains based on the new mapping relationship and setting up new communication channels between out-of-control switches and their corresponding target controllers. Once the above mapping relationship is established, a communication connection needs to be set up, and the out-of-control switch must be registered into the local control domain to complete the migration process. The out-of-control switch migration algorithm is shown in Algorithm 4. After establishing a communication connection between the migrating switch and the target controller, it signifies that the switch has completed its migration task. The target controller then broadcasts an update message to the entire control plane. Once all out-of-control switches have completed their migration tasks, the game domain is automatically dissolved. ## 5 Experiments

### Experimental Design and Environment

The SDN network simulation experiment is conducted on the Ubuntu 24.04 operating system. The Floodlight [25] controller serves as the control platform, while Mininet [26] is used to generate experimental network topologies. Iperf [27] is utilized for assessing network performance metrics, and the bench [28] tool is employed to test the load pressure variations on the target controller. Additionally, NetworkX [29] is used to construct network topologies to validate the effectiveness of the proposed algorithm. To evaluate the performance of the proposed algorithm, various network topologies from the literature [30] with differences in the number of switches and links reflecting the diversity of the experimental setups are adopted. The network topology information for the experiments is detailed in Table 1. The capacity limit of the controllers in the experimental environment is set to handle a maximum of 8000 packet_in messages, while the request rate from switches is maintained between 200 and 400 messages per second. To ensure the scientific accuracy and correctness of the experimental results, a total of 200 experiments were conducted under different network scales, and finally, average values of the experimental data were measured as verification results. In this experiment, a timeout-based retransmission strategy was implemented to prevent packet loss. After a controller sends a route update to a neighboring controller, it awaits confirmation. If no confirmation is received within five seconds, the update is retransmitted.