# Load-Balanced Dynamic SFC Migration Based on Resource Demand Prediction
## 5 Performance Evaluation
### Simulation Result and Analysis  
In this paper, the following metrics are used to evaluate the performance of the algorithm under three conditions of sufficient resources, moderate resources, and scarce resources: node resource variance, total network migration times, average variance of network node resources, and service interruption rate, i.e., the ratio of interruption time to the SFC lifecycle. Firstly, the performance of three algorithms in predicting the resource demand of each network function in the prediction network was compared: LSTM, CNN-AT-LSTM, and LSTM-encoder-decoder. The results of model training are shown in Table 1. It can be seen that the mean square error (MSE) and root mean square error (RMSE) between the predicted values and the actual values of the CNN-AT-LSTM model are the smallest, indicating that this model has the highest prediction accuracy. To intuitively demonstrate the predictive capabilities of the models, we chose LSTM and CNN-AT-LSTM as examples. We compared the CPU demand predictions for a single VNF with the actual values. The detailed comparison results are presented in Figure 5, which includes annotations for \"Level Shift\" and \"Change Point.\" During times when the data experienced significant level shifts, CNN-AT-LSTM quickly adjusted its predictions  
Figure 4: Cellular network topology. and closely followed the changes in the actual values. In contrast, the LSTM model showed some delay. At data change points, the prediction errors of CNN-AT-LSTM were much smaller than those of the LSTM model. This highlights CNN-AT-LSTM's ability to capture rapid dynamic changes more effectively. The results indicate that the attention mechanism in CNN-AT-LSTM allows it to focus on important time steps within the input sequence. This is especially useful during pattern shifts and data change points. As a result, CNN-AT-LSTM improves overall prediction accuracy and response speed. In summary, CNN-AT-LSTM offers higher prediction precision and reliability when dealing with the dynamic fluctuations of network resource demands. It is better equipped to handle severe and sudden variations in resource requirements compared to the LSTM model. The resource demand prediction results serve as input for the RP-LBM. RP-LBM can identify potential overload nodes in advance and develop corresponding migration strategies. Figures 6 and 7 illustrate the changes in network resource variance under three different resource states: (a) sufficient resources, (b) moderate resources, and (c) scarce resources. The figure also compares the average node resource variance under these different conditions. In each scenario, we use different deep reinforcement learning algorithms, namely DQN and PPO, to create migration strategies. We compare these strategies with situations where no pre-migration is performed. The reward functions of the DQN and PPO algorithms are based on the network system's load-balancing capability. This design causes the algorithms to prefer migration strategies that minimize network resource variance. Consequently, both algorithms maintain a lower variance in network resource usage and support the network's load-balancing state. In contrast, the no-migration strategy uses the shortest path algorithm to deploy SFC but does not optimize network node resource usage. This approach results in unbalanced network resource utilization and fails to manage resource allocation effectively. As a result, the overall performance and stability of the system may be negatively affected. \begin{table}
\begin{tabular}{c c c c} \hline
**Metric** & **LSTM** & **CNN-AT-LSTM** & **LSTM–Encoder–Decoder** \\ \hline MSE & 21.973 & 15.579 & 19.653 \\ RMSE & 4.688 & 3.947 & 4.433 \\ \hline \end{tabular}
\end{table} 
Table 1: Comparison of average results on all VNFs in SFCs between LSTM, CNN-AT-LSTM, and LSTM–encoder–decoder. Figure 5: Comparison of model-predicted values and actual values.