def create_topology1():
    net = DCNetwork(monitor=False, enable_learning=True)
    dc1 = net.addDatacenter("dc1")

    heatapi1 = OpenstackApiEndpoint("0.0.0.0", 5001)

    # connect data center to this endpoint
    heatapi1.connect_datacenter(dc1)

    # heatapirun API endpoint server (in another thread, don't block)
    heatapi1.start()

    heatapi1.connect_dc_network(net)

    net.start()
Exemple #2
0
def create_topology1():
    net = DCNetwork(monitor=True, enable_learning=True)
    dc1 = net.addDatacenter("datacenter1")

    heatapi1 = OpenstackApiEndpoint("131.234.31.45", 5001)

    # connect data center to this endpoint
    heatapi1.connect_datacenter(dc1)

    # heatapirun API endpoint server (in another thread, don't block)
    heatapi1.start()

    heatapi1.connect_dc_network(net)

    net.start()
    net.CLI()
    # when the user types exit in the CLI, we stop the emulator
    net.stop()
Exemple #3
0
 def _create_openstack_api_endpoints(self):
     # create
     api1 = OpenstackApiEndpoint("0.0.0.0", 6001)
     api2 = OpenstackApiEndpoint("0.0.0.0", 6002)
     api3 = OpenstackApiEndpoint("0.0.0.0", 6003)
     api4 = OpenstackApiEndpoint("0.0.0.0", 6004)
     # connect PoPs
     api1.connect_datacenter(self.pop1)
     api2.connect_datacenter(self.pop2)
     api3.connect_datacenter(self.pop3)
     api4.connect_datacenter(self.pop4)
     # connect network
     api1.connect_dc_network(self)
     api2.connect_dc_network(self)
     api3.connect_dc_network(self)
     api4.connect_dc_network(self)
     # start
     api1.start()
     api2.start()
     api3.start()
     api4.start()
Exemple #4
0
def create_topology1():
    net = DCNetwork(monitor=True, enable_learning=False)
    dc1 = net.addDatacenter("dc1")
    dc2 = net.addDatacenter("dc2")
    dc3 = net.addDatacenter("dc3")
    dc4 = net.addDatacenter("dc4")

    heatapi1 = OpenstackApiEndpoint("0.0.0.0", 5001)
    heatapi2 = OpenstackApiEndpoint("0.0.0.0", 5002)
    heatapi3 = OpenstackApiEndpoint("0.0.0.0", 5003)
    heatapi4 = OpenstackApiEndpoint("0.0.0.0", 5004)

    # connect data centers to this endpoint
    heatapi1.connect_datacenter(dc1)
    heatapi2.connect_datacenter(dc2)
    heatapi3.connect_datacenter(dc3)
    heatapi4.connect_datacenter(dc4)

    s1 = net.addSwitch("s1")
    net.addLink(dc1, s1, jitter="10ms", delay="12ms", loss=0, bw=0.5)
    net.addLink(dc2, s1, bw=0.5, loss=0, delay="20ms", jitter="15ms")
    net.addLink(dc3, s1, delay="30ms", loss=1, bw=0.5, jitter="10ms")
    net.addLink(dc4, s1, delay="40ms", loss=2, bw=1, jitter="10ms")
    # heatapirun API endpoint server (in another thread, don't block)
    heatapi1.start()
    heatapi2.start()
    heatapi3.start()
    heatapi4.start()

    heatapi1.connect_dc_network(net)
    heatapi2.connect_dc_network(net)
    heatapi3.connect_dc_network(net)
    heatapi4.connect_dc_network(net)

    net.start()
    net.CLI()
    # when the user types exit in the CLI, we stop the emulator
    net.stop()