How to map Virtual Network Functions on Servers if the server contains enough resources.
AnsweredI have to model a system that contains two virtual network functions (VNFs: VNF1, VNF2) having some storage, computation, memory, and bandwidth demand. (Graph image enclosed.)
I want to map them to servers (S1, S2) if the servers have enough resource capacity(storage, computation, memory, and bandwidth).
I have a binary variable 'fivnf', which will be 1 if the VNFs can be mapped to the servers else 0. I am confused about how to write this?
I have tried to model the system as follows (binary variable is script bold).
model = ConcreteModel()
# VNFGraph
model.Nf = {'VNF1', 'VNF2'}
model.Lf = {('VNF1', 'VNF2')}
# SERVERGraph
model.Ns = {'S1', 'S2'}
model.Ls = {('S1', 'S2')}
model.ns = set()
model.ls = set()
model.nf = set()
model.lf = set()
#Binary Variable to check the possible mapping.
model.fivnf = Var(domain=Binary, bounds=(0, 1))
# D=Requested resource, a=available resource, C=total capacity
model.Dcpu = Param(model.nf, initialize=1)
model.acpu = Var(model.ns, within=NonNegativeReals)
model.Ccpu = Param(model.ns, initialize=3)
# D=Requested resource, a=available resource, C=total capacity
model.Dmem = Param(model.nf, initialize=12)
model.amem = Var(model.ns, within=NonNegativeReals)
model.Cmem = Param(model.ns, initialize=20)
# D=Requested resource, a=available resource, C=total capacity
model.Dsto = Param(model.nf, initialize={10})
model.asto = Var(model.ns, within=NonNegativeReals)
model.Csto = Param(model.ns, initialize=15)
# D=Requested resource, a=available resource, C=total capacity
model.Dbw = Param(model.lf, initialize=200)
model.abw = Var(model.ls, within=NonNegativeReals)
model.Cbw = Param(model.ls, initialize=200)
# Constraints
# ResourceConstraint
# Constraint1
model.c1 = Constraint(
sum((model.fivnf[ub, u] for ub in model.nf for u in model.ns) * (model.Dcpu[ub] for ub in model.nf)) <= (
model.acpu[u] for u in model.ns) * (model.Ccpu[u] for u in model.ns))
# Constraint2
model.c2 = Constraint(
sum((model.fivnf[ub, u] for ub in model.nf for u in model.ns) * (model.Dmem[ub] for ub in model.nf)) <= (
model.amem[u] for u in model.ns) * (model.Cmem[u] for u in model.ns))
# Constraint3
model.c3 = Constraint(
sum((model.fivnf[ub, u] for ub in model.nf for u in model.ns) * (model.Dsto[ub] for ub in model.nf)) <= (
model.asto[u] for u in model.ns) * (model.Csto[u] for u in model.ns))
# Constraint4
model.c4 = Constraint(
sum((model.fivnf[uvb, uv] for uvb in model.lf for uv in model.ls) * (model.Dbw[uvb] for uvb in model.lf)) <= (
model.abw[uv] for uv in model.ls) * (model.Cbw[uv] for uv in model.ls))
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Muhammad,
I want to map them to servers (S1, S2) if the servers have enough resource capacity(storage, computation, memory, and bandwidth).
I think this is similar to the question you asked in the other post. You can use exactly the same decision variables. Let us define \(C^s_i\) as the capacity limit of resource \(s\) on server \(i\). To enforce the capacity limit on each server, your constraint would be similar to what it was explained before:
\[\sum_j \sum_{t^{\prime} \in T_{ijt}} c^s_{ij} x_{ijt^{\prime}} \leq C^s_i, ~~ \forall s, t, i\]
I would recommend looking at the literature and first writing the mathematical formulation of your entire problem by defining the decision variables, objective function, and constraints. It would then be much easier to translate your mathematical formulation to code.
Best regards,
Maliheh
0
Post is closed for comments.
Comments
2 comments