3. Quick Start

In this QuickStart section, we see few quick steps to install and execute the sample topology with RYU Controller.

KNet is compatible with Python 2.7 only.

KNet is currently supported only in Ubuntu 16.04 version.

We have used Ubuntu 16.04 OS for the below demonstations.

_images/ubuntuversion_s.png

The current released version is 1.0.11

3.1. Installation

  1. Install the Prerequisties. Copy and Paste the below command in the Terminal
curl https://raw.githubusercontent.com/knetsolutions/KNet/master/install.sh | bash

This command will install the Docker, openvswitch and required packages.

  1. Once Prerequisties are installed. Execute the below commands to verify the docker and openvswitches are installed.
sudo docker images
sudo ovs-vsctl show
  1. Install the KNet Topology Builder with below commands,
pip install knet
_images/knet_pip_install_s.png
  1. Install the KNet WebUI & and Verify the WebUI in browser
git clone https://github.com/knetsolutions/knet-ui
cd knet-ui
python ui/webserver.py >/dev/null 2>&1 &
_images/knet_ui_install_s.png

Open FireFox/Chrome, with URL: ĥttp://ip:5000/index.html, and see the empty topology page.

_images/WebUI_emptypage_s.png
  1. Start the KNet CLI and verify the commands
knet-cli
_images/knet_cli_start_s.png

3.2. Create a sample Topology and Testing

Now Let us Create the Sample Star Topology with RYU SDN Controller.

Topology should be defined in simple YAML file(its just a text file representing the topology).

Example topology files are available in https://github.com/knetsolutions/knet-example-topologies

SDN example topologies are available inside SDN folder of the knet-example-topologies repo.

Example SDN topologies are available for 1. Linear 2. Star 3. Tree 4. Mesh 5. Partial Mesh

3.2.1. Setup the RYU SDN Controller

1. Install the RYU SDN Controller Open the another terminal and execute the below commands,

cd $HOME
export LC_ALL="en_US.UTF-8"
virtualenv ryu
. ryu/bin/activate
pip install ryu
_images/ryu_install_s.png
  1. Run the Ryu Simple L3 Switch application,
ryu-manager ryu/lib/python2.7/site-packages/ryu/app/simple_switch_13.py
_images/ryu_run_l3switch_s.png

3.2.2. CLI

  1. Create a Topology as below in the CLI
CreateTopology /home/suresh/knet-example-topologies/1.0/topo0.yaml
_images/knet_topology_creation_s.png
  1. Verify the topology digram in UI.

    ĥttp://ip:5000/index.html

_images/Webui_StarTopology_s.png
  1. Open the another terminal, and verify the switches and nodes. Run the below commands in the new terminal and see the created nodes and switches.
sudo docker ps -a
sudo ovs-vsctl show
_images/startopology_dockerswitch_cmds_s.png
  1. Trigger the PingAll command from the KNet CLI and check the output Each node pings each other nodes.
PingAll
_images/CLI_pingall_command_s.png
  1. Verify the OVS flows with the below command,
    sudo ovs-ofctl -O OpenFlow13 dump-flows switch1
_images/ovs_dumpflows_output_s.png

3.3. Delete the Topology

  1. In the KNet CLI, Execute the below command
DeleteTopology
_images/CLI_Delete_Topology_s.png
  1. Exit from the CLI by “Exit” Command

3.4. Cleanup

Cleanup command cleans up the Docker container, ovs switches, log files, db records etc.

  1. In the KNet CLI, Execute the below command
Cleanup
  1. Exit from the CLI by “Exit” Command