########################## Simple OMF ping experiment ########################## This simple example introduces you to OMF6. It presents all the basic steps to develop, run, and access the results of an experiment executed with OMF 6. This tutorial is based on UTH NITlab scenario (`Simple OMF Example `_) - adapted to use in FIT-NITOS Paris platform and `portal.onelab.eu `_ ********************** Experiment Description ********************** This simple experiment involves a single node, which has an active network interface. In this experiment, we will instruct that node to start an instance of the traditional Linux /bin/ping application to probe another host on the network attached to that interface (in our case Google's DNS server). ************* Prerequisites ************* Provisioning and accessing resources ==================================== Before starting this tutorial, please make sure that you have completed the following: - You need to have active account on the OneLab portal (to create an account please follow this tutorial: :doc:`User sign-up`) - You need to create or join existing project (Please follow this tutorial: :ref:`project-label`) - You need to create or join existing slice within the project (Please follow this tutorial: :ref:`slice-label` ) - You need to reserve one node on FIT NITOS Paris (to know how to reserve node please follow this tutorial: :ref:`reservation-with-scheduling-label`) - You have SSH client installed (on OSX and Linux the terminal clients are available by default, on Windows you can donwload and install `Putty `_). Alternatively if you are using Mozilla Firefox or Google Chrome you can install `this plugin `_ to run shell within browser. See more here: :ref:`accessing-reserved-resources-label` Experiment Controller (EC) ========================== .. include:: nitos_exp/ec_nitos.rst *********************** Preparing an experiment *********************** .. include:: nitos_exp/prepare_nitos_exp.rst .. literalinclude:: nitos_exp/paris_tutorial000.rb :language: ruby :linenos: ********************* Running an experiment ********************* .. include:: nitos_exp/run_nitos_exp.rst Accessing your account on the gateway server ============================================ .. include:: nitos_exp/access_acount.rst Cleaning up the environment =========================== .. include:: nitos_exp/clean_nitos_env.rst Running your ED script from EC ============================== 1. On the gateway server copy-paste the script to file paris_tutorial000.rb or download :download:`ED_script ` .. code-block:: bash wget http://doc.onelab.eu/_downloads/paris_tutorial000.rb 2. Update the ED file with your reserved node name (using nano or vim). In this script you need to change node name to the one you have reserved (line 24). Hint: to save your work with nano you need to press ctrl+x and then press 'Y' on your keyboard and hit . .. code-block:: bash nano paris_tutorial000.rb 2. Start the EC software and tell it to execute the experiment described in your ED file, using the command line: .. code-block:: bash omf_ec -u xmpp://griffin.ipv6.lip6.fr exec paris_tutorial000.rb If you would like to know more about the other options of the OMF EC software please run the commands: .. code-block:: bash omf_ec help omf_ec help exec Understanding the output ======================== Below is the example output from the experiment that we have defined and run as part of this experiment: - At first the EC provides us with some information about the parameters of this experiment: .. code-block:: console onelab.upmc.nitos_tut.nitos@griffin:~$ omf_ec -u xmpp://griffin.ipv6.lip6.fr exec test.rb OMF Experiment Controller - Copyright (c) 2012-13 National ICT Australia Limited (NICTA) {:type=>:xml, :authenticate=>nil} 15:41:58 INFO XMPP::Communicator: Connecting to 'griffin.ipv6.lip6.fr' ... 15:42:03 INFO XMPP::Communicator: Connected 15:42:03 INFO Object: OMF Experiment Controller 6.1.1 - Start 15:42:03 INFO Object: Connected using {:proto=>:xmpp, :user=>"griffin-21097", :domain=>"griffin.ipv6.lip6.fr"} 15:42:03 INFO Object: Execute: /home/onelab.upmc.nitos_tut.nitos/test.rb 15:42:03 INFO Object: Properties: {} 15:42:03 WARN Context::AppContext: No OML URI configured for measurement collection! (see option 'oml_uri'). Disabling OML Collection for 'ping'. 15:42:03 INFO OmfEc::Experiment: Experiment: 2015-05-29T13:41:58.229Z starts 15:42:03 INFO OmfEc::Experiment: Configure 'node11' to join 'Sender' - It provides us some feedback about its communication with the xmpp server and other OMF entities.It also informs us when a defined event has been triggered: .. code-block:: console 15:42:03 INFO OmfEc::Experiment: Newly discovered resource >> xmpp://node11@griffin.ipv6.lip6.fr 15:42:03 INFO OmfEc::Experiment: Config xmpp://node11@griffin.ipv6.lip6.fr to join Sender 15:42:04 INFO OmfEc::Experiment: Event triggered: 'ALL_NODES_UP, ALL_UP' 15:42:04 INFO OmfEc::Experiment: Newly discovered resource >> xmpp://4a66bb92-97b3-4229-96b5-3652c6021449@griffin.ipv6.lip6.fr - Finally, when an event is triggered (such as ALL_UP_AND_INSTALLED), it informs us about the tasks executed for that event, and their results/outputs: .. code-block:: console 15:42:04 INFO OmfEc::Experiment: Event triggered: 'ALL_UP_AND_INSTALLED' 15:42:04 INFO Object: This is my first OMF experiment 15:42:04 INFO OmfEc: APP_EVENT STARTED from app simple_ping_cxt_0 - msg: env -i /bin/ping 8.8.8.8 -c 3 15:42:04 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 15:42:04 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=1 ttl=53 time=5.18 ms 15:42:05 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=2 ttl=53 time=26.5 ms 15:42:06 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: 64 bytes from 8.8.8.8: icmp_req=3 ttl=53 time=37.4 ms 15:42:06 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: 15:42:06 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: 3 packets transmitted, 3 received, 0% packet loss, time 2002ms 15:42:06 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: --- 8.8.8.8 ping statistics --- 15:42:06 INFO OmfEc: APP_EVENT STDOUT from app simple_ping_cxt_0 - msg: rtt min/avg/max/mdev = 5.182/23.081/37.482/13.416 ms 15:42:06 INFO OmfEc: APP_EVENT EXIT from app simple_ping_cxt_0 - msg: 0 15:42:14 INFO OmfEc::Experiment: Experiment: 2015-05-29T13:41:58.229Z finished 15:42:14 INFO OmfEc::Experiment: Release applications and network interfaces 15:42:14 INFO OmfEc::Experiment: Exit in 15 seconds... 15:42:28 INFO OmfEc::Experiment: OMF Experiment Controller 6.1.1 - Exit. 15:42:29 INFO XMPP::Communicator: Disconnecting... - You can access same results by going to /tmp directory on the server: .. code-block:: console cd /tmp ls -ltr cat 2015-05-29T13:41:58.229Z.log