Skip to content

interface

Stefan Schneider edited this page Mar 15, 2018 · 2 revisions

Interface definition

placement = algorithm.place(network, service, sources, further_args)

Where algorithm is a placement algorithm compatible to this interface. In- and outputs are explained below.

Inputs

Network

The network needs to be a NetworkX network, e.g., read from a graphml file, with nodes and links. The links need to be annotated with delay in ms. Further annotations like node or link resource capacities are allowed.

Service

The service needs to be defined in yaml format and has to include at least the following fields. Further fields are allowed and may be necessary for the placement algorithms to work. VNF names must be unique.

name: service-name
vnfs:
  - name: vnf1
    image: vnf1-image
  - name: vnf2
    image: vnf2-image
vlinks:
  - src: vnf1
    dest: vnf2

Here is a full example of fw1chain.yaml:

name: fw1chain

# list of all involved VNFs (with at least a name and an image)
vnfs:
  - name: vnf_user
    type: source
    stateful: True
    inputs_fwd: 0
    inputs_bwd: 0
    outputs_fwd: 1
    outputs_bwd: 0
    cpu: [0]
    mem: [0]
    out_fwd: []
    out_bwd: []
    image: '{"image":"placement-user-img", "network":"(id=output,ip=10.0.0.1/24)"}'
  - name: vnf_fw1
    type: normal
    stateful: False
    inputs_fwd: 1
    inputs_bwd: 0
    outputs_fwd: 1
    outputs_bwd: 0
    cpu: [1,0]
    mem: [1,0]
    out_fwd:
      - [1,0]
    out_bwd: []
    image: '{"image":"placement-fw1-img", "network":"(id=input,ip=88.0.0.2/24),(id=output,ip=99.0.0.1/24)"}'
  - name: vnf_web
    type: normal
    stateful: False
    inputs_fwd: 1
    inputs_bwd: 0
    outputs_fwd: 0
    outputs_bwd: 0
    cpu: [1,0]
    mem: [1,0]
    out_fwd: []
    out_bwd: []
    image: '{"image":"placement-apache-img", "network":"(id=input,ip=99.0.0.2/24)"}'

# list of vLinks interconnecting the VNFs (with at least src and dest)
vlinks:
  - direction: forward
    src: vnf_user
    src_output: 0
    dest: vnf_fw1
    dest_input: 0
    max_delay: 50
  - direction: forward
    src: vnf_fw1
    src_output: 0
    dest: vnf_web
    dest_input: 0
    max_delay: 50

Sources

Sources (e.g., users or sensors) start at different locations in the network and each belong to a source component of the service. Minimal example in YAML format:

- node: pop1
  vnf: vnf_user
- node: pop7
  vnf: vnf_user

Again, additional fields can be included, e.g., to add information about individual flows per source.

Further arguments

Optionally, further arguments can be specified in addition to the three aforementioned ones. For example, some placement algorithms may require fixed endpoints of their services. Such information, specified as further arguments, is passed directly to the placement algorithm as input.

Example:

placement = algorithm.place(network, service, sources, endpoints="endpoints.yaml", legacy_vnfs="legacy.yaml")

Here, the optional arguments endpoints and legacy_vnfs are passed on directly to the placement algorithm.

Output: Placement

The output of each compatible placement algorithm is stored in a structured YAML file and returned to the placement emulation for further processing. The placement emulation module then starts the calculated placement on the vim-emu emulator. Resulting placement files must have the following structure (optionally, with additional fields):

placement:
  vnfs:
    - name: vnf1
      node: pop0
      image: vnf1-image
    - name: vnf2
      node: pop3
      image: vnf2-image
  vlinks:
    - src: vnf1
      dest: vnf2

VNF names must be unique. image contains information for the emulation platform about which VNF image to start.

Here is a full example:

input:
  model: bjointsp-heuristic
  network: Abilene.graphml
  objective: 0
  seed: 9782
  service: fw1chain.yaml
  sources: source0.yaml
metrics:
  changed:
  - name: vnf_fw1
    node: pop0
  - name: vnf_user
    node: pop0
  - name: vnf_web
    node: pop0
  delays:
  - delay: 0
    dest: vnf_fw1
    dest_node: pop0
    src: vnf_user
    src_node: pop0
  - delay: 0
    dest: vnf_web
    dest_node: pop0
    src: vnf_fw1
    src_node: pop0
  max_cpu_oversub: 0
  max_dr_oversub: 0
  max_mem_oversub: 0
  obj_value: 3004000
  runtime: 0.19302845001220703
placement:
  alloc_node_res:
  - cpu: 1
    mem: 1
    name: vnf_fw1
    node: pop0
  - cpu: 0
    mem: 0
    name: vnf_user
    node: pop0
  - cpu: 1
    mem: 1
    name: vnf_web
    node: pop0
  cpu_oversub: []
  dr_oversub: []
  flows:
  - arc: vnf_user.0->vnf_fw1.0
    dst_node: pop0
    flow_id: f1
    src_node: pop0
  - arc: vnf_fw1.0->vnf_web.0
    dst_node: pop0
    flow_id: f1
    src_node: pop0
  links: []
  mem_oversub: []
  vlinks:
  - dest_node: pop0
    dest_vnf: vnf_fw1
    src_node: pop0
    src_vnf: vnf_user
  - dest_node: pop0
    dest_vnf: vnf_web
    src_node: pop0
    src_vnf: vnf_fw1
  vnfs:
  - image: '{"image":"placement-fw1-img", "network":"(id=input,ip=88.0.0.2/24),(id=output,ip=99.0.0.1/24)"}'
    name: vnf_fw1
    node: pop0
  - image: '{"image":"placement-user-img", "network":"(id=output,ip=10.0.0.1/24)"}'
    name: vnf_user
    node: pop0
  - image: '{"image":"placement-apache-img", "network":"(id=input,ip=99.0.0.2/24)"}'
    name: vnf_web
    node: pop0
time: '2018-03-15 12:46:46'
Clone this wiki locally