PANTHEON.tech
  • About Us
    • References & Partners
    • Tools
  • Products & Expertise
    • Products
      • Orchestration
      • Automation
      • Network Functions
      • Visibility Package
      • Ligato
    • Expertise
      • Software Prototyping
      • SDN
      • OpenDaylight
      • NFV
      • OPNFV
      • ONAP
      • FD.io VPP
      • Ligato
      • Clustering
    • Services
      • Support
      • Services
      • Consulting
      • Trainings
  • Blog & News
  • Career
  • Contact
  • English
  • Search
  • Menu Menu
  • LinkedIn
  • Twitter
  • Youtube
  • Instagram
  • Rss
StoneWork + GNS3

[Tutorial] StoneWork + GNS3 (Complete)

May 8, 2018/in Hidden /by PANTHEON.tech

PANTHEON.tech has made StoneWork available on the GNS 3 marketplace. This makes it easy for anybody to try out our all-in-one solution, which combines multiple cloud-native network functions from our CDNF.io portfolio, in a separate environment.

This tutorial will give you the basics on how to set-up StoneWork in an environment, where you can safely test out interaction and its positioning within your (simulated) network.

The goal of this tutorial is to have a basic setup, where we will:

  • Setup StoneWork interface IP address
  • Set the status of StoneWork to UP
  • Verify the connection by pinging the address

Components

StoneWork is a solution which, thanks to its modular architecture, enables you to combine multiple CNFs from the CDNF.io portfolio, using only one data-plane, to increase the overall throughput, while keeping rich functionality.

GNS3 emulates network software, so you can try different virtual or real appliances in a completely separate environment and simulate a complex network.

Requirements

  • GNS3 works optimally on Linux, so we will be using Ubuntu 20.04.2.0
  • Make sure to do follow the GNS3 Linux Install documentation, which also adds Docker CE
  • Download the appliance image for Alpine Linux, a minimalistic distribution for GNS3
  • Download the appliance image for StoneWork here.

Setup the Environment: StoneWork in GNS3

After setting up your Linux environment and installing GNS3 on your distro of choice,

  1. Create a new project. We will call this one StoneWork Demo Run.
  2. Go to File – Import appliance and import both Alpine Linux & StoneWork Mini files. They will be saved as templates.
  3. Install the appliances. The default option we used is Install the appliance on your local computer. GNS3 will then inform you, in which category the appliance will appear.
  4. You will find both appliances by clicking on the next to last button, Browse all devices, on the left-side toolbar of GNS3.
gns3 appliances

Here, we can find all the imported and default appliances in GNS3

5. Drag both Alpine Linux & StoneWork Mini to the environment in the middle. Wait for the appliances to finish downloading.

6. Under the button for Browse all devices, click on Add a link. You will now be able to link both appliances together, to create a connection.

7. Click on AlpineLinux-1, and select the only available interface – eth0. Then click on StoneWorkmini-1, and select eth0 as well.

8. Click on the green button in the horizontal toolbar, to start all appliances.

StoneWork + GNS3 - Running Appliances

Both appliances are running and green-lit

Congratulations! The topology is set up and we will now continue the setup, in order for Alpine Linux and StoneWork to be able to ping (send packets to) each other.

9. Right-click on AlpineLinux-1 and select Console.

10. In the console window, type in ip add to view the IP addresses linking towards Alpine Linux.

ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
7: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether b6:74:c3:ad:4f:a5 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b474:c3ff:fead:4fa5/64 scope link 
       valid_lft forever preferred_lft forever

11. Then, add the following command to edit the IP address:

ip addr add 10.0.0.1/24 dev eth0

12. Verify the IP address by typing ip add again. The entire output should look like this:

/ # ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
7: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether b6:74:c3:ad:4f:a5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::b474:c3ff:fead:4fa5/64 scope link 
       valid_lft forever preferred_lft forever

Verify Connection: StoneWork in GNS3

Important: You can access the console for Alpine Linux via Right Click – Console, but StoneWork is accessed via Right Click – Auxiliary Console. Something to keep in mind, while commanding both instances.

We want to connect the interface, as well as connect both appliances.

  1. We will need to set up the configuration of StoneWork via CLI. Right-click on StoneWorkmini-1 and select Auxiliary Console. The path to StoneWork config should be the same as below. The entire command should look like this:
    cat /etc/stonework/config/day0-config.yaml
  2. If you want to change the StoneWork config, you will need to edit this file. The file should look like this:
    vppConfig:
      interfaces:
      - name: "my-eth0"
        type: AF_PACKET
        enabled: false
        physAddress: "3e:af:13:8f:a5:ba"
        afpacket:
          hostIfName: "eth0"
      - name: "my-eth1"
        type: AF_PACKET
        enabled: false
        physAddress: "52:12:91:be:c7:00"
        afpacket:
          hostIfName: "eth1"
      - name: "my-eth2"
        type: AF_PACKET
        enabled: false
        physAddress: "46:89:d6:41:44:29"
        afpacket:
          hostIfName: "eth2"
      - name: "my-eth3"
        type: AF_PACKET
        enabled: false
        physAddress: "2a:f6:78:04:64:7f"
        afpacket:
          hostIfName: "eth3"
      - name: "my-eth4"
        type: AF_PACKET
        enabled: false
        physAddress: "76:3d:2f:56:22:0f"
        afpacket:
          hostIfName: "eth4"
    
  3. To edit the config, we will edit the file via VIM:
    vim /etc/stonework/config/day0-config.yaml
  4. On your keyboard, click the A key to edit the file.
  5. In the file, set my-eth0 set enabled to true (instead of the default false). This way we make sure, that the interface will be UP & running.
  6. Then, type I on your keyboard to insert the following lines into the config, under enabled: true:
    ipAddresses:
    - "10.0.0.2/24"
  7. Save changes with ESC – colon (:) – w
  8. To exit VIM, type ESC – colon – q
  9. To update the configuration in StoneWork itself, type in the following command:
    agentctl config update --replace /etc/stonework/config/day0-config.yaml

Verify Updated Config in StoneWork

We have successfully set up the configuration of StoneWork! Now, we will verify the update in StoneWork.

  1. Type in the following command to the Auxiliary console of StoneWorkmin-1:
    agentctl config history
  2. The output will look like this:
    # agentctl config history
      SEQ  TYPE            START  INPUT      OPERATIONS          RESULT  SUMMARY                
      0    status sync     44m    <none>     <none>                      <none>                 
      1    config replace  44m    30 values  CREATE:5            ok      CONFIGURED:5           
      2    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      3    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      4    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      5    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      6    status update   43m    1  values  CREATE:1            ok      OBTAINED:1             
      7    config replace  5m     35 values  CREATE:3, UPDATE:1  ok      CONFIGURED:4           
      8    status update   5m     2  values  CREATE:1, DELETE:1  ok      OBTAINED:1, REMOVED:1  
    / # 
    
  3.  To double-check the settings in the VPP data-plane, type in vppctl into the same Terminal window, then show int. You should see, that the State of eth0 is up
     vppctl
        _______    _        _   _____  ___ 
     __/ __/ _   (_)__    | | / / _ / _ 
     _/ _// // / / / _    | |/ / ___/ ___/
     /_/ /____(_)_/___/   |___/_/  /_/    
    
    vpp# show int
                  Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count     
    host-eth0                         1      up          9000/0/0/0     rx packets                    16
                                                                        rx bytes                    1120
                                                                        drops                         16
                                                                        ip6                           16
    host-eth1                         2     down         9000/0/0/0     
    host-eth2                         3     down         9000/0/0/0     
    host-eth3                         4     down         9000/0/0/0     
    host-eth4                         5     down         9000/0/0/0     
    local0                            0     down          0/0/0/0
  4. To verify the IP address we’ve set up for StoneWork, type in show int addr :
    vpp# show int addr
    host-eth0 (up):
      L3 10.0.0.2/24
    host-eth1 (dn):
    host-eth2 (dn):
    host-eth3 (dn):
    host-eth4 (dn):
    local0 (dn):
    

    With everything set up correctly, we will make both appliances ping each other, to verify their connection.

Ping: StoneWork & Alpine Linux

The setup of our IP addresses looks like this:

  • Alpine Linux appliance (AlpineLinux-1): 10.0.0.1
  • StoneWork (StoneWorkmini-1): 10.0.0.2

Now, you can ping both ways with the following commands:

  • AlpineLinux-1: Open Console, type in ping 10.0.0.2
    / # ping 10.0.0.2
    PING 10.0.0.2 (10.0.0.2): 56 data bytes
    64 bytes from 10.0.0.2: seq=0 ttl=64 time=1.812 ms
    64 bytes from 10.0.0.2: seq=1 ttl=64 time=0.759 ms
    64 bytes from 10.0.0.2: seq=2 ttl=64 time=1.012 ms
    64 bytes from 10.0.0.2: seq=3 ttl=64 time=2.590 ms
    ^C
    --- 10.0.0.2 ping statistics ---
    4 packets transmitted, 4 packets received, 0% packet loss
    round-trip min/avg/max = 0.759/1.543/2.590 ms
  • StoneWorkmini-1: Open Auxiliary Console, type in vppctl, then ping 10.0.0.1
    vpp# ping 10.0.0.1
    116 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=2.6766 ms
    116 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=.8829 ms
    116 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=2.2815 ms
    116 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=3.2285 ms
    116 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=2.1995 ms
    
    Statistics: 5 sent, 5 received, 0% packet loss

Congratulations again! You have managed to set up StoneWork in GNS3. The purpose of this tutorial was to show you how to set up StoneWork in GNS3, in a separate environment, so you can test & play around with it.

Make sure to:

  • Contact us, if you are interested in StoneWork for commercial purposes. This demo showed a minimalistic distribution of StoneWork.
  • Check out CDNF.io for more CNFs

(Update, 5th of April 2021 – StoneWork is available on the GNS3 marketplace!)


by Július Milan & Filip Čúzy | Leave us your feedback on this post!

You can contact us here!

Explore our PANTHEON.tech GitHub.

Watch our YouTube Channel.

[Tutorial] Create & Use Containerized RNC Application

January 26, 2018/in Hidden /by Filip

The lighty.io RESTCONF-NETCONF application allows to easily initialize, start and utilize the most used OpenDaylight services and optionally add custom business logic.

We provide a pre-prepared Helm 2 & Helm 3 chart inside the lighty.io RNC application, which can be easily used for Kubernetes deployment.

Manage Network Elements in SDN | lighty.io RNC

This article tutorial shows how to deploy RNC applications with Helm and a custom local Kubernetes engine. Let us know what you thought of and missed in this tutorial!


Deploy RNC application with Helm 2

lighty.io releases to version 15.1.0 contain Helm charts supported only by Helm 2 and Kubernetes to version 1.21 or lower. Kubernetes in version 1.22 release removed support for networking.k8s.io/v1beta1 which is required for successful Helm chart build.

Deploy RNC app with local Kubernetes engine

For deploying the RNC application, we will use and show how to install the microk8s Local Kubernetes engine. Feel free to use any other of your favorite local Kubernetes engine which you have installed. You just need to meet the condition to use k8s versions 1.21 or lower.

1) Install microk8s with a snap. We will need to specify the version to 1.21 which uses k8s on version 1.21.

sudo snap install microk8s --classic --channel=1.21/stable
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
2) Verify running microK8s instance
microk8s status --wait-ready
   microk8s is running
   high-availability: no
   datastore master nodes: 127.0.0.1:19001
   datastore standby nodes: none

3) Enable required add-ons

microk8s enable dns helm

4) Initialize Helm. In microk8s, it is required to change the repository and tiller image for a successful initialization

microk8s.helm init --stable-repo-url=https://charts.helm.sh/stable --tiller-image ghcr.io/helm/tiller:v2.17.0

5) Check if all required k8s pods are working correctly.

microk8s.kubectl get pods -n kube-system

5.1) If not, check the error messages inside pods and try to resolve problems to run them correctly.

microk8s.kubectl describe pod [FAILED_POD_NAME] -n kube-system

6) Add PANTHEON.tech repositories to your Helm and update

microk8s.helm repo add pantheon-helm-repo https://pantheontech.github.io/helm-charts/
microk8s.helm repo update

7) Deploy the RNC app at version 15.1.0 with Helm.

microk8s.helm install --name lighty-rnc-app pantheon-helm-repo/lighty-rnc-app-helm --version 15.1.0

8) Check if the RNC app was successfully deployed and the k8s pod is running

microk8s.helm ls
microk8s.kubectl get pods

Configuration for your RNC app

RNC application could be configured through the Helm values file. Default RNC app values.yaml file can be found inside lighty.io GitHub.

1) Set  RESTCONF port to 8181 through the –set flag

microk8s.helm install --name lighty-rnc-app pantheon-helm-repo/lighty-rnc-app-helm --set lighty.restconf.restconfPort=8181

2) Set the RESTCONF port with providing configured values.yaml file

2.1) Download the values.yaml file

2.2) Update the image to your desired version.

image:
name: ghcr.io/pantheontech/lighty-rnc
version: 15.1.0
pullPolicy: IfNotPresent

2.3) Update the RESTCONF port or any required changes in the values.yaml file.

2.4) Deploy the RNC app with the changed values.yaml file. Use upgrade if you have already deployed the RNC application.

microk8s.helm upgrade lighty-rnc-app pantheon-helm-repo/lighty-rnc-app-helm --values [VALUES_YAML_FILE]

Deploy RNC application with Helm 3

The current lighty.io Master contains an updated Helm chart compatible with Helm 3 and Kubernetes v1.22. This example will show how to deploy the RNC app application with Helm 3 which is definitely recommended.

Download lighty.io Master

For this example, we will use the Helm chart and Docker for the NETCONF Simulator located in the lighty.io master branch. We will modify the helm chart to download the latest version of the RNC docker image.

1) Download lighty.io from GitHub repository and checkout to master branch, or download the lighty.io master zip file

git clone https://github.com/PANTHEONtech/lighty.git
git checkout master

2) Move to the lighty-rnc-app-helm directory

cd lighty/lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-app-helm/helm/lighty-rnc-app-helm

3) Change Docker image inside values.yaml file to:

image:
name: ghcr.io/pantheontech/lighty-rnc
version: latest
pullPolicy: IfNotPresent

Deploy RNC App w/ local Kubernetes engine

For deploying the RNC application, we will use and show how to install the microk8s Local Kubernetes engine. Feel free to use any other of your favorite local Kubernetes engine which you have installed.

1) Install microk8s with Snap

sudo snap install microk8s --classic
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube

2) Enable the required add-ons

microk8s enable dns helm3

3) Deploy the RNC app

microk8s helm3 install lighty-rnc-app ./lighty-rnc-app-helm/

4) Check if the RNC app was successfully deployed and k8s pods is running.

microk8s.helm3 ls
microk8s.kubectl get pods

Create testing device from lighty.io NETCONF simulator

For testing purposes, we will need some devices. PANTHEON.tech has already created a testing tool, that simulates NETCONF devices.

We will use this device and start it inside a Docker container. A Docker file can be found inside lighty.io, which can create an image for this simulated device.

1) Download the NETCONF simulator Docker file from lighty.io to a separate folder

2) Create a Docker image from the Docker file

sudo docker build -t lighty-netconf-simulator

3) Start the Docker container with a testing device at port 17830, or any other port, by changing the -p parameter.

sudo docker run -d --rm --name netconf-simulator -p17830:17830 lighty-netconf-simulator:latest

Test RNC application with simple CRUD operation on a device

This part will show a simple use case of how to connect a device and perform some basic CRUD operations on deployed RNC applications.

1) Check the IP assigned to k8s pod for RNC app. This IP will be used as a HOST_IP parameter in requests.

microk8s.kubectl get pod lighty-rnc-app-lighty-rnc-app-helm-548774945b-4tjvz -o custom-columns=":status.podIP" | xargs

2) Check the IP assigned to the Docker container. This parameter will be used as DEVICE_IP parameter in requests.

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' netconf-simulator

3) Connect the simulated device to the RNC application

curl --request PUT 'http://[HOST_IP]:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=new-node' \
--header 'Content-Type: application/json' \
--data-raw '{
    "netconf-topology:node": [
        {
            "node-id": "new-node",
            "host": [DEVICE_IP],
            "port": 17830,
            "username": "admin",
            "password": "admin",
            "tcp-only": false,
            "keepalive-delay": 0
        }
    ]
}'

4) Get device information from the RNC app. Check-in response if connection-status is “connected”

curl --request GET 'http://[HOST_IP]:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=new-node'

# Response
{
    "network-topology:node": [
        {
            "node-id": "new-node",
            "netconf-node-topology:connection-status": "connected",
            "netconf-node-topology:username": "admin",
            "netconf-node-topology:password": "admin",
            "netconf-node-topology:available-capabilities": {
               ...
            },
            "netconf-node-topology:host": "[DEVICE_IP]",
            "netconf-node-topology:port": 17830,
            "netconf-node-topology:tcp-only": false,
            "netconf-node-topology:keepalive-delay": 0
        }
    ]
}

5) Write a new topology-id to simulate device data

curl --request PUT 'http://[HOST_IP]:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=new-node/yang-ext:mount/network-topology:network-topology' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network-topology:network-topology": {
        "topology": [
            {
                "topology-id": "new-topology"
            }
        ]
    }
}'

6) Get data from the simulated device

curl  --request GET 'http://[HOST_IP]:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=new-node/yang-ext:mount/network-topology:network-topology'

# Response
{
    "network-topology:network-topology": {
        "topology": [
            {
                "topology-id": "new-topology"
            },
            {
                "topology-id": "default-topology"
            }
        ]
    }
}

7) Remove the device from the RNC application

curl --request DELETE 'http://[HOST_IP]:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=new-node'

8) Device Logs: Logs from the device can be shown by executing the following command:

sudo docker logs [CONTAINER ID]

9) RNC Logs: Logs from the RNC app can be shown by executing the following command:

microk8s.kubectl logs [POD_NAME]

We hope you enjoyed this tutorial! If you are interested in commercial support or a custom lighty.io integration, make sure to contact us.

Let us know what you thought of this tutorial and what you missed!


by Peter Šuňa | Leave us your feedback on this post!

You can contact us here!

Explore our PANTHEON.tech GitHub.

Watch our YouTube Channel.

More @ PATHEON.tech

  • [What Is] Multus CNI
  • [OpenDaylight] Migrating Bierman RESTCONF to RFC 8040
  • [StoneWork] IS-IS Feature
PANTHEON
TECHNOLOGIES Technologies in Pantheon Memebership Tools in Pantheon Drafts
CAREER List of job positions
EDUCATION
BLOG
CONTACT
© 2022 PANTHEON.tech s.r.o
  • LinkedIn
  • Twitter
  • Youtube
  • Instagram
  • Rss

This site uses cookies. Read more about them in our Privacy Policy or adjust the setting under "Settings".

Accept settingsSettings

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Analytics Cookies

These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are or to help us customize our website and application for you in order to enhance your experience.

If you do not want that we track your visit to our site you can disable tracking in your browser here:


Google Analytics:




LeadFeeder:

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy Policy
Accept settingsMore information
Scroll to top