# Load-Balanced Dynamic SFC Migration Based on Resource Demand Prediction
## 3 System Model and Problem Description
### SFC and VNF  
The VNF type set is represented as \(F\), and the CPU and memory resources consumed by the server to instantiate a VNF \(f\in F\), denoted as \(v^{mf}\), are \(c^{f}\) and \(m^{f}\), respectively. A physical node can instantiate one or more types of VNFs, and each type of VNF can support the deployment of multiple virtual network function instances. The SFC set is represented as \(S\), and each request \(sfc^{j}\in S\) can be represented as \(sfc^{j}=\left\langle v^{s}_{j,in},v^{s}_{j,out},V^{NF}_{j},E^{NF}_{j},I_{j}\right\rangle\), where \(v^{s}_{j,in}\) and \(v^{s}_{j,out}\) represent the entrance and exit network elements, respectively; \(V^{NF}_{j}\) represents a set of ordered NF request sets, the set of VNF types that the traffic passes through in order; \(E^{NF}_{j}\) represents the logical link set, connecting the VNFs between the entrance and exit network element nodes; and \(I_{j}\) represents the permissible end-to-end delay of the request. The CPU resource demand and memory resource demand of the \(u\)-th NF \(v^{nf}_{j,u}\in V^{NF}_{j}\) of \(sfc^{j}\) are \(c^{nf}_{j,u}\) and \(m^{nf}_{j,u}\), respectively. The traffic segment \(\left(v^{nf}_{j,u},v^{nf}_{j,v}\right)\) of \(sfc^{j}\) is represented as the logical link \(e^{nf}_{j,uv}\in E^{NF}_{j}\), and the bandwidth demand of the logical link is \(bw^{nf}_{j,uv}\). The decision variable \(t^{f}_{j,u}\in\{0,1\}\) specifies the types of NFs in the SFC. If the \(u\)-th virtual node \(v^{nf}_{j,u}\in V^{NF}_{j}\) of \(sfc^{j}\) is of type \(f\), then \(t^{f}_{j,u}\) equals 1:  
\[t^{f}_{j,u}= \begin{cases}1,&\text{ if }v^{nf}_{j,u}\text{is }of\text{ }type\text{ }of\text{ }f\in F\\ 0,&\text{ otherwise}\end{cases}  \tag{1}\]  
It is stipulated that the entrance and exit network element nodes do not have a type; that is, \(t^{f}_{j,u}\) is always equal to 0. When the decision variable \(\eta^{i}_{j,u}\in\{0,1\}\) equals 1, it indicates that the \(u\)-th virtual node \(v^{nf}_{j,u}\in V^{NF}_{j}\) of \(sfc^{j}\) is deployed on the physical node \(v^{s}_{i}\in V^{S}\):  
\[\eta^{i,t}_{j,u}= \begin{cases}1,&\text{ if }v^{nf}_{j,u}\text{is }mapped\text{ to }v^{s}_{i}\text{ during }t\\ 0,&\text{ otherwise}\end{cases}  \tag{2}\]  
When the decision variable \(\Upsilon^{pq}_{j,uv}\in\{0,1\}\) equals 1, it indicates that the traffic segment \(e^{nf}_{j,uv}\in E^{NF}_{j}\) of \(sfc^{j}\) flows through the physical link \(e^{S}_{pq}\in E^{S}\), which can be represented as follows:  
\[\Upsilon^{pq}_{j,uv}= \begin{cases}1,&\text{ if }e^{nf}_{j,uv}\text{ is }mapped\text{ to }e^{s}_{pq}\text{ during }t\\ 0,&\text{ otherwise}\end{cases}  \tag{3}\]  
Figure 1: SFC mapping architecture. If an NF of type \(f\in F\) is mapped to \(v_{i}^{s}\in V^{S}\), then a VNF of type \(f\) must also be instantiated on node \(v_{i}^{s}\). Here we define the state variable \(\beta_{f}^{i}\in\{0,1\}\), which equals \(1\) if there is a VNF of type \(f\in F\) on the physical node \(v_{i}^{s}\in V^{S}\):  
\[\beta_{f}^{i}= \begin{cases}1&\text{if $a\ VNF\;of\;type\;f\;is\;assigned\;on\;v_{i}^{s} $}\\ 0&\text{otherwise}\end{cases}  \tag{4}\]  
\[\beta_{f}^{i,t}=1,\;\text{if $\sum_{sf\in F\in S}\sum_{v_{i,u}^{sf}\in V_{j}^{ NF}}\eta_{j,u}^{i,t}t_{j,u}^{f}\geq 1,\;\forall v_{i}^{s}\in V^{S}$, $f\in F$, $t\in T$} \tag{5}\]  
Due to dynamic traffic changes, the relationship between the inflow bandwidth and resource demand of \(v_{j,\
u}^{nf}\in V_{j}^{NF}\) at time \(t\) can be expressed as follows:  
\[c_{j,\
u}^{nf}(t)=bw_{j,uv}^{nf}(t)\sum_{f\in F}t_{j,\
u}^{f}\;\text{coeff}_{c} ^{f}\;\forall t\in T \tag{6}\]  
\[m_{j,\
u}^{nf}(t)=bw_{j,uv}^{nf}(t)\sum_{f\in F}t_{j,\
u}^{f}\;\text{coeff}_{m} ^{f}\;\forall t\in T \tag{7}\]  
where \(coeff_{c}^{f}\) and \(coeff_{m}^{f}\) represent the CPU resource coefficient and memory resource coefficient, respectively, of the VNF of type \(f\in F\). The data flow may be amplified or reduced (such as firewalls and intrusion defense will reduce traffic) when passing through each NF, causing the required bandwidth to change.