aboutsummaryrefslogtreecommitdiff
path: root/content/en/docs/Tools/rumba_example.py
blob: fc132b680ec53af1ce8feb45caba7bfd2172dabe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from rumba.model import Node, NormalDIF, ShimEthDIF

# import testbed plugins
import rumba.testbeds.jfed as jfed
import rumba.testbeds.local as local

# import Ouroboros prototype plugin
import rumba.prototypes.ouroboros as our

__all__ = ["local_exp", "nodes"]

n1 = NormalDIF("n1")
e1 = ShimEthDIF("e1")
e2 = ShimEthDIF("e2")
e3 = ShimEthDIF("e3")

clientNode1 = Node("client1",
                   difs=[e1, n1],
                   dif_registrations={n1: [e1]})

clientNode2 = Node("client2",
                   difs=[e3, n1],
                   dif_registrations={n1: [e3]})

routerNode = Node("router",
                  difs=[e1, e2, e3, n1],
                  dif_registrations={n1: [e1, e2, e3]})

serverNode = Node("server",
                  difs=[e2, n1],
                  dif_registrations={n1: [e2]})

nodes = ["client1", "client2", "router", "server"]

local_tb = local.Testbed()

local_exp = our.Experiment(local_tb,
                           nodes=[clientNode1,
                                  clientNode2,
                                  routerNode,
                                  serverNode])