X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Fns3%2Fmulti_host%2Fexperiment_interconnected_ns3ns3.py;fp=examples%2Fns3%2Fmulti_host%2Fexperiment_interconnected_ns3ns3.py;h=0000000000000000000000000000000000000000;hb=4ffa02a6eeaf8c5daacb10d8f52fc15782af84ab;hp=ab2a8a2c8ec602890dabf6c7beebd8da695663b9;hpb=1ce40ff6bf01ed8257316ace03a46f165114149b;p=nepi.git diff --git a/examples/ns3/multi_host/experiment_interconnected_ns3ns3.py b/examples/ns3/multi_host/experiment_interconnected_ns3ns3.py deleted file mode 100644 index ab2a8a2c..00000000 --- a/examples/ns3/multi_host/experiment_interconnected_ns3ns3.py +++ /dev/null @@ -1,65 +0,0 @@ -# -# NEPI, a framework to manage network experiments -# 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 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 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Author: Damien Saucez -# Alina Quereilhac - -from experiment_interconnected import ExperimentInterconnected - -class ExperimentInterconnectedNs3Ns3(ExperimentInterconnected): - def connect_with_udp_tunnel(self, xp_remote): - # Connect the two experiments via a UDP tunnel direcly on the FD devices - tunnel = self.ec.register_resource("planetlab::ns3::FdUdpTunnel") - self.ec.register_connection(tunnel, self.fddev) - self.ec.register_connection(tunnel, xp_remote.fddev) - - return tunnel - - def interconnect(self, xp_remote): - """ - Interconnect two ns3 simulations via a UDP tunnel - """ - # sanity checks - # - # topology must be setup - if not self.topology_built: - raise Exception("Topology not setup on ", self) - if not xp_remote.topology_built: - raise Exception("Topology not setup on ", xp_remote ) - # - # experiment cannot be interconnected to another experiment - if self.interconnected: - raise Exception("Experiment already interconnected on ", self) - if xp_remote.interconnected: - raise Exception("Experiment already interconnected on ", xp_remote) - - # IP for the AP of the two experiments - # XXX DSA: ugly - ip = ["10.0.0.1", "10.0.0.2"] - - # add an FD device on both local and remote experiments - self.add_fdnetdevice(ip[0], "30") - xp_remote.add_fdnetdevice(ip[1], "30") - - # Connect the two experiments via a UDP tunnel direcly on the FD devices - self.connect_with_udp_tunnel(xp_remote) - - # Add a route to the remote network on each experiment, via the FD device - self.add_route(self.nsnodes[0], xp_remote.netblock, xp_remote.prefix, ip[1]) - xp_remote.add_route(xp_remote.nsnodes[0], self.netblock, self.prefix, ip[0]) - - # Sanity check - self.interconnected = True