# DRL-Based Dynamic SFC Orchestration Algorithm for LEO Satellite Networks
## 3 System Model
### Problem Modeling  
In this section, the optimization objective is to maximize the service provider's total profit over a specific orchestration period. The network service provider's profit consists of two parts: the first part is the revenue generated from successfully providing service function chain requests, which is related to the number of successfully deployed service function chains within the orchestration period and the profit per successful deployment; the second part is the cost incurred from redeploying service function chains that fail to meet user service quality requirements during their lifecycle. In research on service function chain redeployment, this cost is jointly determined by the number of hops involved in VNF migration during redeployment and the traffic volume carried by the service function chain. The operator's profit calculation formula is shown as follows:  
\[\max_{x_{i,j,k}(t),y_{i,j}(t),z_{i,j,k}^{n,n}(t),\,w_{i}(t)}P=R+C \tag{9}\]  
In the above formula, the binary decision variable \(x_{i,j,k}(t)\in\{0,1\}\) indicates whether at time \(t\), the \(j\)-th virtual node \(vn_{j}\) of the \(i\)-th user service request \(sfc_{i}\) is mapped to the physical node \(n_{k}\), with a value of 1 if mapped and 0 otherwise. Here, virtual nodes can be either VNFs or the source and destination nodes of service requests; binary decision variable \(y_{i,j}(t)\in\{0,1\}\) indicates whether at time \(t\), user service request \(sfc_{i}\) selects path \(p_{j}(t)\) between source and destination nodes as the user traffic routing path, with a value of 1 if selected and 0 otherwise; binary decision variable \(z(t)\in\{0,1\}\) indicates whether at time \(t\), the virtual link \(e_{j,k}\) between the \(j\)-th and \(k\)-th virtual nodes of the \(i\)-th user service request \(sfc_{i}\) uses the physical link \(l_{m,n}(t)\) as part of its traffic routing path, with a value of 1 if used and 0 otherwise; decision variable \(w_{i}(t)\) indicates whether at time \(t\), the \(i\)-th user service request requiring readjustment due to delay constraint violations is successfully readjusted, with a value of 1 if successfully readjusted or not requiring readjustment and 0 otherwise. The operator's total profit equals the difference between revenue from providing services to users and the cost of readjusting service function chains that fail to meet delay constraints to ensure service quality. The revenue from providing services to users can be calculated using the following formula:  
\[R=\sum_{i}\alpha\cdot lifecycle_{i}\cdot\delta_{i} \tag{10}\]  
The formula indicates that the operator's total revenue over the entire network period equals the sum of revenue earned from providing services to each user. In this paper, the operator's revenue model can be summarized as follows: charging fees as revenue for providing network access services that meet service quality requirements through the occupation of underlying network infrastructure resources during the user service lifecycle without separately considering the costs of resource occupation by services. In service layer modeling, both the VNF resource occupation of underlying nodes and user traffic bandwidth occupation of physical links are modeled as positively correlated with user traffic; therefore, the operator's total revenue from providing services to a single user can be approximately estimated using the user's traffic volume and service duration. The formula shows that the revenue earned from providing services to a single user is proportional to the service duration and input traffic demand of that user's service request. For service operators, throughout the network period, the main cost of ensuring service quality comes from capital expenditure and operational costs associated with readjusting deployed virtual network functions and remapping affected virtual links when network topology changes lead to service quality degradation.