hawkv6 / generic-processor

Generic processor to complement the standard Cisco's Jalapeno processors.
Apache License 2.0
0 stars 0 forks source link

Retrieve ipv6 / interface model from Kafka #4

Closed severindellsperger closed 8 months ago

severindellsperger commented 8 months ago

We need interface relevant information to correlate the link impairment telemetry data (delay, packet loss, etc.) with the ls_link from BMP. This information can be retrieved via Telemetry too.

The following config should be used to get the interface status and the configured ipv6 addresses.

 sensor-group openconfig_interfaces
  sensor-path openconfig-interfaces:interfaces/interface/state/oper-status
  sensor-path openconfig-interfaces:interfaces/interface/subinterfaces/subinterface/openconfig-if-ip:ipv6/addresses/address

Since we get the router name, the interface name, and the IPV6 address, we can enrich the link impairment telemetry data with the IPv6 address. Next, we can filter all ls_links by the ipv6 address, retrieve the correct ls_link, and add the impairments to the correct ls_link.

Additional info: An impairment measurement looks like the following:

{
  "fields": {
    "delay_measurement_session/last_advertisement_information/advertised_values/average": 10000,
    "delay_measurement_session/last_advertisement_information/advertised_values/maximum": 10000,
    "delay_measurement_session/last_advertisement_information/advertised_values/minimum": 10000,
    "delay_measurement_session/last_advertisement_information/advertised_values/variance": 0
  },
  "name": "performance-measurement",
  "tags": {
    "host": "telegraf",
    "interface_name": "GigabitEthernet0/0/0/1",
    "node": "0/RP0/CPU0",
    "path": "Cisco-IOS-XR-perf-meas-oper:performance-measurement/nodes/node/interfaces/interface-details/interface-detail",
    "source": "XR-1",
    "subscription": "hawk-metrics"
  },
  "timestamp": 1704728135
}

A ls_link object looks like the following:

{
  "action": "add",
  "router_hash": "182ce3ada75f0e2a616ad8f06e290cd3",
  "router_ip": "fc00:0:4::4",
  "domain_id": 0,
  "peer_hash": "cebcd9451b54fe903976d1bae5860719",
  "peer_ip": "fc00:0:5::5",
  "peer_type": 0,
  "peer_asn": 64097,
  "timestamp": "2024-01-20T11:36:30.00076517Z",
  "igp_router_id": "0000.0000.0004",
  "protocol": "IS-IS Level 2",
  "protocol_id": 2,
  "area_id": "0",
  "nexthop": "fc00:0:5::5",
  "mt_id_tlv": {
    "o_flag": false,
    "a_flag": false,
    "mt_id": 2
  },
  "local_link_id": 5,
  "remote_link_id": 4,
  "local_link_ip": "2001:db8:45::4",
  "remote_link_ip": "2001:db8:45::5",
  "igp_metric": 10,
  "max_link_bw_kbps": 1000000,
  "remote_node_hash": "d3fcffedacaf2782a7377892c813c87c",
  "local_node_hash": "f86a8011f6bd5a32065379369afaa7ce",
  "remote_igp_router_id": "0000.0000.0005",
  "local_node_asn": 64097,
  "remote_node_asn": 64097,
  "srv6_endx_sid": [
    {
      "endpoint_behavior": 33,
      "flags": {
        "b_flag": false,
        "s_flag": false,
        "p_flag": false
      },
      "algorithm": 0,
      "weight": 0,
      "sid": "fc00:0:0:4:42::",
      "sub_tlvs": [
        {
          "type": 1252,
          "length": 8,
          "locator_block_length": 40,
          "locator_node_length": 24,
          "function_length": 16,
          "argument_length": 0
        }
      ]
    }
  ],
  "unidir_link_delay": 2000,
  "unidir_link_delay_min_max": [
    2000,
    2000
  ],
  "is_adj_rib_in_post_policy": false,
  "is_adj_rib_out_post_policy": false,
  "is_loc_rib_filtered": false
}
severindellsperger commented 8 months ago

All telemetry example messages can be found here: https://github.com/hawkv6/clab-telemetry-linker/tree/main/example-messages