# A Framework for the Joint Placement of Edge Service Infrastructure and User Plane Functions for 5G
## 4 Framework Proposal
### UPF Placement Stages
#### 4.2.2 Near-Optimal UPF Placement
Notice that in both groups there are services with different mobility requirements. For the UPFs dedicated to services with high requirements, we assumed 1 ms for the overall user plane latency and 1 backup UPF (\(K_{u}\) = 2). In addition, for the second group, we considered 5 ms and no backup deployment (\(K_{u}\) = 1). The required number of UPF (\(K_{u}\)) to which an access node must be assigned was calculated upon expression (15), where \(p_{r}\) and \(p_{u}\) represent the failure probability of access nodes and UPFs, respectively. To achieve a service reliability greater than 99.999%, \(p_{r}\) must be lower than \(10^{-5}\) whereas \(p_{u}\) can take any value. Specifically, \(p_{r}=10^{-6}\) and \(p_{u}=10^{-3}\) were assumed. Additionally, to meet latency demands of 1 ms, the overall delay (Round-Trip-Time, RTT) between access nodes and UEs cannot exceed 0.5 ms [37]. Taking this into account and assuming that UPFs and DN (application servers) are co-located with a total processing time of 0.3 ms, a maximum of 0.2 ms RTT (\(L_{req}\)) between access nodes and UPFs is assumed. For the second group of services, this value was relaxed to 1 ms.

\[R[r]=(1-p_{r})\left[ \begin{matrix}1-\prod_{\forall u\in K_{u}[r]}\end{matrix}  \right[1-(1-p_{u})] \tag{15}\]

Since the selected scenario is formed by three regions with different characteristics (i.e., City_1, City_2 and Rural), we ran our UPF placement solutions in all of them separately. Table 6 describes some characteristics of these scenarios, such as access node (\(N_{r}\)) and candidate location (\(N_{c}\)) distribution and total access network demands per service category. The candidate locations comprise the set of ENs and existent Points of Presence (PoPs). The PoPs were analyzed as candidates only for UPFs serving the second group of services. These candidates were preferred over ENs when the ENs were not able to comply with the restriction (11). The UPF placement solutions were analyzed for different values of UPF capacity taking into account the resources available in the underlying ENs. First, the UPFs placement for services with high requirements was determined and after having updated the infrastructure available resources, we proceeded to the placement of the second group of UPFs. The results obtained by the optimal and heuristic solutions for mobility and non-mobility considerations (i.e., OUP_M1, OUP_M0, NOUP_M1 and NOUP_M0) were compared regarding the number of UPFs, UPF utilization, UPF and execution time. The mathematical models were implemented with the Python-based package Pyomo [38] along with Gurobi [39] as underlying solver. Their optimal solutions were determined with zero optimality gap. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Region** & **Candidate Nodes** & **Access Nodes** & **Total Demand (Tb/s)** \\ \hline  & **EN** & **PoP** & **Radio** & **Fixed** & **Group 1** & **Group 2** \\ \hline City\_1 & 13 & 12 & 10 & 22 & 2.67 & 17.93 \\ City\_2 & 12 & 12 & 11 & 21 & 2.34 & 14.62 \\ Rural & 33 & 0 & 16 & 20 & 6.34 & 15.66 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Network nodes distribution. #### 5.2.1 Number of UPFs

Figures 5 and 6 depict the total number of UPFs obtained for services with high and low requirements respectively. From these figures we can observe that the proposed heuristic performance is close to the optimal solution results, for either existing mobility and not existing mobility considerations. Namely, for services with high requirements in urban scenarios (see Figure 5) the four solutions obtained the same number of UPFs (main and backup). Similar results were achieved in the rural area, but in this case, the heuristics required one UPF more than the optimal for \(C_{u}=1\) Tb/s. Moreover, in this scenario, the number of main UPFs is always higher than the number of backups. This is because of the existence of two isolated access nodes that cannot be assigned to a backup UPF without violating the latency constraint or the main-backup relationship (see Section 4.2.2 for more details).