1 #!/usr/bin/env python
\r
3 # NEPI, a framework to manage network experiments
\r
4 # Copyright (C) 2013 INRIA
\r
6 # This program is free software: you can redistribute it and/or modify
\r
7 # it under the terms of the GNU General Public License version 2 as
\r
8 # published by the Free Software Foundation;
\r
10 # This program is distributed in the hope that it will be useful,
\r
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 # GNU General Public License for more details.
\r
15 # You should have received a copy of the GNU General Public License
\r
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
18 # Author: Damien Saucez <damien.saucez@inria.fr>
\r
19 # Alina Quereilhac <alina.quereilhac@inria.fr>
\r
22 from experiment_interconnected_ns3_planetlab import ExperimentInterconnectedNs3Planetlab
\r
23 from nepi.execution.ec import ExperimentController
\r
24 from nepi.execution.resource import ResourceManager
\r
26 # Experiment parameters
\r
27 experiment_id = "case_c"
\r
29 netblock = "192.168.3.0"
\r
34 "hostname":"onelab4.warsaw.rd.tp.pl",
\r
35 "username":"inria_nepi",
\r
36 "identity": "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME'])
\r
41 os.environ["NEPI_NTHREADS"] = "1"
\r
42 ResourceManager._reschedule_delay = "0s"
\r
44 # == Experimentation setup ====================================================
\r
46 # Prepare the ExperimentController
\r
47 ec = ExperimentController(exp_id = experiment_id)
\r
49 # Create the simulated network
\r
50 xp = ExperimentInterconnectedNs3Planetlab(ec, node_info, nb_nodes)
\r
51 xp.build_topology(netblock = netblock, prefix = prefix, target = agent)
\r
53 # Create Planetlab application
\r
54 app = xp.add_planetlab_client(xp.ip_ap)
\r
56 # Interconnect Planetlab and ns3
\r
57 xp.interconnect("192.168.3.128", "25")
\r
59 # Let's run the experiment
\r
61 ec.wait_finished([app])
\r
63 # and see the output
\r
64 stdout = ec.trace(xp.apps[0], "stdout")
\r
65 print "[", stdout, "]"
\r