1、说明
本文描述VNFFGD模板的结构以及基于"V1.0 CSD 03"要求的各个组成部分的字段。V1.0 CSD 03:http://docs.oasis-open.org/tosca/tosca-nfv/v1.0/tosca-nfv-v1.0.html
每一个VNFFGD的yaml文件模板都有以下部分:
tosca_definitions_version:
This defines the TOSCA definition version on which the template is based.
The current version being tosca_simple_profile_for_nfv_1_0_0.
tosca_default_namespace:
This is optional. It mentions default namespace which includes schema,
types version etc.
description:
A short description about the template.
metadata:
template_name: A name to be given to the template.
topology_template:
Describes the topology of the VNFFG under node_template field.
node_template:
Describes node types of a VNFFG.
FP:
Describes properties and path of a Forwarding Path.
groups:
Describes groupings of nodes that have an implied relationship.
VNFFG:
Describes properties and members of a VNF Forwarding Graph.
2、Forwarding Path
VNFFGD定义了一条链路中所有VNFs的流量转发图。type: tosca.nodes.nfv.FP.Tacker
properties: 定义FP的属性,包括 id(path id必须唯一),策略以及流量在每个端口的定义。
2.1 指定FP属性
一个FP模板如下,当前只支持一条FP:node_templates:
Forwarding_path1:
type: tosca.nodes.nfv.FP.Tacker
description: creates path (CP11->CP12->CP32)
properties:
id: 51
policy:
type: ACL
criteria:
- network_src_port_id: 640dfd77-c92b-45a3-b8fc-22712de480e1
- destination_port_range: 80-1024
- ip_proto: 6
- ip_dst_prefix: 192.168.1.2/24
path:
- forwarder: VNF1
capability: CP1
- forwarder: VNF2
capability: CP2
id:用于唯一标识一条路径。
这个ID后期将会用于通过设置SPI(Service Path Identifier)的属性
NSH(Network Service Header)来实现唯一路径的确定。
policy: 定义流量的匹配规则
当前只支持ACL(access control list)。
path:定义数据的流向
当VNFD设置了多个CP的时候,第一个默认为入口,第二个默认为出口。
当只有一个CP的时候,第一个网卡既为入口又为出口。
3、Group
用于定义VNFFG,并且只能定义一个。4、VNFFG
VNFFG中定义着转发图中的资源。type: tosca.groups.nfv.VNFFG
properties: 定义VNFFG的属性,包括vendor, version, dependent_virtual_link, connection_points, constituent_vnfs.
members: 定义当前VNFFG的FP. 当前只支持一个.
例子如下:
groups:
VNFFG1:
type: tosca.groups.nfv.VNFFG
description: HTTP to Corporate Net
properties:
vendor: tacker
version: 1.0
number_of_endpoints: 2
dependent_virtual_link: [VL1,VL2,VL3]
connection_point: [CP1,CP2]
constituent_vnfs: [VNF1,VNF2]
members: [Forwarding_path1]
number_of_endpoints:CP的个数
dependent_virtual_link:VNFFG用到的VL列表
connection_point:VNFFG用到的CP列表
constituent_vnfs:VNFFG用到的VNFD列表
5、小结
一个全量的VNFFGD定义如下:tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: Sample VNFFG template
topology_template:
description: Sample VNFFG template
node_templates:
Forwarding_path1:
type: tosca.nodes.nfv.FP.Tacker
description: creates path (CP12->CP22)
properties:
id: 51
policy:
type: ACL
criteria:
- network_src_port_id: 640dfd77-c92b-45a3-b8fc-22712de480e1
- destination_port_range: 80-1024
- ip_proto: 6
- ip_dst_prefix: 192.168.1.2/24
path:
- forwarder: VNFD1
capability: CP12
- forwarder: VNFD2
capability: CP22
groups:
VNFFG1:
type: tosca.groups.nfv.VNFFG
description: HTTP to Corporate Net
properties:
vendor: tacker
version: 1.0
number_of_endpoints: 2
dependent_virtual_link: [VL12,VL22]
connection_point: [CP12,CP22]
constituent_vnfs: [VNFD1,VNFD2]
members: [Forwarding_path1]