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.
The current released version is 1.0.11
3.1. Installation¶
- 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.
- Once Prerequisties are installed. Execute the below commands to verify the docker and openvswitches are installed.
sudo docker images
sudo ovs-vsctl show
- Install the KNet Topology Builder with below commands,
pip install knet
- 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 &
Open FireFox/Chrome, with URL: ĥttp://ip:5000/index.html, and see the empty topology page.
- Start the KNet CLI and verify the commands
knet-cli
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
- Run the Ryu Simple L3 Switch application,
ryu-manager ryu/lib/python2.7/site-packages/ryu/app/simple_switch_13.py
3.2.2. CLI¶
- Create a Topology as below in the CLI
CreateTopology /home/suresh/knet-example-topologies/1.0/topo0.yaml
Verify the topology digram in UI.
ĥttp://ip:5000/index.html
- 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
- Trigger the PingAll command from the KNet CLI and check the output Each node pings each other nodes.
PingAll
- Verify the OVS flows with the below command,
- sudo ovs-ofctl -O OpenFlow13 dump-flows switch1
3.3. Delete the Topology¶
- In the KNet CLI, Execute the below command
DeleteTopology
- Exit from the CLI by “Exit” Command
3.4. Cleanup¶
Cleanup command cleans up the Docker container, ovs switches, log files, db records etc.
- In the KNet CLI, Execute the below command
Cleanup
- Exit from the CLI by “Exit” Command