Tutorials/CloudSim/1.2/vpn connection

Connecting to a cloud simulation with a Virtual Private Network === This tutorial covers:
 * Connect your local computer to a cloud constellation using a Virtual Private Network

Prerequisites === This tutorial assumes you have started a single simulator constellation or a  VPC trio constellation.

On the local machine, install the openvpn package. sudo apt-get install openvpn

Introduction ===

Connection between a local computer to a cloud constellation is done using a Virtual Private Network. The local machine acts as an OpenVPN client that connects to a server running inside the constellation.
 * In the case of a simulator constellation, the simulator machine acts as the OpenVPN server
 * In the case of a VPC trio constellation, the router machine acts as the OpenVPN server

Setup the private network with a simulator constellation. ===

This section assumes that you are running a simulator constellation as explained in the Start/stop a single simulation in the cloud tutorial.

It is possible to connect to the simulator machine with a terminal using ssh. You can also establish a VPN connection with the simulator and connect via ROS. Both these connections need keys to be installed on your local machine. You can download these keys (as well as useful scripts) by following the link "Download keys". This should save zip file on your local machine (in the ~/Downloads/simulator_c_05fe3f08.zip in this example). Extract the content in a directory in your local machine.

mkdir cloudsim_start_tutorial cd cloudsim_start_tutorial unzip ~/Downloads/simulator_cx4a0cd28e.zip

In a separate terminal window, launch the VPN (Virtual Private Network): cd simulator_cx4a0cd28e sudo ./start_vpn.bash

Wait until you see the completion message:

Killing other openvpn connections... openvpn: no process found VPN ready. To kill it: sudo killall openvpn

This command starts an encrypted network connection between your local machine and the simulation constellation. To verify that it is the case, ping the simulator computer, using the VPN IP address (rather than it's public IP):

ping 11.8.0.1
 * 1) ping the simulator

Setup the private network with a VPC trio constellation ===

This section assumes that you are running a VPC trio constellation as explained in the Start a VPC trio constellation tutorial.

Download the router's zip file (by pressing the "Download keys" button from the router section of the CloudSim) and start the VPN.

mkdir trio_tutorial cd trio_tutorial unzip ~/Downloads/router_cxe488142c.zip cd router_cxe488142c sudo ./start_vpn.bash

You should see an output similar to this: Killing other openvpn connections... tun0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 POINTOPOINT NOARP MULTICAST MTU:1500  Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Adding route to 10.0.0.0/24 network VPN ready. To kill it: sudo killall openvpn

This command starts an encrypted network connection between your local machine and the simulation constellation. To verify that it is the case, ping the field computer and the simulator:

ping 10.0.0.50
 * 1) ping the router

ping 10.0.0.51
 * 1) ping the simulator

ping 10.0.0.52
 * 1) ping the field computer

Stopping the Virtual Private Network ===

You can stop the VPN connection at any time with the following command:

sudo killall openvpn


 * 1) Next ##


 * Using the field computer VPC trio constellation
 * Use gzclient on your local machine to connect to a cloud simulation
 * CloudSim development