diff --git a/proto/context.proto b/proto/context.proto index 9f06d32ee04b5102ce2af511f45f8de34f984599..c275621a4086e7bc5e088d3757b5e12f54d0c8af 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -223,6 +223,9 @@ enum DeviceDriverEnum { DEVICEDRIVER_IETF_ACTN = 10; DEVICEDRIVER_OC = 11; DEVICEDRIVER_QKD = 12; + DEVICEDRIVER_IETF_L3VPN = 13; + DEVICEDRIVER_IETF_SLICE = 14; + DEVICEDRIVER_NCE = 15; } enum DeviceOperationalStatusEnum { diff --git a/src/common/DeviceTypes.py b/src/common/DeviceTypes.py index eb315352b47bbe501f66868c0181a0d34cd6cfed..30bbd0b15e9d199294a3d7ee7826b22695d0e45c 100644 --- a/src/common/DeviceTypes.py +++ b/src/common/DeviceTypes.py @@ -52,3 +52,6 @@ class DeviceTypeEnum(Enum): # ETSI TeraFlowSDN controller TERAFLOWSDN_CONTROLLER = 'teraflowsdn' + IETF_SLICE = 'ietf-slice' + + NCE = 'nce' \ No newline at end of file diff --git a/src/common/tools/descriptor/Tools.py b/src/common/tools/descriptor/Tools.py index c8807cef0d1357c732d34b11580d1f73e157501a..2ecd38ae146f5c5e3a04a84ad3bb05385554f659 100644 --- a/src/common/tools/descriptor/Tools.py +++ b/src/common/tools/descriptor/Tools.py @@ -115,6 +115,8 @@ CONTROLLER_DEVICE_TYPES = { DeviceTypeEnum.MICROWAVE_RADIO_SYSTEM.value, DeviceTypeEnum.OPEN_LINE_SYSTEM.value, DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value, + DeviceTypeEnum.IETF_SLICE.value, + DeviceTypeEnum.NCE.value, } def split_controllers_and_network_devices(devices : List[Dict]) -> Tuple[List[Dict], List[Dict]]: diff --git a/src/context/service/database/models/enums/DeviceDriver.py b/src/context/service/database/models/enums/DeviceDriver.py index 5342f788a7b273aa7f6ae3c5779774165cd852bc..fe0d83fb1886a42526b1c71304b7e3ecc2b0b7d7 100644 --- a/src/context/service/database/models/enums/DeviceDriver.py +++ b/src/context/service/database/models/enums/DeviceDriver.py @@ -33,6 +33,9 @@ class ORM_DeviceDriverEnum(enum.Enum): GNMI_OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG OPTICAL_TFS = DeviceDriverEnum.DEVICEDRIVER_OPTICAL_TFS IETF_ACTN = DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN + IETF_L3VPN = DeviceDriverEnum.DEVICEDRIVER_IETF_L3VPN + NCE = DeviceDriverEnum.DEVICEDRIVER_NCE + IETF_SLICE = DeviceDriverEnum.DEVICEDRIVER_IETF_SLICE OC = DeviceDriverEnum.DEVICEDRIVER_OC QKD = DeviceDriverEnum.DEVICEDRIVER_QKD diff --git a/src/device/service/drivers/__init__.py b/src/device/service/drivers/__init__.py index b99ee50ca8319ab96f9062a3c58c356fa2ae7ec7..bfadaafdd7961cc6ce09ee8491503b15e42a7ab8 100644 --- a/src/device/service/drivers/__init__.py +++ b/src/device/service/drivers/__init__.py @@ -90,6 +90,24 @@ DRIVERS.append( } ])) +from .ietf_slice.driver import IetfSliceDriver # pylint: disable=wrong-import-position +DRIVERS.append( + (IetfSliceDriver, [ + { + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.IETF_SLICE, + FilterFieldEnum.DRIVER: DeviceDriverEnum.DEVICEDRIVER_IETF_SLICE, + } + ])) + +from .nce.driver import NCEDriver # pylint: disable=wrong-import-position +DRIVERS.append( + (NCEDriver, [ + { + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.NCE, + FilterFieldEnum.DRIVER: DeviceDriverEnum.DEVICEDRIVER_NCE, + } + ])) + if LOAD_ALL_DEVICE_DRIVERS: from .openconfig.OpenConfigDriver import OpenConfigDriver # pylint: disable=wrong-import-position DRIVERS.append( diff --git a/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py b/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py index f0775371d0f3fea01411ce4049226377feebc27e..ca0b5b480c005324bc856cb82627940dbc0210b8 100644 --- a/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py +++ b/src/pathcomp/frontend/service/algorithms/tools/ComposeConfigRules.py @@ -22,6 +22,7 @@ LOGGER = logging.getLogger(__name__) SETTINGS_RULE_NAME = '/settings' STATIC_ROUTING_RULE_NAME = '/static_routing' +IETF_DATA = 'ietf_data' RE_UUID = re.compile(r'([0-9a-fA-F]{8})\-([0-9a-fA-F]{4})\-([0-9a-fA-F]{4})\-([0-9a-fA-F]{4})\-([0-9a-fA-F]{12})') @@ -93,6 +94,7 @@ def compose_l3nm_config_rules(main_service_config_rules : List, subservice_confi CONFIG_RULES = [ (SETTINGS_RULE_NAME, L3NM_SETTINGS_FIELD_DEFAULTS), (STATIC_ROUTING_RULE_NAME, {}), + (IETF_DATA, {}), ] for rule_name, defaults in CONFIG_RULES: compose_config_rules(main_service_config_rules, subservice_config_rules, rule_name, defaults) diff --git a/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py b/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py index 42635bf4ad5cfd1a1a4cb174b73d26c51576af9a..eebdfc25e9d021921454672065fc18220f677227 100644 --- a/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py +++ b/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py @@ -26,6 +26,9 @@ DEVICE_TYPE_TO_DEEPNESS = { DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value : 80, DeviceTypeEnum.EMULATED_IP_SDN_CONTROLLER.value : 80, DeviceTypeEnum.IP_SDN_CONTROLLER.value : 80, + DeviceTypeEnum.IETF_SLICE.value : 80, + DeviceTypeEnum.NCE.value : 80, + DeviceTypeEnum.EMULATED_PACKET_ROUTER.value : 70, DeviceTypeEnum.PACKET_ROUTER.value : 70, diff --git a/src/pathcomp/frontend/service/algorithms/tools/ServiceTypes.py b/src/pathcomp/frontend/service/algorithms/tools/ServiceTypes.py index 8230092c2decc0b2c988f63a2677f879f7ec944f..ae567d9d65e4d971930fecb0971672f5bdb1ab73 100644 --- a/src/pathcomp/frontend/service/algorithms/tools/ServiceTypes.py +++ b/src/pathcomp/frontend/service/algorithms/tools/ServiceTypes.py @@ -22,6 +22,7 @@ NETWORK_DEVICE_TYPES = { PACKET_DEVICE_TYPES = { DeviceTypeEnum.TERAFLOWSDN_CONTROLLER, + DeviceTypeEnum.IETF_SLICE, DeviceTypeEnum.NCE, DeviceTypeEnum.IP_SDN_CONTROLLER, DeviceTypeEnum.EMULATED_IP_SDN_CONTROLLER, DeviceTypeEnum.PACKET_ROUTER, DeviceTypeEnum.EMULATED_PACKET_ROUTER, DeviceTypeEnum.PACKET_SWITCH, DeviceTypeEnum.EMULATED_PACKET_SWITCH, diff --git a/src/service/service/service_handler_api/FilterFields.py b/src/service/service/service_handler_api/FilterFields.py index 78f084605bcd759825975cb7f11abc659506755b..585bad6b04ceb182587532d517459d508af416d9 100644 --- a/src/service/service/service_handler_api/FilterFields.py +++ b/src/service/service/service_handler_api/FilterFields.py @@ -42,6 +42,9 @@ DEVICE_DRIVER_VALUES = { DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_OPTICAL_TFS, DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN, + DeviceDriverEnum.DEVICEDRIVER_NCE, + DeviceDriverEnum.DEVICEDRIVER_IETF_SLICE, + DeviceDriverEnum.DEVICEDRIVER_IETF_L3VPN, DeviceDriverEnum.DEVICEDRIVER_OC, DeviceDriverEnum.DEVICEDRIVER_QKD, } diff --git a/src/service/service/service_handlers/__init__.py b/src/service/service/service_handlers/__init__.py index f93cf011fe02139ae350b91eab52eb71ded0574d..3d1ae9041443977985a13ca272bbe7a1b1cc0769 100644 --- a/src/service/service/service_handlers/__init__.py +++ b/src/service/service/service_handlers/__init__.py @@ -21,6 +21,8 @@ from .l3nm_emulated.L3NMEmulatedServiceHandler import L3NMEmulatedServiceHandler from .l3nm_openconfig.L3NMOpenConfigServiceHandler import L3NMOpenConfigServiceHandler from .l3nm_gnmi_openconfig.L3NMGnmiOpenConfigServiceHandler import L3NMGnmiOpenConfigServiceHandler from .l3nm_ietf_actn.L3NMIetfActnServiceHandler import L3NMIetfActnServiceHandler +from .l3nm_nce.L3NMNCEServiceHandler import L3NMNCEServiceHandler +from .l3slice_ietfslice.L3SliceIETFSliceServiceHandler import L3NMSliceIETFSliceServiceHandler from .microwave.MicrowaveServiceHandler import MicrowaveServiceHandler from .p4.p4_service_handler import P4ServiceHandler from .tapi_tapi.TapiServiceHandler import TapiServiceHandler @@ -66,6 +68,18 @@ SERVICE_HANDLERS = [ FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN, } ]), + (L3NMNCEServiceHandler, [ + { + FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_L3NM, + FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_NCE, + } + ]), + (L3NMSliceIETFSliceServiceHandler, [ + { + FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_L3NM, + FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_IETF_SLICE, + } + ]), (TapiServiceHandler, [ { FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, diff --git a/src/service/service/service_handlers/l3nm_emulated/ConfigRules.py b/src/service/service/service_handlers/l3nm_emulated/ConfigRules.py index 1d6764619e81864e9b048319a087f1a10f17d601..f1b02eab564c6a2eb38f25e4567a2a04ca0156ed 100644 --- a/src/service/service/service_handlers/l3nm_emulated/ConfigRules.py +++ b/src/service/service/service_handlers/l3nm_emulated/ConfigRules.py @@ -43,7 +43,7 @@ def setup_config_rules( vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400 address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1' address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30 - if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id) + if_subif_name = '{:s}.{:s}'.format(endpoint_name, str(vlan_id)) json_config_rules = [ json_config_rule_set( @@ -57,7 +57,7 @@ def setup_config_rules( 'name': endpoint_name, 'description': network_interface_desc, 'mtu': mtu, }), json_config_rule_set( - '/interface[{:s}]/subinterface[{:d}]'.format(endpoint_name, sub_interface_index), { + '/interface[{:s}]/subinterface[{:s}]'.format(endpoint_name, str(sub_interface_index)), { 'name': endpoint_name, 'index': sub_interface_index, 'description': network_subinterface_desc, 'vlan_id': vlan_id, 'address_ip': address_ip, 'address_prefix': address_prefix, @@ -163,7 +163,7 @@ def teardown_config_rules( #address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1' #address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30 - if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id) + if_subif_name = '{:s}.{:s}'.format(endpoint_name, str(vlan_id)) service_short_uuid = service_uuid.split('-')[-1] network_instance_name = '{:s}-NetInst'.format(service_short_uuid) #network_interface_desc = '{:s}-NetIf'.format(service_uuid) @@ -175,7 +175,7 @@ def teardown_config_rules( 'name': network_instance_name, 'id': if_subif_name, }), json_config_rule_delete( - '/interface[{:s}]/subinterface[{:d}]'.format(endpoint_name, sub_interface_index), { + '/interface[{:s}]/subinterface[{:s}]'.format(endpoint_name, str(sub_interface_index)), { 'name': endpoint_name, 'index': sub_interface_index, }), json_config_rule_delete( diff --git a/src/service/service/task_scheduler/TaskExecutor.py b/src/service/service/task_scheduler/TaskExecutor.py index 6fb1eca3497fef311605e2cd202ca74bd9cb730f..51fc42a5a5ea06d5abaa49946a154d0c38f6de8b 100644 --- a/src/service/service/task_scheduler/TaskExecutor.py +++ b/src/service/service/task_scheduler/TaskExecutor.py @@ -287,8 +287,12 @@ class TaskExecutor: devices.setdefault(device_type, dict())[device_uuid] = device else: if not exclude_managed_by_controller: - device_type = DeviceTypeEnum._value2member_map_[device.device_type] - devices.setdefault(device_type, dict())[device_uuid] = device + controller_device_type_enum = DeviceTypeEnum._value2member_map_[controller.device_type] + if controller_device_type_enum == DeviceTypeEnum.IETF_SLICE: + devices.setdefault(controller_device_type_enum, dict())[device_uuid] = device + else: + device_type = DeviceTypeEnum._value2member_map_[device.device_type] + devices.setdefault(device_type, dict())[device_uuid] = device device_type = DeviceTypeEnum._value2member_map_[controller.device_type] devices.setdefault(device_type, dict())[controller.device_id.device_uuid.uuid] = controller return devices @@ -321,7 +325,7 @@ class TaskExecutor: self, connection : Connection, service : Service, **service_handler_settings ) -> Dict[DeviceTypeEnum, Tuple['_ServiceHandler', Dict[str, Device]]]: connection_device_types : Dict[DeviceTypeEnum, Dict[str, Device]] = self.get_devices_from_connection( - connection, exclude_managed_by_controller=True + connection, exclude_managed_by_controller=False ) service_handlers : Dict[DeviceTypeEnum, Tuple['_ServiceHandler', Dict[str, Device]]] = dict() for device_type, connection_devices in connection_device_types.items():