aboutsummaryrefslogtreecommitdiff
path: root/examples/scalingtime.py
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/scalingtime.py
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/scalingtime.py')
-rwxr-xr-xexamples/scalingtime.py135
1 files changed, 52 insertions, 83 deletions
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()