# Deep Reinforcement Learning-Based Algorithm for VNF-SC Deployment

Authors: Junlei Xuan; Huifang Yang; Xuelin Zhao; Xingpo Ma; Xiaokai Yang
Journal: Security and Communication Networks
 (2021)

---

## Abstract

Network function virtualization (NFV) has the potential to lead to significant reductions in capital expenditure and can improve the flexibility of the network. Virtual network function (VNF) deployment problem will be one of key problems that need to be addressed in NFV. To solve the problem of routing and VNF deployment, an optimization model, which minimizes the maximum index of used frequency slots, the number of used frequency slots, and the number of initialized VNF, is established. In this optimization model, the dependency among the different VNFs is considered. In order to solve the service chain mapping problem of high dynamic virtual network, a new virtual network function service chain mapping algorithm PDQN-VNFSC was proposed by combining prediction algorithm and DQN (Deep Q-Network). Firstly, the real-time mapping of virtual network service chains is modeled into a partial observable Markov decision process. Then, the real-time mapping process of virtual network service chain is optimized by using global and long-term benefits. Finally, the service chain of virtual network function is mapped through the learning decision framework of offline learning and online deployment. The simulation results show that, compared with the existing algorithms, the proposed algorithm has a lower the maximum index of used frequency slots, the number of used frequency slots, and the number of initialized VNF.


---

## Body

## 1. Introduction

In the traditional network, in order to provide a variety of network services, operators need to deploy a large number of monitors, load balancers, firewalls, intrusion detection systems, and other different network functions. These network functions (NF) generally require specific devices to be physically deployed to realize, and the network data flow of some network functions that need to cross is called the network function chain [1–3]. Network function virtualization (NFV) is a technology that utilizes virtualization to separate network functions from dedicated hardware. Then, the virtual network function is mapped to the general server, switch, or memory to form the virtual network function (VNF) [4, 5]. This technology can not only reduce the cost of network construction and operation but also improve the flexibility of the network [6–8]. Therefore, the network data flow of some virtual network functions that need to go through is called VNF Service Chain (VNF-SC). Virtual network function configuration in the virtual network function chain is a key problem to be solved in the implementation of network function virtualization, and how to solve the problem of virtual network function configuration is a key to solve the problem of network function virtualization [9–11].In recent decade years, there are large number works focusing on the virtual network function service chain deployment problem, such as [12, 13]. Zhu et al. [8], through calculating K alternative path data center deployment of virtual network function of the virtual network with required function of the longest common subsequence between sequence, determine the function of virtual network routing of service chain and virtual network function deployment plan, designed to maximize the network in the virtual network in the reuse rate. Considering that virtual network functions can be migrated, Tachun’s team [14] proposed routing, deployment, and migration algorithm of virtual network function service chain based on rollback strategy, so as to minimize the bandwidth occupied by the rejected virtual network function service chain and the energy consumed in the network. Aiming at the problem of finding the best placement of service chain in distributed cloud environment, Mechtri et al. [15] proposed an algorithm of adjacency matrix eigendecomposition based on infrastructure topology diagram and requested virtual network function forwarding graph. Under the background of network function virtualization, the research on the resource scheduling scheme oriented to virtual network function service chain is mainly based on three kinds of methods: heuristic method [10, 16], optimization model method [17], and learning theory-based method [18]. Based on the heuristic method, the resource scheduling scheme can be obtained quickly, but it is easy to fall into local optimal. The method based on the optimization model can get the optimal scheduling scheme, but it is difficult in modeling and solving. With the development of high performance computing and deep neural network, the study of the method resource scheduling scheme based on learning theory has attracted the attention of many scholars. The basic idea of the method based on learning theory is to obtain the resource scheduling scheme under different network states through learning strategies. In order to get the approximate optimal mapping scheme of virtual network function service chain, Quang et al. [18] proposed a solution method based on reinforcement learning search in a large action space to get the optimal mapping scheme. In order to solve the deployment problem of virtual network functions in software-defined networks, the problem was modeled as 0-1 integer programming problem in [19], and a virtual network function deployment algorithm based on double Q network was proposed. In order to minimize the energy consumption in the network, Solozabal et al. [20] adopt the combinatorial optimization theory and deep reinforcement learning to carry out the virtual network function deployment algorithm. Baojia et al. [21] study the problem of virtual network function deployment and propose a deep reinforcement learning method based on AC(Actor-Critic), which can well obtain the deployment scheme of virtual network function according to the current network state.In this paper, the problem VNFs deployment for VNF-SC is investigated. To solve the problem of routing and VNF deployment, an optimization model, which minimizes the maximum index of used frequency slots, the number of used frequency slots, and the number of initialized VNF, is established. In this optimization model, the dependency among the different VNFs is considered. In order to solve the service chain mapping problem of high dynamic virtual network, a new virtual network function service chain mapping algorithm PDQN-VNFSC was proposed by combining prediction algorithm and DQN (Deep Q-Network). Firstly, the real-time mapping of virtual network service chains is modeled into a partial observable Markov decision process. Then, the real-time mapping process of virtual network service chain is optimized by using global and long-term benefits. Finally, the service chain of virtual network function is mapped through the learning decision framework of offline learning and online deployment.The rest of this paper is organized as follows. Section2 gives the network architecture and the optimization model. To solve the optimization model effectively, we propose an improved brain storm optimization algorithm in Section 3. To evaluate the algorithm proposed, simulation experiments are conducted, and the experimental results are analyzed in Section 4. The paper is concluded with a summary in Section 5.


## 2. Problem Description and Mathematical Modeling

### 2.1. Problem Description

Undirected graphG=V,E represents a network topology, where V=V1,V2,…,VNV and E=lij|Vi,Vj∈V represent the set of network nodes and the set of network links in the network, respectively. NV and NE denote the number of nodes and links in the IoT network. Network nodes represent devices in the network, such as gateways, routers, and switches. These nodes only have the function of network forwarding, without the functions of monitor, load balancer, firewall, and intrusion detection system. Some of the network nodes in the network topology are connected to the data center, and some software can be deployed to implement the related functions. Therefore, the nodes in the network can be represented by a binary group Vi=i,Ωi, where Ωi≠0 denotes the number of data centers connected to the nodes; otherwise, Ωi=0. NDC denotes the number of data centers in the network. All virtual network functions can be realized in any data center. The set of virtual network functions is expressed as VNF=VNF1,VNF2,…,VNFNvnf, where Nvnf represents the number of virtual network functions. E=lij|Vi,Vj∈V denotes the number of nodes in the network and lij=1 denotes the link between network nodes Vi and Vj, otherwise lij=lij=0. There are NF frequency slots on each link and the numbered as 1,2,…,NF, respectively.R=R1,R2,…,RNR represents a set (NR denotes the number of virtual network function service chains (VNF-SC)) of virtual network function service chains, where Rk=sk,dk,VNFkD,VNFkI represents the kth VNF-SC. sk and dk represent the source node and the destination node of the virtual network service chain Rk, respectively. VNFkD is the set of dependent virtual network functions required by the virtual network service chain Rk and is represented as VNFkD=VNFk1D,VNFk2D,…,VNFkNDD, so we have VNFkD⊆VNF. The virtual network functions in VNFkD must be implemented in a fixed order in which the order is noncommutative, that is, if i<j, VNFkiD need to be implemented before VNFkjD. VNFkI is the set of independent virtual network functions required by the virtual network service chain Rk and is represented as VNFkD=VNFk1I,VNFk2I,…,VNFkNII. Similarly, we also have VNFkI⊆VNF. Different from the virtual network functions in VNFkD and the virtual network functions in VNFkI the set are implemented in an arbitrary order, and there is no interdependence between any two virtual network functions. BkD=bk,BkD,BkI, where bk represents the number of frequency slots required to be occupied when the virtual network function service chain Rk has not realized any virtual network functions, and BkD=bk1D,bk2D,…,bkNDD represents the ratio of the number of frequency slots occupied by the virtual network function service chain Rk after realizing the corresponding dependent virtual network functions to the number occupied by the virtual network function when the virtual network function has not been realized. Similarly, BkI=bk1I,bk2I,…,bkNII represents the ratio of the number of frequency slots occupied by the virtual network function service chain Rk after the corresponding independent virtual network function is implemented to the number occupied by the virtual network function when the virtual network function is not implemented.The routing of static virtual network function service chain and the configuration of virtual network function in elastic optical network between data centers can be summarized as follows. When a batch of virtual network function service chains arrive, how to choose the appropriate path for each virtual network function service chain, configure its required virtual network functions in the corresponding data center, and allocate appropriate frequency gap for them to achieve a certain objective optimization?


### 2.2. Mathematical Modeling

This paper aims to obtain a virtual network function chain routing, virtual network function configuration, and spectrum allocation scheme that can minimize the maximum frequency slots occupied in the network, the minimum frequency slots occupied in the network, and the minimum number of deployed virtual network functions in all data centers. In this paper, the weighted summation method is adopted to transform the three-objective optimization problem into a single-objective constrained optimization problem, and the optimization objective is normalized. Therefore, the optimization objective of the optimization model established in this paper can be expressed as(1)minf=minαNFMNF+βNFUNFNE+γNvnfINDCNvnf,where NFM, NFU, and NvnfI are, respectively, the maximum frequency slots’ number occupied in the network, the number of frequency slots occupied in the network, and the number of virtual network functions configured in the network. α,β,andγ are three weight coefficients; α≥0,β≥0,γ≥0, and α+β+γ=1. Since NFM≤NF, NFU≤NFNE, and NvnfI≤NDCNvnf, thus, we have 0≤f≤1. Some conditions need to be satisfied in the routing of the virtual network function chain, the configuration of the virtual network function, and the spectrum allocation, that is, the constraint conditions are satisfied:(a)
Any virtual network function service chainRkRk∈R can only occupy one path in the candidate path set, i.e.,(2)a∑q=1NQλkq=1,k=1,2,…,NR,whereNQ is the number of paths in the candidate path set of the virtual network function service chain RkRk∈R. If and only if the virtual network function service chain RkRk∈R occupies the qth path in its candidate path set Qk=Qk1,Qk2,…,QkNQ, λkq=1, otherwise λkq=0.(b)
All the virtual network functions required can be realized on the data center on the occupied path of the service chainRkRk∈R; then,(3)VNFkD∪VNFkI⊆∪Vi∈VkqVNFki,k=1,2,…,NR,whereVkq is the set of nodes connected with data centers in the candidate path set of service chain of virtual network functions Rk and VNFki is the set of virtual network functions realized on nodes Vi connected with data centers.(c)
The data center on the occupied path linked to the virtual network function service chainRkRk∈R is able to satisfy all the required virtual network function dependencies, i.e.,(4)VNFkiD∈∪Vi∈Vkqt′VNFki,∀VNFktD,VNFkt′D,whereVNFktD,VNFkt′D represents two virtual network functions in the set of virtual network functions VNFktD and VNFkt′D, and VNFkt′D are dependent on VNFktD; that is, VNFktD must be implemented prior to VNFkt′D. Vkqt′ represents the set of nodes (including VNFkt′D the nodes connected to the data center) in the path occupied by the service chain of the virtual network function, in which VNFkt′D are in front of the nodes connected to the data center.(d)
Any of the virtual network functions that need to be implemented by linking to the virtual network function service chainRkRk∈R can only be configured on one data center; then,(5)∑Vi∈Vkqϕkti=1,∀VNFt∈VNFkD∪VNFkI.If and only if the virtual network functionVNFi required by the virtual network function service chain Rk is configured in the data center connected to the node Vt, ϕkti=1; otherwise, ϕkti=0.Since the first fit strategy is intended to be used for spectrum allocation, the allocation schemes all satisfy the constraints such as frequency slot consistency and frequency slot continuity, so the formal description of the constraints required for spectrum allocation is no longer given. Based on the given objective function and constraint conditions, the optimization model established in this paper is as follows:(6)minf=minαNFMNF+βNFUNFNE+γNvnfINDCNvnfs.t.a∑q=1NQλkq=1,k=1,2,…,NRbVNFkD∪VNFkI⊆∪Vi∈VkqVNFki,Rk∈RcVNFkiD∈∪Vi∈Vkqt′VNFki,∀VNFktD,VNFkt′Dd∑Vi∈Vkqϕkti=1,∀VNFt∈VNFkD∪VNFkI.Analysis found that the established optimization model is a discrete, nonconvex optimization model; the traditional derivative information such as the optimization method is not applicable to solve the model; however, such machine learning is not dependent on the functions of derivative information, such as the group of the intelligent optimization model is more suitable for solving the established model, the model for the solution of efficient. A new virtual network function service chain mapping algorithm PDQN-VNFSC was proposed by combining prediction algorithm and DQN (Deep Q-Network).


## 2.1. Problem Description

Undirected graphG=V,E represents a network topology, where V=V1,V2,…,VNV and E=lij|Vi,Vj∈V represent the set of network nodes and the set of network links in the network, respectively. NV and NE denote the number of nodes and links in the IoT network. Network nodes represent devices in the network, such as gateways, routers, and switches. These nodes only have the function of network forwarding, without the functions of monitor, load balancer, firewall, and intrusion detection system. Some of the network nodes in the network topology are connected to the data center, and some software can be deployed to implement the related functions. Therefore, the nodes in the network can be represented by a binary group Vi=i,Ωi, where Ωi≠0 denotes the number of data centers connected to the nodes; otherwise, Ωi=0. NDC denotes the number of data centers in the network. All virtual network functions can be realized in any data center. The set of virtual network functions is expressed as VNF=VNF1,VNF2,…,VNFNvnf, where Nvnf represents the number of virtual network functions. E=lij|Vi,Vj∈V denotes the number of nodes in the network and lij=1 denotes the link between network nodes Vi and Vj, otherwise lij=lij=0. There are NF frequency slots on each link and the numbered as 1,2,…,NF, respectively.R=R1,R2,…,RNR represents a set (NR denotes the number of virtual network function service chains (VNF-SC)) of virtual network function service chains, where Rk=sk,dk,VNFkD,VNFkI represents the kth VNF-SC. sk and dk represent the source node and the destination node of the virtual network service chain Rk, respectively. VNFkD is the set of dependent virtual network functions required by the virtual network service chain Rk and is represented as VNFkD=VNFk1D,VNFk2D,…,VNFkNDD, so we have VNFkD⊆VNF. The virtual network functions in VNFkD must be implemented in a fixed order in which the order is noncommutative, that is, if i<j, VNFkiD need to be implemented before VNFkjD. VNFkI is the set of independent virtual network functions required by the virtual network service chain Rk and is represented as VNFkD=VNFk1I,VNFk2I,…,VNFkNII. Similarly, we also have VNFkI⊆VNF. Different from the virtual network functions in VNFkD and the virtual network functions in VNFkI the set are implemented in an arbitrary order, and there is no interdependence between any two virtual network functions. BkD=bk,BkD,BkI, where bk represents the number of frequency slots required to be occupied when the virtual network function service chain Rk has not realized any virtual network functions, and BkD=bk1D,bk2D,…,bkNDD represents the ratio of the number of frequency slots occupied by the virtual network function service chain Rk after realizing the corresponding dependent virtual network functions to the number occupied by the virtual network function when the virtual network function has not been realized. Similarly, BkI=bk1I,bk2I,…,bkNII represents the ratio of the number of frequency slots occupied by the virtual network function service chain Rk after the corresponding independent virtual network function is implemented to the number occupied by the virtual network function when the virtual network function is not implemented.The routing of static virtual network function service chain and the configuration of virtual network function in elastic optical network between data centers can be summarized as follows. When a batch of virtual network function service chains arrive, how to choose the appropriate path for each virtual network function service chain, configure its required virtual network functions in the corresponding data center, and allocate appropriate frequency gap for them to achieve a certain objective optimization?


## 2.2. Mathematical Modeling

This paper aims to obtain a virtual network function chain routing, virtual network function configuration, and spectrum allocation scheme that can minimize the maximum frequency slots occupied in the network, the minimum frequency slots occupied in the network, and the minimum number of deployed virtual network functions in all data centers. In this paper, the weighted summation method is adopted to transform the three-objective optimization problem into a single-objective constrained optimization problem, and the optimization objective is normalized. Therefore, the optimization objective of the optimization model established in this paper can be expressed as(1)minf=minαNFMNF+βNFUNFNE+γNvnfINDCNvnf,where NFM, NFU, and NvnfI are, respectively, the maximum frequency slots’ number occupied in the network, the number of frequency slots occupied in the network, and the number of virtual network functions configured in the network. α,β,andγ are three weight coefficients; α≥0,β≥0,γ≥0, and α+β+γ=1. Since NFM≤NF, NFU≤NFNE, and NvnfI≤NDCNvnf, thus, we have 0≤f≤1. Some conditions need to be satisfied in the routing of the virtual network function chain, the configuration of the virtual network function, and the spectrum allocation, that is, the constraint conditions are satisfied:(a)
Any virtual network function service chainRkRk∈R can only occupy one path in the candidate path set, i.e.,(2)a∑q=1NQλkq=1,k=1,2,…,NR,whereNQ is the number of paths in the candidate path set of the virtual network function service chain RkRk∈R. If and only if the virtual network function service chain RkRk∈R occupies the qth path in its candidate path set Qk=Qk1,Qk2,…,QkNQ, λkq=1, otherwise λkq=0.(b)
All the virtual network functions required can be realized on the data center on the occupied path of the service chainRkRk∈R; then,(3)VNFkD∪VNFkI⊆∪Vi∈VkqVNFki,k=1,2,…,NR,whereVkq is the set of nodes connected with data centers in the candidate path set of service chain of virtual network functions Rk and VNFki is the set of virtual network functions realized on nodes Vi connected with data centers.(c)
The data center on the occupied path linked to the virtual network function service chainRkRk∈R is able to satisfy all the required virtual network function dependencies, i.e.,(4)VNFkiD∈∪Vi∈Vkqt′VNFki,∀VNFktD,VNFkt′D,whereVNFktD,VNFkt′D represents two virtual network functions in the set of virtual network functions VNFktD and VNFkt′D, and VNFkt′D are dependent on VNFktD; that is, VNFktD must be implemented prior to VNFkt′D. Vkqt′ represents the set of nodes (including VNFkt′D the nodes connected to the data center) in the path occupied by the service chain of the virtual network function, in which VNFkt′D are in front of the nodes connected to the data center.(d)
Any of the virtual network functions that need to be implemented by linking to the virtual network function service chainRkRk∈R can only be configured on one data center; then,(5)∑Vi∈Vkqϕkti=1,∀VNFt∈VNFkD∪VNFkI.If and only if the virtual network functionVNFi required by the virtual network function service chain Rk is configured in the data center connected to the node Vt, ϕkti=1; otherwise, ϕkti=0.Since the first fit strategy is intended to be used for spectrum allocation, the allocation schemes all satisfy the constraints such as frequency slot consistency and frequency slot continuity, so the formal description of the constraints required for spectrum allocation is no longer given. Based on the given objective function and constraint conditions, the optimization model established in this paper is as follows:(6)minf=minαNFMNF+βNFUNFNE+γNvnfINDCNvnfs.t.a∑q=1NQλkq=1,k=1,2,…,NRbVNFkD∪VNFkI⊆∪Vi∈VkqVNFki,Rk∈RcVNFkiD∈∪Vi∈Vkqt′VNFki,∀VNFktD,VNFkt′Dd∑Vi∈Vkqϕkti=1,∀VNFt∈VNFkD∪VNFkI.Analysis found that the established optimization model is a discrete, nonconvex optimization model; the traditional derivative information such as the optimization method is not applicable to solve the model; however, such machine learning is not dependent on the functions of derivative information, such as the group of the intelligent optimization model is more suitable for solving the established model, the model for the solution of efficient. A new virtual network function service chain mapping algorithm PDQN-VNFSC was proposed by combining prediction algorithm and DQN (Deep Q-Network).


## 3. Deep Reinforcement Learning and DQN

Reinforcement learning (RL) model mainly describes the agent to interact with the environment repeatedly through the mechanism of trial and error and to learn the optimal strategy by maximizing the cumulative return. The model based on RL strategy consists of five key parts, including stateS, action A, state transition probability P, return r, and strategy πs,a. In the process of interaction between agents and the environment, agents execute corresponding actions according to the strategy at different time points according to the observed state and system returns. After the action, the agent’s state is transferred to the next state with the description of probability P, while the agent receives feedback from the environment in return r. Since the current state of the agent affects the next state and has nothing to do with the state before the current state, MDP can be used to describe the reinforcement learning model.Through RL modeling, its core is to be able to getπs,a:S×A⟶0,1, that is, to get the mapping of the agent’s state space and action space to probability. Generally, agents have huge state space and action space, which requires that the RL method can use limited learning experience to complete the acquisition and representation of effective knowledge in a large range of space. When the scale of operator network is large enough, the scale of system state space will make it difficult to solve the equations. More importantly, the state transition probability matrix of the SFC migration model cannot be obtained in advance, which makes it difficult to use both the classical strategy iteration method and the value iteration method. In the recent research work, deep neural network (DNN) has been successfully used to solve the reinforcement learning model and good results have been obtained.


### 3.1. SFC Deployment Based on Double DQN

When the network decision-making mechanism acts as an “agent” is in a certain state, it can choose a variety of actions, and the execution of different actions will make the agent enter the next different state. This paper introduces an action value functionQπs,a to estimate the value of each action. Thus, the action value function is represented as Qπs,a=Ert+1+ηrt+2+η2rt+3+⋯|s,a and can be rewritten as(7)Qπs,a=Esr+ηQπs′,a′|s,a.In order to obtain the optimal strategy, we need to solve the optimal action value function:(8)Q∗s,a=ES′r+ηmaxa′Q∗s′,a′|s,a.The value iteration algorithm is to update theQ value to make it converge to the optimal, and the idea of Q-learning is obtained completely according to the value iteration. However, value iteration needs to update all Q values each time. However, it is difficult to traverse the whole state space for the SFC deployment problem studied in this paper, so Q-learning only uses limited samples to update Q values:(9)Qs,a=1−μQs,a+μr+ηmaxa′Q∗s′,a′|s,a.Although the targetQ value can be obtained according to the value iteration algorithm, it does not assign new Q value to the obtained Q value. Instead, it approaches the target in a progressive way, similar to gradient descent. In (9), the learning rate controlling the difference between the previous Q value and the new Q value can reduce the error. η represents the attrition rate, i.e., the degree to which future experience is important to the actions performed in the current state. Then, it converges to an optimal value of Q. In this paper, the value function Qs,a:φ is introduced to represent the input of any state to get the output. The purpose is to transform the complex updating problem of the Q value into a function problem. Similar states correspond to similar actions to achieve the approximation of the value function and then continue to be expressed by Qs,a:φ≈Q∗s,a, where the parameters represent the weight of the neural network. By updating parameters, DQN makes the approximate Q function infinitely approximate to the optimal value and turns it into a function optimization problem. Due to the nonlinear characteristics of the function, this paper adopts the deep neural network as the approximate Q function; that is, the deep reinforcement learning method is adopted, and based on this, a method of SFC mapping based on double DQN is proposed, which effectively avoids the influence caused by overestimation. Dual DQN separates the selection and evaluation actions in the target Q value, allowing them to use different Q functions (network). One is used to generate the greedy strategy, and the other is used to generate the estimate value of the Q function, so the implementation needs two Q function networks. The Q function network of the original DQN is called the online network, and the latter is called the target network. The target used by the dual DQN algorithm can be expressed as(10)YtDQN=rt+1+νQst+1,argmaxa′Qst+1,a:ϕt;ϕt−.In the dual DQN, two different targets are calculated, respectively, from the currentQ network and the target Q network. The current Q network is responsible for selecting actions, and the target Q network with delay ϕt−, which is responsible for calculating the target Q value. In addition, the experience pool is used to solve the problem of correlation and nonstatic distribution. The experience pool stores the transfer samples st,at,rt,st+1 obtained from the interaction between each time-step agent and the environment to the playback memory unit. When training is needed, a part of the adjustment samples are randomly taken out for training.The advantage of the algorithm based on dual DQN is that it can construct the loss function throughQ learning and then solve the correlation and nonstatic distribution problems through experience replay. Meanwhile, it can use the target network. The network solves the stability problem. Algorithm 1 describes the pseudocode of the DQN-based SFC mapping algorithm.Algorithm 1: Framework of proposed algorithm.
Input: Network Topology G, VNF-SC set R, VNF set VNFOutput: VNF-SC deployment strategy(1)
Initialize the neural network with random weightϕ;(2)
Initialize the action value functionQ;(3)
Initialize the experience replay memoryER;(4)
forepisode =  1,2,…,Gmaxdo(5)
Observation initial states0;(6)
fort =  1,2,…,ERdo(7)
A randomθ is generated randomly;(8)
ifθ>εthen(9)
Select a action|at=argmax|aQst,a:ϕt;(10)
else(11)
Select a random actionat with probability ε;(12)
end(13)
Perform the actionat in the emulator and observe the return rt+1 and the new state st+1;(14)
Store the intermediate quantityst,at,rt,st+1 into the experiential pool memory ER;(15)
Get a set of samples from the empirical pool memoryER;(16)
Calculate the loss functionL|ϕt;(17)
Calculate the gradient of the loss function with respect toϕt;(18)
Update:|ϕt=ϕt−ω∇ϕtLϕt, where ω is the learning rate;(19)
end(20)
end


## 3.1. SFC Deployment Based on Double DQN

When the network decision-making mechanism acts as an “agent” is in a certain state, it can choose a variety of actions, and the execution of different actions will make the agent enter the next different state. This paper introduces an action value functionQπs,a to estimate the value of each action. Thus, the action value function is represented as Qπs,a=Ert+1+ηrt+2+η2rt+3+⋯|s,a and can be rewritten as(7)Qπs,a=Esr+ηQπs′,a′|s,a.In order to obtain the optimal strategy, we need to solve the optimal action value function:(8)Q∗s,a=ES′r+ηmaxa′Q∗s′,a′|s,a.The value iteration algorithm is to update theQ value to make it converge to the optimal, and the idea of Q-learning is obtained completely according to the value iteration. However, value iteration needs to update all Q values each time. However, it is difficult to traverse the whole state space for the SFC deployment problem studied in this paper, so Q-learning only uses limited samples to update Q values:(9)Qs,a=1−μQs,a+μr+ηmaxa′Q∗s′,a′|s,a.Although the targetQ value can be obtained according to the value iteration algorithm, it does not assign new Q value to the obtained Q value. Instead, it approaches the target in a progressive way, similar to gradient descent. In (9), the learning rate controlling the difference between the previous Q value and the new Q value can reduce the error. η represents the attrition rate, i.e., the degree to which future experience is important to the actions performed in the current state. Then, it converges to an optimal value of Q. In this paper, the value function Qs,a:φ is introduced to represent the input of any state to get the output. The purpose is to transform the complex updating problem of the Q value into a function problem. Similar states correspond to similar actions to achieve the approximation of the value function and then continue to be expressed by Qs,a:φ≈Q∗s,a, where the parameters represent the weight of the neural network. By updating parameters, DQN makes the approximate Q function infinitely approximate to the optimal value and turns it into a function optimization problem. Due to the nonlinear characteristics of the function, this paper adopts the deep neural network as the approximate Q function; that is, the deep reinforcement learning method is adopted, and based on this, a method of SFC mapping based on double DQN is proposed, which effectively avoids the influence caused by overestimation. Dual DQN separates the selection and evaluation actions in the target Q value, allowing them to use different Q functions (network). One is used to generate the greedy strategy, and the other is used to generate the estimate value of the Q function, so the implementation needs two Q function networks. The Q function network of the original DQN is called the online network, and the latter is called the target network. The target used by the dual DQN algorithm can be expressed as(10)YtDQN=rt+1+νQst+1,argmaxa′Qst+1,a:ϕt;ϕt−.In the dual DQN, two different targets are calculated, respectively, from the currentQ network and the target Q network. The current Q network is responsible for selecting actions, and the target Q network with delay ϕt−, which is responsible for calculating the target Q value. In addition, the experience pool is used to solve the problem of correlation and nonstatic distribution. The experience pool stores the transfer samples st,at,rt,st+1 obtained from the interaction between each time-step agent and the environment to the playback memory unit. When training is needed, a part of the adjustment samples are randomly taken out for training.The advantage of the algorithm based on dual DQN is that it can construct the loss function throughQ learning and then solve the correlation and nonstatic distribution problems through experience replay. Meanwhile, it can use the target network. The network solves the stability problem. Algorithm 1 describes the pseudocode of the DQN-based SFC mapping algorithm.Algorithm 1: Framework of proposed algorithm.
Input: Network Topology G, VNF-SC set R, VNF set VNFOutput: VNF-SC deployment strategy(1)
Initialize the neural network with random weightϕ;(2)
Initialize the action value functionQ;(3)
Initialize the experience replay memoryER;(4)
forepisode =  1,2,…,Gmaxdo(5)
Observation initial states0;(6)
fort =  1,2,…,ERdo(7)
A randomθ is generated randomly;(8)
ifθ>εthen(9)
Select a action|at=argmax|aQst,a:ϕt;(10)
else(11)
Select a random actionat with probability ε;(12)
end(13)
Perform the actionat in the emulator and observe the return rt+1 and the new state st+1;(14)
Store the intermediate quantityst,at,rt,st+1 into the experiential pool memory ER;(15)
Get a set of samples from the empirical pool memoryER;(16)
Calculate the loss functionL|ϕt;(17)
Calculate the gradient of the loss function with respect toϕt;(18)
Update:|ϕt=ϕt−ω∇ϕtLϕt, where ω is the learning rate;(19)
end(20)
end


## 4. Experimental Results and Analysis

### 4.1. Simulation parameters

In order to verify the effectiveness of the algorithm, simulation experiments are carried out in two widely used network topologies: the National Natural Science Foundation Network (NSFNet) with 14 nodes and 21 links and the US Backbone network with 27 nodes and 44 links. The number of frequency gaps on each link of the network is 1000, i.e., eight groups of different quantities (100, 200, …, 800). The initial occupancy frequency gap number of each group of virtual network function service chain requests is generated randomly in the interval [1, 10], and the change ratio of occupancy frequency gap number is generated randomly in the interval [0.5, 2]. It is assumed that there are altogether 10 virtual network functions, that is, the number of virtual network functions required by each virtual network function chain is generated within the interval [1, 10] and randomly divided into two kinds of virtual network functions that are dependent and independent of each other.


### 4.2. Experimental Results

In order to verify the effectiveness of the algorithm, this paper compares the two algorithms, respectively. The first algorithm (represented by LBA) proposed in [16] is compared. The second algorithm is a combination of LBA algorithm and the least-priority strategy proposed in [19] (represented by LF-LBA). Figure 1 shows the experimental results of NSFNET network and US Backbone network when NDC=0.5NVandα=1, respectively. Figure 2 shows the experimental results of NSFNET network and US Backbone network when NDC=0.5NVandβ=1, respectively. Figure 3 shows the experimental results of NSFNET network and US Backbone network when NDC=0.5NVandγ=1, respectively. Figure 4 shows the experimental results of NSFNET network and US backbone network when NDC=0.5NVandα=β=β=1/3, respectively. Similarly, experimental results of NSFNET network and US Backbone network when NDC=3/4NVandα=1 are shown in Figure 5. Experimental results of NSFNET network and US backbone network when NDC=3/4NVandβ=1 are shown in Figure 6. Experimental results of NSFNET network and US backbone network when NDC=3/4NVandγ=1 are shown in Figure 7. Experimental results of NSFNET network and US backbone network when NDC=3/4NVandα=β=γ=1/3 are shown in Figure 8.Figure 1
Experimental results whenNDC=1/2NV and α=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 2
Experimental results whenNDC=1/2NV and β=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 3
Experimental results whenNDC=1/2NV and γ=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 4
Experimental results whenNDC=1/2NV and α=β=γ (a) NSFNET (b) US Backbone.
(a)(b)Figure 5
Experimental results whenNDC=1/2NV and α=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 6
Experimental results whenNDC=1/2NV and β=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 7
Experimental results whenNDC=1/2NV and γ=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 8
Experimental results whenNDC=1/2NV and α=β=γ: (a) NSFNET and (b) US backbone.
(a)(b)


### 4.3. Experimental Analysis

Whenα=1, the goal of optimization is to minimize the maximum frequency slots number occupying the frequency slots in the network. As can be seen from Figures 1 and 5, with the increase in the number of virtual network function service chains, the maximum frequency slots occupied in the network also increases gradually. Because the LBA algorithm does not consider the dependencies between virtual network functions and uses a fixed order to configure virtual network functions, it cannot well solve the configuration problem of virtual network functions that consider the dependencies between virtual network service functions. The LF-LBA algorithm also fails to consider the dependencies among virtual network functions. Although the virtual network functions occupying a small frequency slots are given priority in configuration, the optimal scheme still cannot be obtained when the dependencies among virtual network functions are considered. However, the PDQN-VNFSC algorithm proposed in this paper takes into account the dependence between different virtual network functions and can search for the optimal configuration scheme through multiple iterations, so the PDQN-VNFSC proposed in this paper can obtain better results than LBA and LF-LBA. It can also be seen from the experimental results that the algorithm designed in this paper can get the maximum frequency slots occupied in the network which is smaller than the two contrast algorithms.When the number of virtual network functional service chains is 100, the PDQN-VNFSC algorithm proposed in this paper can get the maximum frequency slots occupied in the network 1.1%–2.3% smaller than the two contrast algorithms. When the number of virtual network functional service chains is 800, the PDQN-VNFSC algorithm proposed in this paper can obtain the maximum frequency slots occupied in the network, which is 5.1%–6.4% smaller than the two comparison algorithms. It can be seen from Figures 1 and 5; for the same network topology and the number of service chains with the same virtual network function, when the number of linked data centers in the network increases, the maximum frequency slots occupied in the network decreases. When the number of data centers is relatively small, these nodes in the network will become the key nodes, and more virtual network function service chains will pass through this node, which will also lead to more virtual network function service chains passing through the links connected with this node. Therefore, the maximum frequency slots occupied in the network will be larger. On the contrary, when the number of data centers is small, the virtual network function service chain will occupy different links more evenly, which will reduce the maximum frequency slots occupied in the network.Whenβ=1, the objective of optimization is to minimize the number of frequency slots occupied in the network. As can be seen from Figures 2 and 6, with the increase in the number of virtual network function service chains, the number of frequency slots occupied in the network gradually increases. It can also be seen from the experimental results that the algorithm designed in this paper can get a smaller number of frequency slots occupied in the network than the two contrast algorithms. When the number of functional service chains in the virtual network is 100, the PDQN-VNFSC algorithm proposed in this paper can obtain the number of occupied frequency slots in the network which is 1.3%–2.4% smaller than the two comparison algorithms. When the number of functional service chains in the virtual network is 800, the PDQN-VNFSC algorithm proposed in this paper can obtain the number of occupied frequency slots in the network which is 4.2%–5.6% smaller than the two comparison algorithms.Whenγ=1, the goal of optimization is to minimize the number of virtual network functions configured on the data center in the network. As can be seen from Figures 3 and 7, as the number of virtual network function service chains increases, the number of virtual network functions configured on the data center in the network also gradually increases. The experimental results also show that the algorithm designed in this paper can get fewer virtual network functions configured on the data center in the network than the two contrast algorithms. When the number of virtual network function service chains is 100, the PDQN-VNFSC algorithm proposed in this paper can obtain that the number of virtual network functions configured on the data center in the network is 1.0%–1.9% smaller than the two comparison algorithms. When the number of virtual network function service chains is 800, the PDQN-VNFSC algorithm proposed in this paper can get that the number of virtual network functions configured on the data center in the network is 3.4%–4.6% less than the two comparison algorithms.Whenα=β=γ=1/3, the goal of optimization is to minimize the maximum frequency slots number occupying frequency slots in the network, the number occupying frequency slots in the network, and the number of virtual network functions configured on the data center in the network, and the three have the same weight. As can be seen from Figures 4 and 8, the three target values after weighted summation gradually increase with the increase of the number of virtual network function service chains. It can also be seen from the experimental results that the algorithm designed in this paper can obtain the three target values after the weighted sum less than the two contrast algorithms. When the number of virtual network functional service chains is 100, the PDQN-VNFSC algorithm proposed in this paper can get the three target values after the weighted sum, which are 1.7%–4.2% smaller than the two comparison algorithms. When the number of virtual network functional service chains is 800, the PDQN-VNFSC algorithm proposed in this paper can get the three target values after the weighted sum, which is 3.4%–4.8% smaller than the two comparison algorithms.


## 4.1. Simulation parameters

In order to verify the effectiveness of the algorithm, simulation experiments are carried out in two widely used network topologies: the National Natural Science Foundation Network (NSFNet) with 14 nodes and 21 links and the US Backbone network with 27 nodes and 44 links. The number of frequency gaps on each link of the network is 1000, i.e., eight groups of different quantities (100, 200, …, 800). The initial occupancy frequency gap number of each group of virtual network function service chain requests is generated randomly in the interval [1, 10], and the change ratio of occupancy frequency gap number is generated randomly in the interval [0.5, 2]. It is assumed that there are altogether 10 virtual network functions, that is, the number of virtual network functions required by each virtual network function chain is generated within the interval [1, 10] and randomly divided into two kinds of virtual network functions that are dependent and independent of each other.


## 4.2. Experimental Results

In order to verify the effectiveness of the algorithm, this paper compares the two algorithms, respectively. The first algorithm (represented by LBA) proposed in [16] is compared. The second algorithm is a combination of LBA algorithm and the least-priority strategy proposed in [19] (represented by LF-LBA). Figure 1 shows the experimental results of NSFNET network and US Backbone network when NDC=0.5NVandα=1, respectively. Figure 2 shows the experimental results of NSFNET network and US Backbone network when NDC=0.5NVandβ=1, respectively. Figure 3 shows the experimental results of NSFNET network and US Backbone network when NDC=0.5NVandγ=1, respectively. Figure 4 shows the experimental results of NSFNET network and US backbone network when NDC=0.5NVandα=β=β=1/3, respectively. Similarly, experimental results of NSFNET network and US Backbone network when NDC=3/4NVandα=1 are shown in Figure 5. Experimental results of NSFNET network and US backbone network when NDC=3/4NVandβ=1 are shown in Figure 6. Experimental results of NSFNET network and US backbone network when NDC=3/4NVandγ=1 are shown in Figure 7. Experimental results of NSFNET network and US backbone network when NDC=3/4NVandα=β=γ=1/3 are shown in Figure 8.Figure 1
Experimental results whenNDC=1/2NV and α=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 2
Experimental results whenNDC=1/2NV and β=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 3
Experimental results whenNDC=1/2NV and γ=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 4
Experimental results whenNDC=1/2NV and α=β=γ (a) NSFNET (b) US Backbone.
(a)(b)Figure 5
Experimental results whenNDC=1/2NV and α=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 6
Experimental results whenNDC=1/2NV and β=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 7
Experimental results whenNDC=1/2NV and γ=1: (a) NSFNET and (b) US backbone.
(a)(b)Figure 8
Experimental results whenNDC=1/2NV and α=β=γ: (a) NSFNET and (b) US backbone.
(a)(b)


## 4.3. Experimental Analysis

Whenα=1, the goal of optimization is to minimize the maximum frequency slots number occupying the frequency slots in the network. As can be seen from Figures 1 and 5, with the increase in the number of virtual network function service chains, the maximum frequency slots occupied in the network also increases gradually. Because the LBA algorithm does not consider the dependencies between virtual network functions and uses a fixed order to configure virtual network functions, it cannot well solve the configuration problem of virtual network functions that consider the dependencies between virtual network service functions. The LF-LBA algorithm also fails to consider the dependencies among virtual network functions. Although the virtual network functions occupying a small frequency slots are given priority in configuration, the optimal scheme still cannot be obtained when the dependencies among virtual network functions are considered. However, the PDQN-VNFSC algorithm proposed in this paper takes into account the dependence between different virtual network functions and can search for the optimal configuration scheme through multiple iterations, so the PDQN-VNFSC proposed in this paper can obtain better results than LBA and LF-LBA. It can also be seen from the experimental results that the algorithm designed in this paper can get the maximum frequency slots occupied in the network which is smaller than the two contrast algorithms.When the number of virtual network functional service chains is 100, the PDQN-VNFSC algorithm proposed in this paper can get the maximum frequency slots occupied in the network 1.1%–2.3% smaller than the two contrast algorithms. When the number of virtual network functional service chains is 800, the PDQN-VNFSC algorithm proposed in this paper can obtain the maximum frequency slots occupied in the network, which is 5.1%–6.4% smaller than the two comparison algorithms. It can be seen from Figures 1 and 5; for the same network topology and the number of service chains with the same virtual network function, when the number of linked data centers in the network increases, the maximum frequency slots occupied in the network decreases. When the number of data centers is relatively small, these nodes in the network will become the key nodes, and more virtual network function service chains will pass through this node, which will also lead to more virtual network function service chains passing through the links connected with this node. Therefore, the maximum frequency slots occupied in the network will be larger. On the contrary, when the number of data centers is small, the virtual network function service chain will occupy different links more evenly, which will reduce the maximum frequency slots occupied in the network.Whenβ=1, the objective of optimization is to minimize the number of frequency slots occupied in the network. As can be seen from Figures 2 and 6, with the increase in the number of virtual network function service chains, the number of frequency slots occupied in the network gradually increases. It can also be seen from the experimental results that the algorithm designed in this paper can get a smaller number of frequency slots occupied in the network than the two contrast algorithms. When the number of functional service chains in the virtual network is 100, the PDQN-VNFSC algorithm proposed in this paper can obtain the number of occupied frequency slots in the network which is 1.3%–2.4% smaller than the two comparison algorithms. When the number of functional service chains in the virtual network is 800, the PDQN-VNFSC algorithm proposed in this paper can obtain the number of occupied frequency slots in the network which is 4.2%–5.6% smaller than the two comparison algorithms.Whenγ=1, the goal of optimization is to minimize the number of virtual network functions configured on the data center in the network. As can be seen from Figures 3 and 7, as the number of virtual network function service chains increases, the number of virtual network functions configured on the data center in the network also gradually increases. The experimental results also show that the algorithm designed in this paper can get fewer virtual network functions configured on the data center in the network than the two contrast algorithms. When the number of virtual network function service chains is 100, the PDQN-VNFSC algorithm proposed in this paper can obtain that the number of virtual network functions configured on the data center in the network is 1.0%–1.9% smaller than the two comparison algorithms. When the number of virtual network function service chains is 800, the PDQN-VNFSC algorithm proposed in this paper can get that the number of virtual network functions configured on the data center in the network is 3.4%–4.6% less than the two comparison algorithms.Whenα=β=γ=1/3, the goal of optimization is to minimize the maximum frequency slots number occupying frequency slots in the network, the number occupying frequency slots in the network, and the number of virtual network functions configured on the data center in the network, and the three have the same weight. As can be seen from Figures 4 and 8, the three target values after weighted summation gradually increase with the increase of the number of virtual network function service chains. It can also be seen from the experimental results that the algorithm designed in this paper can obtain the three target values after the weighted sum less than the two contrast algorithms. When the number of virtual network functional service chains is 100, the PDQN-VNFSC algorithm proposed in this paper can get the three target values after the weighted sum, which are 1.7%–4.2% smaller than the two comparison algorithms. When the number of virtual network functional service chains is 800, the PDQN-VNFSC algorithm proposed in this paper can get the three target values after the weighted sum, which is 3.4%–4.8% smaller than the two comparison algorithms.


## 5. Conclusion

In order to solve the routing problem of virtual network function service chain and the configuration problem of virtual network function in elastic optical network, a global constraint optimization model is established, which aims at minimizing the maximum frequency slots occupied in the network, the number of frequency slots occupied in the network, and the number of virtual network functions configured.The model divides the virtual network function into two types: the virtual network function with dependence and the virtual network function without interdependence. In order to solve the model efficiently, the weighted summation method was used to transform the three-objective optimization problem into a single-objective constrained optimization problem, and a deep reinforcement learning-based algorithm was designed. However, this paper uses the weighted method to transform the three-objective optimization problem into a single-objective constrained optimization problem. In the following research, the multiobjective optimization method will be used to solve the established model, so as to provide more decision schemes for decision makers.



---

*Source: 7398206-2021-10-06.xml*