Tutorials/CloudSim/1.2/traffic shaper

Using the traffic shaper tool to modify latency and packet loss ===

This tutorial covers:
 * Modify the latency and packet loss of the machines within the constellation

Prerequisites === This tutorial assumes you have a cloudsim already installed and ready to use. Check out this section for setup.

Introduction ===

Cloudsim allows you to vary the amount of additional latency that gets injected between the client (OCU) and the router machine based on the intrinsic latency between the OCU and the cloud, specifically, the router machine that's doing the latency injection via tc command (show / manipulate traffic control settings). At the router machine, the intrinsic OCU/cloud latency is measured and the additional latency required to reach the desired latency is added. The percentage of packet loss can be artificially modified following the same principle.

How to modify latency and packet loss on a single simulation machine ===

First of all you should start launching your simulator constellation. Check out the tutorials for launching a single simulator machine.

Once the constellations is up and running, click on the Download Keys link of the simulator machine. Unzip the content and change to the new directory created (note that the name of the file includes the constellation id, so your file name will be different from the one shown in the tutorial.

cd Downloads unzip simulator_cx311e3852.zip cd simulator_cx311e3852

Your current directory contains keys and scripts for starting the vpn and for opening a ssh session with the simulator machine easily. Let's try doing a ssh to the router machine by running the next command.

. ssh.bash

You'll see the prompt of the simulator machine confirming that the ssh connection is properly established. Now verify your current latency by running ping command towards your preferred destination.

ping google.com

Modify the traffic shaper widget injecting 100 extra miliseconds of latency.



Verify that the latency time in the ping console increases accordingly.



You can also press the Reset button to restore the default settings.

Feel free to explore in the same way with the packet loss capabilities of the traffic shaper. Be careful with high values of packet loss and latency as they might cause that your router does not respond properly (values higher than 500ms. for latency and 40% for packet loss will be ignored to avoid connectivity problems).

How to modify latency and packet loss on a VPC trio constellation ===

First of all you should start launching your VPC trio constellation. Check out the tutorial for [[Tutorials/CloudSim/1.2/vrc_trio | launching a VPC trio].

Once the constellations is up and running, click on the Download Keys link of the router machine. Unzip the content and change to the new directory created (note that the name of the file includes the constellation id, so your file name will be different from the one shown in the tutorial.

cd Downloads unzip router_cxddaa10cc.zip cd router_cxddaa10cc

Your current directory contains keys and scripts for starting the vpn and for opening a ssh session with the router machine easily. Let's try doing a ssh to the router machine by running the next command.

. router_ssh.bash

You'll see the prompt of the router machine confirming that the ssh connection is properly established. Now verify your current latency by running ping command towards your preferred destination.

ping google.com

Modify the traffic shaper widget injecting 100 extra miliseconds of latency.



Verify that the latency time in the ping console increases accordingly.



You can also press the Reset button to restore the default settings.

Feel free to explore in the same way with the packet loss capabilities of the traffic shaper. Be careful with high values of packet loss and latency as they might cause that your router does not respond properly (values higher than 500ms. for latency and 40% for packet loss will be ignored to avoid connectivity problems).


 * 1) Next ##

Next: CloudSim development