9. Traffic Tests

9.1. TCP and UDP Tests using IPERF :

As all nodes are ubuntu nodes, we can just install iperf and start use it. In this below example shows the IPERF traffic gene

Objective is create the example topology0, and generate the IPERF Tests between node a1 and a4. a4 will act as iperf server, and a1 will act as iperf client.

a1 node ip is 10.20.20.2 a4 node ip is 10.20.20.5

9.1.1. Create the Topology using KNet CLI.

_images/topology_cli_s.png

9.1.2. View the Topology Web UI

_images/topology_ui_s.png

9.1.3. Start the Ryu Controller SimpleSwitch13 application,

_images/ryu_s.png

9.1.4. Install the IPERF on a1 node

sudo docker exec -it a1 bash
sudo apt-get update
sudo apt-get install iperf
_images/iperf_install1_s.png
_images/iperf_install2_s.png

9.1.5. Install the IPERF on a4 node

Repeat the IPERF installation methond mentioned in above step in node a4.

9.1.6. Start the IPERF in a4 node as TCP Server.

sudo docker exec -it a4 bash
iperf -s
_images/iperf_server_start_s.png

9.1.7. Start the IPERF in a1 node as TCP Client.

sudo docker exec -it a1 bash
iperf -c 10.20.20.5
_images/iperf_client_output_s.png

9.1.8. Check the Results.

Server Side

_images/iperf_server_output_s.png

9.1.9. Check the OVS flows.

_images/ovs_flows_s1.png

9.1.10. References

IPERF supports UDP Traffic tests as well , Below links can help you for udp tests.

  1. https://iperf.fr/iperf-doc.php
  2. https://openmaniak.com/iperf.php

9.2. HTTP Tests Using Apache WebServer & Locust :

As all nodes are ubuntu nodes, we can just install Apache Webserver and Locust https://locust.io/ (HTTP Load Testing Tool) start using it.

Objective is create the example topology0, and Install the Apache Web Server in a4 node. Install Locust in a1 node. Trigger the Locust to test the apache web server(a4). Locust will generate huge http connections to the Apache web server and load it.

a1 node ip is 10.20.20.2 a4 node ip is 10.20.20.5

9.2.1. Create the Topology using KNet CLI.

_images/topology_cli_s.png

9.2.2. View the Topology Web UI

_images/topology_ui_s.png

9.2.3. Start the Ryu Controller L4Switch application,

L4Switch(https://github.com/knetsolutions/knet/L4Switch.py) application creates flow based on srcip, dstip, protocol,srcport, dstport.

_images/ryu_l4_s.png

9.2.4. Install the Apache WebServer on a4 node

sudo docker exec -it a4 bash
sudo apt-get update
sudo apt-get install apache2
sudo service apache restart
_images/apache_install_s.png
_images/apache_start_s.png

9.2.5. Install the Locust Tool on a1 node

sudo docker exec -it a1 bash
sudo apt-get update
sudo apt-get install python-dev python-pip
sudo pip install locustio
_images/locust_install_s.png

9.2.6. Run the Locust HTTP Load test

In the a1 node, Create a locust input file (loadtest.py)

from locust import HttpLocust, TaskSet
def index(l):
    l.client.get("/index.html")

class UserBehavior(TaskSet):
    tasks = {index: 2}

class WebsiteUser(HttpLocust):
    task_set = UserBehavior
    min_wait = 0
    max_wait = 0

Start the locust as below, 10.20.20.5 is a4 IP

locust -f loadtest.py --no-web --host http://10.20.20.5
_images/locust_run_s.png

The output shows , how many connections per second requested and the response time, etc.

_images/locust_output_s.png

Check the flow tables in ovs

sudo ovs-ofctl -O OpenFlow13 dump-flows switch1
sudo ovs-ofctl -O OpenFlow13 dump-flows switch1 | wc
_images/flow_tables_s.png
_images/flow_tables_count_s.png

I could able to simulate around 2000 Flows in 2 minutes. we can test flow setup rate using this test.