# Load Balancing Oriented Predictive Routing Algorithm for Data Center Networks
## 3 Algorithm Design
### Link Occupancy Prediction Model  
The link occupancy prediction function of the LLBR algorithm first establishes a data model for the network link occupancy. Then, using the data model as the input data, a neural network structure is designed to predict the network link occupancy in the next duty cycle according to the ST-ResNet. In the LLBR algorithm, the occupancy state of the link is monitored by the Floodlight controller and the occupancy state data of the link are collected. The collected data is used to train the parameters of the model. Network data collection consists of two parts: the establishment of the network request and the storage of the link occupation state. The network request is a random discrete function (Equation (1)) hat follows the Poisson distribution to generate two non-repeated random numbers [40]. Then, the random number is mapped to the terminal ID according to the mapping of Equation (2). \[P_{n}(t)=\frac{e^{-\lambda t}\times(\lambda t)^{n}}{n!}(n=0,1,2,\dots,N) \tag{1}\]  
\[F(x)=\frac{D_{max}-D_{min}}{S_{max}-S_{min}}\times(x-S_{min}) \tag{2}\]  
\(x\) is the random number generated by the Poisson distribution, \(D_{max}\) is the maximum ID number of the terminal, and \(D_{min}\) is the minimum ID number of the terminal. \(S_{min}\) is the minimum value of the generated random number, and \(S_{max}\) is the maximum value of the generated random number. \(F(x)\) is the final mapping result. The controller is used to collect the occupancy status of the link, and the collected data is divided into two datasets (namely, the DATA and DATE datasets) and are saved in HDF5 format. The DATA dataset is a three-dimensional array. The first dimension represents the number of data transmitted by the link. The second and third dimensions form a two-dimensional array(Figure 2). The number of links between two ports is calculated using Equation (3). \[count(s,d)=links(s,d)+links(d,s) \tag{3}\]  
where \(links(s,d)\) is the number of links used from \(s\) to \(d\), and \(links(d,s)\) is the number of links used from \(d\) to \(s\). \(count(s,d)\) is the total number of this links used. As shown in Figure 2, the four ports were taken as examples to record the usage times of the links between each port within an hour, and the recorded data was mapped into the grid as shown in Figure 2b for the succeeding neural network training. As shown in Figure 2a, the network is bi-directional. The number from r2 to r4 is 2 and the number from r4 to r2 is 1, so the total number of uses of the link is 3. The total number of uses is recorded in Figure 2b, from which we observe that the intersection of r2 and r4 is 3. The DATE data set represents the timestamp generated by each piece of data. For example, the time of data transmission is 13:00 on 8 January 2021, and the storage format of DATE is 2021010813. The network link occupancy prediction model uses the deep residual neural network to divide the terminal link into the grid shown in Figure 2b through the understanding of spatio-temporal data. Then, the link usage times of one cycle are projected onto the grid to form a two-dimensional image. The data of multiple cycles form the link data. The architecture of the network link occupancy prediction model consists of three modules (Figure 3). First, the input data is divided according to the characteristics of the simulated network, and then the three groups of characteristic data are merged to generate three residual networks. Finally, three residual networks constitute the prediction model through the convolution and residual units. (1) Partitioning of input data  
Network traffic in a DCN has the characteristics of self-similarity, periodicity, and long correlation. Therefore, the input data can be divided according to different time intervals. The data of the last 3 h were taken as the simulation of the self-similarity characteristic, those of 24 h a day as the simulation of the periodicity characteristic, and those of one week as the simulation of the long correlation characteristic to form three residual networks.