Commit c3a287a7 authored by vicens's avatar vicens
Browse files

Updating slicing section on 05-osm-usage

parent d8869d92
Loading
Loading
Loading
Loading
+294 −1
Original line number Diff line number Diff line
@@ -855,7 +855,300 @@ Any of the VMs can be accessed through SSH to further monitor (with `htop`, for

## Using Network Slices

TODO: Page in elaboration. Meanwhile, you can find a good explanation and examples [in this presentation](http://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/presentations/8th%20OSM%20Hackfest%20-%20Session%206%20-%205G%20Network%20Slicing%20with%20OSM.pdf)
### Resources

For the session, we need a set of resources (VNFs, NSs, NSTs) that are available in the following [link](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/)

- [slice_hackfest_vnfd.tar.gz](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/slice_hackfest_vnfd.tar.gz)
- [slice_hackfest_middle_vnfd.tar.gz](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/slice_hackfest_middle_vnfd.tar.gz)

**NS:**

- [slice_hackfest_nsd.tar.gz](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/slice_hackfest_nsd.tar.gz)
- [slice_hackfest_middle_nsd.tar.gz](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/slice_hackfest_middle_nsd.tar.gz)

**NST:**

- [slice_hackfest_nst.yaml](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/slice_hackfest_nst.yaml)
- [slice_hackfest2_nst.yaml](https://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/packages/slice_hackfest2_nst.yaml)

### Network Slice Template Diagram

The diagram below shows the Network Slice Template we are going to develop in this session. As you can see, we have three network slice subnets, connected by Virtual Links Descriptors (VLDs) through the connection points of the network services. We have a Virtual Link for management slice_vld_mgmt and two Virtual links for data, slice_vld_data1 and slice_vld_data2. In the middle, we have a network-slice-subnet that interconnects the Netslice subnet we have on the left side to the Netslice subnet in have on the right side.

![nst diagram](assets/800px-nst.png)

#### Virtual Network Functions

The VNFs used for this session are two. The difference between them is the number of interfaces that have to create the connections. While the *slice_hackfest_middle_vnfd* VNF have three interfaces (mgmt, data1, data2), the *slice_hackfest_vnfd* have only two (mgmt, data). The rest of the specifications are the same as 1vCPU, 1GB of RAM, 10GB of disk, and image-name 'US1604' that is the ubuntu 16.04 image.

![vnfd](assets/800px-vnfd.png)

![middle vnfd](assets/800px-middle_vnfd.png)

#### Network Services

Two network services are needed for this session. The network services differ in the number of interfaces that posses and the VNF that is contained inside the Network service. The NS *slice_hackfest_nsd* has two VLDs, one for data and other for management while the *slice_hackfest_middle_nsd* has three VLDs, one for management and the other two for data1 and data2.

Inside *slice_hackfest_middle_nsd* we have the *slice_hackfest_middle_vnfd* and *slice_hackfest_nsd* posses the vnf *slice_hackfest_vnfd*.

The diagram below shows the *slice_hackfest_nsd* and *slice_hackfest_middle_nsd*, its connection points, vlds and vnfs.

![nsd](assets/800px-nsd.png)

![middle nsd](assets/800px-middle_nsd.png)

### Creating a Network Slice Template (NST)

Based on the OSM information model for Network slice templates [here](http://osm-download.etsi.org/repository/osm/debian/ReleaseSIX/docs/osm-im/osm_im_trees/nst.html) we can write the YAML descriptor for the NST. Let's dissect part by part the NST:

```yaml
nst:
-   id: slice_hackfest_nst
    name: slice_hackfest_nst
    SNSSAI-identifier:
        slice-service-type: eMBB
    quality-of-service:
        id: 1

```

The snippet above, we set an id and name for the network slice template, and we specify the required parameter *SNSSAI-identifier* to have a reference which kind of service will be deployed inside this slice. Additionally, we add a *quality-of-service* parameter that will be used in future releases of OSM.

After setting the id, name and some required parameters, we need to define which network services will compose our network slice template. The section *netslice-subnet* looks like:

```yaml
 netslice-subnet:
    -   id: slice_hackfest_nsd_1
        is-shared-nss: false
        description: NetSlice Subnet (service) composed by 1 vnf with 2 cp
        nsd-ref: slice_hackfest_nsd

    -   id: slice_hackfest_nsd_2
        is-shared-nss: true
        description: NetSlice Subnet (service) composed by 1 vnf with 3 cp
        nsd-ref: slice_hackfest_middle_nsd

    -   id: slice_hackfest_nsd_3
        is-shared-nss: false
        description: NetSlice Subnet (service) composed by 1 vnf with 2 cp
        nsd-ref: slice_hackfest_nsd
```

Each item of the *netslice-subnet* list requires an id to identify it. The option *is-shared-nss* is a boolean flag to determine if the nss is shared among Network Slice Instances that use this Netslice Subnet. Moreover, we provide an optional description, and we set the reference to the Network Service that form the netslice subnet in the field *nsd-ref*.

Finally, we need to define the connections among the *netslice-subnets*. We can define the connections in section *netslice-vld*:

```yaml
netslice-vld:
    -   id: slice_vld_mgmt
        name: slice_vld_mgmt
        type: ELAN
        mgmt-network: true
        nss-connection-point-ref:
        -   nss-ref: slice_hackfest_nsd_1
            nsd-connection-point-ref: nsd_cp_mgmt
        -   nss-ref: slice_hackfest_nsd_2
            nsd-connection-point-ref: nsd_cp_mgmt
        -   nss-ref: slice_hackfest_nsd_3
            nsd-connection-point-ref: nsd_cp_mgmt
    -   id: slice_vld_data1
        name: slice_vld_data1
        type: ELAN
        nss-connection-point-ref:
        -   nss-ref: slice_hackfest_nsd_1
            nsd-connection-point-ref: nsd_cp_data
        -   nss-ref: slice_hackfest_nsd_2
            nsd-connection-point-ref: nsd_cp_data1
```

Having the network slice template ready, we need to upload the resources to the OSM before upload the network slice template. You can use the following commands to check the vnfds nsds and upload the packages to OSM:

- **VNF package:**
  - List Virtual Network Functions Descriptors
    - `osm vnfd-list`
  - Upload the *slice_hackfest_vnf* package
    - `osm vnfd-create slice_hackfest_vnf.tar.gz`
  - Upload the *slice_hackfest_middle_vnf package*
    - `osm vnfd-create slice_hackfest_middle_vnf.tar.gz`
  - Show if *slice_hackfest_vnf* was uploaded correctly to OSM
    - `osm vnfd-show slice_hackfest_vnfd`
  - Show if *slice_hackfest_vnf* was uploaded correctly to OSM
    - `osm vnfd-show slice_hackfest_middle_vnfd`

- **NS package:**
  - List Network Service Descriptors
    - `osm nsd-list`
  - Upload the *slice_hackfest_ns* package
    - `osm nsd-create slice_hackfest_ns.tar.gz`
  - Upload the *slice_hackfest_middle_ns* package
    - `osm nsd-create slice_hackfest_middle_ns.tar.gz`
  - Show if *slice_hackfest_nsd* was uploaded correctly to OSM
    - `osm nsd-show slice_hackfest_nsd`
  - Show if *slice_hackfest_middle_nsd* was uploaded correctly to OSM
    - `osm nsd-show slice_hackfest_middle_nsd`

- **NST:**
  - List network slice templates
    - `osm nst-list`
  - Upload the *slice_hackfest_nst.yaml* template
    - `osm nst-create slice_hackfest_nst.yaml`
  - Upload the *slice_hackfest2_nst.yaml* template
    - `osm nst-create slice_hackfest2_nst.yaml`
  - Show if *slice_hackfest_nst* was uploaded correctly to OSM
    - `osm nst-show slice_hackfest_nst`
  - Show if *slice_hackfest2_nst* was uploaded correctly to OSM
    - `osm nst-show slice_hackfest2_nst`

With all resources already available in OSM, we can proceed to deploy the *slice_hackfest_nst*. Let's start with the help of the command to create a network slice instance:

```text
osm nsi-create --help
Usage: osm nsi-create [OPTIONS]

  creates a new Network Slice Instance (NSI)

Options:
  --nsi_name TEXT     name of the Network Slice Instance
  --nst_name TEXT     name of the Network Slice Template
  --vim_account TEXT  default VIM account id or name for the deployment
  --ssh_keys TEXT     comma separated list of keys to inject to vnfs
  --config TEXT       Netslice specific yaml configuration:
                      netslice_subnet: [
                      id: TEXT, vim_account: TEXT,
                      vnf: [member-vnf-index: TEXT, vim_account: TEXT]
                      vld: [name: TEXT,
                            vim-network-name: TEXT or DICT with vim_account,
                            vim_net entries]
                      additionalParamsForNsi: {param: value, ...}
                      additionalParamsForsubnet: [{id: SUBNET_ID,
                      additionalParamsForNs: {},
                      additionalParamsForVnf: {}}]
                      ],
                      netslice-vld: [name: TEXT,
                      vim-network-name: TEXT or DICT with vim_account,
                      vim_net entries]
  --config_file TEXT  nsi specific yaml configuration file
  --wait              do not return the control immediately, but keep it
                      until the operation is completed, or timeout
  -h, --help          Show this message and exit.
```

To instantiate the network slice template we are going to use the command:

```text
osm nsi-create\
--nsi_name my_first_slice\
--nst_name slice_hackfest_nst\
--vim_account <replace_vim_account_name>\
--config 'netslice-vld: [{ "name": "slice_vld_mgmt", "vim-network-name": <replace_vim_external_network> }]'

```

Where:

- `--nsi-name` is the name of our network slice Instance: **my_first_slice**
- `--nst-name` is the name of our network slice template: **slice_hackfest_nst**
- `--vim_account` is the default VIM account id or name for the deployment
- `--config`  is the configuration parameter we use for this slice. We want to attach the management network to an external network of the VIM to have access to the VNF deployed in the slice. In the `netslice-vld` list, we set that the `slice_vld_mgmt` will use the external network VIM in the key `vim-network-name`. It has to be replaced with the name of the external network of the VIM.

We have two more commands to operate the slices instances.

- List Network Slice Instances
  - `osm nsi-list`
- Delete Network Slice Instance
  - `osm nsi-delete <nsi_name> or <nsi_id>`

The result of the deployment in Openstack will look like:

![Network Slice Instance](assets/800px-hackfest_nsi.png)

![Network Slice Instance Openstack](assets/400px-slice_instance_openstack.png)

In the picture above, we can see three VNFs deployed in openstack connected to management openstack network `osm-ext` and also connected among them following the vlds described in the network slice template.

### Sharing a Network Slice Subnet

In this section, we will create a new network slice template that uses the middle netslice subnet from the previous instantiation to add a new netslice-subnet connected via data2 VLD. The picture below defines the case we want to achieve.

![Sharing network slice subnet](assets/800px-shared_nst.png)

The network slice template used in this section is *slice_hackfest2_nst.yaml* and is available in the [resources](#resources) section.

```yaml
nst:
-   id: slice_hackfest2_nst
    name: slice_hackfest2_nst
    SNSSAI-identifier:
        slice-service-type: eMBB
    quality-of-service:
        id: 1

    netslice-subnet:
    -   id: slice_hackfest_nsd_2
        is-shared-nss: true
        description: NetSlice Subnet (service) composed by 1 vnf with 3 cp
        nsd-ref: slice_hackfest_middle_nsd
    -   id: slice_hackfest_nsd_3
        is-shared-nss: false
        description: NetSlice Subnet (service) composed by 1 vnf with 2 cp
        nsd-ref: slice_hackfest_nsd

    netslice-vld:
    -   id: slice_vld_mgmt
        name: slice_vld_mgmt
        type: ELAN
        mgmt-network: true
        nss-connection-point-ref:
        -   nss-ref: slice_hackfest_nsd_2
            nsd-connection-point-ref: nsd_cp_mgmt
        -   nss-ref: slice_hackfest_nsd_3
            nsd-connection-point-ref: nsd_cp_mgmt
    -   id: slice_vld_data2
        name: slice_vld_data2
        type: ELAN
        nss-connection-point-ref:
        -   nss-ref: slice_hackfest_nsd_2
            nsd-connection-point-ref: nsd_cp_data2
        -   nss-ref: slice_hackfest_nsd_3
            nsd-connection-point-ref: nsd_cp_data
```

As you can see in the YAML above, this NST have 2 *netslice-subnet*, one with the flag *is-shared-nss* as true and the other one with the flag *is-shared-nss* as false. The *netslice-vlds* will connect the *slice_hackfest_middle_nsd* nss with management interface and data2 with the *slice_hackfest_nsd* via *nsd_cp_data*

To instantiate this network we will use the same command used previously but changing the `nst_name` to *slice_hackfest2_nst*:

```text
osm nsi-create\
--nsi_name my_shared_slice\
--nst_name slice_hackfest2_nst\
--vim_account <replace_vim_account_name>\
--config 'netslice-vld: [{ "name": "slice_vld_mgmt", "vim-network-name": <replace_vim_external_network> }]'
```

The result of the instantiation is shown in the picture below:

![shared nsi](assets/800px-hackfest_shared_nsi.png)

![shared nsi openstack](assets/400px-shared_nsi_openstack.png)

Only one Network Slice Subnet was instantiated since the middle Network Slice Subnet is shared with this second NSI.

#### Result of deleting the Network Slice Instance 1

What would happens with the shared Network Slice Subnet and the second Network Slice Instance if we delete the first Network Slice Instance?

Let's make a try!

With the command `osm nsi-delete my_first_slice` we can delete the first Network Slice Instance. The result is that the middle Network Slice Subnet (shared) belongs to the NSI2, and is not deleted when NSI1 is deleted. All networks and services created for NSS middle are kept. In the picture below, you can see the result in Openstack and the logical result of the deletion of NSI1:

![nsi1 deletion](assets/800px-nsi1_delete.png)

![nsi1 deletion openstack](assets/400px-nsi1_delete_openstack.png)

To remove the NSI2 you can do it with the command: `osm nsi-delete my_shared_slice`.

Further information you can find a good explanation and examples [in this presentation](http://osm-download.etsi.org/ftp/osm-6.0-six/8th-hackfest/presentations/8th%20OSM%20Hackfest%20-%20Session%206%20-%205G%20Network%20Slicing%20with%20OSM.pdf)

## Using Kubernetes-based VNFs (KNFs)

+35.7 KiB
Loading image diff...
+40.8 KiB
Loading image diff...
+39.5 KiB
Loading image diff...
+47.7 KiB
Loading image diff...
Loading