skilyxx / ONOS-SVM

Using ONOS and an SVM to detect anomalous behavior in IoT devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ONOS-SVM-Tutorial

Using ONOS and an SVM to detect anomalous behavior in IoT devices (Ubuntu 18.04 Tested)

This repo will be to provide general knowledge on how to install and use the ONOS platform.
I will also provide multiple useful commands for the CLI, GUI, and Docker that will speed up the process of development.

Mininet-Installation

Make sure you have Mininet Installed
For installing mininet on Ubuntu 18.04 its pretty simple.
Run: sudo apt install mininet


ONOS-Installation (via Docker)

If you don't have docker already installed Digital Ocean has a great tutorial that you can follow.

Digital Ocean Docker install tutorial:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
Once you have docker installed you need to setup your environment with the required tools needed to run ONOS.

Required tools / Commands
MAKE SURE TO RUN THESE COMMANDS IN THE ORDER THEY APPEAR
MAKE SURE YOURE ON A FRESH NEW VM OR INSTALLATION OF UBUNTU

  1. sudo apt install python
  2. sudo apt install python3
  3. sudo apt install python-pip python-dev python-setuptools
  4. sudo apt install python3-pip python3-dev python3-setuptools
  5. pip3 install --upgrade pip
  6. pip3 install selenium
  7. sudo apt-get install git
  8. sudo apt-get install git-review

ONOS Docker
Clone ONOS github: git clone https://gerrit.onosproject.org/onos
Pull the ONOS image: sudo docker pull onosproject/onos


Running-ONOS and Accessing-GUI/CLI

Running ONOS docker image:
sudo docker run -t -d -p 8181:8181 -p 8101:8101 -p 5005:5005 -p 830:830 --name onos onosproject/onos

Inorder to access the CLI and GUI you need to run a few docker commands.

Find Docker Container ID:
sudo docker ps (This command is used to find all of the currently running docker containers)
Once you find the ID make sure to copy it.

Finding Docker IP addr:
sudo docker inspect 'container-id' (This command inspects the listed docker container and all of its details)
Once you find the IP addr make sure to copy it.

In the next few commands were going to use our Docker IP '172.17.0.2'

Accessing GUI:
Open up a web browser and copy this URL http://172.17.0.2:8181/onos/ui/index.html
When you access the GUI you will not see a topology that comes later.

Note: The web browser may prompt you to enter in a username and password in order to login
use Username:onos Password:rocks this should allow you to log in. Also if you just started the
container it may show an error once you copy the URL just wait a minute for the GUI to start up.

Accessing CLI:
Make sure to run this command in the host machine terminal.
ssh onos@172.17.0.2 -p 8101

Note: For the password same as the GUI use -> rocks

Activating ONOS Applications:
When inside of the GUI go to the applications windows and search for openflow and look for the "openflow provider suite" app. Click on it and the press the play button at the top right of the screen to activate the app. Do the same steps and look for the "Reactive Forwarding" app and activate that as well.
Now were ready to start to run Mininet and a default simulated topology.

Note: If you dont activate these apps the mininet topology won't connect to the ONOS remote controller

Running Mininet with ONOS:
By now everything should be setup in order to run the Mininet command below to connect the controller to the simulated topology.

sudo mn --controller remote,ip=172.17.0.2,port=6633 --topo tree,2,2

After running this command the mininet prompt should start up. Next you want to type the "pingall" command in mininet so that the OvS switches discover all of the connected hosts.

Next you want to access the GUI and while in the GUI you should only be able to see the three switches. If you press H the hosts along with their individual ip address should be visible.


SVM-Tutorial (Coming Soon)


Useful-Commands and Documents

Mininet:

  • xterm h1 h2 s1 (This command pulls up all of the terminals for the simulated topology components)
  • sudo mn (This command generally runs mininet with no controller)

Openflow virtual switch:

Docker Commands:

  • sudo docker ps (lists currently running docker containers)
  • sudo docker ps -a (lists recently exited containers)
  • sudo docker rm 'docker id' (rm instance and frees up resources)
  • sudo docker exec -it onos /bin/bash (accessing terminal in container)
  • sudo docker inspect "docker id" (Inspecting docker container details)

ONOS CLI Commands:

Netcat Commands to start a TCP connection:

  • Server: nc -l 2399
  • Client: nc "server_ip" 2399

Contributors


About

Using ONOS and an SVM to detect anomalous behavior in IoT devices


Languages

Language:Python 100.0%