## 2 Materials and Methods
### Problem Modelisation
#### 2.1.4 Penalty Terms and Feasibility Constraints
\begin{cases}\frac{u_{res,k,i}}{c^{l}_{res,k,i}},&\text{if }c_{res,k,i}>0\\ 0,&\text{otherwise}\end{cases}  \tag{6}\]  
where \(u_{res,k,i}\) is the instantaneous _res_ resource usage in \(f^{k}_{i}\), and \(c^{l}_{res,k,i}\) is the _res_ resource capacity of \(f^{k}_{i}\) during \(t\). The value of \(c^{l}_{res,k,i}\) is fixed during an entire time-step \(t\) and depends on any dynamic resource provisioning algorithm acted by the VNO. In this work we assume a bounded _greedy_ resource provisioning policy as specified in Appendix A.1. On the other hand, if we denote with \(\tilde{R}_{t}\) the a subset of \(R_{t}\) that contains the requests that have already been accepted at the current moment, we can compute \(u_{res,k,i}\) as:  
\[u_{res,k,i}=\hat{u}^{t}_{res,k,i}+\sum_{r\in\tilde{R}_{t}}x_{k,r,i}\cdot\sigma_ {k,r,res}+\sum_{l\in N_{Cp}}y^{k}_{l,i}\cdot v_{k,res} \tag{7}\]  
where:  
* The variable \(\hat{u}^{t}_{res,k,i}\) indicates the _res_ resource demand in \(f^{k}_{i}\) at the beginning of time-step \(t\),
* The binary variable \(x_{k,r,i}\) was already defined and it indicates if \(\hat{f}^{k}_{r}\) is assigned to \(f^{k}_{i}\),
* \(\sigma_{k,r,res}\) is the _res_ resource demand faced by any \(k\)-type VNF when serving \(r\), and we call it the _client resource-demand_,
* The binary variable \(y^{k}_{l,i}\) is \(1\) if \(f^{k}_{i}\) is currently ingesting content from content provider \(l\), and \(0\) otherwise,
* The parameter \(v_{k,res}\) models the _res_ resource demand faced by any \(k\)-type VNF when ingesting content from any content provider. Notice that, modeling resource usage with (7), we take into account not only the resource demand associated with the content transmission, but we also model the resource usage related to each content ingestion task the VNF is currently executing. The _res_ resource demand that any \(k\)-type VNF faces when serving a session request \(r\) is computed as:  
\[\sigma_{k,r,res}=\sigma_{max,k,res}\cdot s_{r} \tag{8}\]  
where \(\sigma_{max,k,res}\) is a fixed parameter that indicates the maximum possible _res_ resource consumption implied while serving any session request incoming to any \(k\)-type VNF. The variable \(s_{r}\in[0,1]\) instead, is indicating the _session workload_ of \(r\), which depends on the specific characteristics of \(r\). In particular, the _session workload_ will depend on the _normalized maximum bitrate_ and the _mean payload per time-step_ of \(r\), denoted as \(b_{r}\) and \(p_{r}\), respectively:  
\[s_{r}=(p_{r})^{\phi_{p}}\cdot(b_{r})^{\phi_{b}} \tag{9}\]  
In (8), the parameters \(\phi_{p},\phi_{b}\in[0,1]\) do not depend on \(r\) and are fixed normalization exponents that balance the contribution of \(b_{r}\) and \(p_{r}\) in \(s_{r}\). Recall that the binary variable \(v_{r}\) indicates if the SFC assigned to \(r\) respects or not its maximum tolerable RTT. Notice that we can assess the total throughput served by the vCDN during \(t\) as:  
\[\chi^{t}_{T}=\chi^{t}_{Q}\cdot\sum_{r\in R_{t}}s_{r} \tag{10}\]  
The second penalty term is related to the **Operational Costs**, which is constituted by both the hosting costs and the Data-transportation costs. We can compute the _Hosting Costs_ for our vCDN during \(t\) as:  
\[\chi^{t}_{H}=\chi^{t-1}_{H}-\tilde{\chi}^{t}_{H}+\sum_{i\in N_{H}}\sum_{k\in K }\sum_{res\in\mathbf{R}}\gamma_{res,i}\cdot c^{t}_{res,k,i} \tag{11}\]  
where  
* \(\chi^{t-1}_{H}\) are the total Hosting Costs at the end of time-step \(t-1\),
* \(\tilde{\chi}^{t}_{H}\) are the hosting costs related to the timed-out sessions at the beginning of time-step \(t\),
* \(\mathbf{R}\) is the set of resources we model, i.e., Bandwidth, Memory, and CPU,
* \(\gamma_{res,i}\) is the per-unit resource cost of resource _res_ at node \(i\). Recall that \(c^{t}_{res,k,i}\) is the _res_ resource capacity at \(f^{k}_{i}\) during \(t\). Notice that different nodes may have different per-unit resource costs as they may be instantiated in different cloud providers.