Exemplo n.º 1
0
def ovs_reset_bridges():
    mconfig = get_mconfig_manager().load_service_mconfig(
        'pipelined', mconfigs_pb2.PipelineD(),
    )
    service_config = load_service_config('pipelined')
    if service_config.get('enable_nat', mconfig.nat_enabled):
        non_nat_sgi_interface = ""
        sgi_management_iface_ip_addr = ""
        sgi_management_iface_gw = ""
    else:
        non_nat_sgi_interface = service_config['nat_iface']
        sgi_management_iface_ip_addr = service_config.get(
           'sgi_management_iface_ip_addr', mconfig.sgi_management_iface_ip_addr,
        )
        sgi_management_iface_gw = service_config.get(
           'sgi_management_iface_gw', mconfig.sgi_management_iface_gw,
        )

    sgi_bridge_name = service_config.get('uplink_bridge', "uplink_br0")

    reset_br = "magma-bridge-reset.sh -n %s %s %s %s" % \
               (
                   sgi_bridge_name,
                   non_nat_sgi_interface,
                   sgi_management_iface_ip_addr,
                   sgi_management_iface_gw,
               )
    print("ovs-restart: ", reset_br)
    subprocess.call(reset_br.split())
Exemplo n.º 2
0
def main():
    """
    Loads the Ryu apps we want to run from the config file.
    This should exit on keyboard interrupt.
    """

    # Run asyncio loop in a greenthread so we can evaluate other eventlets
    # TODO: Remove once Ryu migrates to asyncio
    asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy())

    service = MagmaService('pipelined', mconfigs_pb2.PipelineD())
    service_config = service.config

    if environment.is_dev_mode():
        of_rest_server.configure(service_config)

    # Set Ryu config params
    cfg.CONF.ofp_listen_host = "127.0.0.1"

    # Load the ryu apps
    service_manager = ServiceManager(service)
    service_manager.load()

    def callback(returncode):
        if returncode != 0:
            logging.error("Failed to set MASQUERADE: %d", returncode)

    if service.mconfig.nat_enabled:
        call_process(
            'iptables -t nat -A POSTROUTING -o %s -j MASQUERADE' %
            service.config['nat_iface'], callback, service.loop)

    service.loop.create_task(
        monitor_ifaces(service.config['monitored_ifaces'], service.loop), )

    manager = AppManager.get_instance()
    # Add pipelined rpc servicer
    pipelined_srv = PipelinedRpcServicer(
        service.loop, manager.applications.get('MeterStatsController', None),
        manager.applications.get('EnforcementController', None),
        manager.applications.get('EnforcementStatsController', None),
        manager.applications.get('DPIController', None),
        manager.applications.get('UEMacAddressController', None),
        manager.applications.get('PacketTracingController', None),
        service_manager)
    pipelined_srv.add_to_server(service.rpc_server)

    # Run the service loop
    service.run()

    # Cleanup the service
    service.close()
Exemplo n.º 3
0
 def _monitor(self, poll_interval=15):
     """
     Main thread that polls config updates and updates LI mirror flows
     """
     while True:
         li_imsis = load_service_mconfig('pipelined',
                                         mconfigs_pb2.PipelineD()).li_imsis
         imsis_to_add = [
             imsi for imsi in li_imsis if imsi not in self._li_imsis
         ]
         self._install_mirror_flows(imsis_to_add)
         imsis_to_rm = [
             imsi for imsi in self._li_imsis if imsi not in li_imsis
         ]
         self._remove_mirror_flows(imsis_to_rm)
         self._li_imsis = li_imsis
         hub.sleep(poll_interval)
Exemplo n.º 4
0
def output_datapath_actions(
    ue_ip: str, external_ip: str, external_port: str, ue_port: str, protocol: str
):
    """
    Returns the Output of Datapath Actions based as per the supplied UE IP
    """
    service = MagmaService("pipelined", mconfigs_pb2.PipelineD())
    if service.mconfig.nat_enabled:
        in_port = "local"
    else:
        in_port = "patch-up"

    cmd = ["sudo", "ovs-appctl", "ofproto/trace", "gtp_br0"]

    cmd_append = (
        protocol + ",in_port=" + in_port + ",ip_dst=" + ue_ip + ",ip_src=" + external_ip
    )

    if protocol != "icmp":
        cmd_append += (
            ","
            + protocol
            + "_src="
            + external_port
            + ","
            + protocol
            + "_dst="
            + ue_port
        )

    cmd.append(cmd_append)

    print("Running: " + " ".join(cmd))
    output = subprocess.check_output(cmd)
    output_str = str(output, "utf-8").strip()
    pattern = "Datapath\sactions:(.*)"
    match = re.search(pattern, output_str)
    if match:
        return match.group(1).strip()
    else:
        return "NA"
Exemplo n.º 5
0
    def __init__(self) -> None:
        """Initialize common ue network parameters and ovs commands"""

        # Dump flow table zero
        self.output_flow_table_zero = self.get_ovs_dump_flow_table_zero()

        # Parse the args
        parser = self.create_parser()
        self.args = parser.parse_args()

        # Get ue network parameters
        self.mtr_port = self.get_mtr0_port()
        self.ue_ip = self.find_ue_ip(self.args.imsi)

        service = MagmaService("pipelined", mconfigs_pb2.PipelineD())
        if service.mconfig.nat_enabled:
            self.ingress_in_port = "local"
        else:
            self.ingress_in_port = "patch-up"

        if self.args.direction == "UL":
            self.ingress_tun_id = self.get_ingress_tunid(
                self.ue_ip, self.ingress_in_port)

            if not self.ingress_tun_id:
                print("Ingress Tunnel not Found")
                exit(1)

            data = self.get_egress_tunid_and_port(self.ue_ip,
                                                  self.ingress_tun_id)
            if data:
                self.egress_tun_id = data["tun_id"]
                self.egress_in_port = data["in_port"]
            else:
                print("Egress Tunnel not Found")
                exit(1)
Exemplo n.º 6
0
    def _monitor(self, poll_interval=15):
        """
        Main thread that polls config updates and updates LI mirror flows
        """
        while True:
            mconfg_li_imsis = load_service_mconfig(
                'pipelined',
                mconfigs_pb2.PipelineD(),
            ).li_ues.imsis

            li_imsis = []
            for imsi in mconfg_li_imsis:
                if any(i.isdigit() for i in imsi):
                    li_imsis.append(imsi)
            imsis_to_add = [
                imsi for imsi in li_imsis if imsi not in self._li_imsis
            ]
            self._install_mirror_flows(imsis_to_add)
            imsis_to_rm = [
                imsi for imsi in self._li_imsis if imsi not in li_imsis
            ]
            self._remove_mirror_flows(imsis_to_rm)
            self._li_imsis = li_imsis
            hub.sleep(poll_interval)
Exemplo n.º 7
0
def main():
    """
    Loads the Ryu apps we want to run from the config file.
    This should exit on keyboard interrupt.
    """

    # Run asyncio loop in a greenthread so we can evaluate other eventlets
    # TODO: Remove once Ryu migrates to asyncio
    asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy())

    service = MagmaService('pipelined', mconfigs_pb2.PipelineD())

    # Optionally pipe errors to Sentry
    sentry_init(service_name=service.name)

    service_config = service.config

    if environment.is_dev_mode():
        of_rest_server.configure(service_config)

    # Set Ryu config params
    cfg.CONF.ofp_listen_host = "127.0.0.1"

    # override mconfig using local config.
    # TODO: move config compilation to separate module.
    enable_nat = service.config.get('enable_nat', service.mconfig.nat_enabled)
    service.config['enable_nat'] = enable_nat
    logging.info("Nat: %s", enable_nat)
    vlan_tag = service.config.get(
        'sgi_management_iface_vlan',
        service.mconfig.sgi_management_iface_vlan,
    )
    service.config['sgi_management_iface_vlan'] = vlan_tag

    sgi_ip = service.config.get(
        'sgi_management_iface_ip_addr',
        service.mconfig.sgi_management_iface_ip_addr,
    )
    service.config['sgi_management_iface_ip_addr'] = sgi_ip

    sgi_gateway_ip = service.config.get(
        'sgi_management_iface_gw',
        service.mconfig.sgi_management_iface_gw,
    )
    service.config['sgi_management_iface_gw'] = sgi_gateway_ip

    # Keep router mode off for smooth upgrade path
    service.config['dp_router_enabled'] = service.config.get(
        'dp_router_enabled',
        False,
    )
    if 'virtual_mac' not in service.config:
        if service.config['dp_router_enabled']:
            up_bridge_name = service.config.get(
                'uplink_bridge', UPLINK_OVS_BRIDGE_NAME,
            )
            mac_addr = get_if_hwaddr(up_bridge_name)
        else:
            mac_addr = get_if_hwaddr(service.config.get('bridge_name'))

        service.config['virtual_mac'] = mac_addr

    # this is not read from yml file.
    service.config['uplink_port'] = OFPP_LOCAL
    uplink_port_name = service.config.get('ovs_uplink_port_name', None)
    if enable_nat is False and uplink_port_name is not None:
        service.config['uplink_port'] = BridgeTools.get_ofport(
            uplink_port_name,
        )

    # header enrichment related configuration.
    service.config['proxy_port_name'] = PROXY_PORT_NAME
    he_enabled_flag = False
    if service.mconfig.he_config:
        he_enabled_flag = service.mconfig.he_config.enable_header_enrichment
    he_enabled = service.config.get('he_enabled', he_enabled_flag)
    service.config['he_enabled'] = he_enabled

    # monitoring related configuration
    mtr_interface = service.config.get('mtr_interface', None)
    if mtr_interface:
        mtr_ip = get_ip_from_if(mtr_interface)
        service.config['mtr_ip'] = mtr_ip

    # Load the ryu apps
    service_manager = ServiceManager(service)
    service_manager.load()

    def callback(returncode):
        if returncode != 0:
            logging.error(
                "Failed to set MASQUERADE: %d", returncode,
            )

    # TODO fix this hack for XWF
    if enable_nat is True or service.config.get('setup_type') == 'XWF':
        call_process(
            'iptables -t nat -A POSTROUTING -o %s -j MASQUERADE'
            % service.config['nat_iface'],
            callback,
            service.loop,
        )

    service.loop.create_task(
        monitor_ifaces(
            service.config['monitored_ifaces'],
        ),
    )

    manager = AppManager.get_instance()
    # Add pipelined rpc servicer
    pipelined_srv = PipelinedRpcServicer(
        service.loop,
        manager.applications.get('GYController', None),
        manager.applications.get('EnforcementController', None),
        manager.applications.get('EnforcementStatsController', None),
        manager.applications.get('DPIController', None),
        manager.applications.get('UEMacAddressController', None),
        manager.applications.get('CheckQuotaController', None),
        manager.applications.get('IPFIXController', None),
        manager.applications.get('VlanLearnController', None),
        manager.applications.get('TunnelLearnController', None),
        manager.applications.get('Classifier', None),
        manager.applications.get('InOutController', None),
        manager.applications.get('NGServiceController', None),
        service.config,
        service_manager,
    )
    pipelined_srv.add_to_server(service.rpc_server)

    if service.config['setup_type'] == 'CWF':
        bridge_ip = service.config['bridge_ip_address']
        has_quota_port = service.config['has_quota_port']
        no_quota_port = service.config['no_quota_port']

        def on_exit_server_thread():
            service.StopService(None, None)

        # For CWF start quota check servers
        start_check_quota_server(
            run_flask, bridge_ip, has_quota_port, True,
            on_exit_server_thread,
        )
        start_check_quota_server(
            run_flask, bridge_ip, no_quota_port, False,
            on_exit_server_thread,
        )

    if service.config['setup_type'] == 'LTE':
        polling_interval = service.config.get(
            'ovs_gtp_stats_polling_interval',
            MIN_OVSDB_DUMP_POLLING_INTERVAL,
        )
        collector = GTPStatsCollector(
            polling_interval,
            service.loop,
        )
        collector.start()

    # Run the service loop
    service.run()

    # Cleanup the service
    service.close()
Exemplo n.º 8
0
def output_datapath_actions(
    imsi: str,
    direction: str,
    ue_ip: str,
    external_ip: str,
    external_port: str,
    ue_port: str,
    protocol: str,
):
    """
    Returns the Output of Datapath Actions based as per the supplied UE IP
    """
    service = MagmaService("pipelined", mconfigs_pb2.PipelineD())
    cmd = ["sudo", "ovs-appctl", "ofproto/trace", "gtp_br0"]
    if service.mconfig.nat_enabled:
        in_port = "local"
    else:
        in_port = "patch-up"

    if direction == "DL":

        cmd_append = (
            protocol
            + ",in_port="
            + in_port
            + ",ip_dst="
            + ue_ip
            + ",ip_src="
            + external_ip
        )

        if protocol != "icmp":
            cmd_append += (
                ","
                + protocol
                + "_src="
                + external_port
                + ","
                + protocol
                + "_dst="
                + ue_port
            )

        cmd.append(cmd_append)

    elif direction == "UL":
        ingress_tun_id = get_ingress_tunid(ue_ip, in_port)
        if not ingress_tun_id:
            print("Ingress Tunnel not Found")
            exit(1)

        data = get_egress_tunid_and_port(ue_ip, ingress_tun_id)
        if not data:
            print("Egress Tunnel not Found")
            exit(1)

        cmd_append = (
            protocol
            + ",in_port="
            + data["in_port"]
            + ",tun_id="
            + data["tun_id"]
            + ",ip_dst="
            + external_ip
            + ",ip_src="
            + ue_ip
        )

        if protocol != "icmp":
            cmd_append += (
                ","
                + protocol
                + "_src="
                + ue_port
                + ","
                + protocol
                + "_dst="
                + external_port
            )

        cmd.append(cmd_append)
    else:
        return

    print("Running: " + " ".join(cmd))
    output = subprocess.check_output(cmd)
    output_str = str(output, "utf-8").strip()
    pattern = "Datapath\sactions:(.*)"
    match = re.search(pattern, output_str)
    if match:
        return match.group(1).strip()
    else:
        return
Exemplo n.º 9
0
def main():
    """
    Loads the Ryu apps we want to run from the config file.
    This should exit on keyboard interrupt.
    """

    # Run asyncio loop in a greenthread so we can evaluate other eventlets
    # TODO: Remove once Ryu migrates to asyncio
    asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy())

    service = MagmaService('pipelined', mconfigs_pb2.PipelineD())
    service_config = service.config

    if environment.is_dev_mode():
        of_rest_server.configure(service_config)

    # Set Ryu config params
    cfg.CONF.ofp_listen_host = "127.0.0.1"

    # Load the ryu apps
    service_manager = ServiceManager(service)
    service_manager.load()

    def callback(returncode):
        if returncode != 0:
            logging.error(
                "Failed to set MASQUERADE: %d", returncode
            )

    if service.mconfig.nat_enabled:
        call_process('iptables -t nat -A POSTROUTING -o %s -j MASQUERADE'
                     % service.config['nat_iface'],
                     callback,
                     service.loop
                     )

    service.loop.create_task(monitor_ifaces(
        service.config['monitored_ifaces'],
        service.loop),
    )

    manager = AppManager.get_instance()
    # Add pipelined rpc servicer
    pipelined_srv = PipelinedRpcServicer(
        service.loop,
        manager.applications.get('EnforcementController', None),
        manager.applications.get('EnforcementStatsController', None),
        manager.applications.get('DPIController', None),
        manager.applications.get('UEMacAddressController', None),
        manager.applications.get('CheckQuotaController', None),
        manager.applications.get('IPFIXController', None),
        manager.applications.get('VlanLearnController', None),
        manager.applications.get('TunnelLearnController', None),
        service_manager)
    pipelined_srv.add_to_server(service.rpc_server)

    if service.config['setup_type'] == 'CWF':
        bridge_ip = service.config['bridge_ip_address']
        has_quota_port = service.config['has_quota_port']
        no_quota_port = service.config['no_quota_port']

        def on_exit_server_thread():
            service.StopService(None, None)

        # For CWF start quota check servers
        start_check_quota_server(run_flask, bridge_ip, has_quota_port, True,
                                 on_exit_server_thread)
        start_check_quota_server(run_flask, bridge_ip, no_quota_port, False,
                                 on_exit_server_thread)

    # Run the service loop
    service.run()

    # Cleanup the service
    service.close()
Exemplo n.º 10
0
def main():
    """
    Loads the Ryu apps we want to run from the config file.
    This should exit on keyboard interrupt.
    """

    # Run asyncio loop in a greenthread so we can evaluate other eventlets
    # TODO: Remove once Ryu migrates to asyncio
    asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy())

    service = MagmaService('pipelined', mconfigs_pb2.PipelineD())
    service_config = service.config

    if environment.is_dev_mode():
        of_rest_server.configure(service_config)

    # Set Ryu config params
    cfg.CONF.ofp_listen_host = "127.0.0.1"

    # override mconfig using local config.
    # TODO: move config compilation to separate module.
    enable_nat = service.config.get('enable_nat', service.mconfig.nat_enabled)
    service.config['enable_nat'] = enable_nat
    logging.info("Nat: %s", enable_nat)
    vlan_tag = service.config.get('sgi_management_iface_vlan',
                                  service.mconfig.sgi_management_iface_vlan)
    service.config['sgi_management_iface_vlan'] = vlan_tag

    sgi_ip = service.config.get('sgi_management_iface_ip_addr',
                                service.mconfig.sgi_management_iface_ip_addr)
    service.config['sgi_management_iface_ip_addr'] = sgi_ip

    if 'virtual_mac' not in service.config:
        service.config['virtual_mac'] = get_if_hwaddr(
            service.config.get('bridge_name'))

    # Load the ryu apps
    service_manager = ServiceManager(service)
    service_manager.load()

    def callback(returncode):
        if returncode != 0:
            logging.error("Failed to set MASQUERADE: %d", returncode)

    # TODO fix this hack for XWF
    if enable_nat is True or service.config.get('setup_type') == 'XWF':
        call_process(
            'iptables -t nat -A POSTROUTING -o %s -j MASQUERADE' %
            service.config['nat_iface'], callback, service.loop)

    service.loop.create_task(
        monitor_ifaces(service.config['monitored_ifaces'], service.loop), )

    manager = AppManager.get_instance()
    # Add pipelined rpc servicer
    pipelined_srv = PipelinedRpcServicer(
        service.loop, manager.applications.get('GYController', None),
        manager.applications.get('EnforcementController', None),
        manager.applications.get('EnforcementStatsController', None),
        manager.applications.get('DPIController', None),
        manager.applications.get('UEMacAddressController', None),
        manager.applications.get('CheckQuotaController', None),
        manager.applications.get('IPFIXController', None),
        manager.applications.get('VlanLearnController', None),
        manager.applications.get('TunnelLearnController', None),
        service_manager)
    pipelined_srv.add_to_server(service.rpc_server)

    if service.config['setup_type'] == 'CWF':
        bridge_ip = service.config['bridge_ip_address']
        has_quota_port = service.config['has_quota_port']
        no_quota_port = service.config['no_quota_port']

        def on_exit_server_thread():
            service.StopService(None, None)

        # For CWF start quota check servers
        start_check_quota_server(run_flask, bridge_ip, has_quota_port, True,
                                 on_exit_server_thread)
        start_check_quota_server(run_flask, bridge_ip, no_quota_port, False,
                                 on_exit_server_thread)

    if service.config['setup_type'] == 'LTE':
        polling_interval = service.config.get('ovs_gtp_stats_polling_interval',
                                              MIN_OVSDB_DUMP_POLLING_INTERVAL)
        collector = GTPStatsCollector(polling_interval, service.loop)
        collector.start()

    # Run the service loop
    service.run()

    # Cleanup the service
    service.close()
Exemplo n.º 11
0
def main():
    """
    Loads the Ryu apps we want to run from the config file.
    This should exit on keyboard interrupt.
    """

    # Run asyncio loop in a greenthread so we can evaluate other eventlets
    # TODO: Remove once Ryu migrates to asyncio
    asyncio.set_event_loop_policy(aioeventlet.EventLoopPolicy())

    service = MagmaService('pipelined', mconfigs_pb2.PipelineD())

    # Optionally pipe errors to Sentry
    sentry_init(service_name=service.name, sentry_mconfig=service.shared_mconfig.sentry_config)

    service_config = service.config

    if environment.is_dev_mode():
        of_rest_server.configure(service_config)

    # Set Ryu config params
    cfg.CONF.ofp_listen_host = "127.0.0.1"

    # override mconfig using local config.
    # TODO: move config compilation to separate module.
    enable_nat = service.config.get('enable_nat', service.mconfig.nat_enabled)
    service.config['enable_nat'] = enable_nat
    logging.info("Nat: %s", enable_nat)
    enable5g_features = service.config.get(
        'enable5g_features',
        service.mconfig.enable5g_features,
    )
    service.config['enable5g_features'] = enable5g_features
    logging.info("enable5g_features: %s", enable5g_features)
    vlan_tag = service.config.get(
        'sgi_management_iface_vlan',
        service.mconfig.sgi_management_iface_vlan,
    )
    service.config['sgi_management_iface_vlan'] = vlan_tag

    sgi_ip = service.config.get(
        'sgi_management_iface_ip_addr',
        service.mconfig.sgi_management_iface_ip_addr,
    )
    service.config['sgi_management_iface_ip_addr'] = sgi_ip

    sgi_gateway_ip = service.config.get(
        'sgi_management_iface_gw',
        service.mconfig.sgi_management_iface_gw,
    )
    service.config['sgi_management_iface_gw'] = sgi_gateway_ip

    # SGi IPv6 address conf
    sgi_ipv6 = service.config.get(
        'sgi_management_iface_ipv6_addr',
        service.mconfig.sgi_management_iface_ipv6_addr,
    )
    service.config['sgi_management_iface_ipv6_addr'] = sgi_ipv6

    sgi_gateway_ipv6 = service.config.get(
        'sgi_management_iface_ipv6_gw',
        service.mconfig.sgi_management_iface_ipv6_gw,
    )
    service.config['sgi_management_iface_ipv6_gw'] = sgi_gateway_ipv6

    # Keep router mode off for smooth upgrade path
    service.config['dp_router_enabled'] = service.config.get(
        'dp_router_enabled',
        False,
    )
    if 'virtual_mac' not in service.config:
        if service.config['dp_router_enabled']:
            up_iface_name = service.config.get('nat_iface', None)
            mac_addr = get_if_hwaddr(up_iface_name)
        else:
            mac_addr = get_if_hwaddr(service.config.get('bridge_name'))

        service.config['virtual_mac'] = mac_addr

    # this is not read from yml file.
    service.config['uplink_port'] = OFPP_LOCAL
    uplink_port_name = service.config.get('ovs_uplink_port_name', None)
    if enable_nat is False and uplink_port_name is not None:
        service.config['uplink_port'] = BridgeTools.get_ofport(
            uplink_port_name,
        )

    # header enrichment related configuration.
    service.config['proxy_port_name'] = PROXY_PORT_NAME
    he_enabled_flag = False
    if service.mconfig.he_config:
        he_enabled_flag = service.mconfig.he_config.enable_header_enrichment
        if he_enabled_flag:
            bridge = service.config.get('bridge_name')
            BridgeTools.add_ovs_port(bridge, PROXY_PORT_NAME, PROXY_OF_PORT)

    he_enabled = service.config.get('he_enabled', he_enabled_flag)
    service.config['he_enabled'] = he_enabled

    # tune datapath according to config
    configure_tso(service.config)
    setup_sgi_tunnel(service.config, service.loop)
    tune_datapath(service.config)
    setup_masquerade_rule(service.config, service.loop)

    # monitoring related configuration
    mtr_interface = service.config.get('mtr_interface', None)
    if mtr_interface:
        try:
            service.config['mtr_ip'] = get_ip_from_if(mtr_interface)
        except ValueError:
            logging.warning("Unable to set up mtr interface", exc_info=True)

    # Load the ryu apps
    service_manager = ServiceManager(service)
    service_manager.load()

    service.loop.create_task(
        monitor_ifaces(
            service.config['monitored_ifaces'],
        ),
    )

    manager = AppManager.get_instance()
    # Add pipelined rpc servicer
    pipelined_srv = PipelinedRpcServicer(
        service.loop,
        manager.applications.get('GYController', None),
        manager.applications.get('EnforcementController', None),
        manager.applications.get('EnforcementStatsController', None),
        manager.applications.get('DPIController', None),
        manager.applications.get('UEMacAddressController', None),
        manager.applications.get('CheckQuotaController', None),
        manager.applications.get('IPFIXController', None),
        manager.applications.get('VlanLearnController', None),
        manager.applications.get('TunnelLearnController', None),
        manager.applications.get('Classifier', None),
        manager.applications.get('InOutController', None),
        manager.applications.get('NGServiceController', None),
        service.config,
        service_manager,
    )
    pipelined_srv.add_to_server(service.rpc_server)

    if service.config['setup_type'] == 'CWF':
        bridge_ip = service.config['bridge_ip_address']
        has_quota_port = service.config['has_quota_port']
        no_quota_port = service.config['no_quota_port']

        def on_exit_server_thread():
            service.StopService(None, None)

        # For CWF start quota check servers
        start_check_quota_server(
            run_flask, bridge_ip, has_quota_port, True,
            on_exit_server_thread,
        )
        start_check_quota_server(
            run_flask, bridge_ip, no_quota_port, False,
            on_exit_server_thread,
        )

    if service.config['setup_type'] == 'LTE':
        polling_interval = service.config.get(
            'ovs_gtp_stats_polling_interval',
            MIN_OVSDB_DUMP_POLLING_INTERVAL,
        )
        collector = GTPStatsCollector(
            polling_interval,
            service.loop,
        )
        collector.start()

    # Run the service loop
    service.run()

    # Cleanup the service
    service.close()