diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-04-11 17:44:47 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-04-12 15:19:09 +0200 |
commit | 2b155aa25a2f61ad9bb84c273781a0597c6cef76 (patch) | |
tree | 20ea8f127969ab9e4852c6ddd66e2a8637b27675 /examples | |
parent | 6d8d0d30d75b318650034470b376a57a37b57944 (diff) | |
download | rumba-2b155aa25a2f61ad9bb84c273781a0597c6cef76.tar.gz rumba-2b155aa25a2f61ad9bb84c273781a0597c6cef76.zip |
Added Testing scripts and demonstrator conf to rumba converter
Diffstat (limited to 'examples')
-rw-r--r-- | examples/europe-vpns-small.py | 113 | ||||
-rw-r--r-- | examples/europe-vpns.py | 217 | ||||
-rw-r--r-- | examples/europe.py | 212 | ||||
-rw-r--r-- | examples/insane-stacking.py | 42 | ||||
-rw-r--r-- | examples/resilient-square.py | 48 | ||||
-rw-r--r-- | examples/seven.py | 61 | ||||
-rw-r--r-- | examples/star.py | 40 | ||||
-rw-r--r-- | examples/triangle.py | 42 |
8 files changed, 775 insertions, 0 deletions
diff --git a/examples/europe-vpns-small.py b/examples/europe-vpns-small.py new file mode 100644 index 0000000..062015f --- /dev/null +++ b/examples/europe-vpns-small.py @@ -0,0 +1,113 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shimmilan-nice = ShimEthDIF("shimmilan-nice", link_speed=0)) +shimmilan-zurich = ShimEthDIF("shimmilan-zurich", link_speed=0)) +shimbarcelona-lyon = ShimEthDIF("shimbarcelona-lyon", link_speed=0)) +shimflorence-rome = ShimEthDIF("shimflorence-rome", link_speed=0)) +shimbarcelona-valencia = ShimEthDIF("shimbarcelona-valencia", link_speed=0)) +shimlyon-nice = ShimEthDIF("shimlyon-nice", link_speed=0)) +shimmilan-venice = ShimEthDIF("shimmilan-venice", link_speed=0)) +shimpisa-rome = ShimEthDIF("shimpisa-rome", link_speed=0)) +shimmadrid-valencia = ShimEthDIF("shimmadrid-valencia", link_speed=0)) +shimlyon-paris = ShimEthDIF("shimlyon-paris", link_speed=0)) +shimnaples-rome = ShimEthDIF("shimnaples-rome", link_speed=0)) +shimflorence-pisa = ShimEthDIF("shimflorence-pisa", link_speed=0)) +shimbarcelona-madrid = ShimEthDIF("shimbarcelona-madrid", link_speed=0)) +shimmunich-vienna = ShimEthDIF("shimmunich-vienna", link_speed=0)) +shimflorence-milan = ShimEthDIF("shimflorence-milan", link_speed=0)) +shimlisbon-madrid = ShimEthDIF("shimlisbon-madrid", link_speed=0)) +shimvenice-vienna = ShimEthDIF("shimvenice-vienna", link_speed=0)) +shimmunich-zurich = ShimEthDIF("shimmunich-zurich", link_speed=0)) +shimflorence-venice = ShimEthDIF("shimflorence-venice", link_speed=0)) + +fravpn = NormalDIF("fravpn") +ibervpn = NormalDIF("ibervpn") +eu = NormalDIF("eu") +itavpn = NormalDIF("itavpn") + +vienna = Node("vienna", + difs=[venice-vienna, munich-vienna], + dif_registrations={}) + +milan = Node("milan", + difs=[florence-milan, milan-venice, milan-zurich, milan-nice, eu, itavpn], + dif_registrations={eu: [milan-venice, florence-milan, milan-zurich, milan-nice], itavpn: [eu]}) + +zurich = Node("zurich", + difs=[milan-zurich, munich-zurich], + dif_registrations={}) + +paris = Node("paris", + difs=[lyon-paris, eu, fravpn], + dif_registrations={fravpn: [eu], eu: [lyon-paris]}) + +venice = Node("venice", + difs=[florence-venice, milan-venice, venice-vienna, eu, itavpn], + dif_registrations={eu: [milan-venice, florence-venice, venice-vienna], itavpn: [eu]}) + +pisa = Node("pisa", + difs=[pisa-rome, florence-pisa, eu, itavpn], + dif_registrations={eu: [pisa-rome, florence-pisa], itavpn: [eu]}) + +valencia = Node("valencia", + difs=[barcelona-valencia, madrid-valencia, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [barcelona-valencia, madrid-valencia]}) + +lisbon = Node("lisbon", + difs=[lisbon-madrid, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [lisbon-madrid]}) + +barcelona = Node("barcelona", + difs=[barcelona-lyon, barcelona-madrid, barcelona-valencia, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [barcelona-lyon, barcelona-madrid, barcelona-valencia]}) + +nice = Node("nice", + difs=[milan-nice, lyon-nice, eu, fravpn], + dif_registrations={fravpn: [eu], eu: [milan-nice, lyon-nice]}) + +lyon = Node("lyon", + difs=[lyon-nice, lyon-paris, barcelona-lyon, eu, fravpn], + dif_registrations={fravpn: [eu], eu: [lyon-paris, lyon-nice, barcelona-lyon]}) + +madrid = Node("madrid", + difs=[barcelona-madrid, madrid-valencia, lisbon-madrid, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [barcelona-madrid, madrid-valencia, lisbon-madrid]}) + +munich = Node("munich", + difs=[munich-zurich, munich-vienna], + dif_registrations={}) + +florence = Node("florence", + difs=[florence-rome, florence-pisa, florence-milan, florence-venice, eu, itavpn], + dif_registrations={eu: [florence-pisa, florence-rome, florence-milan, florence-venice], itavpn: [eu]}) + +naples = Node("naples", + difs=[naples-rome, eu, itavpn], + dif_registrations={eu: [naples-rome], itavpn: [eu]}) + +rome = Node("rome", + difs=[naples-rome, pisa-rome, florence-rome, eu, itavpn], + dif_registrations={eu: [naples-rome, pisa-rome, florence-rome], itavpn: [eu]}) + +tb = qemu.Testbed(exp_name = "europe-vpns-small", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/europe-vpns.py b/examples/europe-vpns.py new file mode 100644 index 0000000..859f0c3 --- /dev/null +++ b/examples/europe-vpns.py @@ -0,0 +1,217 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shimoslo-stockholm = ShimEthDIF("shimoslo-stockholm", link_speed=0)) +shimbarcelona-lyon = ShimEthDIF("shimbarcelona-lyon", link_speed=0)) +shimberlin-munich = ShimEthDIF("shimberlin-munich", link_speed=0)) +shimmunich-zurich = ShimEthDIF("shimmunich-zurich", link_speed=0)) +shimedimburgh-london = ShimEthDIF("shimedimburgh-london", link_speed=0)) +shimmunich-prague = ShimEthDIF("shimmunich-prague", link_speed=0)) +shimmilan-zurich = ShimEthDIF("shimmilan-zurich", link_speed=0)) +shimbucarest-sofia = ShimEthDIF("shimbucarest-sofia", link_speed=0)) +shimalgiers-naples = ShimEthDIF("shimalgiers-naples", link_speed=0)) +shimbudapest-varsaw = ShimEthDIF("shimbudapest-varsaw", link_speed=0)) +shimmunich-vienna = ShimEthDIF("shimmunich-vienna", link_speed=0)) +shimamsterdam-oslo = ShimEthDIF("shimamsterdam-oslo", link_speed=0)) +shimbelgrad-zagreb = ShimEthDIF("shimbelgrad-zagreb", link_speed=0)) +shimbudapest-prague = ShimEthDIF("shimbudapest-prague", link_speed=0)) +shimnaples-tunis = ShimEthDIF("shimnaples-tunis", link_speed=0)) +shimhelsinki-stockholm = ShimEthDIF("shimhelsinki-stockholm", link_speed=0)) +shimflorence-rome = ShimEthDIF("shimflorence-rome", link_speed=0)) +shimmadrid-valencia = ShimEthDIF("shimmadrid-valencia", link_speed=0)) +shimalgiers-tunis = ShimEthDIF("shimalgiers-tunis", link_speed=0)) +shimlyon-paris = ShimEthDIF("shimlyon-paris", link_speed=0)) +shimprague-vienna = ShimEthDIF("shimprague-vienna", link_speed=0)) +shimhelsinki-varsaw = ShimEthDIF("shimhelsinki-varsaw", link_speed=0)) +shimnaples-rome = ShimEthDIF("shimnaples-rome", link_speed=0)) +shimberlin-varsaw = ShimEthDIF("shimberlin-varsaw", link_speed=0)) +shimflorence-pisa = ShimEthDIF("shimflorence-pisa", link_speed=0)) +shimpisa-rome = ShimEthDIF("shimpisa-rome", link_speed=0)) +shimbelgrad-bucarest = ShimEthDIF("shimbelgrad-bucarest", link_speed=0)) +shimamsterdam-brussels = ShimEthDIF("shimamsterdam-brussels", link_speed=0)) +shimmilan-venice = ShimEthDIF("shimmilan-venice", link_speed=0)) +shimathens-naples = ShimEthDIF("shimathens-naples", link_speed=0)) +shimflorence-venice = ShimEthDIF("shimflorence-venice", link_speed=0)) +shimbelgrad-sofia = ShimEthDIF("shimbelgrad-sofia", link_speed=0)) +shimbarcelona-madrid = ShimEthDIF("shimbarcelona-madrid", link_speed=0)) +shimmilan-nice = ShimEthDIF("shimmilan-nice", link_speed=0)) +shimvenice-vienna = ShimEthDIF("shimvenice-vienna", link_speed=0)) +shimalgiers-valencia = ShimEthDIF("shimalgiers-valencia", link_speed=0)) +shimlyon-nice = ShimEthDIF("shimlyon-nice", link_speed=0)) +shimlisbon-madrid = ShimEthDIF("shimlisbon-madrid", link_speed=0)) +shimbarcelona-valencia = ShimEthDIF("shimbarcelona-valencia", link_speed=0)) +shimflorence-milan = ShimEthDIF("shimflorence-milan", link_speed=0)) +shimamsterdam-berlin = ShimEthDIF("shimamsterdam-berlin", link_speed=0)) +shimamsterdam-stockholm = ShimEthDIF("shimamsterdam-stockholm", link_speed=0)) +shimberlin-prague = ShimEthDIF("shimberlin-prague", link_speed=0)) +shimbudapest-zagreb = ShimEthDIF("shimbudapest-zagreb", link_speed=0)) +shimbrussels-london = ShimEthDIF("shimbrussels-london", link_speed=0)) +shimathens-sofia = ShimEthDIF("shimathens-sofia", link_speed=0)) +shimbrussels-paris = ShimEthDIF("shimbrussels-paris", link_speed=0)) +shimberlin-brussels = ShimEthDIF("shimberlin-brussels", link_speed=0)) +shimlondon-paris = ShimEthDIF("shimlondon-paris", link_speed=0)) + +itavpn = NormalDIF("itavpn") +cenvpn = NormalDIF("cenvpn") +ibervpn = NormalDIF("ibervpn") +nortvpn = NormalDIF("nortvpn") +eu = NormalDIF("eu") +eastvpn = NormalDIF("eastvpn") + +sofia = Node("sofia", + difs=[athens-sofia, bucarest-sofia, belgrad-sofia, eu], + dif_registrations={eu: [athens-sofia, belgrad-sofia, bucarest-sofia]}) + +bucarest = Node("bucarest", + difs=[bucarest-sofia, belgrad-bucarest, eu, eastvpn], + dif_registrations={eu: [bucarest-sofia, belgrad-bucarest], eastvpn: [eu]}) + +zagreb = Node("zagreb", + difs=[belgrad-zagreb, budapest-zagreb, eu, eastvpn], + dif_registrations={eu: [belgrad-zagreb, budapest-zagreb], eastvpn: [eu]}) + +lisbon = Node("lisbon", + difs=[lisbon-madrid, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [lisbon-madrid]}) + +pisa = Node("pisa", + difs=[pisa-rome, florence-pisa, eu, itavpn], + dif_registrations={itavpn: [eu], eu: [pisa-rome, florence-pisa]}) + +tunis = Node("tunis", + difs=[algiers-tunis, naples-tunis, eu], + dif_registrations={eu: [algiers-tunis, naples-tunis]}) + +berlin = Node("berlin", + difs=[berlin-prague, berlin-munich, berlin-varsaw, amsterdam-berlin, berlin-brussels, eu, cenvpn], + dif_registrations={cenvpn: [eu], eu: [berlin-munich, berlin-prague, berlin-varsaw, amsterdam-berlin, berlin-brussels]}) + +barcelona = Node("barcelona", + difs=[barcelona-lyon, barcelona-madrid, barcelona-valencia, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [barcelona-lyon, barcelona-madrid, barcelona-valencia]}) + +venice = Node("venice", + difs=[florence-venice, milan-venice, venice-vienna, eu, itavpn], + dif_registrations={itavpn: [eu], eu: [milan-venice, florence-venice, venice-vienna]}) + +helsinki = Node("helsinki", + difs=[helsinki-stockholm, helsinki-varsaw, eu, nortvpn], + dif_registrations={nortvpn: [eu], eu: [helsinki-stockholm, helsinki-varsaw]}) + +lyon = Node("lyon", + difs=[lyon-nice, lyon-paris, barcelona-lyon, eu], + dif_registrations={eu: [lyon-paris, lyon-nice, barcelona-lyon]}) + +madrid = Node("madrid", + difs=[barcelona-madrid, madrid-valencia, lisbon-madrid, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [barcelona-madrid, madrid-valencia, lisbon-madrid]}) + +prague = Node("prague", + difs=[budapest-prague, prague-vienna, munich-prague, berlin-prague, eu, cenvpn], + dif_registrations={cenvpn: [eu], eu: [budapest-prague, prague-vienna, munich-prague, berlin-prague]}) + +vienna = Node("vienna", + difs=[venice-vienna, munich-vienna, prague-vienna, eu, cenvpn], + dif_registrations={cenvpn: [eu], eu: [venice-vienna, prague-vienna, munich-vienna]}) + +amsterdam = Node("amsterdam", + difs=[amsterdam-berlin, amsterdam-brussels, amsterdam-oslo, amsterdam-stockholm, eu, cenvpn], + dif_registrations={cenvpn: [eu], eu: [amsterdam-berlin, amsterdam-oslo, amsterdam-brussels, amsterdam-stockholm]}) + +athens = Node("athens", + difs=[athens-naples, athens-sofia, eu], + dif_registrations={eu: [athens-naples, athens-sofia]}) + +florence = Node("florence", + difs=[florence-rome, florence-pisa, florence-milan, florence-venice, eu, itavpn], + dif_registrations={itavpn: [eu], eu: [florence-pisa, florence-rome, florence-milan, florence-venice]}) + +brussels = Node("brussels", + difs=[berlin-brussels, amsterdam-brussels, brussels-paris, brussels-london, eu], + dif_registrations={eu: [berlin-brussels, amsterdam-brussels, brussels-london, brussels-paris]}) + +naples = Node("naples", + difs=[naples-rome, algiers-naples, naples-tunis, athens-naples, eu, itavpn], + dif_registrations={itavpn: [eu], eu: [naples-rome, athens-naples, algiers-naples, naples-tunis]}) + +zurich = Node("zurich", + difs=[milan-zurich, munich-zurich, eu], + dif_registrations={eu: [munich-zurich, milan-zurich]}) + +edimburgh = Node("edimburgh", + difs=[edimburgh-london, eu], + dif_registrations={eu: [edimburgh-london]}) + +milan = Node("milan", + difs=[florence-milan, milan-venice, milan-zurich, milan-nice, eu, itavpn], + dif_registrations={itavpn: [eu], eu: [milan-venice, florence-milan, milan-zurich, milan-nice]}) + +rome = Node("rome", + difs=[naples-rome, pisa-rome, florence-rome, eu, itavpn], + dif_registrations={itavpn: [eu], eu: [naples-rome, pisa-rome, florence-rome]}) + +nice = Node("nice", + difs=[milan-nice, lyon-nice, eu], + dif_registrations={eu: [milan-nice, lyon-nice]}) + +stockholm = Node("stockholm", + difs=[oslo-stockholm, amsterdam-stockholm, helsinki-stockholm, eu, nortvpn], + dif_registrations={nortvpn: [eu], eu: [helsinki-stockholm, oslo-stockholm, amsterdam-stockholm]}) + +varsaw = Node("varsaw", + difs=[budapest-varsaw, berlin-varsaw, helsinki-varsaw, eu, eastvpn], + dif_registrations={eu: [budapest-varsaw, berlin-varsaw, helsinki-varsaw], eastvpn: [eu]}) + +budapest = Node("budapest", + difs=[budapest-zagreb, budapest-prague, budapest-varsaw, eu, eastvpn], + dif_registrations={eu: [budapest-varsaw, budapest-zagreb, budapest-prague], eastvpn: [eu]}) + +belgrad = Node("belgrad", + difs=[belgrad-sofia, belgrad-bucarest, belgrad-zagreb, eu, eastvpn], + dif_registrations={eu: [belgrad-sofia, belgrad-bucarest, belgrad-zagreb], eastvpn: [eu]}) + +london = Node("london", + difs=[london-paris, brussels-london, edimburgh-london, eu], + dif_registrations={eu: [brussels-london, edimburgh-london, london-paris]}) + +paris = Node("paris", + difs=[lyon-paris, brussels-paris, london-paris, eu], + dif_registrations={eu: [lyon-paris, london-paris, brussels-paris]}) + +munich = Node("munich", + difs=[munich-zurich, munich-vienna, munich-prague, berlin-munich, eu, cenvpn], + dif_registrations={cenvpn: [eu], eu: [munich-vienna, munich-zurich, munich-prague, berlin-munich]}) + +valencia = Node("valencia", + difs=[barcelona-valencia, madrid-valencia, algiers-valencia, eu, ibervpn], + dif_registrations={ibervpn: [eu], eu: [barcelona-valencia, madrid-valencia, algiers-valencia]}) + +algiers = Node("algiers", + difs=[algiers-valencia, algiers-tunis, algiers-naples, eu], + dif_registrations={eu: [algiers-valencia, algiers-tunis, algiers-naples]}) + +oslo = Node("oslo", + difs=[amsterdam-oslo, oslo-stockholm, eu, nortvpn], + dif_registrations={nortvpn: [eu], eu: [amsterdam-oslo, oslo-stockholm]}) + +tb = qemu.Testbed(exp_name = "europe-vpns", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/europe.py b/examples/europe.py new file mode 100644 index 0000000..062d053 --- /dev/null +++ b/examples/europe.py @@ -0,0 +1,212 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shimvenice-vienna = ShimEthDIF("shimvenice-vienna", link_speed=0)) +shimbrussels-paris = ShimEthDIF("shimbrussels-paris", link_speed=0)) +shimmilan-venice = ShimEthDIF("shimmilan-venice", link_speed=0)) +shimberlin-brussels = ShimEthDIF("shimberlin-brussels", link_speed=0)) +shimlisbon-madrid = ShimEthDIF("shimlisbon-madrid", link_speed=0)) +shimbudapest-zagreb = ShimEthDIF("shimbudapest-zagreb", link_speed=0)) +shimprague-vienna = ShimEthDIF("shimprague-vienna", link_speed=0)) +shimbelgrad-bucarest = ShimEthDIF("shimbelgrad-bucarest", link_speed=0)) +shimathens-sofia = ShimEthDIF("shimathens-sofia", link_speed=0)) +shimmunich-zurich = ShimEthDIF("shimmunich-zurich", link_speed=0)) +shimhelsinki-stockholm = ShimEthDIF("shimhelsinki-stockholm", link_speed=0)) +shimbelgrad-zagreb = ShimEthDIF("shimbelgrad-zagreb", link_speed=0)) +shimmilan-zurich = ShimEthDIF("shimmilan-zurich", link_speed=0)) +shimbelgrad-sofia = ShimEthDIF("shimbelgrad-sofia", link_speed=0)) +shimamsterdam-stockholm = ShimEthDIF("shimamsterdam-stockholm", link_speed=0)) +shimbudapest-prague = ShimEthDIF("shimbudapest-prague", link_speed=0)) +shimnaples-tunis = ShimEthDIF("shimnaples-tunis", link_speed=0)) +shimflorence-pisa = ShimEthDIF("shimflorence-pisa", link_speed=0)) +shimflorence-rome = ShimEthDIF("shimflorence-rome", link_speed=0)) +shimmunich-prague = ShimEthDIF("shimmunich-prague", link_speed=0)) +shimedimburgh-london = ShimEthDIF("shimedimburgh-london", link_speed=0)) +shimbarcelona-valencia = ShimEthDIF("shimbarcelona-valencia", link_speed=0)) +shimlyon-nice = ShimEthDIF("shimlyon-nice", link_speed=0)) +shimbudapest-varsaw = ShimEthDIF("shimbudapest-varsaw", link_speed=0)) +shimberlin-varsaw = ShimEthDIF("shimberlin-varsaw", link_speed=0)) +shimlondon-paris = ShimEthDIF("shimlondon-paris", link_speed=0)) +shimmunich-vienna = ShimEthDIF("shimmunich-vienna", link_speed=0)) +shimoslo-stockholm = ShimEthDIF("shimoslo-stockholm", link_speed=0)) +shimbarcelona-madrid = ShimEthDIF("shimbarcelona-madrid", link_speed=0)) +shimmilan-nice = ShimEthDIF("shimmilan-nice", link_speed=0)) +shimlyon-paris = ShimEthDIF("shimlyon-paris", link_speed=0)) +shimflorence-venice = ShimEthDIF("shimflorence-venice", link_speed=0)) +shimhelsinki-varsaw = ShimEthDIF("shimhelsinki-varsaw", link_speed=0)) +shimalgiers-valencia = ShimEthDIF("shimalgiers-valencia", link_speed=0)) +shimberlin-munich = ShimEthDIF("shimberlin-munich", link_speed=0)) +shimamsterdam-oslo = ShimEthDIF("shimamsterdam-oslo", link_speed=0)) +shimnaples-rome = ShimEthDIF("shimnaples-rome", link_speed=0)) +shimalgiers-tunis = ShimEthDIF("shimalgiers-tunis", link_speed=0)) +shimberlin-prague = ShimEthDIF("shimberlin-prague", link_speed=0)) +shimathens-naples = ShimEthDIF("shimathens-naples", link_speed=0)) +shimmadrid-valencia = ShimEthDIF("shimmadrid-valencia", link_speed=0)) +shimbarcelona-lyon = ShimEthDIF("shimbarcelona-lyon", link_speed=0)) +shimbrussels-london = ShimEthDIF("shimbrussels-london", link_speed=0)) +shimamsterdam-berlin = ShimEthDIF("shimamsterdam-berlin", link_speed=0)) +shimamsterdam-brussels = ShimEthDIF("shimamsterdam-brussels", link_speed=0)) +shimalgiers-naples = ShimEthDIF("shimalgiers-naples", link_speed=0)) +shimflorence-milan = ShimEthDIF("shimflorence-milan", link_speed=0)) +shimbucarest-sofia = ShimEthDIF("shimbucarest-sofia", link_speed=0)) +shimpisa-rome = ShimEthDIF("shimpisa-rome", link_speed=0)) + +eu = NormalDIF("eu") + +amsterdam = Node("amsterdam", + difs=[amsterdam-berlin, amsterdam-brussels, amsterdam-oslo, amsterdam-stockholm, eu], + dif_registrations={eu: [amsterdam-berlin, amsterdam-oslo, amsterdam-brussels, amsterdam-stockholm]}) + +munich = Node("munich", + difs=[munich-zurich, munich-vienna, munich-prague, berlin-munich, eu], + dif_registrations={eu: [munich-vienna, munich-zurich, munich-prague, berlin-munich]}) + +valencia = Node("valencia", + difs=[barcelona-valencia, madrid-valencia, algiers-valencia, eu], + dif_registrations={eu: [barcelona-valencia, madrid-valencia, algiers-valencia]}) + +algiers = Node("algiers", + difs=[algiers-valencia, algiers-tunis, algiers-naples, eu], + dif_registrations={eu: [algiers-valencia, algiers-tunis, algiers-naples]}) + +naples = Node("naples", + difs=[naples-rome, algiers-naples, naples-tunis, athens-naples, eu], + dif_registrations={eu: [naples-rome, athens-naples, algiers-naples, naples-tunis]}) + +nice = Node("nice", + difs=[milan-nice, lyon-nice, eu], + dif_registrations={eu: [milan-nice, lyon-nice]}) + +lisbon = Node("lisbon", + difs=[lisbon-madrid, eu], + dif_registrations={eu: [lisbon-madrid]}) + +bucarest = Node("bucarest", + difs=[bucarest-sofia, belgrad-bucarest, eu], + dif_registrations={eu: [bucarest-sofia, belgrad-bucarest]}) + +budapest = Node("budapest", + difs=[budapest-zagreb, budapest-prague, budapest-varsaw, eu], + dif_registrations={eu: [budapest-varsaw, budapest-zagreb, budapest-prague]}) + +rome = Node("rome", + difs=[naples-rome, pisa-rome, florence-rome, eu], + dif_registrations={eu: [naples-rome, pisa-rome, florence-rome]}) + +barcelona = Node("barcelona", + difs=[barcelona-lyon, barcelona-madrid, barcelona-valencia, eu], + dif_registrations={eu: [barcelona-lyon, barcelona-madrid, barcelona-valencia]}) + +pisa = Node("pisa", + difs=[pisa-rome, florence-pisa, eu], + dif_registrations={eu: [pisa-rome, florence-pisa]}) + +tunis = Node("tunis", + difs=[algiers-tunis, naples-tunis, eu], + dif_registrations={eu: [algiers-tunis, naples-tunis]}) + +zurich = Node("zurich", + difs=[milan-zurich, munich-zurich, eu], + dif_registrations={eu: [munich-zurich, milan-zurich]}) + +athens = Node("athens", + difs=[athens-naples, athens-sofia, eu], + dif_registrations={eu: [athens-naples, athens-sofia]}) + +paris = Node("paris", + difs=[lyon-paris, brussels-paris, london-paris, eu], + dif_registrations={eu: [lyon-paris, london-paris, brussels-paris]}) + +stockholm = Node("stockholm", + difs=[oslo-stockholm, amsterdam-stockholm, helsinki-stockholm, eu], + dif_registrations={eu: [helsinki-stockholm, oslo-stockholm, amsterdam-stockholm]}) + +varsaw = Node("varsaw", + difs=[budapest-varsaw, berlin-varsaw, helsinki-varsaw, eu], + dif_registrations={eu: [budapest-varsaw, berlin-varsaw, helsinki-varsaw]}) + +lyon = Node("lyon", + difs=[lyon-nice, lyon-paris, barcelona-lyon, eu], + dif_registrations={eu: [lyon-paris, lyon-nice, barcelona-lyon]}) + +vienna = Node("vienna", + difs=[venice-vienna, munich-vienna, prague-vienna, eu], + dif_registrations={eu: [venice-vienna, prague-vienna, munich-vienna]}) + +milan = Node("milan", + difs=[florence-milan, milan-venice, milan-zurich, milan-nice, eu], + dif_registrations={eu: [milan-venice, florence-milan, milan-zurich, milan-nice]}) + +brussels = Node("brussels", + difs=[berlin-brussels, amsterdam-brussels, brussels-paris, brussels-london, eu], + dif_registrations={eu: [berlin-brussels, amsterdam-brussels, brussels-london, brussels-paris]}) + +berlin = Node("berlin", + difs=[berlin-prague, berlin-munich, berlin-varsaw, amsterdam-berlin, berlin-brussels, eu], + dif_registrations={eu: [berlin-munich, berlin-prague, berlin-varsaw, amsterdam-berlin, berlin-brussels]}) + +madrid = Node("madrid", + difs=[barcelona-madrid, madrid-valencia, lisbon-madrid, eu], + dif_registrations={eu: [barcelona-madrid, madrid-valencia, lisbon-madrid]}) + +oslo = Node("oslo", + difs=[amsterdam-oslo, oslo-stockholm, eu], + dif_registrations={eu: [amsterdam-oslo, oslo-stockholm]}) + +venice = Node("venice", + difs=[florence-venice, milan-venice, venice-vienna, eu], + dif_registrations={eu: [milan-venice, florence-venice, venice-vienna]}) + +london = Node("london", + difs=[london-paris, brussels-london, edimburgh-london, eu], + dif_registrations={eu: [brussels-london, edimburgh-london, london-paris]}) + +sofia = Node("sofia", + difs=[athens-sofia, bucarest-sofia, belgrad-sofia, eu], + dif_registrations={eu: [athens-sofia, belgrad-sofia, bucarest-sofia]}) + +helsinki = Node("helsinki", + difs=[helsinki-stockholm, helsinki-varsaw, eu], + dif_registrations={eu: [helsinki-stockholm, helsinki-varsaw]}) + +florence = Node("florence", + difs=[florence-rome, florence-pisa, florence-milan, florence-venice, eu], + dif_registrations={eu: [florence-pisa, florence-rome, florence-milan, florence-venice]}) + +belgrad = Node("belgrad", + difs=[belgrad-sofia, belgrad-bucarest, belgrad-zagreb, eu], + dif_registrations={eu: [belgrad-sofia, belgrad-bucarest, belgrad-zagreb]}) + +zagreb = Node("zagreb", + difs=[belgrad-zagreb, budapest-zagreb, eu], + dif_registrations={eu: [belgrad-zagreb, budapest-zagreb]}) + +prague = Node("prague", + difs=[budapest-prague, prague-vienna, munich-prague, berlin-prague, eu], + dif_registrations={eu: [budapest-prague, prague-vienna, munich-prague, berlin-prague]}) + +edimburgh = Node("edimburgh", + difs=[edimburgh-london, eu], + dif_registrations={eu: [edimburgh-london]}) + +tb = qemu.Testbed(exp_name = "europe", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/insane-stacking.py b/examples/insane-stacking.py new file mode 100644 index 0000000..4a2f4e3 --- /dev/null +++ b/examples/insane-stacking.py @@ -0,0 +1,42 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shim300 = ShimEthDIF("shim300", link_speed=0)) + +n1 = NormalDIF("n1") +n2 = NormalDIF("n2") +n3 = NormalDIF("n3") +n5 = NormalDIF("n5") +n7 = NormalDIF("n7") +n4 = NormalDIF("n4") +n6 = NormalDIF("n6") + +a = Node("a", + difs=[300, n1, n2, n3, n4, n5, n6, n7], + dif_registrations={n1: [300], n2: [n1], n3: [n2], n5: [n4], n7: [n6], n4: [n3], n6: [n5]}) + +b = Node("b", + difs=[300, n1, n2, n3, n4, n5, n6, n7], + dif_registrations={n1: [300], n2: [n1], n3: [n2], n5: [n4], n7: [n6], n4: [n3], n6: [n5]}) + +tb = qemu.Testbed(exp_name = "insane-stacking", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/resilient-square.py b/examples/resilient-square.py new file mode 100644 index 0000000..82d5389 --- /dev/null +++ b/examples/resilient-square.py @@ -0,0 +1,48 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shim700 = ShimEthDIF("shim700", link_speed=100)) +shim400 = ShimEthDIF("shim400", link_speed=100)) +shim500 = ShimEthDIF("shim500", link_speed=100)) +shim600 = ShimEthDIF("shim600", link_speed=1)) +shim300 = ShimEthDIF("shim300", link_speed=100)) + +n1 = NormalDIF("n1") + +c = Node("c", + difs=[400, 500, 700, n1], + dif_registrations={n1: [400, 500, 700]}) + +b = Node("b", + difs=[300, 400, n1], + dif_registrations={n1: [300, 400]}) + +a = Node("a", + difs=[300, 600, 700, n1], + dif_registrations={n1: [300, 600, 700]}) + +d = Node("d", + difs=[500, 600, n1], + dif_registrations={n1: [500, 600]}) + +tb = qemu.Testbed(exp_name = "resilient-square", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/seven.py b/examples/seven.py new file mode 100644 index 0000000..42402a6 --- /dev/null +++ b/examples/seven.py @@ -0,0 +1,61 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shim500 = ShimEthDIF("shim500", link_speed=0)) +shim600 = ShimEthDIF("shim600", link_speed=0)) +shim700 = ShimEthDIF("shim700", link_speed=0)) +shim400 = ShimEthDIF("shim400", link_speed=0)) +shim300 = ShimEthDIF("shim300", link_speed=0)) +shim800 = ShimEthDIF("shim800", link_speed=0)) + +n1 = NormalDIF("n1") + +b = Node("b", + difs=[300, 400, n1], + dif_registrations={n1: [300, 400]}) + +g = Node("g", + difs=[800, n1], + dif_registrations={n1: [800]}) + +c = Node("c", + difs=[400, 500, 600, n1], + dif_registrations={n1: [400, 500, 600]}) + +f = Node("f", + difs=[500, n1], + dif_registrations={n1: [500]}) + +a = Node("a", + difs=[300, n1], + dif_registrations={n1: [300]}) + +d = Node("d", + difs=[600, 700, n1], + dif_registrations={n1: [600, 700]}) + +e = Node("e", + difs=[700, 800, n1], + dif_registrations={n1: [700, 800]}) + +tb = qemu.Testbed(exp_name = "seven", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/star.py b/examples/star.py new file mode 100644 index 0000000..c00aab7 --- /dev/null +++ b/examples/star.py @@ -0,0 +1,40 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shim300 = ShimEthDIF("shim300", link_speed=0)) + +n1 = NormalDIF("n1") + +a = Node("a", + difs=[300, n1], + dif_registrations={n1: [300]}) + +b = Node("b", + difs=[300, n1], + dif_registrations={n1: [300]}) + +c = Node("c", + difs=[300, n1], + dif_registrations={n1: [300]}) + +tb = qemu.Testbed(exp_name = "star", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() diff --git a/examples/triangle.py b/examples/triangle.py new file mode 100644 index 0000000..6be58a5 --- /dev/null +++ b/examples/triangle.py @@ -0,0 +1,42 @@ +#!/usr/bin/env/python + +from rumba.model import * + +# import testbed plugins +import rumba.testbeds.emulab as emulab +import rumba.testbeds.jfed as jfed +import rumba.testbeds.faketestbed as fake +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 + +shim500 = ShimEthDIF("shim500", link_speed=30)) +shim400 = ShimEthDIF("shim400", link_speed=20)) +shim300 = ShimEthDIF("shim300", link_speed=10)) + +n1 = NormalDIF("n1") + +a = Node("a", + difs=[300, 500, n1], + dif_registrations={n1: [300, 500]}) + +b = Node("b", + difs=[300, 400, n1], + dif_registrations={n1: [300, 400]}) + +c = Node("c", + difs=[400, 500, n1], + dif_registrations={n1: [400, 500]}) + +tb = qemu.Testbed(exp_name = "triangle", + bzimage = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/bzImage", + initramfs = "/home/mcapitani/RINA/checkouts/rlite/demo/buildroot/rootfs.cpio") + +exp = rl.Experiment(tb, nodes = [a, b, c, d]) + +print(exp) + +exp.run() |