Commit 222c46e1 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

PathComp component - Frontend:

- Added IP SDN Ctrl as a packet device in sub-service composer and resource groups
- Added logic to separate connections managed by intermediate SDN controllers
parent 51415915
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -95,6 +95,36 @@ def convert_explicit_path_hops_to_connections(
            connections.append(connection)
            connection_stack.queue[-1][3].append(connection[0])
            #connection_stack.queue[-1][2].append(path_hop)
        elif prv_res_class[2] is None and res_class[2] is not None:
            # entering domain of a device controller, create underlying connection
            LOGGER.debug('  entering domain of a device controller, create underlying connection')
            sub_service_uuid = str(uuid.uuid4())
            prv_service_type = connection_stack.queue[-1][1]
            service_type = get_service_type(res_class[1], prv_service_type)
            connection_stack.put((sub_service_uuid, service_type, [path_hop], []))
        elif prv_res_class[2] is not None and res_class[2] is None:
            # leaving domain of a device controller, terminate underlying connection
            LOGGER.debug('  leaving domain of a device controller, terminate underlying connection')
            connection = connection_stack.get()
            connections.append(connection)
            connection_stack.queue[-1][3].append(connection[0])
            connection_stack.queue[-1][2].append(path_hop)
        elif prv_res_class[2] is not None and res_class[2] is not None:
            if prv_res_class[2] == res_class[2]:
                # stay in domain of a device controller, connection continues
                LOGGER.debug('  stay in domain of a device controller, connection continues')
                connection_stack.queue[-1][2].append(path_hop)
            else:
                # switching to different device controller, chain connections
                LOGGER.debug('  switching to different device controller, chain connections')
                connection = connection_stack.get()
                connections.append(connection)
                connection_stack.queue[-1][3].append(connection[0])

                sub_service_uuid = str(uuid.uuid4())
                prv_service_type = connection_stack.queue[-1][1]
                service_type = get_service_type(res_class[1], prv_service_type)
                connection_stack.put((sub_service_uuid, service_type, [path_hop], []))
        elif prv_res_class[0] is None:
            # path ingress
            LOGGER.debug('  path ingress')
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ DEVICE_TYPE_TO_DEEPNESS = {
    DeviceTypeEnum.DATACENTER.value                      : 90,

    DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value          : 80,
    DeviceTypeEnum.EMULATED_IP_SDN_CONTROLLER.value      : 80,
    DeviceTypeEnum.IP_SDN_CONTROLLER.value               : 80,

    DeviceTypeEnum.EMULATED_PACKET_ROUTER.value          : 70,
    DeviceTypeEnum.PACKET_ROUTER.value                   : 70,

+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ NETWORK_DEVICE_TYPES = {

PACKET_DEVICE_TYPES = {
    DeviceTypeEnum.TERAFLOWSDN_CONTROLLER,
    DeviceTypeEnum.IP_SDN_CONTROLLER, DeviceTypeEnum.EMULATED_IP_SDN_CONTROLLER,
    DeviceTypeEnum.PACKET_ROUTER, DeviceTypeEnum.EMULATED_PACKET_ROUTER,
    DeviceTypeEnum.PACKET_SWITCH, DeviceTypeEnum.EMULATED_PACKET_SWITCH,
}