blob: f2be310e457ef163f946ca36f2658edb314014c7 [file] [log] [blame]
peustermcbcd4c22015-12-28 11:33:42 +01001"""
2This is an example topology for the distributed cloud emulator (dcemulator).
3(c) 2015 by Manuel Peuster <manuel.peuster@upb.de>
4
5The original Mininet API has to be completely hidden and not be used by this
6script.
7"""
8import logging
9from dcemulator.net import DCNetwork
10
11logging.basicConfig(level=logging.DEBUG)
12
13
14def create_topology1():
15 # initialize network
16 net = DCNetwork()
17
18 # add data centers
19 dc1 = net.addDatacenter("dc1")
20 dc2 = net.addDatacenter("dc2")
21 dc3 = net.addDatacenter("dc3")
22 dc4 = net.addDatacenter("dc4")
23 # add additional SDN switches to our topology
24 s1 = net.addSwitch("s1")
25 # add links between data centers
26 net.addLink(dc1, dc2)
27 net.addLink("dc1", s1)
28 net.addLink(s1, "dc3")
29 net.addLink(s1, dc4)
30 # start network
31 net.start()
32 net.CLI() # TODO remove this when we integrate APIs?
33 net.stop() # TODO remove this when we integrate APIs?
34 # start APIs (to access emulated cloud data centers)
35 pass # TODO: how to reflect one API endpoint per DC?
36
37
38def main():
39 create_topology1()
40
41
42if __name__ == '__main__':
43 main()