Use Cases on Using Telemetry

This section provides use case on using Telemetry.

Example: Configure Event-driven Telemetry for LLDP

Telemetry supports NETCONF event notifications where the NETCONF client is configured to receive event notifications from a NETCONF server through a subscription. The NETCONF client must subscribe using a create-subscription request. Currently, only the events from Link Layer Discovery Protocol (LLDP) is supported. These event notifications are sent until either the NETCONF session or the subscription is terminated.


Note

Configuring a sensor group and a subscription is not required for receiving NETCONF notifications. While sensor path and subscription configurations are required for receiving telemetry events, NETCONF create-subscription is required for receiving NETCONF notifications.


To generate NETCONF notifications:
  1. Enable NETCONF agent and SSH sub system.
    
    ssh server netconf
    netconf-yang agent ssh
    
  2. Enable model-driven telemetry.
    
    telemetry model-driven
    
  3. Enable LLDP.
    lldp
    

This example shows event-driven telemetry fo LLDP configuration data.

  1. Create a destination group.
    
    grpc
    port 56782
    address-family ipv4
    !
    telemetry model-driven
    destination-group <destination-udp>
      address-family ipv4 <client-ip>1 port <udp port num>
       encoding self-describing-gpb
       protocol udp
      !
    !
    destination-group <destination-tcp>
      address-family ipv4 <client-ip> port <tcp port num>
       encoding gpb
       protocol tcp
      !
    destination-group <destination-grpc>
      address-family ipv4 <grpc client ip>port <grpc port num>
       encoding self-describing-gpb
       protocol grpc no-tls
    
  2. Create a sensor group.
    
    sensor-group <sensor-group-name>
      sensor-path Cisco-IOS-XR-ethernet-lldp-oper:lldp/global-lldp/lldp-info 
      sensor-path Cisco-IOS-XR-ethernet-lldp-oper:lldp/nodes/node/interfaces/interface  
      sensor-path Cisco-IOS-XR-ethernet-lldp-oper:lldp/nodes/node/neighbors/details/detail    
     !
    
  3. Create a subscription.
    subscription udp-out
      sensor-group-id <sensor-group-name> sample-interval 0
      destination-id <destination-udp>
    !
    
    subscription <subscription-name>
      sensor-group-id <sensor-group-name> sample-interval 0
      destination-id <destination-tcp>
    
    subscription <subscription-name>
      sensor-group-id <sensor-group-name> sample-interval 0
    !
    netconf-yang agent
    ssh
    !
    
  4. Set the notification to stream data when an event occurs.
    
    Router(config-lldp)#timer 12
    Router(config-lldp)#commit
    
    Router(config-lldp)#holdtime 150
    Router (config-lldp)#commit
    
    Router (config-lldp)#exit
    #506
    <?xml version="1.0"?>
    <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
     <eventTime>Date-and-Time</eventTime>
     <lldp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ethernet-lldp-oper">
      <global-lldp>
       <lldp-info>
        <chassis-id>000b.1bc9.e700</chassis-id>
        <chassis-id-sub-type>4</chassis-id-sub-type>
        <system-name>ios</system-name>
        <timer>12</timer>
        <hold-time>120</hold-time>
        <re-init>2</re-init>
       </lldp-info>
      </global-lldp>
     </lldp>
    </notification>
    Ready to send a request.
    Paste your request or enter 'get', 'get-config', 'create-sub', or 'bye' to quit):
    
  5. Validate response received from NETCONF agent.
    #506
    <?xml version="1.0"?>
    <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
     <eventTime>Date-and-Time</eventTime>
     <lldp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ethernet-lldp-oper">
      <global-lldp>
       <lldp-info>
        <chassis-id>000b.1bc9.e700</chassis-id>
        <chassis-id-sub-type>4</chassis-id-sub-type>
        <system-name>ios</system-name>
        <timer>12</timer>
        <hold-time>150</hold-time>
        <re-init>2</re-init>
       </lldp-info>
      </global-lldp>
     </lldp>
    </notification>
    

Example: Create and Delete LACP Bundle or Member

OpenConfig-Link Aggregation Control Protocol (OC-LACP) data model can be used to stream model-driven telemetry (MDT) and event-driven telemetry (EDT) data. Link Aggregation Control Protocol (LACP) controls the bundling of one or more ports together to form a single logical link. This single link provides higher bidirectional bandwidth, redundancy, and load balancing between the routers in the network.

The OC-LACP model defined by the OC community, helps manage LACP-enabled bundles and member interfaces. Cisco IOS XR software supports OC-LACP version 1.0.2. The support is extended to version 1.1.0 from Cisco IOS XR software release 6.6.1.

Note

Streaming model-driven or event-driven telemetry data is supported only on operational state parameters.


The support for telemetry is provided only for LACP state data at global, bundle and member level.

Using this model, user can configure LACP parameters on the bundle interface and view state data for LACP-enabled bundle and member interfaces.

The OC LACP yang model is available in the Github repository.

The following logs shows an example of expected telemetry data when a LACP member is added to bundle, and then deleted from the bundle.

Add a LACP Member to Bundle

  1. Add an ethernet link bundle with the specified bundle-id.
    Router#config
    Router(config)#interface bundle-ether 4
    
  2. Specify the interface details.
    Router(config)#interface gigabitEthernet 0/2/0/3
  3. Add the link to the specified bundle. To enable active or passive LACP on the bundle, include the optional mode active or mode passive keywords in the command string.
    Router(config-if)#bundle id 4 mode passive 
    Router(config-if)#no shutdown 
    
  4. Check the log.
    Sub_id 200000001, flag 4, len 830
    --------
    {"node_id_str":"ios","subscription_id_str":"app_TEST_200000001","encoding_path":"openconfig-lacp:lacp",
    "collection_id":"5","collection_start_time":"1542876320548","msg_timestamp":"1542876320548","
    data_json":[{"timestamp":"1542876320548","keys":[],"content":{"interfaces":{"interface":{"name":"Bundle-Ether4",
    "members":{"member":{"interface":"GigabitEthernet0/2/0/3","state":{"interface":"GigabitEthernet0/2/0/3",
    "activity":"PASSIVE","timeout":"LONG","synchronization":"OUT_SYNC","aggregatable":true,"collecting":false,
    "distributing":false,"system-id":"02-9d-af-84-41-05","oper-key":4,"partner-id":"00-00-00-00-00-00","partner-key":0,
    "port-num":0,"partner-port-num":0,"counters":{"lacp-in-pkts":"0","lacp-out-pkts":"0","lacp-rx-errors":"0",
    "lacp-unknown-errors":"0","lacp-errors":"0"}}}}}}}}],"collection_end_time":"1542876320548"}
    --------
    Sub_id 200000001, flag 4, len 830
    --------
    {"node_id_str":"ios","subscription_id_str":"app_TEST_200000001","encoding_path":"openconfig-lacp:lacp","collection_id":
    "6","collection_start_time":"1542876320569","msg_timestamp":"1542876320569","data_json":[{"timestamp":"1542876320568",
    "keys":[],"content":{"interfaces":{"interface":{"name":"Bundle-Ether4","members":{"member":{"interface":
    "GigabitEthernet0/2/0/3","state":{"interface":"GigabitEthernet0/2/0/3","activity":"PASSIVE","timeout":"LONG",
    "synchronization":"OUT_SYNC","aggregatable":true,"collecting":false,"distributing":false,"system-id":
    "02-9d-af-84-41-05","oper-key":4,"partner-id":"00-00-00-00-00-00","partner-key":0,"port-num":4,"partner-port-num":0,
    "counters":{"lacp-in-pkts":"0","lacp-out-pkts":"0","lacp-rx-errors":"0","lacp-unknown-errors":"0","lacp-errors":"0"}}}}}}}}],
    "collection_end_time":"1542876320569"}
    --------
    Sub_id 200000001, flag 4, len 466
    --------
    {"node_id_str":"ios","subscription_id_str":"app_TEST_200000001","encoding_path":"openconfig-lacp:lacp","collection_id":
    "7","collection_start_time":"1542876320570","msg_timestamp":"1542876320570","data_json":[{"timestamp":"1542876320568",
    "keys":[],"content":{"interfaces":{"interface":{"name":"Bundle-Ether4","state":{"name":"Bundle-Ether4","interval":"SLOW","lacp-mode":
    "PASSIVE","system-id-mac":"02-9d-af-84-41-05","system-priority":32768}}}}}],"collection_end_time":"1542876320570"}
    

Delete a LACP Member from Bundle

  1. Delete a LACP member from the bundle, a scenario where the bundle also becomes non-LACP.
    Router(config)#interface gigabitEthernet 0/2/0/3
    Router(config-if)#bundle id 4 mode on
    Router(config-if)#commit 
    
  2. Check the log.
    
    --------
    Sub_id 200000001, flag 4, len 425
    --------
    {"node_id_str":"ios","subscription_id_str":"app_TEST_200000001","encoding_path":"openconfig-lacp:lacp",
    "collection_id":"8","collection_start_time":"1542876408256","msg_timestamp":"1542876408256","data_json":
    [{"timestamp":"1542876408256","delete":true,"keys":[],"content":{"interfaces":{"interface":{"name":
    "Bundle-Ether4","members":{"member":{"interface":"GigabitEthernet0/2/0/3"}}}}}}],"collection_end_time":
    "1542876408256"}
    --------
    Sub_id 200000001, flag 4, len 365
    --------
    {"node_id_str":"ios","subscription_id_str":"app_TEST_200000001","encoding_path":"openconfig-lacp:lacp",
    "collection_id":"9","collection_start_time":"1542876408256","msg_timestamp":"1542876408256","data_json":
    [{"timestamp":"1542876408256","delete":true,"keys":[],"content":{"interfaces":{"interface":{"name":
    "Bundle-Ether4"}}}}],"collection_end_time":"1542876408256"}