# Fronthaul Design for Wireless Networks
## 3 Fronthaul Design Methodology
### Link Design Algorithm
#### 3.1.3 Link Design Algorithm Workflow  
Figure 2 depicts the flowchart of the link design algorithm. The first step is to read and store the information contained in the \"MRT.dat\", \"FSO.dat\", and \"FO.dat\" files. These \".dat\" files are text files that contain data about the user-specified equipment being tested, as well as about the respective  
associated costs; in general, these necessary inputs are provided by the equipment manufacturers and, concerning costs, by taking into account the CAPEX and OPEX items listed in the previous section. The user can test and compare, at the same time, as many different equipment as desired, as the algorithm is able to process a variable amount of equipment; in this manner, the user can, for example, test and compare different solutions from different providers in a single run of the algorithm. More specifically, each line of the \".dat\" file associated with the respective communication technology (MRT, FSO, and FO) corresponds to a different equipment of that technology. The structure of each line of these \".dat\" files, namely the required inputs for each communication technology equipment (which should be separated by commas), is given in Table 2, where ID refers to the identifier (number or word) of an equipment, \(B\) stands for the maximum bit rate that an equipment can offer for the specified inputs, whereas \(B\)x\(D\) corresponds to the maximum bit rate \(\times\) distance product of an optical fiber. In addition, the user must provide data (such as link length, required bit rate, and climate information) regarding the link deployment scenario. This information is given in the \"Scenario.dat\" text file and follows a line structure (separated by commas), where the required inputs are indicated in Table 3; these correspond respectively to link length (\(d\)), required bit rate (\(B_{min}\)), maximum percentage of the time regarding tolerated link unavailability (\(U_{max}\)), temperature (\(T\)), rain intensity not exceeded in 0.01% of the time (\(R_{i}^{(0.01\%)}\)), relative humidity (\(H\)), transmitter altitude (\(h_{a}\)), height difference between the top of an obstacle and the line-of-sight (\(h_{obs}\)), average number of foggy days (\(\overline{N_{fog}}\)), average duration of fog events (\(\overline{D}\)), and minimum accepted link margins for MRT, FSO, and FO links (\(M_{min}^{\text{(MRT)}}\), \(M_{min}^{\text{(FSO)}}\), and \(M_{min}^{\text{(FO)}}\), respectively). From here, the algorithm becomes independent of the user. It will go through all the \(N\) different user-specified equipment, and for each one, the algorithm first checks if the required bit rate of the link is met by the equipment; if that condition is satisfied, then it is evaluated if the link is feasible with that equipment (taking into account the communication technologies models); in other words, if the required link distance is shown to be too long to be accommodated in a single-hop by the equipment that is under consideration in each iteration, then that equipment is ignored in the remaining analysis. Finally, the algorithm returns the cheapest working solution (taking into account the link costs analysis), namely the respective equipment ID and total costs. Please note that if none of the \(N\) different user-specified pieces of equipment meet the link requirements, then the algorithm returns (positive) infinity for the total costs and no ID.