Deploy VOLTHA using KinD Voltha - caprivm/virtualization GitHub Wiki

caprivm ([email protected])

Description

Based on the ONF official page, VOLTHA (Virtual OLT Hardware Abstraction) is an open source project to create a hardware abstraction for broadband access equipment. It supports the principle of multi-vendor, disaggregated, “any broadband access as a service” for the Central Office. Currently provides a common, vendor agnostic, GPON control and management system, for a set of white-box and vendor-specific PON hardware devices. This is the VOLTHA architecture:

VOLTHA architecture

This deployment procedure has been tested on a VM with the following characteristics:

Feature Value
OS Used Ubuntu 18.04 LTS
vCPU 4
RAM (GB) 16
Disk (GB) 50
Home User ubuntu
VOLTHA Tag master
Nested Virtualization true

NOTE: The last point of the table could be optional if the VM runs docker without the need to configure in BIOS the VT-x options (in intel processors).

The contents of the page are:

Prerequisites

The kind-voltha needs curl, sed, jq, yq and docker. For install them execute the next commands.

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y curl sed jq snapd git
sudo snap install yq

Also, before starting this guide, you should have installed the following tools. You can check the adjacent links if you haven't already:

Deploy kind-voltha

For deploy kind-voltha, execute the next commands. Two important things to take account: the term kind refers to Kubernetes in Docker, thus if you have an already cluster the flag DEPLOY_K8S must be configured as no. The second thing is that this guide implements the TT workflow of VOLTHA.

sudo apt-get update
git clone https://github.com/opencord/kind-voltha.git && cd kind-voltha
export NAME=minimal
# Deploy Voltha
DEPLOY_K8S=y WITH_BBSIM="yes" WITH_EAPOL="no" WITH_DHCP="yes" CONFIG_SADIS="bbsim" BBSIM_CFG="configs/bbsim-sadis-tt.yaml" ./voltha up
# After deployment, define variables for kube and voltha commands
export KUBECONFIG="/home/ubuntu/.kube/kind-config-voltha-minimal"
export VOLTCONFIG="/home/ubuntu/.volt/config-minimal"
export PATH=/home/ubuntu/kind-voltha/bin:$PATH

The variables can be configured in the ~/.bashrc which prevents export them every time you login to the machine. You can verify the cluster setup obtaining the pods.

kubectl get pods -A
# NAMESPACE            NAME                                                   READY   STATUS    RESTARTS   AGE
# default              etcd-0                                                 1/1     Running   0          46h
# default              kafka-0                                                1/1     Running   1          46h
# default              kafka-zookeeper-0                                      1/1     Running   0          46h
# default              onos-onos-classic-0                                    1/1     Running   0          46h
# kube-system          coredns-66bff467f8-vt2gl                               1/1     Running   0          46h
# kube-system          coredns-66bff467f8-wcvt9                               1/1     Running   0          46h
# kube-system          etcd-voltha-minimal-control-plane                      1/1     Running   0          46h
# kube-system          kindnet-f5bck                                          1/1     Running   0          46h
# kube-system          kindnet-jxnjp                                          1/1     Running   0          46h
# kube-system          kindnet-sjx7w                                          1/1     Running   0          46h
# kube-system          kube-apiserver-voltha-minimal-control-plane            1/1     Running   0          46h
# kube-system          kube-controller-manager-voltha-minimal-control-plane   1/1     Running   0          46h
# kube-system          kube-proxy-hpf7g                                       1/1     Running   0          46h
# kube-system          kube-proxy-s6bdv                                       1/1     Running   0          46h
# kube-system          kube-proxy-zjfdn                                       1/1     Running   0          46h
# kube-system          kube-scheduler-voltha-minimal-control-plane            1/1     Running   0          46h
# local-path-storage   local-path-provisioner-bd4bb6b75-srv59                 1/1     Running   0          46h
# voltha               bbsim0-664cf5d7d7-shzk6                                1/1     Running   0          46h
# voltha               open-olt-voltha-adapter-openolt-76989d7f5b-c8h4f       1/1     Running   0          46h
# voltha               open-onu-voltha-adapter-openonu-0                      1/1     Running   0          46h
# voltha               voltha-voltha-ofagent-648db7dc88-4hrxp                 1/1     Running   0          46h
# voltha               voltha-voltha-rw-core-77559fc8d8-vv4xd                 1/1     Running   0          46h

Also, you can verify the status of services.

kubectl get svc -A
# NAMESPACE     NAME                       TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                                             AGE
# default       etcd                       ClusterIP   None             <none>        2380/TCP,2379/TCP                                   47h
# default       kafka                      ClusterIP   10.109.114.158   <none>        9092/TCP                                            47h
# default       kafka-headless             ClusterIP   None             <none>        9092/TCP                                            47h
# default       kafka-zookeeper            ClusterIP   10.104.153.154   <none>        2181/TCP                                            47h
# default       kafka-zookeeper-headless   ClusterIP   None             <none>        2181/TCP,3888/TCP,2888/TCP                          47h
# default       kubernetes                 ClusterIP   10.96.0.1        <none>        443/TCP                                             47h
# default       onos-atomix-api            ClusterIP   10.109.26.49     <none>        5678/TCP                                            47h
# default       onos-atomix-hs             ClusterIP   None             <none>        5679/TCP                                            47h
# default       onos-onos-classic-hs       ClusterIP   None             <none>        6653/TCP,6640/TCP,9876/TCP,8101/TCP,8181/TCP        47h
# kube-system   kube-dns                   ClusterIP   10.96.0.10       <none>        53/UDP,53/TCP,9153/TCP                              47h
# voltha        bbsim0                     ClusterIP   10.99.187.166    <none>        50060/TCP,50070/TCP,50074/TCP,50071/TCP,50075/TCP   47h
# voltha        voltha-voltha-api          ClusterIP   10.110.6.252     <none>        55555/TCP                                           47h

Expose port in Kubernetes

Some ports like 8181 (ONOS GUI) are exposed by default in voltha deployment. However, other ports as the bbsim API are not exposed by default. For this, execute:

kubectl port-forward --address 0.0.0.0 service/bbsim0 50070:50070 50071:50071 -n voltha &

Look that the port-forward task keeps the process in background for any API call. Now, you can access to API via VM IP and 50071 port, for instance, try to execute http://<ip>:50071/v1/olt/flows.

Provision an OLT

You can create a BBSim based OLT in VOLTHA with:

voltctl device create -t openolt -H <bbsim_cluster_ip>:50060

The bbsim_cluster_ip can be obtained with kubectl get svc --all-namespaces and look for the bbsim0 service. Next, when you run this command, an OLT is created but is disable. For enable run the next command. Take in account that this command is useful if you have only one OLT.

voltctl device enable $(voltctl device list --filter Type~openolt -q)

Once the OLT is enabled in VOLTHA you should be able to see the ONU attached to it by listing the devices:

voltctl device list

Reference: https://docs.voltha.org/master/overview/operate.html

Subscriber provisioning

In order to provision a subscriber you need to identify it. In ONOS a subscriber is viewed as an enabled port (UNI) on the logical switch that VOLTHA exposes, for example:

ssh -p 8101 karaf@localhost # (pwd: karaf)
# Password authentication
# Password:
# Welcome to Open Network Operating System (ONOS)!
#      ____  _  ______  ____
#     / __ \/ |/ / __ \/ __/
#    / /_/ /    / /_/ /\ \
#    \____/_/|_/\____/___/

# Documentation: wiki.onosproject.org
# Tutorials:     tutorials.onosproject.org
# Mailing lists: lists.onosproject.org

# Come help out! Find out how at: contribute.onosproject.org

# Hit '<tab>' for a list of available commands
# and '[cmd] --help' for help on a specific command.
# Hit '<ctrl-d>' or type 'logout' to exit ONOS session.

karaf@root > ports -e
# id=of:00000a0a0a0a0a00, available=true, local-status=connected 1d22h ago, role=MASTER, type=SWITCH, mfr=VOLTHA Project, hw=open_pon, sw=open_pon, serial=BBSIM_OLT_0, chassis=a0a0a0a0a00, driver=voltha, channelId=10.244.1.6:36314, managementAddress=10.244.1.6, protocol=OF_13
#   port=16, state=enabled, type=fiber, speed=0 , adminState=enabled, portMac=08:00:00:00:00:10, portName=BBSM00000001-1
#   port=1048576, state=enabled, type=fiber, speed=0 , adminState=enabled, portMac=0a:0a:0a:0a:0a:00, portName=nni-1048576

Once the port number representing a subscriber has been retrieved, you can provision it via:

karaf@root > volt-add-subscriber-access of:00000a0a0a0a0a00 16

Where of:00000a0a0a0a0a00 is the OpenFlow ID of the Logical Device representing the OLT and 16 is the port representing that particular subscriber. To verify that the subscriber has been provisioned:

karaf@root > volt-programmed-subscribers
# location=of:00000a0a0a0a0a00/16 tagInformation=UniTagInformation{uniTagMatch=55, ponCTag=55, ponSTag=555, usPonCTagPriority=5, usPonSTagPriority=5, dsPonCTagPriority=5, dsPonSTagPriority=5, technologyProfileId=66, enableMacLearning=false, upstreamBandwidthProfile='User_Bandwidth1', downstreamBandwidthProfile='User_Bandwidth2', serviceName='vod', configuredMacAddress='2e:60:00:00:01:02', isDhcpRequired=true, isIgmpRequired=true}
# location=of:00000a0a0a0a0a00/16 tagInformation=UniTagInformation{uniTagMatch=65, ponCTag=444, ponSTag=333, usPonCTagPriority=7, usPonSTagPriority=7, dsPonCTagPriority=7, dsPonSTagPriority=7, technologyProfileId=65, enableMacLearning=false, upstreamBandwidthProfile='User_Bandwidth1', downstreamBandwidthProfile='User_Bandwidth2', serviceName='voip', configuredMacAddress='2e:60:00:00:01:01', isDhcpRequired=true, isIgmpRequired=false}
# location=of:00000a0a0a0a0a00/16 tagInformation=UniTagInformation{uniTagMatch=35, ponCTag=900, ponSTag=900, usPonCTagPriority=-1, usPonSTagPriority=-1, dsPonCTagPriority=-1, dsPonSTagPriority=-1, technologyProfileId=64, enableMacLearning=false, upstreamBandwidthProfile='User_Bandwidth1', downstreamBandwidthProfile='User_Bandwidth2', serviceName='hsia', configuredMacAddress='null', isDhcpRequired=false, isIgmpRequired=false}

Note that there is the three services preconfigured in the TT workflow.

Access bbsimctl

When running a test you can check the state of each ONU using bbsimctl. The easiest way to use bbsimctl is to exec inside the bbsim container:

kubectl -n voltha exec -it $(kubectl -n voltha get pods -l app=bbsim -o name) -- /bin/bash

After this, you can check the status of the ONU and it services.

Check the ONU Status

root@bbsim0-664cf5d7d7-shzk6:/app# bbsimctl onu list
# PONPORTID    ID    PORTNO    SERIALNUMBER    OPERSTATE    INTERNALSTATE
# 0            1     0         BBSM00000001    up           enabled

Check the Service Status

root@bbsim0-664cf5d7d7-shzk6:/app# bbsimctl onu services BBSM00000001
# ONUSN           INTERNALSTATE    NAME    HWADDRESS            STAG    CTAG    NEEDSEAPOL    NEEDSDHCP    NEEDSIGMP    GEMPORT    EAPOLSTATE    DHCPSTATE            IGMPSTATE
# BBSM00000001    initialized      hsia    2e:60:00:00:01:00    900     900     false         false        false        1024       created       created              created
# BBSM00000001    initialized      voip    2e:60:00:00:01:01    333     444     false         true         false        1025       created       dhcp_ack_received    created
# BBSM00000001    initialized      vod     2e:60:00:00:01:02    555     55      false         true         true         1026       created       dhcp_ack_received    created
# BBSM00000001    initialized      MC      2e:60:00:00:01:03    550     55      false         false        false        0          created       created              created

Enable/Disable ONU

bbsimctl gives you the ability to control the device lifecycle, for example you can turn ONUs on and off:

root@bbsim0-664cf5d7d7-shzk6:/app# bbsimctl onu shutdown BBSM00000001
# [Status: 0] ONU BBSM00000001 successfully shut down.

root@bbsim0-664cf5d7d7-shzk6:/app# bbsimctl onu poweron BBSM00000001
# [Status: 0] ONU BBSM00000001 successfully powered on.

Reference: https://docs.voltha.org/master/bbsim/docs/source/operations.html#bbsimctll

⚠️ **GitHub.com Fallback** ⚠️