# Fronthaul Design for Wireless Networks
## 3 Fronthaul Design Methodology
### Network Planning Algorithm
#### 3.2.2 Network Planning Algorithm Workflow  
Figure 3 depicts the flowchart of the network planning algorithm. The first step is to read and store the information contained in the \"RRH.dat\" file, which is a text file that contains (in each line and separated by commas) the Cartesian coordinates \((X,Y)\) of the RRHs under consideration, along with the required bit rate for each RRH; Table 4 presents the structure of each line regarding the \"RRH.dat\" file. In addition, the user must provide data regarding the BBUs in the \"BBU.dat\" text file; once more, a line structure is followed (separated by commas), where the required inputs are the ones indicated in Table 5; these correspond respectively to the maximum number of RRHs supported by a BBU (\(RRHs_{max}\)), the maximum bit rate supported by a BBU for each RRH-BBU link (\(B_{max}\)), the costs of a BBU (Costs\({}_{BBU}\)), the minimum and maximum number of BBUs to be considered in the analysis (\(min\_{BBU}\) and \(max\_{BBU}\), respectively), and the number of different initializations regarding the network costs optimization procedure (\(D_{init}\)). Afterwards and given the starting number of BBUs (\(mit\_{BBU}\)), the algorithm computes the positions of the BBUs. This step, combined with the assignment of each RRH to a BBU (where multiple RRHs can be connected to a single BBU), can be regarded as solving a clustering problem. Since smaller RRH-BBU link distances not only increase the likelihood of adopting single-hop wireless communication technologies (which are simpler to install), but also lead to cheaper FO links, as well as lower fronthaul latencies can be achieved, the adopted criterion for clustering is based on minimizing the distances between RRHs and BBUs. Accordingly and by applying the \(K\)-means clustering algorithm (as suggested in [31]), the positions of the BBUs are determined. More specifically, the \(K\)-means procedure groups the RRHs into \(K\) different subsets, where \(K\) equals the considered number of BBUs (hence, \(K\leq\) RRHs), by minimizing the sum of squared distances between the RRHs belonging to a cluster and the corresponding cluster centroid, i.e., the associated BBU position. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**RRH.dat** & \(\begin{array}{c}X\\ \text{(m)}\end{array}\) & \(\begin{array}{c}Y\\ \text{(Mkp)}\end{array}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Required inputs for the “RRH.dat” file. Next, the algorithm verifies if the BBUs can support the number of RRHs assigned to each one of them, as well as the required bit rate of each RRH-BBU link; if this is the case, then the link design algorithm is used to determine the cheapest working solution satisfying each RRH-BBU link requirement (such as link distance and required bit rate) for the deployment scenario (the scenario characteristics, except link distance and required bit rate, are extracted from the \"Scenario.dat\" file); cf. Section 3.1. Subsequently, the total costs of the network are computed taking into account the network costs analysis, i.e., by summing up the costs of all RRH-BBU links and the costs of the considered number of BBUs. Figure 3: Flowchart of the network planning algorithm. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**BBU.dat** & \(RRHs_{max}\) & \(B_{max}\) & Costs\_BBU & \(min\_BBU\) & \(max\_BBU\) & \(D_{init}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Required inputs for the “BBU.dat” file. Noticing that the \(K\)-means approach is an iterative algorithm that relies on an initial random choice of centroid positions, this procedure may yield different clustering results on different runs of the algorithm, which, in turn, may lead to different network costs; note that there are \(K^{N(RRHs)}\) ways to partition \(N\) RRHs into \(K\) clusters.