2 Copyright (c) 2015 SONATA-NFV
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
17 Neither the name of the SONATA-NFV [, ANY ADDITIONAL AFFILIATION]
18 nor the names of its contributors may be used to endorse or promote
19 products derived from this software without specific prior written
22 This work has been performed in the framework of the SONATA project,
23 funded by the European Commission under Grant number 671517 through
24 the Horizon 2020 and 5G-PPP programmes. The authors would like to
25 acknowledge the contributions of their colleagues of the SONATA
26 partner consortium (www.sonata-nfv.eu).
29 A simple topology with two PoPs for the y1 demo story board.
31 (dc1) <<-->> s1 <<-->> (dc2)
33 - SAP deployment enabled
34 - learning switch enabled
38 from mininet
.log
import setLogLevel
39 from emuvim
.dcemulator
.net
import DCNetwork
40 from emuvim
.api
.rest
.rest_api_endpoint
import RestApiEndpoint
41 from emuvim
.api
.sonata
import SonataDummyGatekeeperEndpoint
42 from mininet
.node
import RemoteController
45 logging
.basicConfig(level
=logging
.INFO
)
48 def create_topology1():
50 net
= DCNetwork(controller
=RemoteController
, monitor
=True, enable_learning
=True)
51 dc1
= net
.addDatacenter("dc1")
54 # add the command line interface endpoint to each DC (REST API)
55 rapi1
= RestApiEndpoint("0.0.0.0", 5001)
56 rapi1
.connectDCNetwork(net
)
57 rapi1
.connectDatacenter(dc1
)
58 # run API endpoint server (in another thread, don't block)
62 # add the SONATA dummy gatekeeper to each DC
63 sdkg1
= SonataDummyGatekeeperEndpoint("0.0.0.0", 5000, deploy_sap
=True)
64 sdkg1
.connectDatacenter(dc1
)
65 # run the dummy gatekeeper (in another thread, don't block)
68 # start the emulation platform
75 setLogLevel('info') # set Mininet loglevel
79 if __name__
== '__main__':