# Copyright (C) 2013 INRIA
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+from __future__ import print_function
+
from nepi.execution.ec import ExperimentController
import os
ec = ExperimentController(exp_id = "dce-ccncat")
-node = ec.register_resource("LinuxNode")
+node = ec.register_resource("linux::Node")
ec.set(node, "hostname", "localhost")
ec.set(node, "cleanProcesses", True)
-simu = ec.register_resource("LinuxNS3Simulation")
+simu = ec.register_resource("linux::ns3::Simulation")
ec.register_connection(simu, node)
nsnode1 = add_ns3_node(ec, simu)
### create applications
# Add ccnd to ns-3 node1
-ccnd1 = ec.register_resource("ns3::LinuxDceCCND")
+ccnd1 = ec.register_resource("linux::ns3::dce::CCND")
ec.set (ccnd1, "stackSize", 1<<20)
ec.set (ccnd1, "debug", 7)
ec.set (ccnd1, "capacity", 50000)
"..", "..", "test", "resources", "linux",
"ns3", "ccn", "repoFile1")
-ccnr = ec.register_resource("ns3::LinuxDceCCNR")
+ccnr = ec.register_resource("linux::ns3::dce::CCNR")
ec.set (ccnr, "repoFile1", repofile)
ec.set (ccnr, "stackSize", 1<<20)
ec.set (ccnr, "StartTime", "2s")
ec.register_connection(ccnr, nsnode1)
# Add CCN repository with content to ns-3 node2
-ccnd2 = ec.register_resource("ns3::LinuxDceCCND")
+ccnd2 = ec.register_resource("linux::ns3::dce::CCND")
ec.set (ccnd2, "stackSize", 1<<20)
ec.set (ccnd2, "debug", 7)
ec.set (ccnd2, "capacity", 50000)
ec.register_connection(ccnd2, nsnode2)
# Add face from ns-3 node1 to ns-3 node2
-ccndc1 = ec.register_resource("ns3::LinuxDceFIBEntry")
+ccndc1 = ec.register_resource("linux::ns3::dce::FIBEntry")
ec.set (ccndc1, "protocol", "udp")
ec.set (ccndc1, "uri", "ccnx:/")
ec.set (ccndc1, "host", "10.0.0.2")
ec.register_connection(ccndc1, nsnode1)
# Add face from ns-3 node2 to ns-3 node1
-ccndc2 = ec.register_resource("ns3::LinuxDceFIBEntry")
+ccndc2 = ec.register_resource("linux::ns3::dce::FIBEntry")
ec.set (ccndc2, "protocol", "udp")
ec.set (ccndc2, "uri", "ccnx:/")
ec.set (ccndc2, "host", "10.0.0.1")
ec.register_connection(ccndc2, nsnode2)
# Add a ccncat to node2 to retrieve content
-ccncat = ec.register_resource("ns3::LinuxDceCCNCat")
+ccncat = ec.register_resource("linux::ns3::dce::CCNCat")
ec.set (ccncat, "contentName", "ccnx:/test/bunny.ts")
ec.set (ccncat, "stackSize", 1<<20)
ec.set (ccncat, "StartTime", "4s")
stdout = ec.trace(ccncat, "stdout")
# convert from bytes to MB
-print "%0.2f MBytes received" % (len(stdout) / 1024.0 / 1024.0 )
+print("%0.2f MBytes received" % (len(stdout) / 1024.0 / 1024.0 ))
ec.shutdown()
-