# Trajectories and Resource Management of Flying Base Stations for C-V2X
## 4 Aerial Operation
### Radio Resource Scheduling  
The RRM is performed by a high level entity that jointly supervises both the TBSs and UAV (e.g., an SDN controller). Indeed, since the TBSs and the UAV share the same RRs pool (by working on the same carrier frequency with the same bandwidth), a joint scheduling is necessary. For any vehicle that can be served by both the TBSs and the UAV, the one providing the highest throughput is chosen. Algorithm 1 shows the network implementation of RRM, which is executed every second. ```
Data: UAV and TBSs positions, vehicle positions and data-rate demand, \(\beta\), \(\sigma\), ATG channel, \(SNR_{\min}\), \(SIR_{\min}\), TBSs and UAV resource pool capacity Result: Set of served and set of unserved vehicles for each RRM intervaldo for each vehicle \(v\) in the scenariodo  compute SNR and SIR of \(v\) to closest TBS, \(SNR_{v,\text{TBS}}\) and \(SIR_{v,\text{TBS}}\);  compute SNR and SIR of \(v\) to the UAV if in the coverage range, \(SNR_{v,\text{UAV}}\) and \(SIR_{v,\text{UAV}}\); if\(SNR_{v,\text{UAV}}>SNR_{min}\) AND \(SIR_{v,\text{UAV}}>SIR_{min}\) AND RRs required < pool capacitythen if\(SNR_{v,\text{TBS}}>SNR_{\text{UAV}}\) AND \(SIR_{v,\text{TBS}}>SIR_{min}\)then \(SNR_{v}=SNR_{v,\text{TBS}}\) and \(SIR_{v}=SIR_{v,\text{TBS}}\) (\(v\) is served by the TBS); else \(SNR_{v}=SNR_{v,\text{UAV}}\) and \(SIR_{v}=SIR_{v,\text{UAV}}\) (\(v\) is served by the UAV);  end if else if\(SNR_{v,\text{TBS}}>SNR_{min}\) AND \(SIR_{v,\text{TBS}}>SIR_{min}\) AND RRs required < pool capacitythen \(SNR_{v}=SNR_{v,\text{TBS}}\) and \(SIR_{v}=SIR_{v,\text{TBS}}\) (\(v\) is served by the TBS); else \(v\) is not served;  end if  end for  end for  compute Round Robin algorithm for scheduling at the TBSs;  compute Round Robin and Proportional Fair algorithm for scheduling at the UAV;  end for
```  
**Algorithm 1**Radio resource scheduling. At first, the values of SNR and SIR of a vehicle towards its closest TBS are computed; the same computation is repeated for the link of the vehicle with the UAV, if it is in the coverage range. If both values of SNR and SIR are above the corresponding threshold, the interested base station checks if the vehicle request does not exceed the RRs remaining capacity. Then, when these three requirements are satisfied, a vehicle can be considered served. If the user is in the coverage range of the UAV, it will be served by the station providing the higher SNR value between the TBS and the UAV. In this way,the UAV serves vehicles that would have not been satisfied by the terrestrial network, and improves the service quality of the others by releasing the corresponding RRs. The scheduling at the TBSs followed a first-come first-served fashion in case not enough resources were available for all the vehicles asking for the service. A Round Robin algorithm was used for resource assignment. In contrast, the UAV was able to employ a different method, thanks to the knowledge of the traffic demand such as all users positions, link quality and service requirements of vehicles: it first served the vehicles with higher SNR. At the UAV, Round Robin was followed by a Proportional Fair algorithm for RRs assignment. In this way, it gained a better efficiency in the service provision. Since a reuse factor of one is assumed, the TBSs and UAV shared the same pool of RRs. For this reason, in order to avoid high interference levels, the UAV was programmed to reuse only part of the resources. Each time the scheduling was computed, the RRs available for the UAV are the ones not used by the TBSs in its coverage area. Therefore, the UAV had to compute in real-time its RR pool capacity, because it dynamically changed with the UAV movements. In this way, the co-channel interference that the UAV can cause to the vehicles served by a TBS can be neglected and it does not influence the TBS normal operation.