a21cdba404730e93bac78af2fd32820ceda85826
2 This is an example topology for the distributed cloud emulator (dcemulator).
3 (c) 2015 by Manuel Peuster <manuel.peuster@upb.de>
5 The original Mininet API has to be completely hidden and not be used by this
9 from dcemulator
.net
import DCNetwork
10 from api
.zerorpcapi
import ZeroRpcApiEndpoint
12 logging
.basicConfig(level
=logging
.DEBUG
)
15 def create_topology1():
16 # TODO add long comments to this example to show people how to use this
21 dc1
= net
.addDatacenter("dc1")
22 dc2
= net
.addDatacenter("dc2")
23 dc3
= net
.addDatacenter("dc3")
24 dc4
= net
.addDatacenter("dc4")
25 # add additional SDN switches to our topology
26 s1
= net
.addSwitch("s1")
27 # add links between data centers
29 net
.addLink("dc1", s1
)
30 net
.addLink(s1
, "dc3")
33 # create and start APIs (to access emulated cloud data centers)
34 zapi1
= ZeroRpcApiEndpoint("0.0.0.0", 4242)
35 zapi1
.connectDatacenter(dc1
)
36 zapi1
.connectDatacenter(dc2
)
38 # lets also create a second API endpoint on another port to
39 # demonstrate hat you can have one endpoint for each of
41 zapi2
= ZeroRpcApiEndpoint("0.0.0.0", 4343)
42 zapi2
.connectDatacenter(dc3
)
43 zapi2
.connectDatacenter(dc4
)
48 net
.CLI() # TODO remove this when we integrate APIs?
49 net
.stop() # TODO remove this when we integrate APIs?
56 if __name__
== '__main__':