Commit 9dfff1be authored by Georgios P. Katsikas's avatar Georgios P. Katsikas
Browse files

feat: upgraded SD-Fabric library with 5G UPF support

parent 9099c938
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -448,7 +448,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            if IPV4_SRC in acl_entry:
                try:
                    rules += rules_set_up_acl_filter_host(
                        ingress_port=port_id,
                        port_id=port_id,
                        ip_address=acl_entry[IPV4_SRC],
                        prefix_len=acl_entry[IPV4_PREFIX_LEN],
                        ip_direction="src",
@@ -461,7 +461,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            if IPV4_DST in acl_entry:
                try:
                    rules += rules_set_up_acl_filter_host(
                        ingress_port=port_id,
                        port_id=port_id,
                        ip_address=acl_entry[IPV4_DST],
                        prefix_len=acl_entry[IPV4_PREFIX_LEN],
                        ip_direction="dst",
@@ -474,7 +474,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            if TRN_PORT_SRC in acl_entry:
                try:
                    rules += rules_set_up_acl_filter_port(
                        ingress_port=port_id,
                        port_id=port_id,
                        transport_port=acl_entry[TRN_PORT_SRC],
                        transport_direction="src",
                        action=action
@@ -486,7 +486,7 @@ class P4FabricACLServiceHandler(_ServiceHandler):
            if TRN_PORT_DST in acl_entry:
                try:
                    rules += rules_set_up_acl_filter_port(
                        ingress_port=port_id,
                        port_id=port_id,
                        transport_port=acl_entry[TRN_PORT_DST],
                        transport_direction="dst",
                        action=action
+169 −40

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ def rules_set_up_int_recirculation_ports(
    for port in recirculation_port_list:
        rules_list.extend(
            rules_set_up_port(
                port=port,
                port_id=port,
                port_type=port_type,
                fwd_type=fwd_type,
                vlan_id=vlan_id,
+29 −17
Original line number Diff line number Diff line
@@ -410,6 +410,13 @@ class P4FabricINTServiceHandler(_ServiceHandler):
        dev_name = device_obj.name
        rules  = []

        port_id = self.__switch_info[dev_name][PORT_INT][PORT_ID]
        next_id = port_id
        mac_src = self.__switch_info[dev_name][MAC]
        collector_mac_dst = self.__int_collector_mac
        collector_ip_dst = self.__int_collector_ip
        vlan_id = self.__int_vlan_id

        ### INT reporting rules
        try:
            rules += rules_set_up_int_watchlist(action=action)
@@ -422,7 +429,7 @@ class P4FabricINTServiceHandler(_ServiceHandler):
                recirculation_port_list=self.__switch_info[dev_name][RECIRCULATION_PORT_LIST],
                port_type=PORT_TYPE_INT,
                fwd_type=FORWARDING_TYPE_UNICAST_IPV4,
                vlan_id=self.__int_vlan_id,
                vlan_id=vlan_id,
                action=action
            )
        except Exception as ex:
@@ -463,10 +470,10 @@ class P4FabricINTServiceHandler(_ServiceHandler):
        ### INT port setup rules
        try:
            rules += rules_set_up_port(
                port=self.__switch_info[dev_name][PORT_INT][PORT_ID],
                port_id=port_id,
                port_type=PORT_TYPE_HOST,
                fwd_type=FORWARDING_TYPE_BRIDGING,
                vlan_id=self.__int_vlan_id,
                vlan_id=vlan_id,
                action=action
            )
        except Exception as ex:
@@ -476,13 +483,17 @@ class P4FabricINTServiceHandler(_ServiceHandler):
        ### INT port forwarding rules
        try:
            rules += rules_set_up_fwd_bridging(
                vlan_id=self.__int_vlan_id,
                eth_dst=self.__int_collector_mac,
                egress_port=self.__switch_info[dev_name][PORT_INT][PORT_ID],
                port_id=port_id,
                vlan_id=vlan_id,
                eth_dst=collector_mac_dst,
                next_id=next_id,
                action=action
            )
            rules += rules_set_up_next_output_simple(
                egress_port=self.__switch_info[dev_name][PORT_INT][PORT_ID],
            rules += rules_set_up_next_profile_hashed_routing(
                port_id=port_id,
                next_id=next_id,
                eth_src=mac_src,
                eth_dst=collector_mac_dst,
                action=action
            )
        except Exception as ex:
@@ -491,16 +502,16 @@ class P4FabricINTServiceHandler(_ServiceHandler):

        ### INT packet routing rules
        try:
            rules += rules_set_up_next_routing_simple(
                egress_port=self.__switch_info[dev_name][PORT_INT][PORT_ID],
                eth_src=self.__switch_info[dev_name][MAC],
                eth_dst=self.__int_collector_mac,
            rules += rules_set_up_next_hashed(
                port_id=port_id,
                next_id=next_id,
                action=action
            )
            rules += rules_set_up_routing(
                ipv4_dst=self.__int_collector_ip,
                port_id=port_id,
                ipv4_dst=collector_ip_dst,
                ipv4_prefix_len=32,
                egress_port=self.__switch_info[dev_name][PORT_INT][PORT_ID],
                next_id=next_id,
                action=action
            )
        except Exception as ex:
@@ -587,13 +598,14 @@ class P4FabricINTServiceHandler(_ServiceHandler):
            return

        # Start the INT collector
        c_id = None
        c_uuid = None
        try:
            telemetry_frontend_client = TelemetryFrontendClient()
            c_id: CollectorId = telemetry_frontend_client.StartCollector(collect_int) # type: ignore
            assert c_id.collector_id.uuid, "INT collector failed to start"
            c_uuid = c_id.collector_id.uuid
            assert c_uuid, "INT collector failed to start"
        except Exception as ex:
            LOGGER.error(f"INT collector cannot be initialized: Failed to start the collector {ex}")
            return

        LOGGER.info(f"INT collector with ID {c_id.collector_id.uuid} is successfully invoked")
        LOGGER.info(f"INT collector with ID {c_uuid} is successfully invoked")
+0 −62

File deleted.

Preview size limit exceeded, changes collapsed.

Loading