9. Traffic Tests

KNet Supports UDP, TCP tests as simple Commands. KNet runs IPERF in the node to perform this test.

9.1. TCP Test :

TcpTest command performs the TCP test between two nodes for 10s

KNet-cli#help TcpTest

Runs IPERF TCP test.
Args: source destination  Number-of-connections
return: result
Example:  TcpTest a1 a2 1
          TcpTest a1 a2 10


9.2. UDP Test:

UdpTest command performs the UDP test between two nodes for 10s

KNet-cli#help UdpTest

Runs IPERF UDP test.
Args: source destination  Bandwitdh(Mbps) Number-of-connections
return: result
Example:  UdTest a1 a2 10 1
          UdpTest a1 a2 1 1


9.2.1. 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.3. 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 a4 node ip is

9.3.1. Create the Topology using KNet CLI.


9.3.2. View the Topology Web UI


9.3.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.


9.3.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

9.3.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

9.3.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):

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

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

Start the locust as below, is a4 IP

locust -f loadtest.py --no-web --host

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


Check the flow tables in ovs

sudo ovs-ofctl -O OpenFlow13 dump-flows switch1
sudo ovs-ofctl -O OpenFlow13 dump-flows switch1 | wc

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