Service Chain Optimization in SDNs
Service Chain Optimization in SDNs
1 Introduction
Computer communication networks are in constant need of expansion to cope
with the ever growing traffic. As networks grow, management and maintenance
become more and more complicated. Current developments that aim to improve
the utilization of network resources include the detachment of network applica-
tions from network infrastructure and the transition from network planning to
network programming.
Research supported in part by Network Programming (Neptune) Consortium, Israel.
D. Rawitz—Partially supported by the Israel Science Foundation (grant no. 497/14).
c Springer International Publishing AG, part of Springer Nature 2018
D. Alistarh et al. (Eds.): ALGOCLOUD 2017, LNCS 10739, pp. 27–40, 2018.
[Link]
28 G. Kutiel and D. Rawitz
capacity that bounds the number of requests it may service. They presented
an O(log )-competitive algorithm for the problem of maximizing the number of
serviced chains, assuming that capacities are Ω(log ). It is also shown that this
ratio is asymptotically optimal even for randomized online algorithms. APX-
hardness results for the offline version of the problem were also presented. Rost
and Schmid [13] considered variant of this problem, where each node can host a
subset of the VNFs. In addition, each VNF has a demand and each VNF-node
pair has a capacity, and in a feasible solution the total demand for each pair
is bounded by the capacity. They considered two goals: maximum profit and
minimum resource cost and gave bicriteria approximation algorithms which are
based on LP-rounding for several special cases.
Even et al. [5] studied online path computation and VNF placement. They
considered compound requests that arrive in an online manner. Each request is a
flow with a specification of routing and VNF requirements which is represented
by a directed acyclic graph (DAG) whose vertices are VNFs. Each VNF can
be performed by a specified subset of servers in the system. Upon arrival of a
request, the algorithm either rejects the request or accepts it with a specific rout-
ing and VNF assignment, under given server capacity constraints. Each request
has a benefit that is gained if it is accepted, and the goal is to maximize the
total benefit gained by accepted requests. Even et al. [5] proposed an algorithm
that copes with requests with unknown duration without preemption by using
a third response, which is refer to as “stand by”, whose competitive ratio is
O(log(knbmax )), where n is the number of nodes, bmax is an upper bound on a
request benefit per time unit, and k is the maximum number of VNFs of any ser-
vice chain. This performance guarantee holds for the case where the processing
of any request in any possible service chain is never more than O(1/(k log(nk)))
fraction of the capacity of any network component. Even et al. [6] presented
a randomized approximation algorithm for the same problem that computes
(1 − ε)-approximate placements if the demand of any processing request in any
possible service chain is never more than an O(ε2 / log n) fraction of the capacity
of any network component.
path, and it is feasible if each server can handle the VNFs that are assigned to
it, and if each link on the path can carry the flow that is assigned to it. Moreover
each link causes a delay, and the service chain placement should also comply with
a global bound on the total latency. Each pair of server and VNF is associated
with a cost for placing the network function in the server. This cost measures
compatibility of a VNF to a server (e.g., infinite costs means “incompatible”).
Given a request, the goal is to find a feasible service chain of minimum total cost
or to identify that a valid service chain does not exist.
We show that even feasibility is NP-hard in general networks using a reduc-
tion from Hamiltonian Path. We show that the problem is still NP-hard if the
network is a DAG even for a very simple network, and even if the specification
consists of a single option. Both reductions are from Partition.
On the positive side, we present an FPTAS for the case where the network is
a DAG which is based on a non-trivial dynamic programming algorithm. Based
on our FPTAS, we provide a randomized algorithm for general networks in which
there is an optimal placement whose physical path consists of at most k vertices
whose degree is larger than 2. For example, this can be assumed if all simple
paths from s to t contain at most k such vertices. The algorithm computes a
(1 + ε)-approximate placement with high probability using k! log n invocations
of the FPTAS. We also present a (deterministic) parameterized algorithm that
computes a (1 + ε)-approximate placement in time O(k! · poly(n)), where k is
the number of vertices in the network whose degree is larger than 2.
2 Preliminaries
Model. An instance of the Service Chain Placement (SCP) problem is com-
posed of three components, a physical network, a virtual specification, and place-
ment costs:
Physical network: The physical network is a graph G = (V, E). Each node
v ∈ V has a non-negative processing capacity p(v), and each directed edge
e ∈ E has a non-negative bandwidth capacity b(e). Without loss of generality,
we assume that p(s) = p(t) = 0.
Virtual specification: The description of a request for a service chain consists
of a physical source s ∈ V , a physical destination t ∈ V , and a directed
acyclic graph (DAG) G = (V, E). The DAG G has a source node σ ∈ V and a
destination τ ∈ V. Each node α ∈ V represent a VNF that has a processing
demand p(α). Without loss of generality, we assume that p(σ) = p(τ ) = 0.
Each edge ε ∈ E has a bandwidth demand b(ε).
Placement costs: There is a non-negative cost c(α, v) for placing the VNF α
in v. We assume that c(σ, s) = 0 and c(σ, v) = ∞, for every v = s. Similarly,
we assume that c(τ, t) = 0 and c(τ, v) = ∞, for every v = t.
A solution consists of the following:
Virtual path: A path from σ to τ in G, namely a sequence of vertices α0 , . . . , αq ,
where α0 = σ, αq = τ , and (αj , αj+1 ) ∈ E, for every j ∈ {0, . . . , q − 1}.
Service Chain Placement in SDNs 31
2 σ s
4
2 8
4
2
6 2
7
5
1 6 3
4
7 3 3
2
3
τ 1 3 8
6
2
2 8 19
6
5 2
2
2 1
3
8
5
7 4
2 4
8
6
4
4
t
In SCP the goal is to find a feasible placement of a virtual path into the physical
DAG that minimizes the cost.
32 G. Kutiel and D. Rawitz
3 Hardness Results
In this section we present three hardness results. First, we show that even the fea-
sibility question of SCP is NP-hard, and therefore no approximation algorithm
exists for SCP. In addition, we show that SCP is NP-hard even if |V \ {s, t}| = 1.
We also show that SCP is NP-hard even if both the physical network and the
virtual DAG are simple paths.
We start by showing that even finding a feasible solution is NP-hard.
Next, we show that SCP is NP-hard even if the physical network is very
simple.
Also,
E= {{αi , βi } × {αi+1 , βi+1 }} ∪ {(σ, α1 ), (σ, β1 ), (αn , t), (βn , t)} .
i
The DAG is shown in Fig. 2. The demands are p(αi ) = ai and p(βi ) = 0, for
every i. Also, b(ε) = 0, for every ε ∈ E. The costs are: c(αi , v) = 0 and c(βi , v) =
ai , for every i.
The SCP instance can be computed in polynomial time. Also, it is not hard
to verify that {a 1 , . . . , an } ∈ Partition if and only if there exists a solution
whose cost is 12 i ai .
α1 α2 ... αn
σ τ
β1 β2 ... βn
Next, we show that SCP is NP-hard even if both the physical network and
the VNF specification are paths.
Theorem 3. SCP is NP-hard, even if both the physical network and the virtual
DAG are paths.
Proof. We prove the theorem using a reduction from Partition. Given a Par-
tition instance {a1 , . . . , an }, we construct a virtual path σ, α1 , . . . , αn , τ and a
physical path s, v1− , v1+ , . . . , vn− , vn+ , t. We set p(v) = 1, for every node v = s, t,
and p(αi ) = 1, for every i. In addition, we set b(e) = 1, for every edge e ∈ E,
and b(ε) = 1, for every edge ε ∈ E. As for the costs, we define c(αi , vi− ) = 0,
c(αi , vi+ ) = ai , and for any v ∈ / {vi− , vi+ } we set c(αi , v) = ∞. We also define
− +
((αi , αi+1 ), (vi , vi )) = ai , and set (ε, e) = 0, otherwise. Finally, we set
n
L = 12 i ai . Figure 3 depicts the above reduction. One can verify that ai is
either counted in the latency of in the cost. Hence, n {a1 , . . . , an } ∈ Partition if
and only if there is a placement with cost 12 i ai .
34 G. Kutiel and D. Rawitz
σ α1 α2 ··· αn τ
0
v1− v2− ··· vn− t
an
a1
a2
0
a1
an
a2
0
0
0
0
0
s v1+ v2+ ··· vn+
Assume that we want to place a minimum cost virtual path from a VNF α to a
VNF β within a physical node v. A sequence of VNFs α = α0 , α2 , . . . , αq = β is
a candidate path if (αi , αi+1 ) ∈ E, for every i, and i p(αi ) ≤ p(v). We would
like to find such a path with minimum cost, and we denote the cost of such a
path by costv (α β).
We use dynamic programming in order to compute such a path. Let
prcv (α β, c) be the minimum amount of processing required to place a vir-
tual path form α to β into v among paths whose cost is at most c. The value of
prcv (α β, c) can be computed recursively as follow:
⎧
⎪
⎪ ∞ c(α, v) > c,
⎪
⎪
⎨ c(α, v) ≤ c,
prcv (α β, c) = p(α) β = α,
⎪
⎪
⎪
⎪
⎩ min {prcv (α γ, c − c(β, v)) + p(β)} otherwise.
(γ,β)∈E
Observe that if c(α, v) > c, then a placement is not possible with a budget c.
Otherwise, if α = β, then the best path is the one containing only α. If α = β,
Service Chain Placement in SDNs 35
then an optimal path ends with an edge (γ, β) ∈ E, which means that the
processing placed at v consists of p(β) plus the minimum amount of processing
of a path from α to γ, whose cost is at most c − c(β, v).
To complete our argument observe that the following holds:
The desired value is cost(τ, t). Consider an optimal placement of a virtual path
ending at α within a path ending at v. Let γ be the first VNF along the virtual
path that is not placed in v. Also, let u be the node in which γ is placed. Hence,
the optimal placement is composed of three segments: an optimal placement of
a virtual path that ends in γ in a physical path ending at u, a virtual edge (γ, β)
is placed in the path from u to v, and a minimum cost placement of a virtual
path from β to α in v, that does not violate the capacity of v. Thus, we check all
pairs (γ, u), where γ ≺ α and u ≺ v, and for each pair we consider any neighbor
36 G. Kutiel and D. Rawitz
Virtual Graph
b(αβ)
σ α β γ
s v w
Physical Graph
(γ, β) ∈ E and β ≺ α such that (u, v) ⇒ (γ, β). The recursive computation is
illustrated in Fig. 4.
As for the running time, observe that checking whether (u, v) ⇒ (γ, β) can be
done using DFS in linear time. Since the number of state is polynomial, and each
state can be computed in polynomial time, the total running time is polynomial.
Finally, we note that the above algorithm computes the minimum amount of
cost, but may also be used to compute the actual placement that achieves this
value using standard techniques.
We now consider the SCP problem with latency. Recall that in this variant of
the problem we are also given a latency function : E × E → R+ , and a latency
upper bound L. The goal is to find a minimum cost placement that also respect
the latency constraint.
Let lat(α, v, c) be the minimum latency created by a placement of a virtual
path from σ to α in a path from s to v whose cost is at most c. Also, let
lat(γ, β, w v) be the minimum possible latency of path from w to v such
that the bandwidth of all edges in the path is at least b(γ, β). That is,
lat(γ, β, w v) = min ((γ, β), e) .
f :b(γ,β)≤mine∈f¯(γ,β) b(e)
e∈f¯(γ,β)
c(α,v) n
· c(α, v) ≤ cmax ,
c (α, v) =
cmax ε
∞ c(α, v) > cmax .
Proof. Given ε > 0, run the dynamic programming algorithm from Sect. 4.3 |V| ·
|V | times, once for each possible value of cmax , and choose the best placement.
According to Lemma 1 the best placement is (1 + ε)-approximate. The running
time is polynomial in the input size and in 1/ε.
5 General Networks
In this section we consider SCP when the physical network is an undirected
graph. Recall that even the feasibility version of SCP is NP-hard in general
networks, and therefore we focus on a special case. A vertex v ∈ V is called
neighborly if it has more than two neighbors. First, we assume that there exists
an optimal placement whose physical path consists of at most k neighborly
vertices. For example, this can be assumed if all simple paths from s to t contain
at most k neighborly vertices. In this case we present a randomized algorithm
that computes an (1 + ε)-approximate placement with high probability whose
running time is O(k! · poly(n)). Our second algorithm works under the stronger
assumption that there are k neighborly vertices in the network. In this case, we
present a deterministic algorithm whose running time is O(k! · poly(n)).
Our randomized algorithm consists of k! iterations of the following two
phases: an orientation phase that applies a random orientation to the physi-
cal network, and an execution of the FPTAS for DAGs given in Theorem 4. The
algorithm finds a (1 − ε)-approximate placement with probability (1 − 1/e), and
the running time of the algorithm is O((n + t(n))k!), where t(n) is the time it
takes to compute a placement when the physical network is a DAG. As usual,
one may amplify the probability of success using repetition.
The orientation phase is done as follows: let N be the set of neighborly
vertices, and let π : N → {1, . . . , |N |} be a random permutation. We direct the
edges according to π. Observe that each edge e ∈ E is found on a simple path
between two neighborly nodes ve and ve , in which all internal vertices are in
V \ N . The edge e is directed towards ve , if π(ve ) > π(ve ), and otherwise it is
directed towards ve . Observe that when this process terminates we get a DAG,
denoted by Gπ , where there is a topological order than is consistent which π.
Figure 5 depicts the orientation stage. A naı̈ve implementation of this phase
would run in O(|V ||E|) time.
Upon completing the orientation, we use our previous algorithm to find a
placement. We repeat this process k! times, each time with a new independent
random permutation, and keep the best embedding so far.
1 1
2 3 2 3
6 6
5 5
4 4
Fig. 5. Orientation phase: on the left is the physical network, where only the heavy
nodes are drawn. The numbers represent the permutation and the dashed path repre-
sents a path of an optimal placement. The orientated physical network is on the right.
It is enough that the internal ordering of the nodes on the dashed path is “correct” to
ensure that the survival of the optimal placement.
References
1. Brown, G.: Service Chaining in Carrier Networks. Heavy Reading (2015)
2. Cohen, R., Lewin-Eytan, L., Naor, J., Raz, D.: Near optimal placement of virtual
network functions. In: 34th IEEE Conference on Computer Communications, pp.
1346–1354 (2015)
40 G. Kutiel and D. Rawitz