# A Framework for the Joint Placement of Edge Service Infrastructure and User Plane Functions for 5G
## 4 Framework Proposal
### UPF Placement Stages
#### 4.2.1 Optimal UPF Placement  
The OUP model aims at reducing deployment costs by minimizing the number of UPFs. Additionally, it also deals with the operational costs related to UPF relocations. However, not all users have the same mobility patterns, being many of them static sensors or indoor that produce zero relocations. Because of this, the proposed model allows distinguishing the optimization objective by taking into account whether the UPFs to be placed will serve users with mobility characteristics (m = 1) or not (m = 0). The OUP model can be formulated as follows:  
Minimize:  
\[C_{cost}= \begin{cases}\sum\limits_{\forall\in N_{c}}\!\!F_{c}\cdot(x_{c}+y_{c}) +\!\!\!\sum\limits_{\forall c\in N_{c}\forall i\in N_{c}\forall j\in N_{r}}\!\!F _{h}\cdot h_{ij}\cdot a_{ijc},\text{ if user mobility is considered}\\ \sum\limits_{\forall c\in N_{c}}\!\!F_{c}\cdot(x_{c}+y_{c}),\text{ otherwise}\end{cases} \] (2a) s.t. : \[x_{c}+y_{c}\leq 1 \forall c\in N_{c} \tag{3}\] \[p_{rc}\leq x_{c} \forall r\in N_{r},\forall c\in N_{c}\] (4) \[b_{rc}\leq y_{c} \forall r\in N_{r},\forall c\in N_{c}\] (5) \[\sum\limits_{\forall c\in N_{c}}p_{rc}=1 \forall r\in N_{r}\] (6) \[\sum\limits_{\forall c\in N_{c}}b_{rc}\geq K_{u}-1 \forall r\in N_{r}\] (7) \[\sum\limits_{\forall r\in N_{r}}d_{r}\cdot p_{rc}\leq\alpha\cdot C _{u_{max}} \forall c\in N_{c}\] (8) \[\sum\limits_{\forall r\in N_{r}}d_{r}\cdot b_{rc}\leq C_{u_{max}} \forall c\in N_{c}\] (9) \[L_{rc}\cdot(p_{rc}+b_{rc})\leq L_{rq} \forall r\in N_{r},\forall c\in N_{c}\] (10) \[Loc_{r}=Loc_{c}\Rightarrow p_{rc}\geq x_{c} \forall r\in N_{r},\forall c\in N_{c}\] (11) \[Loc_{r}\
eq Loc_{c}\Rightarrow p_{rc}\leq x_{c} \forall r\in N_{r},\forall c\in N_{c} \tag{12}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Notation** & **Description** \\ \hline \multicolumn{3}{c}{**Sets and Parameters**} \\ \(N_{r}\) & Set of access nodes (TG) \\ \(N_{c}\) & Set of UPF candidate locations (EN) \\ \(d_{r}\) & Traffic demand at each access node \\ \(C_{u_{max}}\) & Maximum capacity of each UPF \\ \(\alpha\) & Percentage of capacity to be used in the main UPFs \\ \(F_{c}\) & Fixed cost of deploying an UPF at candidate node \(c\) \\ \(F_{h}\) & Cost associated with UPF relocations \\ \(h_{ij}\) & Frequency of handovers between access nodes \(i\) and \(j\) \\ \(K_{u}\) & Minimum number of UPF per access node \\ \(L_{rc}\) & Latency between access nodes and candidates \\ \(L_{rq}\) & Latency requirement between access nodes and UPFs \\ \(m\) & Mobility requirement indicator \\ \multicolumn{3}{c}{**Binary variables**} \\ \(x_{c}\) & 1 if there is a main UPF installed at candidate node \(c\) \\ \(y_{c}\) & 1 if there is a backup UPF installed at candidate node \(c\) \\ \(p_{rc}\) & 1 if access node \(r\) has a main UPF installed at node \(c\) \\ \(b_{rc}\) & 1 if access node \(r\) has a backup UPF installed at node \(c\) \\ \(a_{ijc}\) & 1 if access node \(i\) or \(j\) is assigned to a main UPF installed at candidate node \(c\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Notation used in the UPFP formulation. \[a_{ijc}=p_{ic}\oplus p_{jc} \forall i,j\in N_{r},\forall c\in N_{c} \tag{13}\] \[x_{c},y_{c},p_{rc},b_{rc},a_{ijc}\text{ binary } \forall r\in N_{r},\forall i,j\in N_{r},\forall c\in N_{c} \tag{14}\]  
Expressions (2a) and (2b) represent UPF placement costs for services with and without mobility requirements, respectively. In (2a), the first term is associated with the cost of deploying a UPF at location \(c\) (\(F_{c}\)) while the second term is related to the UPF relocation cost (\(F_{h}\)). Hence, this objective function aims at optimizing both the deployment and operational expenditures by taking into account not only the number of UPFs to be deployed but the frequency of handovers in the (R)AN as well. For UPFs mostly serving users with zero or low mobility, Expression (2b) is more appropriate. In this case, the UPF placement costs can be determined in terms of the number of UPFs and their location dependent costs.