diff --git a/api/v1/app/utils/path_processor.py b/api/v1/app/utils/path_processor.py index 92bf0e3f..df4a0629 100644 --- a/api/v1/app/utils/path_processor.py +++ b/api/v1/app/utils/path_processor.py @@ -27,8 +27,9 @@ def process_path_data( print(f"Hopcount: {hopcount}, Algo: {algo}") # Extract SID locators filtered by algo + # Skip the first node (source) as we only need intermediate + destination SIDs locators = [] - for node in path_data: + for node in path_data[1:]: # print(f"Processing node: {json.dumps(node, indent=2)}") # Check for vertex and sids in the vertex object if 'vertex' in node and 'sids' in node['vertex']: @@ -44,6 +45,11 @@ def process_path_data( sid_entry['srv6_endpoint_behavior']['algo'] == algo): matching_sid = sid_entry.get('srv6_sid') break + # Also accept SIDs without endpoint behavior (e.g., host endpoints) + # These are algo-agnostic and should be included regardless + elif 'srv6_endpoint_behavior' not in sid_entry and matching_sid is None: + matching_sid = sid_entry.get('srv6_sid') + # Don't break - keep looking for an algo-specific SID # If we found a matching SID, add it to locators if matching_sid: diff --git a/install/collectors/telegraf-ingress/telegraf_ingress_dp.yaml b/install/collectors/telegraf-ingress/telegraf_ingress_dp.yaml index fc117cad..1ac90cb1 100644 --- a/install/collectors/telegraf-ingress/telegraf_ingress_dp.yaml +++ b/install/collectors/telegraf-ingress/telegraf_ingress_dp.yaml @@ -17,14 +17,12 @@ spec: spec: containers: - name: telegraf - image: telegraf:1.15-alpine + image: telegraf:1.30.0-alpine volumeMounts: - mountPath: /etc/telegraf/telegraf.conf name: telegraf-ingress-config subPath: telegraf.conf readOnly: true - imagePullSecrets: - - name: regcred volumes: - name: telegraf-ingress-config configMap: diff --git a/install/processors/telegraf-egress/telegraf_egress_dp.yaml b/install/processors/telegraf-egress/telegraf_egress_dp.yaml index 63137222..0c04f373 100644 --- a/install/processors/telegraf-egress/telegraf_egress_dp.yaml +++ b/install/processors/telegraf-egress/telegraf_egress_dp.yaml @@ -17,14 +17,12 @@ spec: spec: containers: - name: telegraf - image: telegraf:1.15-alpine + image: telegraf:1.30.0-alpine volumeMounts: - mountPath: /etc/telegraf/telegraf.conf name: telegraf-egress-config subPath: telegraf.conf readOnly: true - imagePullSecrets: - - name: regcred volumes: - name: telegraf-egress-config configMap: diff --git a/ip-graph/arangodb/bgp-prefix-processor.go b/ip-graph/arangodb/bgp-prefix-processor.go index eadffdf1..b2baf093 100644 --- a/ip-graph/arangodb/bgp-prefix-processor.go +++ b/ip-graph/arangodb/bgp-prefix-processor.go @@ -95,6 +95,22 @@ func (uc *UpdateCoordinator) processPrefixAdvertisement(ctx context.Context, key glog.Infof("Processing %s BGP prefix: %s/%d from AS%d via AS%d (key: %s)", prefixType, prefix, prefixLen, originAS, peerASN, consistentKey) + // Skip /32 and /128 host routes from external eBGP neighbors + // These are typically loopbacks that create incorrect topology when re-advertised + // Only process them if they originate from internal IGP network + if prefixLen == 32 || prefixLen == 128 { + isIGPOrigin, err := uc.checkIfIGPOrigin(ctx, originAS) + if err != nil { + glog.Warningf("Failed to check IGP origin for %s/%d: %v", prefix, prefixLen, err) + } + if !isIGPOrigin { + glog.V(6).Infof("Skipping external eBGP host route %s/%d from AS%d (loopback re-advertisement)", prefix, prefixLen, originAS) + return nil + } + glog.V(6).Infof("Processing internal IGP host route %s/%d from AS%d", prefix, prefixLen, originAS) + } + + // All prefixes create proper vertices (including internal /32 and /128 loopbacks) // All prefixes create proper vertices (including /32 and /128 loopbacks) return uc.createBGPPrefixVertex(ctx, consistentKey, prefixData, prefixType, isIPv4) } @@ -477,6 +493,15 @@ func (uc *UpdateCoordinator) findBGPPeerNodesForPrefix(ctx context.Context, orig return uc.findIGPNodesForPrefix(ctx, originAS, prefixData) } + // Skip /32 and /128 host routes from external eBGP neighbors + // These are typically loopbacks that get re-advertised through the network + // Creating edges for every peer that received them creates incorrect topology + // (matches the deduplication processor logic: FILTER u.prefix_len < 30) + if (prefixLen == 32) || (prefixLen == 128) { + glog.V(6).Infof("Skipping external eBGP host route %s/%d from AS%d (loopback re-advertisement)", prefix, prefixLen, originAS) + return nil, nil + } + // For external prefixes, use peer-centric approach glog.V(7).Infof("Prefix %s/%d is external (origin AS: %d) - attaching to advertising BGP peer", prefix, prefixLen, originAS) return uc.findAdvertisingBGPPeer(ctx, prefix, prefixLen, originAS, peerASN, prefixData)