An online service function chain orchestration method for profit maximization in edge computing networks

Network function virtualization (NFV) is an appealing solution that transforms complex network functions from dedicated hardware to software instances running in a virtualized environment. However, some new challenges will arise when deploying virtual network functions to meet the needs of NFV and edge‐computing (EC) enabled 5G networks. In this paper, we focus on the service function chain (SFC) orchestration problem for EC‐enabled networks to maximize the profit of network service providers. First, the mathematical model of SFC orchestration in NFV and EC‐enabled networks is defined. Then, a two‐stage heuristic algorithm is proposed to optimize the total revenue. Finally, the performance of the method is evaluated by simulation experiments and the results show its effectiveness.


INTRODUCTION
Net function virtualization (NFV) 1 is first proposed by European Telecommunications Standards Institute and has emerged as an appealing solution for network design. NFV enables to replace of hardware implementations with software instances running in a virtualized environment, which is known as the virtual network functions (VNFs). 2,3 In NFV-enabled networks, user service requests (USR) are fulfilled by composing different types of VNFs to form service function chains (SFCs) 4 that are transmitted by the data flow.
Benefiting from virtualization technology, an SFC can be deployed in a more scalable and elastic manner, leading to a significant reduction in capital expenditure and operating expenditure for network service providers. 5 In line with the benefits that NFV brings, an important issue is how to orchestrate the network resources efficiently without violating the node and link capacity constraints. When the requested VNFs are placed on networks, the route should traverse each located VNF one by one in a predefined order. In addition, the quality of service parameters as end-to-end delay should also be taken into account in the SFC orchestration process. Edge computing (EC) 6 is another one of the key technologies for the Internet of Things (IoT), augment reality and distribution optimization of local content. In generally, the main idea of EC is to push VNF instances in edge servers to reduce the latency optimize resource utilization. EC is a hierarchical and geo-distributed architecture 7 that includes different types of servers such as micro datacenters (MDC), remote cloud datacenters (CDC), and service access routers (SAR). MDCs are smaller, reach-level systems that provide all the essential components of a traditional data center. In certain EC applications, the micro data centers are much more suited than traditional data centers as they can typically be much smaller in size. A user can be accessed in EC-enabled network by SARs.
The next generation (5G) telecommunication technology is charged with the capacity of handling huge volumes of traffic, supporting heterogeneity of services, and ultra-reliable low latency communications. 8 Given the characteristics of NFV and EC, we can see that they are two promising technologies to accelerate 5G networks. However, some new challenges shall arise when deploying VNFs to meet the needs in NFV and EC-enabled 5G networks.
1. The mobile edge applications are always running on resource-limited edge devices. Traditional solutions cannot improve resource utilization. 2. EC-enabled networks are dynamic and complex. Traditional solutions are unable to reflect network state changes effectively during the SFC orchestration.
To solve the SFC orchestration problem in EC-enabled networks efficiently, most of the existing works propose heuristic solutions. However, heuristic solutions can only find a suboptimal result.
Traditionally, a VNF is deployed on one virtual machine (VM), each VM has its guest operation system and related libraries to instantiate VNFs. Referring to Reference 9, the resource used to maintain these supports the running of VNFs are called basic resource consumptions (BRCs). In our work, BRCs are concretized as CPU and memory consumptions, and we assume that different VNF instances cannot share the BRCs for the sake of isolation among different instances.
The resource consists of BRCs and instance resource consumptions (IRCs). In our work, BRCs are assumed to be fixed and IRCs are increased with user access to the VNF instance. So, to reduce save capital expenditure and operating expense, an effective solution is to reduce BRCs by placing the same type of VNF in one instance, which decrease the number of VNF instance.
In References 10 and 11 the longest effective function sequence-based algorithm is used to reduce resource consumption by merging the same type of VNFs in one instance. However, they do not consider IRCs. Therefore, the algorithm based on the longest effective function sequence cannot be directly used in our scenario. Moreover, less BRCs may lead to long SFC paths, which will bring an increment in bandwidth consumption, so an optimization algorithm is needed to achieve a tradeoff between bandwidth consumption and node resource consumption.
Given the above facts, we focus on the SFC orchestration problem in NFV and EC-enabled networks considering resource utilization and profit maximization. In light of the complexity of the SFC orchestration problem, an efficient heuristic algorithm is proposed with a modified longest effective function sequence strategy. Our main contributions can be summarized as follows: 1. The mathematical model of SFC orchestration in NFV-and EC-enabled networks is defined. The networks are hierarchically structured and under heterogeneous latency constraints. 2. A two-stage heuristic algorithm is proposed to optimize the total revenue. It employs two weight parameters to balance the deployment cost and resource utilization and merge strategy based on maximum reuse to improve the results. 3. Extensive simulation experiments are carried out to evaluate the performance of the proposed method. The results show that it achieves competitive performance with the optimal solution.
The rest of this paper is organized as follows. Section 2 surveys the related work. The problem is formally defined in Section 3. In Section 4, we introduce the algorithm in detail. The simulation experiments are presented in Section 5. Finally, Section 6 concludes the paper.

RELATED WORKS
In recent years, the SFC orchestration problem in EC-enabled networks has been extensively investigated. The most frequent approaches to deal with the problem include ILP, 12 the heuristic method, 13 deep learning, 14 etc. The SFC orchestration is an NP-Hard problem 15,16 that requires a fast, flexible, and optimal algorithm. Due to its complexity, especially in large-scale networks, lots of recent research efforts have been made to heuristic methods that have been wildly used to address the challenges in orchestrating the SFC across geo-distributed infrastructures.
To maximize the total profit of service providers, Racheg et al. 17 proposed an ILP-based model and used heuristic methods to reduce complexity. Li et al. 9 formulated the SFC orchestration problem in EC networks as an integer linear programming to minimize the total resource consumption. An efficient polynomial time heuristic algorithm was used to solve the optimization problem. Lopezp et al. 18 proposed a modified priority-based greedy heuristic algorithm to weight the latency, bandwidth, resource restrictions and instantiation cost of VNFs. Manzalini et al. 19 thought that softwarization was a systemic transformation and proposed an edge operating system combining SDN, NFV and cloud and edge-fog computing. Jemaa et al. 20 modeled the requests to the end cloud and public clouds using Queueing Theory. Subsequently, they proposed an exact ILP to solve how to place the VNFs in edge clouds without violating the delay constraint.
The wireless SFC orchestration in the radio access network was addressed in Reference 12. In their work, the radio resources for VNF and node had been considered and they presented an ILP and a heuristic algorithm. Yang et al. 21 proposed an approximation algorithm to solve the SFC orchestration problem in edge clouds by taking into account both fully ordered and partially ordered SFCs. How to place VNFs on an EC-enabled network with a minimum number of edge nodes and find the optimal route to meet the time delay constraints was further discussed in Reference 22. Song et al. 23 studied the SFC orchestration problem in 5G edge networks by considering the user's mobility. They proposed a user grouping model based on geographical information and then defined the clusters to minimize the end-to-end delay of network services. Gouareb et al. 24 studied the problem of service function placement and routing across the edge clouds to minimize overall latency, defined as the queuing delay within the edge clouds and in network links. Subramanya et al. 14 proposed a centralized deep-learning model that can perform horizontal and vertical autoscaling in multi-domain networks. In their work, autoscaling was modeled as a time-series forecasting problem that predicts the future number of VNF instances based on the expected traffic demand. The performance of various deep learning models trained over a commercial network operator dataset was evaluated to investigate the pros and cons of federated learning.

System model
The physical network of SFC orchestration addressed in our work includes mixed MDCs, CDCs, and SARs The definitions of MDC, CDC, and SARs can be found in Reference 16. In our model, there is only one CDC, and resources in this CDC are assumed to be infinite. We will discuss the optimization problem with multiple CDCs in future work. We consider the SFC deployed in EC enabled network and USR arrives in an online manner. In NFV-and EC-enabled networks, each USR consists of three parts: SAR, VNFs in MDCs, and VNFs in CDC. Figure 1 shows an overview of our F I G U R E 1 An example of service function chain orchestration in edge-computing networks. Figure shows an overview of our system. When a user service request arrives, the virtual network function (VNF) composition module establishes a feasible chain. After that, the VNF placement module deploys VNFs on a data center in the physical network. At last, the routing paths between adjacent VNFs need to be determined.

Item Value
F I G U R E 2 Problem outline using the example in Table 1. In Figure 2, r starts from SAR1, VNF1 and VNF2 are deployed in MDC1, VNF3 is deployed in MDC2, VNF4 and VNF5 are deployed in cloud datacenters, respectively. The data flow is described in the blue line.
system. When a USR arrives, the VNF composition module establishes a feasible chain. After that, the VNF placement module deploys VNFs on a data center in the physical network. At last, the routing paths between adjacent VNFs need to be determined. A six-tuple < S r , M r , C r , L r , T r , F r > is used to indicate a USR r, where S r , M r , and C r represents the part of r in SAR, MDC and CDC, respectively. L r indicates the logical links in r and T r indicates the propagation latency which ensures the service quality. F r indicates the flow data rate. Table 1 shows an example of r, where the number of VNFs is 5 and the flow data rate is 1 GBps. The SAR, MDC, and CDC part of r is SAR1 {VNF1, VNF2} and {VNF3, VNF4, VNF5}.
This example is described in Figure 2, r starts from SAR1, VNF1, and VNF2 are deployed in MDC1, VNF3 is deployed in MDC2, VNF4, and VNF5 are deployed in CDC, respectively. The data flow is described in the blue line.

Problem description
With the aforementioned system model, now we introduce the mathematical model of optimization problem. The notations and symbols are show in Table 2. We use decision variable x r,i j to denote whether VNF s r i is located on DC j. The logical link between s r j and s r j+1 u i,r m,n,q Whether VNF s r i is located on server n m,q Binary variables Whether virtual link between s r j and s r j+1 is mapped on l ( m q ) Whether m q is activated by any VNF Abbreviations: CDC, cloud datacenters; MDC, micro datacenters; SAR, service access routers; VNF, virtual network function.

System constraints
Firstly, the total CPU and memory consumption cannot exceed CPU/memory capacity in MDC. So we have Equation (1) to be satisfied.
the definition of z f n is presented in (2) and r,j f denotes whether VNF s r j belongs to type f . c(n) denotes the resource capacity of DC n. In Equation (1), is not a variable because the type of s r j is known beforehand. The definition of BRCs is in Section 1.
Equation (3) guarantees that each s r j should be placed in exactly one MDC/CDC. Equations (4) and (5) guarantee that the VNF and virtual links cannot be separated into different MDCs and physical links. For each USR, we have to find a routing path between adjacent VNFs. Hence, we need to determine the mapping of each virtual link. We use decision variable y i,r l to denote whether virtual link between s r j and s r j+1 is mapping on l.
Equation (6) ensures that the total allocated bandwidth on each link does not exceed its maximum capacity and Equation (7) ensures that the virtual link between s r j and s r j+1 can only be mapped on exactly one physical link.

Profit model
Based on a pay-as-you-go model, if a USR request r is accepted, the revenue R r is decided. The total deployment cost of r consists of computational resource consumption C node and link resource consumption C link , which can be represented as Equation (8) and Equation (9), respectively.
where σ ∈ [0, 1] and μ ∈ [0, 1] are coefficient and indicate the relative importance of C node and C link , respectively. Denote the total revenues as Prof, the deployment revenues as R, and the deployment cost as C, then.
where R = ∑ |R| r r p r , r = { 1, r is accpeted 0, otherwise , p r is the income obtained after r is successfully deployed.
From all above, the optimization problem can be defined as follows.
max R − (C node + C link ) .

ARCHITECTURES AND ALGORITHMS
In this section, the heuristic method is explained in detail. Equation (10) is in fact a combinatorial optimization problem, which is known to be NP-hard. For a large-scale network, its computational complexity is extremely high. To this end, we propose a novel heuristic approach to search for near-optimal solution of the optimization problem. For profit maximization, it is better to map all VNFs in a USR to the MDC with lowest resource cost. However, this mapping process may lead to a great number of duplicated copies across the network. To reduce the BRC, we design a VNF migration process to merge the VNFs with the same type together. By assigning VNFs of the same type in one MDC, the number of duplicate VNF copies will decrease, and then BRCs are reduced.

Weights calculation
We precalculate the k-shortest paths of each node pair in network G. In the following procedure, we introduce indicator bet n to describe the centralization of nodes in network G.
In Equation (11), st (n) is the number of shortest paths between node pair (s, t), and st denotes the number of shortest paths between node pair (s, t) that pass through the node n. According to the definition (11), larger bet n means that more paths will pass through node n, and it is more likely to become a "hot spot" in G.
We set the node weight as follows where c n and w n denote the available resource and cost of unit node resource in DC n, c max and w max are used to present the maximum value of c n and w n . Parameters and represent the relative importance of two targets. From Equation (12), it is more likely to choose nodes with a lower cost of unit node resource and smaller bet n value. When a USR arrives, we choose the k-shortest paths set as the candidate paths to deploy SFC. Considering that, the resource in the network varies with the dynamic arrival and departure of USR, it is necessary to introduce a path weight weight p to evaluate the current node resource and link resource utilization. The weight p is represented as: where w util p represents the part related to network resource utilization and w cost p represents the part related to deployment cost. Parameters and are used to balance the two parts. Furthermore, we have where u n is the resource utilization of DC n, p is the link resource utilization of path p, h p is the hops of path p, w max denotes the maximum value of w n . Equation (13) evaluates the deployment priority of path p by hops and the deployment cost of DC nodes in path p. When a USR r arrives, we first obtain the k-shortest paths set path k (s, t), then calculate the path weight weight p according to Equations (13) and (14). After that, we sort the paths in path k (s, t) in ascending order based on weight p . For each p, find node n ∈ p that has the lowest cost of node resource and satisfies the resource constraints. If node n exists, r is accepted and the deployment solution is obtained, then the computational and link resource utilization is updated accordingly. Algorithm 1 gives the process of above strategy.

Algorithm 1. Online USR deployment algorithm based on path and node weights
Input: G, r, F Output: solution(r)
Sort all the paths in ascending order by path weight and store these ordered paths in set path k-sorted (r init , r end ); 4.
for all p ∈ path k-sorted (r init , r end ) 5.
Calculate node weights of all n ∈ p according to (11) and (12). Sort all nodes in ascending order by node weight and store these ordered nodes in Node sorted (p) 6.
for all n ∈ Node sorted (p) 7.

VNF migration
Algorithm 1 is based on the evaluation of path and node weights, which preferentially deploys all VNFs in the SFC on the node with the highest priority to maximize the overall revenue. The limitation of this algorithm is that when the number of service requests continues to increase, deploying the SFC as a whole on a single DC node will lead to excessive BRC consumption, thereby reducing the success rate of deployment. VNF reuse is a feasible method to solve the above problems which is to deploy VNFs of the same type on one node as much as possible to reduce BRC consumption. Inspired by existing work, this section proposes a VNF migration strategy based on maximum reuse. The pseudo-code is shown in migrateVNF. As described, rule of the scheme is migrating VNFs that have only one tenant to other nodes on path p by order. We use {m 1 ,m 2 , … ,m |p| } to represent the nodes and r i to represent the VNF to be migrated. According to the order of the nodes, it is judged whether m j satisfies the corresponding conditions (i), (ii) and (iii) in step 6 to step 8. Condition (i) means that m j has deployed a VNF instance of the same type as r i , so migrating r i to m j can reduce resource consumption. Condition (ii) means that migrating r i to m j will not break Equations (2) and (3) in Section 3.2. Condition (iii) means that the sequence of VNFs is satisfied after migration. Moreover, the operation will not change the path p from start point r init to destination point r end , which means the latency constraints will be satisfied.
If there is an m j that satisfies the condition, the VNF is migrated to this node and the solution(r) is updated. Then let this node be the new loop start tag, and so on until all iterations are completed.
Combined with Algorithms 1 and 2, the pseudo-code of the network service request deployment algorithm based on the maximum reuse degree is shown in Algorithm 3. Algorithm 2. migrateVNF. VNF migrate strategy based on reuse degree Input: solution(r) Output: solution ′ (r) 1. Initialization: Consider USR r is deployed on node n in path p, let solution (r)={r 1 (n),r 2 (n), … , r |r| (n)}, where r i (n) represents the deployment location of VNF r i ,{m 1 ,m 2 ,..,m |p| } represents the DC nodes on path p, set tag = 1,solution ′ (r)= solution(r); 2.
if VNF r 1 deployed at n, the number of access users is 1 4. for if m j satisfies following conditions 6.
(i). VNFs with same type of r i has been deployed on m j ; 7.
(ii). Computational resource constraints is satisfied if migrate VNF r i from n j to m j ; 8.
(iii). The VNF order of r is satisfied if r i is deployed in m j ; 9.
then update r i (n) in solution ′ (r) to r i (m j ), set tag = j 10. Calculate the weight of each weight p according to Equations (13)- (15), and sort them in ascending order 3.
Store the sorted path into set path k-sorted (r init , r end ) 4.
for all p ∈ path k-sorted (r init , r end ) 5.
Calculate each weight n of p according to Equations (11) and (12), store them in set Node sorted (p) and sort in ascending order 7.
Let solution(r)= {r 1 (n),r 2 (n), … , r |r| (n)}, where the content in brackets is the deployment location corresponding to VNF r i , {m 1 ,m 2 ,..,m |p| }is the sequence of DC nodes corresponding to the path p in order, let tag=1; 9.
Let Prof(r) be the deployment revenue corresponding to solution(r); 11.
if solution ′ (r) satisfies Equations (1) and (6)  If no deployment solution that meets the conditions is found, the deployment fails and an error is returned.
Algorithm 3 traverses the shortest path set path k-sorted (r init , r end ) and the node set on the shortest path Node sorted (p). If solution(r) satisfies the resource constraints (2) and (3), then further call migrateVNF to obtain the migrated deployment plan solution ′ (r), and determine the corresponding revenue values of the two, and select the deployment plan with higher revenue to return; if solution(r) does not satisfy the deployment condition resource constraints (2) and (3), directly call migrateVNF to obtain solution ′ (r) and determine whether solution ′ (r) satisfies the constraints (2) and (3), if so, return it; otherwise enter the next iteration. Algorithm 3 first obtains the candidate deployment solution(r) based on Algorithm 1, and on this basis, according to whether the constraints are met, the migration strategy migrateVNF is called to optimize the candidate solutions, reducing the loss of basic resources and improving the success rate of deployment.

Online SFC orchestration
In this section, we consider the USR arrives in an online manner, where the information of USR is unknown in advance. We use a queue arrivedSFC to store the incoming USRs and choose USR to deploy based on first in first out (FIFO) strategy. If the deployment succeeds, the SFC is deployed according to proposed method. If deployment failed, the SFC is discarded. Subsequently, the online SFC orchestration method for profit maximization is illustrated in Algorithm 4.

Algorithm 4. Online SFC orchestration method for profit maximization
Input: G, F, R Output: Profit
Choose a USR r according to FIFO from arrivedSFC 4.
Accept r and deploy SFC, update substrate network resources 7. else 8.
return Profit

Time complexity analysis
In this part, the time complexity of Algorithm 4 is analyzed. To make the description more concise, we suppose the total number of USR is |R|,the average number of VNFs in a USR is r ′ , K is the number of shortest paths, and M is the average number of nodes along a path. Firstly, for Algorithm 1, the path weight of each shortest path p and the node weight of any node along with p need to be calculated. According to Algorithm 3, the shortest path and the weights of all nodes on each path need to be calculated first, and the time complexity of this step is O(KM). Then use the migration strategy to make adjustments to the deployment scenario. In worst cases, the time complexity of migrateVNF is O(KM 2 r ′ ). So the total time complexity of Algorithms 3 and 4 is O(KM(1 + Mr ' )) and O(|R|KM(1 + Mr ' )), respectively.

PERFORMANCE EVALUATION
In this section, we depict the simulation settings and evaluate the performance comparison between Algorithm 4 and existing methods. All methods are implemented with Matlab2016 on Windows10 PC server with Intel Core i5-8250U and 16 GB memory.

Simulation setup
The substrate network topology used to evaluate Algorithm 4 with two networks. Network1 has 30 SARs, 20 MDCs, and 1 CDC, Network2 has 50 SARs, 40 MDCs, and 1 CDC. Both are generated by BRITE based on Waxman model. 25 The propagation delay on each link obeys a uniform distribution of U(0,2). The computational resource capacity of each MDC varies from 800 to 1200 units and the link capacity is set as 1Gbps. The cost of per unit node resource randomly ranges from 0.8 to 1. As for USR, there are 10 different types of VNFs and the computational resource requirement of each type obeys a uniform distribution of U (10,20). The BRCs is set as 30 units. All the weighted factors are equally balanced, that is, , , , and are all set to 0.5. The bandwidth consumption of each SFC obeys a uniform distribution of U (10,50) Mbps. The price of each accepted SFC is 100.

Simulation results
The simulation results are presented in Figure 3A,B. Figure 3Aa-f shows the total revenue, success rate, instance number, computational time, average hops and of node/link costs of Network1, respectively. The scale of total revenue and computational time are unit and second. The number of USRs varies from 100 to 300. From Figure 3A, we can see that Algorithm 4 perform better than OLPM_Ndelay 26 and ONSO_PKP 27 in small-scale network topology because Algorithm 4 can avoid hot nodes in deployment stage and choose nodes with low cost. For example, when USR number is 200, the total revenue of OLPM_NDelay, ONSO_PKP and Algorithm 4 are 5764, 6181, and 6818. Our method increases the total revenue by 18.3% and 10.3% more than OLPM_NDelay and ONSO_PKP.
The instance number can also be reduced by process migrateVNF to improve the total revenue. From Figure 3Ab,c, Algorithm 4 outperforms the benchmark algorithms OLPM_NDelay and ONSO_PKP on total instance number and success rate. For example, when the request arrival rate reaches 400 request/unit-time, Algorithm 4 is 3%-4% more than OLPM_NDelay, and the total instance number is reduced by 13.5%.
In larger topology, we can derive similar conclusions with Figure 3B. Figure 3Ba,b shows that the simulation results in Network2, Algorithm 4 is also superior to the performance of OLPM_NDelay and ONSO_PKP. This is because both ONSO_PKP and Algorithm 4 comprehensively consider deployment costs and revenue by setting weight coefficients, while OLPM_NDelay prioritizes nodes with the least deployment costs, which may lead to SFC being deployed on several hotspots, making it difficult to achieve the best overall revenue. Compared with ONSO_PKP, Algorithm 4 uses the migration strategy to deploy VNFs in the shortest path, which reduces the consumption of basic resources and achieves the goal of increasing profits.
In Figure 3Ad,Bd, OLPM_NDelay needs to traverse all nodes to obtain optimal DC and path. So when it comes to large network topology, the runtime of OLPM_NDelay will significantly grow. From Figure 3Bd, the runtime of ONSO_PKP and Algorithm 4 can be reduced as we calculate the candidate paths and nodes. So with our method, search space is limited and runtime increase linearly, which fits the analysis in Section 4.4.
In the result, we also revalue the performance of the algorithms on average hops and node and link costs, as shown in Figure 3Ae,f,Be,f. When the number of USRs is less than 150, the node and link costs are similar in all algorithms, and our algorithms perform better than that of OLPM_NDelay and ONSO_PKP in the large topology. This reveals that when admitting the same number of service requests, our algorithms are better than the OLPM_NDelay and ONSO_PKP algorithm at reducing deployment cost, and it is verified by the results in Figure 3Ae,Be that the average number of hops of our algorithms are lower than the hops of the compared algorithm.

CONCLUSIONS
In this paper, we studied the VNF placement and resource optimization problem in MDC/CDC EC networks with the goal of profit maximization. The SFCs are hierarchical and geo-distributed owing to the characteristics of EC. Resource constraints and link constraints are considered in our model and a two-stage heuristic algorithm is proposed to optimize the total revenue of service providers.
In the first stage, we precalculate the k-shortest paths for any node pair in the network, which saves the deployment time. Second, we introduce weight parameters of nodes and paths to evaluate the current node resource and link resource utilization. Finally, we design a VNF migration strategy based on maximum reuse degree to improve the utilization and deployment success rate. Evaluation results in small-scale and large-scale topologies verify that our algorithms can significantly reduce deployment time and improve the total revenue for service providers.
We also recognize the limitations of our research. First, the migration strategy proposed in this paper is still conservative. Second, we evaluate the proposed solutions in the simulation environment. We do not implement our SFC orchestration algorithm in the real environment. Therefore, our future work will focus on the above aspects.