Commit 1e6d1553 authored by vicens's avatar vicens Committed by Francisco-Javier Ramon Salguero
Browse files

slicing section on 05-osm-usage

parent d19d4f7c
Loading
Loading
Loading
Loading
+292 −1
Original line number Diff line number Diff line
@@ -855,7 +855,298 @@ 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

This network slicing example of usage requires 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 created for the example. As is shown in the picture, three network slice subnets are 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 subnets we have on both sides.

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

#### Virtual Network Functions

We use two VNFs for this example. The difference between them is the number of network interfaces to create connections. While the *slice_hackfest_middle_vnfd* VNF have three interfaces (mgmt, data1, data2), the *slice_hackfest_vnfd* have only two (mgmt, data). The specifications vCPU (1), RAM (1GB), disk (10GB), and image-name ('US1604') are the same in both VNFs.

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

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

#### Network Services

We use two network services in this example. They are differentiated by 1) the number of interfaces that posses, 2) the VNF contained inside the Network service, 3) the NS *slice_hackfest_nsd* have two VLDs, one for data and other for management 4) the *slice_hackfest_middle_nsd* has three VLDs, one for management and the other two for data1 and data2.

The *slice_hackfest_middle_nsd* have inside the *slice_hackfest_middle_vnfd* and the *slice_hackfest_nsd* has 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) it is possible to start writing the YAML descriptor for 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 contains the mandatory fields for the NST. Additionally, we can find the description below of the 'netslice-subnet' and 'netslice-vld' sections. When we create an NST, the 'id' references the Network Slice Template, and the 'name' is the name set to the NST. Additionally, the required parameter *SNSSAI-identifier* is a reference to which kind of service is inside this slice. In OSM we have three types of slice-service-type. Enhanced mobile broadband (eMBB), Ultra-reliable low-latency communications (URLLC) or massive machine type communications (mMTC). Moreover, we add a *quality-of-service* parameter that is related to the 5G QoS Indicator (5QI).

The section *netslice-subnet* shown below is the place to allocate the network services that compose the slice. Each item of the *netslice-subnet* list has:

1) An `id` to identify the netslice-subnet.
2) 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.
3) An optional `description`.
4) The `nsd-ref`  is the reference to the Network Service descriptor that forms the netslice subnet.

```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
```

Finally, it is defined the connections among the `netslice-subnets` in section `netslice-vld` as is shown below:

```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 is needed to onboard the resources to the OSM before upload the network slice template. The following commands help you to onboard 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, it is possible to create the Network Slice Instance (NSI) using the *slice_hackfest_nst*. You can find below 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 use the following 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 the Network Slice Instance: **my_first_slice**
- `--nst-name` is the name of the Network Slice Template: **slice_hackfest_nst**
- `--vim_account` is the default VIM account id or name to be used by the NSI
- `--config` is the configuration parameter used for the slice. For example, it is possible to attach the NS management network to an external network of the VIM to have access to the VNF deployed in the slice. In this case, `netslice-vld` list, contains the name of the VLD **slice_vld_mgmt** used to attach the external network of the VIM by `vim-network-name` key.

The commands to operate the slice are:

- 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 looks like:

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

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

In the picture above, it is shown 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

To test the feature of sharing a network slice subnet, we create a new network slice template that uses the shared netslice subnet from the previous instantiation. The picture below shows the Network Slice Template.

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

The network slice template used for sharing a network slice subnet is *slice_hackfest2_nst.yaml* and it 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
```

 The YAML above contains 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 slice, 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> }]'
```

You can see the result of the instantiation 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?

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 it is not deleted when NSI1 is deleted. All networks and services created for NSS middle are kept. In the picture below, is shown 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 run the command: `osm nsi-delete my_shared_slice`.

## 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