X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Fdce%2Fwrapped_local_p2p_ccncat.py;h=b85bdffc749b15bdb31a88f4119775083af40cbb;hb=039fbd9629d7570d4c175a5448d24badcd0f3aba;hp=94f69c20a63c02f5f6fb7c2250a668116078b9d6;hpb=f8f93f1014d7720481b0e9770b8014e1d5659f7d;p=nepi.git diff --git a/examples/dce/wrapped_local_p2p_ccncat.py b/examples/dce/wrapped_local_p2p_ccncat.py index 94f69c20..b85bdffc 100644 --- a/examples/dce/wrapped_local_p2p_ccncat.py +++ b/examples/dce/wrapped_local_p2p_ccncat.py @@ -4,9 +4,8 @@ # 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 @@ -18,6 +17,8 @@ # # Author: Alina Quereilhac +from __future__ import print_function + from nepi.execution.ec import ExperimentController import os @@ -56,11 +57,11 @@ def add_device(ec, node, ip, prefix): 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) @@ -80,7 +81,7 @@ ec.register_connection(chan, dev2) ### 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) @@ -94,7 +95,7 @@ repofile = os.path.join( "..", "..", "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") @@ -102,7 +103,7 @@ ec.set (ccnr, "StopTime", "120s") 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) @@ -111,7 +112,7 @@ ec.set (ccnd2, "StopTime", "20s") 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") @@ -121,7 +122,7 @@ ec.set (ccndc1, "StopTime", "120s") 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") @@ -131,7 +132,7 @@ ec.set (ccndc2, "StopTime", "120s") 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") @@ -144,7 +145,6 @@ ec.wait_finished([ccncat]) 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() -