aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-03-01 11:02:25 +0100
committerDimitri Staessens <dimitri@ouroboros.rocks>2026-03-07 11:29:02 +0100
commit6cbcfb039e608419bd6ced673723918aca6fb278 (patch)
tree172061d95f50cda09c3872d32c5f77e459044cd8 /examples
parent4e35c6b445d0cfbad9cf15a48f2d341e29dbd806 (diff)
downloadrumba-6cbcfb039e608419bd6ced673723918aca6fb278.tar.gz
rumba-6cbcfb039e608419bd6ced673723918aca6fb278.zip
rumba: Remove irati/rlite, python2 and qemu support
Remove IRATI and rlite prototype plugins, keeping only Ouroboros. Delete .gitlab-ci.yml (only contained an irati test job and a Sphinx pages job). Clean up all irati/rlite imports and references from examples, documentation, and tools. Qemu was tied heavily with rlite and irati. As it's less useful for ouroboros it's removed rather than reworked. Updated README.md and AUTHORS Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/congestion.py109
-rwxr-xr-xexamples/converged-operator-network.py211
-rwxr-xr-xexamples/datacenter.py78
-rwxr-xr-xexamples/docker-ouroboros.py25
-rw-r--r--examples/example-script.rsb6
-rwxr-xr-xexamples/example.py31
-rwxr-xr-xexamples/geant.py233
-rwxr-xr-xexamples/isps.py68
-rwxr-xr-xexamples/jfed-rlite.py53
-rwxr-xr-xexamples/mouse.py109
-rw-r--r--examples/ouroboros-layer-example.py66
-rwxr-xr-xexamples/rumba_example.py23
-rwxr-xr-xexamples/scalingtime.py135
-rwxr-xr-xexamples/script-example.py50
-rwxr-xr-xexamples/snake.py48
-rwxr-xr-xexamples/square.py52
-rwxr-xr-xexamples/test.py57
-rwxr-xr-xexamples/two-layers.py41
-rwxr-xr-xexamples/vpn.py35
19 files changed, 826 insertions, 604 deletions
diff --git a/examples/congestion.py b/examples/congestion.py
new file mode 100755
index 0000000..844f136
--- /dev/null
+++ b/examples/congestion.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python
+
+# An example script using the rumba package
+
+from rumba.model import Node, UnicastLayer, EthDixLayer
+from rumba.storyboard import *
+from rumba.utils import ExperimentManager, PROMPT_SWAPOUT
+from rumba.topologies import build_star
+
+# import testbed plugins
+import rumba.testbeds.jfed as jfed
+
+# import Ouroboros prototype plugin
+import rumba.prototypes.ouroboros as our
+
+import rumba.log as log
+
+
+__all__ = ["exp", "sb", "nodes", "main", "run"]
+
+log.set_logging_level('DEBUG')
+
+n1 = UnicastLayer("n1")
+
+leaves, routerNode = build_star(
+ ["client1", "client2", "server"], n1, hub_name="router")
+clientNode1, clientNode2, serverNode = leaves
+
+nodes = ["client1", "client2", "router", "server"]
+
+tb = jfed.Testbed(exp_name='cc2',
+ cert_file='/path/to/cert.pem',
+ authority='wall1.ilabt.iminds.be',
+ image='UBUNTU18-64-STD',
+ username='username',
+ exp_hours='1',
+ proj_name='ouroborosrocks')
+
+exp = our.Experiment(tb,
+ nodes=[clientNode1, clientNode2, routerNode, serverNode],
+ # git_repo='https://codeberg.org/o7s/ouroboros',
+ git_branch='be',
+ build_options='-DCMAKE_BUILD_TYPE=Debug '
+ '-DSHM_BUFFER_SIZE=131072 '
+ '-DIPCP_ETH_PAD_RUNT_FRAMES=false '
+ '-DDISABLE_CORE_LOCK=false '
+ '-DPCP_SCHED_THR_MUL=1',
+ add_packages=['ethtool'],
+ influxdb={
+ 'ip': '127.0.0.1',
+ 'port': 8086,
+ 'org': "Ouroboros",
+ 'token': "your-influxdb-token"
+ })
+
+sb = StoryBoard(experiment=exp, duration=1500, servers=[])
+
+
+def run():
+ sb.run_command("server",
+ 'irm bind prog ocbr name ocbr_server;'
+ 'irm name register ocbr_server layer n1;'
+ 'ocbr --listen > /dev/null 2>&1 &')
+ sb.run_command("client1",
+ 'irm bind prog ocbr name ocbr_client1;'
+ 'irm name register ocbr_client1 layer n1;'
+ 'ocbr --listen > /dev/null 2>&1 &')
+ sb.run_command("server",
+ 'irm bind prog oping name oping_server;'
+ 'irm name register oping_server layer n1;'
+ 'oping --listen > /dev/null 2>&1 &')
+ sb.run_command("client1", "for sz in `seq 0 10 200 1000`;"
+ "do oping -n oping_server -i 0ms -s $sz -d 120;"
+ "done")
+ sb.run_command("client1", "ocbr -n ocbr_server -r 70M -d 600 --spin > /dev/null 2>&1 &")
+ sb.run_command("server", "ocbr -n ocbr_client1 -r 70M -d 600 --spin > /dev/null 2>&1 &")
+ time.sleep(30)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 70M -d 30 --spin > /dev/null 2>&1 &")
+ time.sleep(45)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 20M -d 30 --spin > /dev/null 2>&1 &")
+ time.sleep(45)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 60M -d 30 -s 1400 --spin > /dev/null 2>&1 &")
+ time.sleep(45)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 60M -d 30 -s 1200 --spin > /dev/null 2>&1 &")
+ time.sleep(45)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 60M -d 30 -s 1000 --spin > /dev/null 2>&1 &")
+ time.sleep(45)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 60M -d 30 -s 800 --spin > /dev/null 2>&1 &")
+ time.sleep(35)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 60M -d 30 -s 500 --spin > /dev/null 2>&1 &")
+ time.sleep(35)
+ sb.run_command("client2", "ocbr -n ocbr_server -r 60M -d 30 -s 200 --spin > /dev/null 2>&1 &")
+ time.sleep(200)
+# sb.ouroboros_stop_metrics_exporter(nodes)
+# exp.terminate_prototype()
+
+
+def main():
+ with ExperimentManager(exp, swap_out_strategy=PROMPT_SWAPOUT):
+ exp.swap_in()
+ exp.install_prototype()
+ exp.set_phy_link_rate_between("router", "server", 100)
+ exp.start_metrics_exporter(nodes, interval=300)
+ exp.bootstrap_prototype()
+ run()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/examples/converged-operator-network.py b/examples/converged-operator-network.py
index 42df95d..eb604f9 100755
--- a/examples/converged-operator-network.py
+++ b/examples/converged-operator-network.py
@@ -8,176 +8,171 @@ from rumba.storyboard import *
from rumba.utils import *
# import testbed plugins
-import rumba.testbeds.emulab as emulab
import rumba.testbeds.jfed as jfed
-import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
log.set_logging_level('DEBUG')
-f1 = NormalDIF("fixed")
-l1 = NormalDIF("LTE")
-m1 = NormalDIF("metro1")
-m2 = NormalDIF("metro2")
-m3 = NormalDIF("metro3")
-c1 = NormalDIF("core")
-n1 = NormalDIF("overlay")
+f1 = UnicastLayer("fixed")
+l1 = UnicastLayer("LTE")
+m1 = UnicastLayer("metro1")
+m2 = UnicastLayer("metro2")
+m3 = UnicastLayer("metro3")
+c1 = UnicastLayer("core")
+n1 = UnicastLayer("overlay")
-f1e1 = ShimEthDIF("f1e1")
-f1e2 = ShimEthDIF("f1e2")
-f1e3 = ShimEthDIF("f1e3")
+f1e1 = EthDixLayer("f1e1")
+f1e2 = EthDixLayer("f1e2")
+f1e3 = EthDixLayer("f1e3")
-l1e1 = ShimEthDIF("l1e1")
+l1e1 = EthDixLayer("l1e1")
-m1f1 = ShimEthDIF("m1f1")
+m1f1 = EthDixLayer("m1f1")
-m1e1 = ShimEthDIF("m1e1")
-m1e2 = ShimEthDIF("m1e2")
-m1e3 = ShimEthDIF("m1e3")
-m1e4 = ShimEthDIF("m1e4")
-m1e5 = ShimEthDIF("m1e5")
-m1e6 = ShimEthDIF("m1e6")
+m1e1 = EthDixLayer("m1e1")
+m1e2 = EthDixLayer("m1e2")
+m1e3 = EthDixLayer("m1e3")
+m1e4 = EthDixLayer("m1e4")
+m1e5 = EthDixLayer("m1e5")
+m1e6 = EthDixLayer("m1e6")
-m2l1 = ShimEthDIF("m2l1")
+m2l1 = EthDixLayer("m2l1")
-m2e1 = ShimEthDIF("m2e1")
-m2e2 = ShimEthDIF("m2e2")
-m2e3 = ShimEthDIF("m2e3")
-m2e4 = ShimEthDIF("m2e4")
-m2e5 = ShimEthDIF("m2e5")
-m2e6 = ShimEthDIF("m2e6")
+m2e1 = EthDixLayer("m2e1")
+m2e2 = EthDixLayer("m2e2")
+m2e3 = EthDixLayer("m2e3")
+m2e4 = EthDixLayer("m2e4")
+m2e5 = EthDixLayer("m2e5")
+m2e6 = EthDixLayer("m2e6")
-m3e1 = ShimEthDIF("m3e1")
-m3e2 = ShimEthDIF("m3e2")
-m3e3 = ShimEthDIF("m3e3")
-m3e4 = ShimEthDIF("m3e4")
-m3e5 = ShimEthDIF("m3e5")
-m3e6 = ShimEthDIF("m3e6")
+m3e1 = EthDixLayer("m3e1")
+m3e2 = EthDixLayer("m3e2")
+m3e3 = EthDixLayer("m3e3")
+m3e4 = EthDixLayer("m3e4")
+m3e5 = EthDixLayer("m3e5")
+m3e6 = EthDixLayer("m3e6")
-m1c1 = ShimEthDIF("m1c1")
-m1c2 = ShimEthDIF("m1c2")
+m1c1 = EthDixLayer("m1c1")
+m1c2 = EthDixLayer("m1c2")
-m2c1 = ShimEthDIF("m2c1")
-m2c2 = ShimEthDIF("m2c2")
+m2c1 = EthDixLayer("m2c1")
+m2c2 = EthDixLayer("m2c2")
-m3c1 = ShimEthDIF("m3c1")
-m3c2 = ShimEthDIF("m3c2")
+m3c1 = EthDixLayer("m3c1")
+m3c2 = EthDixLayer("m3c2")
-c1e1 = ShimEthDIF("c1e1")
-c1e2 = ShimEthDIF("c1e2")
-c1e3 = ShimEthDIF("c1e3")
-c1e4 = ShimEthDIF("c1e4")
+c1e1 = EthDixLayer("c1e1")
+c1e2 = EthDixLayer("c1e2")
+c1e3 = EthDixLayer("c1e3")
+c1e4 = EthDixLayer("c1e4")
f1n1 = Node("f1n1",
- difs = [n1, f1, f1e3],
- dif_registrations = {f1 : [f1e3], n1: [f1]})
+ layers = [n1, f1, f1e3],
+ registrations = {f1 : [f1e3], n1: [f1]})
f1n2 = Node("f1n2",
- difs = [f1, f1e1, f1e2, f1e3, m1f1],
- dif_registrations = {f1: [f1e1, f1e2, f1e3, m1f1]})
+ layers = [f1, f1e1, f1e2, f1e3, m1f1],
+ registrations = {f1: [f1e1, f1e2, f1e3, m1f1]})
f1n3 = Node("f1n3",
- difs = [n1, f1, f1e1],
- dif_registrations = {f1: [f1e1], n1: [f1]})
+ layers = [n1, f1, f1e1],
+ registrations = {f1: [f1e1], n1: [f1]})
f1n4 = Node("f1n4",
- difs = [n1, f1, f1e2],
- dif_registrations = {f1: [f1e2], n1: [f1]})
+ layers = [n1, f1, f1e2],
+ registrations = {f1: [f1e2], n1: [f1]})
l1n1 = Node("l1n1",
- difs = [n1, l1, m2l1, l1e1],
- dif_registrations = {l1: [m2l1, l1e1], n1: [l1]})
+ layers = [n1, l1, m2l1, l1e1],
+ registrations = {l1: [m2l1, l1e1], n1: [l1]})
l1n2 = Node("l1n2",
- difs = [n1, l1, l1e1],
- dif_registrations = {l1: [l1e1], n1: [l1]})
+ layers = [n1, l1, l1e1],
+ registrations = {l1: [l1e1], n1: [l1]})
m1n1 = Node("m1n1",
- difs = [m1, m1e1, m1e6],
- dif_registrations = {m1: [m1e1, m1e6]})
+ layers = [m1, m1e1, m1e6],
+ registrations = {m1: [m1e1, m1e6]})
m1n2 = Node("m1n2",
- difs = [m1, m1e1, m1e2],
- dif_registrations = {m1: [m1e1, m1e2]})
+ layers = [m1, m1e1, m1e2],
+ registrations = {m1: [m1e1, m1e2]})
m1n3 = Node("m1n3",
- difs = [m1, m1e2, m1e3, m1c1],
- dif_registrations = {m1: [m1e2, m1e3, m1c1]})
+ layers = [m1, m1e2, m1e3, m1c1],
+ registrations = {m1: [m1e2, m1e3, m1c1]})
m1n4 = Node("m1n4",
- difs = [m1, m1e3, m1e4, m1c2],
- dif_registrations = {m1: [m1e3, m1e4, m1c2]})
+ layers = [m1, m1e3, m1e4, m1c2],
+ registrations = {m1: [m1e3, m1e4, m1c2]})
m1n5 = Node("m1n5",
- difs = [m1, m1e4, m1e5],
- dif_registrations = {m1: [m1e4, m1e5]})
+ layers = [m1, m1e4, m1e5],
+ registrations = {m1: [m1e4, m1e5]})
m1n6 = Node("m1n6",
- difs = [n1, m1, f1, m1e5, m1e6, m1f1],
- dif_registrations = {m1: [m1e5, m1e6],
+ layers = [n1, m1, f1, m1e5, m1e6, m1f1],
+ registrations = {m1: [m1e5, m1e6],
f1: [m1f1], n1: [f1, m1]})
m2n1 = Node("m2n1",
- difs = [m2, m2e1, m2e6],
- dif_registrations = {m2: [m2e1, m2e6]})
+ layers = [m2, m2e1, m2e6],
+ registrations = {m2: [m2e1, m2e6]})
m2n2 = Node("m2n2",
- difs = [m2, m2e1, m2e2],
- dif_registrations = {m2: [m2e1, m2e2]})
+ layers = [m2, m2e1, m2e2],
+ registrations = {m2: [m2e1, m2e2]})
m2n3 = Node("m2n3",
- difs = [m2, m2e2, m2e3, m2c1],
- dif_registrations = {m2: [m2e2, m2e3, m2c1]})
+ layers = [m2, m2e2, m2e3, m2c1],
+ registrations = {m2: [m2e2, m2e3, m2c1]})
m2n4 = Node("m2n4",
- difs = [m2, m2e3, m2e4, m2c2],
- dif_registrations = {m2: [m2e3, m2e4, m2c2]})
+ layers = [m2, m2e3, m2e4, m2c2],
+ registrations = {m2: [m2e3, m2e4, m2c2]})
m2n5 = Node("m2n5",
- difs = [m2, m2e4, m2e5],
- dif_registrations = {m2: [m2e4, m2e5]})
+ layers = [m2, m2e4, m2e5],
+ registrations = {m2: [m2e4, m2e5]})
m2n6 = Node("m2n6",
- difs = [n1, m2, l1, m2e5, m2e6, m2l1],
- dif_registrations = {m2: [m2e5, m2e6], l1: [m2l1], n1: [l1, m2]})
+ layers = [n1, m2, l1, m2e5, m2e6, m2l1],
+ registrations = {m2: [m2e5, m2e6], l1: [m2l1], n1: [l1, m2]})
m3n1 = Node("m3n1",
- difs = [m3, m3e1, m3e6],
- dif_registrations = {m3: [m3e1, m3e6]})
+ layers = [m3, m3e1, m3e6],
+ registrations = {m3: [m3e1, m3e6]})
m3n2 = Node("m3n2",
- difs = [m3, m3e1, m3e2],
- dif_registrations = {m3: [m3e1, m3e2]})
+ layers = [m3, m3e1, m3e2],
+ registrations = {m3: [m3e1, m3e2]})
m3n3 = Node("m3n3",
- difs = [m3, m3e2, m3e3, m3c1],
- dif_registrations = {m3: [m3e2, m3e3, m3c1]})
+ layers = [m3, m3e2, m3e3, m3c1],
+ registrations = {m3: [m3e2, m3e3, m3c1]})
m3n4 = Node("m3n4",
- difs = [m3, m3e3, m3e4, m3c2],
- dif_registrations = {m3: [m3e3, m3e4, m3c2]})
+ layers = [m3, m3e3, m3e4, m3c2],
+ registrations = {m3: [m3e3, m3e4, m3c2]})
m3n5 = Node("m3n5",
- difs = [m3, m3e4, m3e5],
- dif_registrations = {m3: [m3e4, m3e5]})
+ layers = [m3, m3e4, m3e5],
+ registrations = {m3: [m3e4, m3e5]})
m3n6 = Node("m3n6",
- difs = [m3, m3e5, m3e6],
- dif_registrations = {m3: [m3e5, m3e6]})
+ layers = [m3, m3e5, m3e6],
+ registrations = {m3: [m3e5, m3e6]})
c1n1 = Node("c1n1",
- difs = [n1, c1, m1, m2, m1c1, m2c1, c1e1, c1e4],
- dif_registrations = {c1: [c1e1, c1e4], m1: [c1, m1c1],
+ layers = [n1, c1, m1, m2, m1c1, m2c1, c1e1, c1e4],
+ registrations = {c1: [c1e1, c1e4], m1: [c1, m1c1],
m2: [c1, m2c1], n1: [m1, m2]})
c1n2 = Node("c1n2",
- difs = [n1, c1, m2, m3, m2c2, m3c1, c1e1, c1e2],
- dif_registrations = {c1: [c1e1, c1e2], m2: [c1, m2c2],
+ layers = [n1, c1, m2, m3, m2c2, m3c1, c1e1, c1e2],
+ registrations = {c1: [c1e1, c1e2], m2: [c1, m2c2],
m3: [c1, m3c1], n1: [m2, m3]})
c1n3 = Node("c1n3",
- difs = [n1, c1, m3, m3c2, c1e2, c1e3],
- dif_registrations = {c1: [c1e2, c1e3], m3: [c1, m3c2], n1: [m3]})
+ layers = [n1, c1, m3, m3c2, c1e2, c1e3],
+ registrations = {c1: [c1e2, c1e3], m3: [c1, m3c2], n1: [m3]})
c1n4 = Node("c1n4",
- difs = [n1, c1, m1, m1c2, c1e3, c1e4],
- dif_registrations = {c1: [c1e3, c1e4], m1: [c1, m1c2], n1: [m1]})
+ layers = [n1, c1, m1, m1c2, c1e3, c1e4],
+ registrations = {c1: [c1e3, c1e4], m1: [c1, m1c2], n1: [m1]})
tb = jfed.Testbed(exp_name = "arcfiret43",
proj_name = "rumba",
- cert_file = "/home/dstaesse/jfed/cert.pem",
+ cert_file = "/path/to/cert.pem",
authority = "exogeni.net",
- username = "dstaesse")
+ username = "username")
-exp = rl.Experiment(tb, nodes = [f1n1, f1n2, f1n3, f1n4,
+exp = our.Experiment(tb, nodes = [f1n1, f1n2, f1n3, f1n4,
l1n1, l1n2,
m1n1, m1n2, m1n3, m1n4, m1n5, m1n6,
m2n1, m2n2, m2n3, m2n4, m2n5, m2n6,
@@ -190,10 +185,10 @@ with ExperimentManager(exp, swap_out_strategy=PAUSE_SWAPOUT):
exp.swap_in()
exp.install_prototype()
exp.bootstrap_prototype()
- c1 = Client("rinaperf", options ="-i 10000 -s 1000 -c 0 -d overlay",
+ c1 = Client("operf", options ="-s 1000 -d 0",
nodes=[f1n1, f1n3, f1n4, l1n2])
- s1 = Server("rinaperf", arrival_rate=2, mean_duration=5,
- options = "-l -d overlay", nodes = [c1n1], clients = [c1])
+ s1 = Server("operf", arrival_rate=2, mean_duration=5,
+ options = "-l", nodes = [c1n1], clients = [c1])
sb = StoryBoard(experiment=exp, duration=3600, servers = [s1])
sb.generate_script()
sb.start()
diff --git a/examples/datacenter.py b/examples/datacenter.py
new file mode 100755
index 0000000..ab02a2a
--- /dev/null
+++ b/examples/datacenter.py
@@ -0,0 +1,78 @@
+from rumba.model import Node, UnicastLayer, EthDixLayer
+import rumba.log as log
+# import testbed plugins
+import rumba.testbeds.local as local
+from rumba.storyboard import *
+# import Ouroboros prototype plugin
+import rumba.prototypes.ouroboros as our
+
+
+__all__ = ["local_exp", "name_nodes", "start_net"]
+
+
+log.set_logging_level("DEBUG")
+
+
+def buildRack(nRack, numHosts=2):
+ rack = UnicastLayer(f"rack{nRack}")
+ cables, hosts = [], []
+
+ for n in range(numHosts):
+ cables.append(EthDixLayer(f"e{n}r{nRack}"))
+ hosts.append(
+ Node(
+ f"h{n}r{nRack}",
+ layers=[cables[-1], rack],
+ registrations={rack: [cables[-1]]},
+ )
+ )
+
+ ToR_switch = Node(
+ f"s{nRack}", layers=[*cables, rack], registrations={rack: cables}
+ )
+
+ return [*hosts, ToR_switch] # list of nodes, ToR_switch latest
+
+
+def build(numRacks=2, numHostsPerRack=2):
+ nodes, router_cables = [], []
+
+ for i in range(numRacks):
+ router_cables.append(EthDixLayer(f"router_{i}"))
+ nodes += buildRack(i, numHosts=numHostsPerRack)
+ nodes[-1].add_layer(router_cables[-1])
+ #nodes[-1].add_registration(router_cables[-1])
+
+ Datacenter_router = Node("router", layers=router_cables)
+
+ return [*nodes, Datacenter_router]
+
+
+nodes = build()
+
+name_nodes = list(map(lambda node: node.name, nodes))
+
+local_tb = local.Testbed()
+
+
+local_exp = our.Experiment(local_tb, nodes=nodes)
+
+
+def start_net():
+ local_exp.swap_in()
+ local_exp.install_prototype()
+ local_exp.bootstrap_prototype()
+
+
+def print_network():
+ local_exp.export_connectivity_graph("datacenter_physical.pdf")
+
+ for layer in local_exp.layer_ordering:
+ if not isinstance(layer, EthDixLayer):
+ local_exp.export_layer_graph(f"datacenter_layer_{layer.name}.pdf", layer)
+
+
+if __name__ == '__main__':
+ #start_net()
+ print_network()
+
diff --git a/examples/docker-ouroboros.py b/examples/docker-ouroboros.py
index ce30fdb..16f6f1d 100755
--- a/examples/docker-ouroboros.py
+++ b/examples/docker-ouroboros.py
@@ -4,6 +4,7 @@
from rumba.model import *
from rumba.utils import ExperimentManager
+from rumba.topologies import build_ring
# import testbed plugins
import rumba.testbeds.dockertb as docker
@@ -25,33 +26,13 @@ args = argparser.parse_args()
log.set_logging_level('DEBUG')
-n01 = NormalDIF("n01")
+n01 = UnicastLayer("n01")
if (args.nodes < 3):
print("The ouroboros must be longer than 2 nodes")
sys.exit(-1)
-nodes = []
-
-shim_prev = None
-for i in range(0, args.nodes):
- shim = ShimEthDIF("e" + str(i))
-
- if shim_prev == None and shim != None:
- node = Node("node" + str(i), difs = [n01, shim],
- dif_registrations = {n01 : [shim]})
- elif shim_prev != None and shim != None:
- node = Node("node" + str(i), difs = [n01, shim, shim_prev],
- dif_registrations = {n01 : [shim, shim_prev]})
- else:
- node = Node("node" + str(i), difs = [n01, shim_prev],
- dif_registrations = {n01 : [shim_prev]})
-
- shim_prev = shim
- nodes.append(node)
-
-nodes[0].add_dif(shim_prev)
-nodes[0].add_dif_registration(n01, shim_prev)
+nodes = build_ring(args.nodes, n01)
tb = docker.Testbed(exp_name = "ouroboros")
diff --git a/examples/example-script.rsb b/examples/example-script.rsb
index 1d49a66..495bf4c 100644
--- a/examples/example-script.rsb
+++ b/examples/example-script.rsb
@@ -35,11 +35,11 @@ echo2, 18 &ev4| $sb run_client_of $Server.server_b
# if no object ($ handle) is provided, the storyboard
# is assumed as the object
-14 | $Node.node_a set_link_state $ShimEthDIF.e1 'up'
+14 | $Node.node_a set_link_state $EthLayer.e1 'up'
-16 | $ShimEthDIF.e1 set_delay 30 10
+16 | $EthLayer.e1 set_delay 30 10
-28 | $ShimEthDIF.e1 set_loss 2
+28 | $EthLayer.e1 set_loss 2
diff --git a/examples/example.py b/examples/example.py
index 2887cd5..9febd6e 100755
--- a/examples/example.py
+++ b/examples/example.py
@@ -7,59 +7,42 @@ from rumba.utils import ExperimentManager
from rumba.storyboard import *
# import testbed plugins
-import rumba.testbeds.emulab as emulab
import rumba.testbeds.jfed as jfed
-import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import rumba.log as log
log.set_logging_level('DEBUG')
-n1 = NormalDIF("n1")
+n1 = UnicastLayer("n1")
n1.add_policy("rmt.pff", "lfa")
n1.add_policy("security-manager", "passwd")
-e1 = ShimEthDIF("e1")
+e1 = EthDixLayer("e1")
a = Node("a",
- difs=[n1, e1],
- dif_registrations={n1: [e1]})
+ layers=[n1, e1],
+ registrations={n1: [e1]})
b = Node("b",
- difs=[e1, n1],
- dif_registrations={n1: [e1]})
+ layers=[e1, n1],
+ registrations={n1: [e1]})
tb = jfed.Testbed(exp_name="example1",
username="user1",
cert_file="/home/user1/cert.pem")
-exp = rl.Experiment(tb, nodes=[a, b])
+exp = our.Experiment(tb, nodes=[a, b])
print(exp)
# General setup (can be reused in other scripts as-is)
storyboard = StoryBoard(duration=30)
-# Clients can be applications that just keep running, and will be
-# stopped by a SIGINT...
-client1 = Client("rinaperf",
- options="-t perf -s 1000 -c 0")
-
-# ... or a custom shutdown method can be provided.
-client2 = Client("rinaperf",
- options="-t perf -s 1000 -D <duration>",
- shutdown="")
-
-server = Server("rinaperf", options="-l", arrival_rate=0.5,
- mean_duration=5, clients=[client1, client2])
# Experiment-specific configuration:
diff --git a/examples/geant.py b/examples/geant.py
index 7fb59ad..720dd9e 100755
--- a/examples/geant.py
+++ b/examples/geant.py
@@ -4,16 +4,10 @@
from rumba.model import *
# import testbed plugins
-import rumba.testbeds.emulab as emulab
import rumba.testbeds.jfed as jfed
-import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
-import rumba.testbeds.dockertb as docker
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import rumba.log as log
@@ -26,55 +20,55 @@ import time
log.set_logging_level('DEBUG')
-n1 = NormalDIF("n1")
+n1 = UnicastLayer("n1")
n1.add_policy("routing", "lfa")
n1.add_policy("pff", "alternate")
-e1 = ShimEthDIF("e1")
-e2 = ShimEthDIF("e2")
-e3 = ShimEthDIF("e3")
-e4 = ShimEthDIF("e4")
-e5 = ShimEthDIF("e5")
-e6 = ShimEthDIF("e6")
-e7 = ShimEthDIF("e7")
-e8 = ShimEthDIF("e8")
-e9 = ShimEthDIF("e9")
-e10 = ShimEthDIF("e10")
-e11 = ShimEthDIF("e11")
-e12 = ShimEthDIF("e12")
-e13 = ShimEthDIF("e13")
-e14 = ShimEthDIF("e14")
-e15 = ShimEthDIF("e15")
-e16 = ShimEthDIF("e16")
-e17 = ShimEthDIF("e17")
-e18 = ShimEthDIF("e18")
-e19 = ShimEthDIF("e19")
-e20 = ShimEthDIF("e20")
-e21 = ShimEthDIF("e21")
-e22 = ShimEthDIF("e22")
-e23 = ShimEthDIF("e23")
-e24 = ShimEthDIF("e24")
-e25 = ShimEthDIF("e25")
-e26 = ShimEthDIF("e26")
-e27 = ShimEthDIF("e27")
-e28 = ShimEthDIF("e28")
-e29 = ShimEthDIF("e29")
-e30 = ShimEthDIF("e30")
-e31 = ShimEthDIF("e31")
-e32 = ShimEthDIF("e32")
-e33 = ShimEthDIF("e33")
-e34 = ShimEthDIF("e34")
-e35 = ShimEthDIF("e35")
-e36 = ShimEthDIF("e36")
-e37 = ShimEthDIF("e37")
-e38 = ShimEthDIF("e38")
-e39 = ShimEthDIF("e39")
-e40 = ShimEthDIF("e40")
-e41 = ShimEthDIF("e41")
-e42 = ShimEthDIF("e42")
-e43 = ShimEthDIF("e43")
-e44 = ShimEthDIF("e44")
+e1 = EthDixLayer("e1")
+e2 = EthDixLayer("e2")
+e3 = EthDixLayer("e3")
+e4 = EthDixLayer("e4")
+e5 = EthDixLayer("e5")
+e6 = EthDixLayer("e6")
+e7 = EthDixLayer("e7")
+e8 = EthDixLayer("e8")
+e9 = EthDixLayer("e9")
+e10 = EthDixLayer("e10")
+e11 = EthDixLayer("e11")
+e12 = EthDixLayer("e12")
+e13 = EthDixLayer("e13")
+e14 = EthDixLayer("e14")
+e15 = EthDixLayer("e15")
+e16 = EthDixLayer("e16")
+e17 = EthDixLayer("e17")
+e18 = EthDixLayer("e18")
+e19 = EthDixLayer("e19")
+e20 = EthDixLayer("e20")
+e21 = EthDixLayer("e21")
+e22 = EthDixLayer("e22")
+e23 = EthDixLayer("e23")
+e24 = EthDixLayer("e24")
+e25 = EthDixLayer("e25")
+e26 = EthDixLayer("e26")
+e27 = EthDixLayer("e27")
+e28 = EthDixLayer("e28")
+e29 = EthDixLayer("e29")
+e30 = EthDixLayer("e30")
+e31 = EthDixLayer("e31")
+e32 = EthDixLayer("e32")
+e33 = EthDixLayer("e33")
+e34 = EthDixLayer("e34")
+e35 = EthDixLayer("e35")
+e36 = EthDixLayer("e36")
+e37 = EthDixLayer("e37")
+e38 = EthDixLayer("e38")
+e39 = EthDixLayer("e39")
+e40 = EthDixLayer("e40")
+e41 = EthDixLayer("e41")
+e42 = EthDixLayer("e42")
+e43 = EthDixLayer("e43")
+e44 = EthDixLayer("e44")
layers = [e1, e2, e3, e4, e5, e6, e7, e8, e9, e10,
e11, e12, e13, e14, e15, e16, e17, e18, e19, e20,
@@ -83,130 +77,129 @@ layers = [e1, e2, e3, e4, e5, e6, e7, e8, e9, e10,
e41, e42, e43, e44]
lisbon = Node("lisbon",
- difs = [n1, e1, e2],
- dif_registrations = {n1: [e1,e2]})
+ layers = [n1, e1, e2],
+ registrations = {n1: [e1,e2]})
madrid = Node("madrid",
- difs = [n1, e1, e6, e9, e11],
- dif_registrations = {n1 : [e1, e6, e9, e11]})
+ layers = [n1, e1, e6, e9, e11],
+ registrations = {n1 : [e1, e6, e9, e11]})
london = Node("london",
- difs = [n1, e2, e3, e4, e5],
- dif_registrations = {n1 : [e2, e3, e4, e5]})
+ layers = [n1, e2, e3, e4, e5],
+ registrations = {n1 : [e2, e3, e4, e5]})
dublin = Node("dublin",
- difs = [n1, e3],
- dif_registrations = {n1 : [e3]})
+ layers = [n1, e3],
+ registrations = {n1 : [e3]})
paris = Node("paris",
- difs = [n1, e4, e6, e7, e8],
- dif_registrations = {n1 : [e4, e6, e7, e8]})
+ layers = [n1, e4, e6, e7, e8],
+ registrations = {n1 : [e4, e6, e7, e8]})
brussels = Node("brussels",
- difs = [n1, e5, e12],
- dif_registrations = {n1 : [e5, e12]})
+ layers = [n1, e5, e12],
+ registrations = {n1 : [e5, e12]})
luxemburg = Node("luxemburg",
- difs = [n1, e7, e16],
- dif_registrations = {n1 : [e7, e16]})
+ layers = [n1, e7, e16],
+ registrations = {n1 : [e7, e16]})
bern = Node("bern",
- difs = [n1, e8, e9, e10, e15],
- dif_registrations = {n1 : [e8, e9, e10, e15]})
+ layers = [n1, e8, e9, e10, e15],
+ registrations = {n1 : [e8, e9, e10, e15]})
roma = Node("roma",
- difs = [n1, e10, e11, e13, e34, e28],
- dif_registrations = {n1 : [e10, e11, e13, e34, e28]})
+ layers = [n1, e10, e11, e13, e34, e28],
+ registrations = {n1 : [e10, e11, e13, e34, e28]})
amsterdam = Node("amsterdam",
- difs = [n1, e12, e14, e17, e18],
- dif_registrations = {n1 : [e12, e14, e17, e18]})
+ layers = [n1, e12, e14, e17, e18],
+ registrations = {n1 : [e12, e14, e17, e18]})
valleta = Node("valleta",
- difs = [n1, e13, e14],
- dif_registrations = {n1 : [e13, e14]})
+ layers = [n1, e13, e14],
+ registrations = {n1 : [e13, e14]})
berlin = Node("berlin",
- difs = [n1, e15, e16, e17, e30, e31],
- dif_registrations = {n1 : [e15, e16, e17, e30, e31]})
+ layers = [n1, e15, e16, e17, e30, e31],
+ registrations = {n1 : [e15, e16, e17, e30, e31]})
copenhagen = Node("copenhagen",
- difs = [n1, e18, e20, e22, e24, e19],
- dif_registrations = {n1 : [e18, e20, e22, e24, e19]})
+ layers = [n1, e18, e20, e22, e24, e19],
+ registrations = {n1 : [e18, e20, e22, e24, e19]})
oslo = Node("oslo",
- difs = [n1, e20, e21],
- dif_registrations = {n1 : [e20, e21]})
+ layers = [n1, e20, e21],
+ registrations = {n1 : [e20, e21]})
stockholm = Node("stockholm",
- difs = [n1, e21, e22],
- dif_registrations = {n1 : [e21, e22]})
+ layers = [n1, e21, e22],
+ registrations = {n1 : [e21, e22]})
tallin = Node("tallin",
- difs = [n1, e24, e25],
- dif_registrations = {n1 : [e24, e25]})
+ layers = [n1, e24, e25],
+ registrations = {n1 : [e24, e25]})
riga = Node("riga",
- difs = [n1, e25, e26],
- dif_registrations = {n1 : [e25, e26]})
+ layers = [n1, e25, e26],
+ registrations = {n1 : [e25, e26]})
vilnius = Node("vilnius",
- difs = [n1, e26, e27],
- dif_registrations = {n1 : [e26, e27]})
+ layers = [n1, e26, e27],
+ registrations = {n1 : [e26, e27]})
warsaw = Node("warsaw",
- difs = [n1, e27, e29],
- dif_registrations = {n1 : [e27, e29]})
+ layers = [n1, e27, e29],
+ registrations = {n1 : [e27, e29]})
praha = Node("praha",
- difs = [n1, e29, e30, e32],
- dif_registrations = {n1 : [e29, e30, e32]})
+ layers = [n1, e29, e30, e32],
+ registrations = {n1 : [e29, e30, e32]})
viena = Node("viena",
- difs = [n1, e32, e33, e35, e39, e28],
- dif_registrations = {n1 : [e32, e33, e35, e39, e28]})
+ layers = [n1, e32, e33, e35, e39, e28],
+ registrations = {n1 : [e32, e33, e35, e39, e28]})
budapest = Node("budapest",
- difs = [n1, e33, e37, e38, e43],
- dif_registrations = {n1 : [e33, e37, e38, e43]})
+ layers = [n1, e33, e37, e38, e43],
+ registrations = {n1 : [e33, e37, e38, e43]})
athens = Node("athens",
- difs = [n1, e39, e40, e44],
- dif_registrations = {n1 : [e39, e40, e44]})
+ layers = [n1, e39, e40, e44],
+ registrations = {n1 : [e39, e40, e44]})
ljubljana = Node("ljubljana",
- difs = [n1, e35, e36],
- dif_registrations = {n1 : [e35, e36]})
+ layers = [n1, e35, e36],
+ registrations = {n1 : [e35, e36]})
zagreb = Node("zagreb",
- difs = [n1, e36, e37],
- dif_registrations = {n1 : [e36, e37]})
+ layers = [n1, e36, e37],
+ registrations = {n1 : [e36, e37]})
sofia = Node("sofia",
- difs = [n1, e38, e40, e42, e23],
- dif_registrations = {n1 : [e38, e40, e42, e23]})
+ layers = [n1, e38, e40, e42, e23],
+ registrations = {n1 : [e38, e40, e42, e23]})
bucharest = Node("bucharest",
- difs = [n1, e42, e43, e41],
- dif_registrations = {n1 : [e42, e43, e41]})
+ layers = [n1, e42, e43, e41],
+ registrations = {n1 : [e42, e43, e41]})
nicosia = Node("nicosia",
- difs = [n1, e44, e34],
- dif_registrations = {n1 : [e44, e34]})
+ layers = [n1, e44, e34],
+ registrations = {n1 : [e44, e34]})
ankara = Node("ankara",
- difs = [n1, e23, e41],
- dif_registrations = {n1 : [e23, e41]})
+ layers = [n1, e23, e41],
+ registrations = {n1 : [e23, e41]})
moscow = Node("moscow",
- difs = [n1, e31, e19],
- dif_registrations = {n1 : [e31, e19]})
+ layers = [n1, e31, e19],
+ registrations = {n1 : [e31, e19]})
tb = jfed.Testbed(exp_name = 'geant8',
- cert_file = '/home/sander/cert.pem',
+ cert_file = '/path/to/cert.pem',
authority = 'wall1.ilabt.iminds.be',
-# authority = 'exogeni.net:umassvmsite',
- username = 'sander',
+ username = 'username',
exp_hours = '200')
nodes = [lisbon, madrid, london, paris, dublin,
@@ -217,7 +210,7 @@ nodes = [lisbon, madrid, london, paris, dublin,
bucharest, nicosia, ankara, moscow]
exp = our.Experiment(tb, nodes=nodes,
- git_repo='https://bitbucket.org/sandervrijders/ouroboros.git',
+ git_repo='https://codeberg.org/o7s/ouroboros',
git_branch='rand3')
@@ -241,7 +234,7 @@ with ExperimentManager(exp, swap_out_strategy=AUTO_SWAPOUT):
arrival_rate=0.01,
mean_duration=duration,
s_id='oping_' + node.name,
- difs=n1
+ layers=n1
)
sb.add_server_on_node(s, node)
@@ -294,9 +287,9 @@ with ExperimentManager(exp, swap_out_strategy=AUTO_SWAPOUT):
prefix = layer.name + '_' + str(i)
sb.schedule_export_lsdb_total(390, prefix + '_lsdb.csv', n1)
- sb.schedule_export_dif_bandwidth(410, prefix + '_1.csv', n1)
- sb.schedule_export_dif_bandwidth(510, prefix + '_2.csv', n1)
- sb.schedule_export_dif_bandwidth(610, prefix + '_3.csv', n1)
- sb.schedule_export_dif_bandwidth(710, prefix + '_4.csv', n1)
+ sb.schedule_export_layer_bandwidth(410, prefix + '_1.csv', n1)
+ sb.schedule_export_layer_bandwidth(510, prefix + '_2.csv', n1)
+ sb.schedule_export_layer_bandwidth(610, prefix + '_3.csv', n1)
+ sb.schedule_export_layer_bandwidth(710, prefix + '_4.csv', n1)
sb.start()
diff --git a/examples/isps.py b/examples/isps.py
index 62a17ad..335c43b 100755
--- a/examples/isps.py
+++ b/examples/isps.py
@@ -15,23 +15,23 @@ import time
log.set_logging_level('DEBUG')
-n0 = NormalDIF("n0")
+n0 = UnicastLayer("n0")
-n1 = NormalDIF("n1")
+n1 = UnicastLayer("n1")
-n2 = NormalDIF("n2")
+n2 = UnicastLayer("n2")
n2.add_policy("routing", "lfa")
n2.add_policy("pff", "alternate")
-e0 = ShimEthDIF("e0")
-e1 = ShimEthDIF("e1")
-e2 = ShimEthDIF("e2")
-e3 = ShimEthDIF("e3")
-e4 = ShimEthDIF("e4")
-e5 = ShimEthDIF("e5")
-e6 = ShimEthDIF("e6")
-e7 = ShimEthDIF("e7")
-e8 = ShimEthDIF("e8")
+e0 = EthDixLayer("e0")
+e1 = EthDixLayer("e1")
+e2 = EthDixLayer("e2")
+e3 = EthDixLayer("e3")
+e4 = EthDixLayer("e4")
+e5 = EthDixLayer("e5")
+e6 = EthDixLayer("e6")
+e7 = EthDixLayer("e7")
+e8 = EthDixLayer("e8")
es = [e0, e1, e2, e3, e4, e5, e6, e7, e8]
@@ -39,50 +39,50 @@ for e in es:
e.set_delay(5)
end0 = Node("end0",
- difs = [e0, e8, n2],
- dif_registrations = {n2: [e0, e8]})
+ layers = [e0, e8, n2],
+ registrations = {n2: [e0, e8]})
end1 = Node("end1",
- difs = [e4, e5, n2],
- dif_registrations = {n2: [e4, e5]})
+ layers = [e4, e5, n2],
+ registrations = {n2: [e4, e5]})
isp10 = Node("isp10",
- difs = [e0, e1, n2, n1],
- dif_registrations = {n2: [e0, n1], n1: [e1]})
+ layers = [e0, e1, n2, n1],
+ registrations = {n2: [e0, n1], n1: [e1]})
isp11 = Node("isp11",
- difs = [e1, e2, n1],
- dif_registrations = {n1: [e1, e2]})
+ layers = [e1, e2, n1],
+ registrations = {n1: [e1, e2]})
isp12 = Node("isp12",
- difs = [e2, e3, n1],
- dif_registrations = {n1: [e2, e3]})
+ layers = [e2, e3, n1],
+ registrations = {n1: [e2, e3]})
isp13 = Node("isp13",
- difs = [e3, e4, n2, n1],
- dif_registrations = {n2: [e4, n1], n1: [e3]})
+ layers = [e3, e4, n2, n1],
+ registrations = {n2: [e4, n1], n1: [e3]})
isp00 = Node("isp00",
- difs = [e8, e7, n2, n0],
- dif_registrations = {n2: [e8, n0], n0: [e7]})
+ layers = [e8, e7, n2, n0],
+ registrations = {n2: [e8, n0], n0: [e7]})
isp01 = Node("isp01",
- difs = [e7, e6, n0],
- dif_registrations = {n0: [e7, e6]})
+ layers = [e7, e6, n0],
+ registrations = {n0: [e7, e6]})
isp02 = Node("isp02",
- difs = [e6, e5, n2, n0],
- dif_registrations = {n2: [e5, n0], n0: [e6]})
+ layers = [e6, e5, n2, n0],
+ registrations = {n2: [e5, n0], n0: [e6]})
tb = jfed.Testbed(exp_name = 'case3',
- cert_file = '/home/sander/cert.pem',
- username = 'sander',
+ cert_file = '/path/to/cert.pem',
+ username = 'username',
exp_hours = '1')
nodes = [end0, end1, isp10, isp11, isp12, isp13, isp00, isp01, isp02]
exp = our.Experiment(tb, nodes=nodes,
- git_repo='https://bitbucket.org/sandervrijders/ouroboros.git',
+ git_repo='https://codeberg.org/o7s/ouroboros',
git_branch='rand3')
duration = 120
@@ -97,7 +97,7 @@ s = Server(
arrival_rate=0.01,
mean_duration=duration + 4,
s_id='oping',
- difs=n2
+ layers=n2
)
sb.add_server_on_node(s, end1)
diff --git a/examples/jfed-rlite.py b/examples/jfed-rlite.py
deleted file mode 100755
index 5cc087f..0000000
--- a/examples/jfed-rlite.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-
-from rumba.model import *
-from rumba.utils import ExperimentManager
-
-import rumba.testbeds.jfed as jfed
-import rumba.prototypes.rlite as rlite
-
-import rumba.log as log
-
-import argparse
-
-
-description = "Script to run rlite on jfed"
-epilog = "2017 H2020 ARCFIRE"
-
-argparser = argparse.ArgumentParser(description = description,
- epilog = epilog)
-argparser.add_argument('--user', type = str, default = 'vmaffio',
- help = "jFed username")
-argparser.add_argument('--cert', type = str,
- help = "Absolute path to certificate (.pem) file"
- " to be used with jFed",
- default = '/home/vmaffione/Downloads/vmaffio-jfed.pem')
-argparser.add_argument('--expname', type = str, default = 'pinocchio',
- help = "Name of the experiment within the jFed testbed")
-
-args = argparser.parse_args()
-
-log.set_logging_level('DEBUG')
-
-n1 = NormalDIF("n1")
-
-e1 = ShimEthDIF("e1")
-
-a = Node("a",
- difs = [n1, e1],
- dif_registrations = {n1 : [e1]})
-
-b = Node("b",
- difs = [e1, n1],
- dif_registrations = {n1 : [e1]})
-
-tb = jfed.Testbed(exp_name = args.expname,
- cert_file = args.cert,
- username = args.user)
-
-exp = rlite.Experiment(tb, nodes = [a, b])
-
-with ExperimentManager(exp):
- exp.swap_in()
- exp.install_prototype()
- exp.bootstrap_prototype()
diff --git a/examples/mouse.py b/examples/mouse.py
index d80da28..38be6e0 100755
--- a/examples/mouse.py
+++ b/examples/mouse.py
@@ -3,107 +3,106 @@
# An example script using the rumba package
from rumba.model import *
-from rumba.utils import ExperimentManager
+from rumba.utils import ExperimentManager, PROMPT_SWAPOUT
# import testbed plugins
-import rumba.testbeds.emulab as emulab
-import rumba.testbeds.jfed as jfed
import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import rumba.log as log
+from rumba.visualizer import draw_network, get_network_from_rumba_experiment
+
log.set_logging_level('DEBUG')
-n01 = NormalDIF("n01")
+n01 = UnicastLayer("n01")
-e01 = ShimEthDIF("e01")
-e02 = ShimEthDIF("e02")
-e03 = ShimEthDIF("e03")
-e04 = ShimEthDIF("e04")
-e05 = ShimEthDIF("e05")
-e06 = ShimEthDIF("e06")
-e07 = ShimEthDIF("e07")
-e08 = ShimEthDIF("e08")
-e09 = ShimEthDIF("e09")
-e10 = ShimEthDIF("e10")
-e11 = ShimEthDIF("e11")
-e12 = ShimEthDIF("e12")
-e13 = ShimEthDIF("e13")
-e14 = ShimEthDIF("e14")
-e15 = ShimEthDIF("e15")
-e16 = ShimEthDIF("e16")
-e17 = ShimEthDIF("e17")
+e01 = EthDixLayer("e01")
+e02 = EthDixLayer("e02")
+e03 = EthDixLayer("e03")
+e04 = EthDixLayer("e04")
+e05 = EthDixLayer("e05")
+e06 = EthDixLayer("e06")
+e07 = EthDixLayer("e07")
+e08 = EthDixLayer("e08")
+e09 = EthDixLayer("e09")
+e10 = EthDixLayer("e10")
+e11 = EthDixLayer("e11")
+e12 = EthDixLayer("e12")
+e13 = EthDixLayer("e13")
+e14 = EthDixLayer("e14")
+e15 = EthDixLayer("e15")
+e16 = EthDixLayer("e16")
+e17 = EthDixLayer("e17")
a = Node("a",
- difs = [n01, e01, e06, e13 ],
- dif_registrations = {n01 : [e01, e06, e13]})
+ layers = [n01, e01, e06, e13 ],
+ registrations = {n01 : [e01, e06, e13]})
b = Node("b",
- difs = [n01, e01, e02, e04],
- dif_registrations = {n01 : [e01, e02, e04]})
+ layers = [n01, e01, e02, e04],
+ registrations = {n01 : [e01, e02, e04]})
c = Node("c",
- difs = [n01, e02, e03],
- dif_registrations = {n01 : [e02, e03]})
+ layers = [n01, e02, e03],
+ registrations = {n01 : [e02, e03]})
d = Node("d",
- difs = [n01, e03, e04, e05],
- dif_registrations = {n01 : [e03, e04, e05]})
+ layers = [n01, e03, e04, e05],
+ registrations = {n01 : [e03, e04, e05]})
e = Node("e",
- difs = [n01, e05, e06, e07],
- dif_registrations = {n01 : [e05, e06, e07]})
+ layers = [n01, e05, e06, e07],
+ registrations = {n01 : [e05, e06, e07]})
f = Node("f",
- difs = [n01, e07, e08],
- dif_registrations = {n01 : [e07, e08]})
+ layers = [n01, e07, e08],
+ registrations = {n01 : [e07, e08]})
g = Node("g",
- difs = [n01, e08, e09, e14],
- dif_registrations = {n01 : [e08, e09, e14]})
+ layers = [n01, e08, e09, e14],
+ registrations = {n01 : [e08, e09, e14]})
h = Node("h",
- difs = [n01, e09, e10, e15],
- dif_registrations = {n01 : [e09, e10, e15]})
+ layers = [n01, e09, e10, e15],
+ registrations = {n01 : [e09, e10, e15]})
i = Node("i",
- difs = [n01, e10, e11, e16],
- dif_registrations = {n01 : [e10, e11, e16]})
+ layers = [n01, e10, e11, e16],
+ registrations = {n01 : [e10, e11, e16]})
j = Node("j",
- difs = [n01, e11, e12],
- dif_registrations = {n01 : [e11, e12]})
+ layers = [n01, e11, e12],
+ registrations = {n01 : [e11, e12]})
k = Node("k",
- difs = [n01, e12, e13],
- dif_registrations = {n01 : [e12, e13]})
+ layers = [n01, e12, e13],
+ registrations = {n01 : [e12, e13]})
l = Node("l",
- difs = [n01, e14, e15],
- dif_registrations = {n01 : [e14, e15]})
+ layers = [n01, e14, e15],
+ registrations = {n01 : [e14, e15]})
m = Node("m",
- difs = [n01, e16, e17],
- dif_registrations = {n01 : [e16, e17]})
+ layers = [n01, e16, e17],
+ registrations = {n01 : [e16, e17]})
n = Node("n",
- difs = [n01, e17],
- dif_registrations = {n01 : [e17]})
+ layers = [n01, e17],
+ registrations = {n01 : [e17]})
-tb = qemu.Testbed(exp_name = "mouse2")
+tb = local.Testbed(exp_name = "mouse2")
-exp = rl.Experiment(tb, nodes = [a, b, c, d, e, f, g, h, i, j, k, l, m, n])
+exp = our.Experiment(tb, nodes = [a, b, c, d, e, f, g, h, i, j, k, l, m, n])
print(exp)
-with ExperimentManager(exp):
+with ExperimentManager(exp, swap_out_strategy=PROMPT_SWAPOUT):
+ nw = get_network_from_rumba_experiment(exp)
+ draw_network(nw)
exp.swap_in()
exp.bootstrap_prototype()
diff --git a/examples/ouroboros-layer-example.py b/examples/ouroboros-layer-example.py
new file mode 100644
index 0000000..310a204
--- /dev/null
+++ b/examples/ouroboros-layer-example.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+
+"""
+Example using the Ouroboros-aligned layer-centric API.
+
+Shows the naming conventions: Layer, UnicastLayer, EthDixLayer, etc.
+"""
+
+from rumba.model import *
+from rumba.utils import ExperimentManager
+
+# import testbed plugins
+import rumba.testbeds.local as local
+
+# import prototype plugins
+import rumba.prototypes.ouroboros as our
+
+import rumba.log as log
+
+log.set_logging_level('DEBUG')
+
+# -----------------------------------------------------------------------
+# Layer-centric syntax
+# -----------------------------------------------------------------------
+
+# Define layers
+top = UnicastLayer("top")
+mid = UnicastLayer("mid")
+top.add_policy("rmt.pff", "lfa")
+
+# Ethernet layers model point-to-point links
+e1 = EthDixLayer("e1")
+e2 = EthDixLayer("e2")
+e3 = EthDixLayer("e3")
+
+# Define nodes and their layer memberships + registrations
+a = Node("a",
+ layers=[top, mid, e1, e2],
+ registrations={mid: [e1, e2],
+ top: [mid]})
+
+b = Node("b",
+ layers=[mid, e1, e3],
+ registrations={mid: [e1, e3],
+ })
+
+c = Node("c",
+ layers=[top, mid, e2, e3],
+ registrations={mid: [e2, e3],
+ top: [mid]})
+
+# Create testbed and experiment
+tb = local.Testbed(exp_name="layer-example")
+exp = our.Experiment(tb, nodes=[a, b, c])
+
+print(exp)
+
+# Use properties from the API
+for layer in exp.layer_ordering:
+ print("Layer: %s (type=%s, is_eth=%s, is_shim=%s)" % (
+ layer.name, layer.layer_type.value, layer.is_eth, layer.is_shim))
+
+with ExperimentManager(exp):
+ exp.swap_in()
+ exp.install_prototype()
+ exp.bootstrap_prototype()
diff --git a/examples/rumba_example.py b/examples/rumba_example.py
new file mode 100755
index 0000000..2027ffa
--- /dev/null
+++ b/examples/rumba_example.py
@@ -0,0 +1,23 @@
+from rumba.model import Node, UnicastLayer, EthDixLayer
+from rumba.topologies import build_star
+
+# import testbed plugins
+import rumba.testbeds.local as local
+
+# import Ouroboros prototype plugin
+import rumba.prototypes.ouroboros as our
+
+__all__ = ["exp", "nodes"]
+
+n1 = UnicastLayer("n1")
+
+leaves, routerNode = build_star(
+ ["client1", "client2", "server"], n1, hub_name="router")
+clientNode1, clientNode2, serverNode = leaves
+
+nodes = ["client1", "client2", "router", "server"]
+
+tb = local.Testbed()
+exp = our.Experiment(tb,
+ nodes=[clientNode1, clientNode2,
+ routerNode, serverNode])
diff --git a/examples/scalingtime.py b/examples/scalingtime.py
index 920553c..9490b4f 100755
--- a/examples/scalingtime.py
+++ b/examples/scalingtime.py
@@ -1,23 +1,19 @@
-#!/usr/bin/env python
-
from rumba.model import *
from rumba.utils import *
# import testbed plugins
import rumba.testbeds.emulab as emulab
import rumba.testbeds.jfed as jfed
-import rumba.testbeds.qemu as qemu
import rumba.testbeds.local as local
import rumba.testbeds.dockertb as docker
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import argparse
+import json
-from rumba.visualizer import draw_experiment
+from rumba.visualizer import draw_network, get_network_from_rumba_experiment
description = "Script to create the demo from the Rumba paper"
@@ -41,29 +37,16 @@ argparser.add_argument('--swapout', type=SwapOutStrategy.from_string,
default=PROMPT_SWAPOUT,
choices=list(SwapOutStrategy),
help='What action to perform on swap-out')
-argparser.add_argument('--prototype', type=str, required=True,
- choices=['irati', 'ouroboros', 'rlite'],
- help='The kind of prototype plugin to use to run'
- ' the experiment.')
+argparser.add_argument('--visualize', action="store_true",
+ help='Draw a representation of the network')
+
subparsers = argparser.add_subparsers(dest='testbed')
emulab_p = subparsers.add_parser('emulab', help='Use emulab testbed')
jfed_p = subparsers.add_parser('jfed', help='Use jfed testbed')
-qemu_p = subparsers.add_parser('qemu', help='Use qemu testbed')
local_p = subparsers.add_parser('local', help='Use local testbed')
docker_p = subparsers.add_parser('docker', help='Use Docker testbed')
-qemu_p.add_argument('--bzimage', metavar='BZIMAGE', type=str,
- help='path to the bzImage file to use')
-qemu_p.add_argument('--initramfs', metavar='INITRAMFS', type=str,
- help='path to the initramfs file to use')
-qemu_p.add_argument('--use_vhost', action='store_true',
- default=False, help='Use vhost')
-qemu_p.add_argument('--qemu_logs_dir', metavar='QEMU_LOGS', type=str,
- default=None, help='path to the folder for qemu logs')
-qemu_p.add_argument('--username', type=str, help="Username")
-qemu_p.add_argument('--password', type=str, help="Password")
-
emulab_p.add_argument('--url', metavar='URL', type=str,
default="wall2.ilabt.iminds.be",
help='Url')
@@ -102,91 +85,90 @@ args = argparser.parse_args()
log.set_logging_level(args.verbosity)
-pi = NormalDIF("pi")
-pi.dt_strategy = 'minimal'
+pi = UnicastLayer("pi")
-c = NormalDIF("core")
+c = UnicastLayer("core")
nodes = []
core_nodes = []
for i in range(0, args.metro_networks):
- m = NormalDIF("m-" + str(i))
+ m = UnicastLayer("m-" + str(i))
e_prev = None
m1 = None
mn = None
for j in range(0, args.metro_nodes):
- if j is not (args.metro_nodes - 1):
- e = ShimEthDIF("e-" + str(i) + "-" + str(j))
+ if j != (args.metro_nodes - 1):
+ e = EthDixLayer("e-" + str(i) + "-" + str(j))
else:
e = None
if e_prev is None and e is not None:
node = Node("metro-" + str(i) + "-" + str(j),
- difs=[m, pi, e],
- dif_registrations={pi: [m], m: [e]})
+ layers=[m, pi, e],
+ registrations={pi: [m], m: [e]})
m1 = node
elif e_prev is not None and e is not None:
node = Node("metro-" + str(i) + "-" + str(j),
- difs=[m, pi, e, e_prev],
- dif_registrations={pi: [m], m: [e, e_prev]})
+ layers=[m, pi, e, e_prev],
+ registrations={pi: [m], m: [e, e_prev]})
else:
node = Node("metro-" + str(i) + "-" + str(j),
- difs=[m, pi, e_prev],
- dif_registrations={pi: [m], m: [e_prev]})
+ layers=[m, pi, e_prev],
+ registrations={pi: [m], m: [e_prev]})
mn = node
nodes.append(node)
e_prev = e
# Create nodes attached to metro
for k in range(0, args.end_nodes):
- ee = ShimEthDIF("e-" + str(i) + "-" + str(j) + "-" + str(k))
+ ee = EthDixLayer("e-" + str(i) + "-" + str(j) + "-" + str(k))
end_node = Node("end-" + str(i) + "-" + str(j) + "-" + str(k),
- difs=[pi, ee],
- dif_registrations={pi: [ee]})
- node.add_dif(ee)
- node.add_dif_registration(pi, ee)
+ layers=[pi, ee],
+ registrations={pi: [ee]})
+ node.add_layer(ee)
+ node.add_registration(pi, ee)
nodes.append(end_node)
- e = ShimEthDIF("e-" + str(i) + "-" + str(args.metro_nodes))
- m1.add_dif(e)
- m1.add_dif_registration(m, e)
- mn.add_dif(e)
- mn.add_dif_registration(m, e)
+ e = EthDixLayer("e-" + str(i) + "-" + str(args.metro_nodes))
+ m1.add_layer(e)
+ m1.add_registration(m, e)
+ mn.add_layer(e)
+ mn.add_registration(m, e)
# Add 2 links from metro to core
- e0 = ShimEthDIF("c-e-" + str(i) + "-0")
- e1 = ShimEthDIF("c-e-" + str(i) + "-1")
- e2 = ShimEthDIF("c-e-" + str(i) + "-2")
+ e0 = EthDixLayer("c-e-" + str(i) + "-0")
+ e1 = EthDixLayer("c-e-" + str(i) + "-1")
+ e2 = EthDixLayer("c-e-" + str(i) + "-2")
c1 = Node("c-" + str(i) + "-0",
- difs=[c, m, pi, e0, e2],
- dif_registrations={pi: [m, c], m: [e0], c: [e2]})
+ layers=[c, m, pi, e0, e2],
+ registrations={pi: [m, c], m: [e0], c: [e2]})
c2 = Node("c-" + str(i) + "-1",
- difs=[c, m, pi, e1, e2],
- dif_registrations={pi: [m, c], m: [e1], c: [e2]})
+ layers=[c, m, pi, e1, e2],
+ registrations={pi: [m, c], m: [e1], c: [e2]})
nodes.append(c1)
nodes.append(c2)
- m1.add_dif(e0)
- m1.add_dif_registration(m, e0)
- mn.add_dif(e1)
- mn.add_dif_registration(m, e1)
+ m1.add_layer(e0)
+ m1.add_registration(m, e0)
+ mn.add_layer(e1)
+ mn.add_registration(m, e1)
for x in range(0, len(core_nodes), 2):
- ce0 = ShimEthDIF("c-c-e-" + str(i) + "-" + str(x))
- ce1 = ShimEthDIF("c-c-e-" + str(i) + "-" + str(x + 1))
+ ce0 = EthDixLayer("c-c-e-" + str(i) + "-" + str(x))
+ ce1 = EthDixLayer("c-c-e-" + str(i) + "-" + str(x + 1))
- core_nodes[x].add_dif(ce0)
- core_nodes[x].add_dif_registration(c, ce0)
- core_nodes[x + 1].add_dif(ce1)
- core_nodes[x + 1].add_dif_registration(c, ce1)
+ core_nodes[x].add_layer(ce0)
+ core_nodes[x].add_registration(c, ce0)
+ core_nodes[x + 1].add_layer(ce1)
+ core_nodes[x + 1].add_registration(c, ce1)
- c1.add_dif(ce0)
- c1.add_dif_registration(c, ce0)
- c2.add_dif(ce1)
- c2.add_dif_registration(c, ce1)
+ c1.add_layer(ce0)
+ c1.add_registration(c, ce0)
+ c2.add_layer(ce1)
+ c2.add_registration(c, ce1)
core_nodes.append(c1)
core_nodes.append(c2)
@@ -203,12 +185,6 @@ elif args.testbed == 'jfed':
for a in jfed_p._actions
if a.dest != 'help'
and getattr(args, a.dest) is not None}
-elif args.testbed == 'qemu':
- test_class = qemu.Testbed
- testbed_args = {a.dest: getattr(args, a.dest)
- for a in qemu_p._actions
- if a.dest != 'help'
- and getattr(args, a.dest) is not None}
elif args.testbed == 'local':
test_class = local.Testbed
testbed_args = {a.dest: getattr(args, a.dest)
@@ -228,25 +204,18 @@ elif args.testbed is None:
testbed = test_class(**testbed_args)
-if args.prototype == 'irati':
- exp_class = irati.Experiment
-elif args.prototype == 'ouroboros':
- exp_class = our.Experiment
-elif args.prototype == 'rlite':
- exp_class = rl.Experiment
-else:
- print('Unexpected prototype!')
- print(argparser.format_help())
- exit(1)
+exp_class = our.Experiment
exp = exp_class(testbed, nodes=nodes)
if __name__ == "__main__":
- draw_experiment(exp)
+
+ if args.visualize:
+ nw = get_network_from_rumba_experiment(exp)
+ draw_network(nw)
with ExperimentManager(exp, swap_out_strategy=args.swapout) as expM:
exp.swap_in()
if not isinstance(testbed, docker.Testbed) \
- and not isinstance(testbed, qemu.Testbed) \
and not isinstance(testbed, local.Testbed):
exp.install_prototype()
exp.bootstrap_prototype()
diff --git a/examples/script-example.py b/examples/script-example.py
index 6cfaf42..e99ce78 100755
--- a/examples/script-example.py
+++ b/examples/script-example.py
@@ -6,59 +6,57 @@ from functools import partial
from rumba.storyboard import *
from rumba.model import *
import rumba.log as log
-import rumba.testbeds.qemu as qemu
-import rumba.prototypes.rlite as rl
+import rumba.testbeds.local as local
+import rumba.prototypes.ouroboros as our
from rumba.utils import ExperimentManager
import rumba.utils as utils
log.set_logging_level(log.DEBUG)
-n1 = NormalDIF("n1")
+n1 = UnicastLayer("n1")
n1.add_policy("rmt.pff", "lfa")
n1.add_policy("security-manager", "passwd")
-e1 = ShimEthDIF("e1")
+e1 = EthDixLayer("e1")
node_a = Node("node_a",
- difs=[n1, e1],
- dif_registrations={n1: [e1]})
+ layers=[n1, e1],
+ registrations={n1: [e1]})
node_b = Node("node_b",
- difs=[e1, n1],
- dif_registrations={n1: [e1]})
+ layers=[e1, n1],
+ registrations={n1: [e1]})
-tb = qemu.Testbed(exp_name="script_test",
- username="root",
- password="root")
+tb = local.Testbed(exp_name="script_test")
-exp = rl.Experiment(tb, nodes=[node_a, node_b])
+exp = our.Experiment(tb, nodes=[node_a, node_b])
client_a = Client(
- "rinaperf",
- options="-t perf -s 1000 -D <duration>",
+ "operf",
+ options="-d <duration> -s 1000",
shutdown="",
- c_id='rinaperf_a'
+ c_id='operf_a'
)
client_b = Client(
- "rinaperf",
- options="-t perf -s 1000 -D <duration> -z rinaperfb",
+ "operf",
+ options="-d <duration> -s 1000 -n operfb",
shutdown="",
- c_id='rinaperf_b'
+ c_id='operf_b'
)
client_c = Client(
- "rinaperf",
- options="-t perf -s 1000 -D <duration> -z rinaperfc",
+ "operf",
+ options="-d <duration> -s 1000 -n operfc",
shutdown="",
- c_id='rinaperf_c'
+ c_id='operf_c'
)
server_a = Server(
- "rinaperf",
+ "operf",
options="-l",
arrival_rate=1,
mean_duration=5,
@@ -67,8 +65,8 @@ server_a = Server(
)
server_b = Server(
- "rinaperf",
- options="-l -z rinaperfb",
+ "operf",
+ options="-l -n operfb",
arrival_rate=0.5,
mean_duration=10,
clients=[client_b],
@@ -76,8 +74,8 @@ server_b = Server(
)
server_c = Server(
- "rinaperf",
- options="-l -z rinaperfc",
+ "operf",
+ options="-l -n operfc",
arrival_rate=1.6,
mean_duration=3,
clients=[client_c],
diff --git a/examples/snake.py b/examples/snake.py
index 5426e28..ac5573f 100755
--- a/examples/snake.py
+++ b/examples/snake.py
@@ -3,19 +3,16 @@
# An example script using the rumba package
from rumba.model import *
-from rumba.utils import ExperimentManager
+from rumba.utils import *
+from rumba.storyboard import *
+from rumba.topologies import build_chain
# import testbed plugins
-import rumba.testbeds.emulab as emulab
import rumba.testbeds.jfed as jfed
-import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
import rumba.log as log
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import argparse
import sys
@@ -31,40 +28,29 @@ args = argparser.parse_args()
log.set_logging_level('DEBUG')
-n01 = NormalDIF("n01")
+n01 = UnicastLayer("n01")
if (args.nodes < 2):
print("Snake must be longer than 2 nodes")
sys.exit(-1)
-nodes = []
+nodes = build_chain(args.nodes, n01)
-shim_prev = None
-for i in range(0, args.nodes):
- if i is not (args.nodes - 1):
- shim = ShimEthDIF("e" + str(i))
- else:
- shim = None
+tb = jfed.Testbed(exp_name = "snake2",
+ cert_file = '/path/to/cert.pem',
+ authority = 'wall1.ilabt.iminds.be',
+ username = 'username',
+ exp_hours = '1',
+ proj_name='ouroborosrocks')
- if shim_prev == None and shim != None:
- node = Node("node" + str(i), difs = [n01, shim],
- dif_registrations = {n01 : [shim]})
- elif shim_prev != None and shim != None:
- node = Node("node" + str(i), difs = [n01, shim, shim_prev],
- dif_registrations = {n01 : [shim, shim_prev]})
- else:
- node = Node("node" + str(i), difs = [n01, shim_prev],
- dif_registrations = {n01 : [shim_prev]})
-
- shim_prev = shim
- nodes.append(node)
-
-tb = qemu.Testbed(exp_name = "snake")
-
-exp = rl.Experiment(tb, nodes = nodes)
+exp = our.Experiment(tb, nodes=nodes,
+ git_repo='https://codeberg.org/o7s/ouroboros',
+ git_branch='be',
+ build_options='-DCMAKE_BUILD_TYPE=Debug')
print(exp)
-with ExperimentManager(exp):
+with ExperimentManager(exp, swap_out_strategy=PAUSE_SWAPOUT):
exp.swap_in()
+ exp.install_prototype()
exp.bootstrap_prototype()
diff --git a/examples/square.py b/examples/square.py
new file mode 100755
index 0000000..ce5cc41
--- /dev/null
+++ b/examples/square.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+
+# An example script using the rumba package
+
+from rumba.model import *
+from rumba.utils import ExperimentManager
+
+# import testbed plugins
+import rumba.testbeds.local as local
+
+# import prototype plugins
+import rumba.prototypes.ouroboros as our
+
+import rumba.log as log
+
+log.set_logging_level('DEBUG')
+
+
+n01 = UnicastLayer("n01")
+n01.add_policy("routing", "ecmp")
+
+e01 = EthDixLayer("e01")
+e02 = EthDixLayer("e02")
+e03 = EthDixLayer("e03")
+e04 = EthDixLayer("e04")
+
+
+a = Node("a",
+ layers = [n01, e01, e02],
+ registrations = {n01 : [e01, e02]})
+
+b = Node("b",
+ layers = [n01, e02, e03],
+ registrations = {n01 : [e02, e03]})
+
+c = Node("c",
+ layers = [n01, e03, e04],
+ registrations = {n01 : [e03, e04]})
+
+d = Node("d",
+ layers = [n01, e01, e04],
+ registrations = {n01 : [e01, e04]})
+
+tb = local.Testbed(exp_name = "square")
+
+exp = our.Experiment(tb, nodes = [a, b, c, d])
+
+print(exp)
+
+with ExperimentManager(exp, swap_out_strategy=PROMPT_SWAPOUT):
+ exp.swap_in()
+ exp.bootstrap_prototype()
diff --git a/examples/test.py b/examples/test.py
new file mode 100755
index 0000000..e17670a
--- /dev/null
+++ b/examples/test.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+# An example script using the rumba package
+
+from rumba.model import *
+from rumba.utils import ExperimentManager
+from rumba.storyboard import *
+
+
+# import testbed plugins
+import rumba.testbeds.jfed as jfed
+
+# import prototype plugins
+import rumba.prototypes.ouroboros as our
+
+import rumba.log as log
+
+log.set_logging_level('DEBUG')
+
+
+n1 = UnicastLayer("n1")
+e1 = EthDixLayer("e1")
+e2 = EthDixLayer("e2")
+
+clientNode = Node("client",
+ layers = [e1, n1],
+ registrations = {n1 : [e1]})
+
+routerNode = Node("router",
+ layers = [e1, e2, n1],
+ registrations = {n1 : [e1, e2]})
+
+serverNode = Node("server",
+ layers = [e2, n1],
+ registrations = {n1 : [e2]})
+
+tb = jfed.Testbed(exp_name = 'example',
+ cert_file = '/path/to/cert.pem',
+ authority = 'wall1.ilabt.iminds.be',
+ username = 'username',
+ exp_hours = '5',
+ proj_name='ouroboros')
+
+exp = our.Experiment(tb, nodes=[clientNode, routerNode, serverNode],
+ git_repo="https://codeberg.org/o7s/ouroboros",
+ git_branch="be-fix")
+
+with ExperimentManager(exp, swap_out_strategy=PAUSE_SWAPOUT):
+ exp.swap_in()
+ exp.install_prototype()
+ exp.bootstrap_prototype()
+ sb = StoryBoard(experiment=exp, duration=15, servers=[])
+ sb.schedule_command(7.5, clientNode,
+ 'echo "7.5 secs in. We are at $(hostname)"')
+ sb.schedule_command(12, serverNode,
+ 'echo "12 secs in. We are at $(hostname)"')
+ sb.start()
diff --git a/examples/two-layers.py b/examples/two-layers.py
index 3f50037..5f6600c 100755
--- a/examples/two-layers.py
+++ b/examples/two-layers.py
@@ -6,15 +6,10 @@ from rumba.model import *
from rumba.storyboard import *
# import testbed plugins
-import rumba.testbeds.emulab as emulab
-import rumba.testbeds.jfed as jfed
import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import rumba.log as log
from rumba.utils import ExperimentManager
@@ -22,36 +17,34 @@ from rumba.utils import ExperimentManager
log.set_logging_level('DEBUG')
-n1 = NormalDIF("n1")
-n2 = NormalDIF("n2")
-n3 = NormalDIF("n3")
-n4 = NormalDIF("n4")
+n1 = UnicastLayer("n1")
+n2 = UnicastLayer("n2")
+n3 = UnicastLayer("n3")
+n4 = UnicastLayer("n4")
-e1 = ShimEthDIF("e1")
-e2 = ShimEthDIF("e2")
-e3 = ShimEthDIF("e3")
+e1 = EthDixLayer("e1")
+e2 = EthDixLayer("e2")
+e3 = EthDixLayer("e3")
a = Node("a",
- difs = [n3, n4, n1, e1],
- dif_registrations = {n4: [n1], n3: [n1], n1 : [e1]})
+ layers = [n3, n4, n1, e1],
+ registrations = {n4: [n1], n3: [n1], n1 : [e1]})
b = Node("b",
- difs = [n1, e1, e2],
- dif_registrations = {n1 : [e1, e2]})
+ layers = [n1, e1, e2],
+ registrations = {n1 : [e1, e2]})
c = Node("c",
- difs = [n3, n4, n1, n2, e2, e3],
- dif_registrations = {n4: [n1], n3: [n1, n2], n1 : [e2], n2: [e3]})
+ layers = [n3, n4, n1, n2, e2, e3],
+ registrations = {n4: [n1], n3: [n1, n2], n1 : [e2], n2: [e3]})
d = Node("d",
- difs = [n3, n2, e3],
- dif_registrations = {n3: [n2], n2 : [e3]})
+ layers = [n3, n2, e3],
+ registrations = {n3: [n2], n2 : [e3]})
-tb = qemu.Testbed(exp_name = "twolayers",
- username = "root",
- password = "root")
+tb = local.Testbed(exp_name="twolayers")
-exp = rl.Experiment(tb, nodes = [a, b, c, d])
+exp = our.Experiment(tb, nodes = [a, b, c, d])
print(exp)
diff --git a/examples/vpn.py b/examples/vpn.py
index 6aa8db6..8aac916 100755
--- a/examples/vpn.py
+++ b/examples/vpn.py
@@ -6,46 +6,39 @@ from rumba.model import *
from rumba.utils import ExperimentManager
# import testbed plugins
-import rumba.testbeds.emulab as emulab
-import rumba.testbeds.jfed as jfed
import rumba.testbeds.local as local
-import rumba.testbeds.qemu as qemu
# import prototype plugins
import rumba.prototypes.ouroboros as our
-import rumba.prototypes.rlite as rl
-import rumba.prototypes.irati as irati
import rumba.log as log
log.set_logging_level('DEBUG')
-n1 = NormalDIF("n1")
-n2 = NormalDIF("n2")
-e1 = ShimEthDIF("e1")
-e2 = ShimEthDIF("e2")
-e3 = ShimEthDIF("e3")
+n1 = UnicastLayer("n1")
+n2 = UnicastLayer("n2")
+e1 = EthDixLayer("e1")
+e2 = EthDixLayer("e2")
+e3 = EthDixLayer("e3")
a = Node("a",
- difs = [e1, n1, n2],
- dif_registrations = {n1 : [e1], n2 : [n1]})
+ layers = [e1, n1, n2],
+ registrations = {n1 : [e1], n2 : [n1]})
b = Node("b",
- difs = [e1, e2, n1],
- dif_registrations = {n1 : [e1, e2]})
+ layers = [e1, e2, n1],
+ registrations = {n1 : [e1, e2]})
c = Node("c",
- difs = [e2, e3, n1],
- dif_registrations = {n1 : [e2, e3]})
+ layers = [e2, e3, n1],
+ registrations = {n1 : [e2, e3]})
d = Node("d",
- difs = [e3, n1, n2],
- dif_registrations = {n1 : [e3], n2 : [n1]})
+ layers = [e3, n1, n2],
+ registrations = {n1 : [e3], n2 : [n1]})
-tb = qemu.Testbed(exp_name = 'example1',
- username = 'root',
- password = 'root')
+tb = local.Testbed(exp_name="example1")
exp = our.Experiment(tb, nodes = [a, b, c, d])