Configure Model-driven Telemetry

Model-driven Telemetry (MDT) provides a mechanism to stream data from an MDT-capable device to a destination. The data to be streamed is defined through subscription.

The data to be streamed is subscribed from a data set in a YANG model. The data from the subscribed data set is streamed out to the destination either at a configured periodic interval or only when an event occurs. This behavior is based on whether MDT is configured for cadence-based telemetry .

The following YANG models are used to configure and monitor MDT:

  • Cisco-IOS-XR-telemetry-model-driven-cfg.yang and openconfig-telemetry.yang: configure MDT using NETCONF or merge-config over grpc.

  • Cisco-IOS-XR-telemetry-model-driven-oper.yang: get the operational information about MDT.

The process of streaming MDT data uses these components:

  • Destination: specifies one or more destinations to collect the streamed data.

  • Sensor path: specifies the YANG path from which data has to be streamed.

  • Subscription: binds one or more sensor-paths to destinations, and specifies the criteria to stream data. In cadence-based telemetry, data is streamed continuously at a configured frequency.

  • Transport and encoding: represents the delivery mechanism of telemetry data.

For more information about the core components, see Core Components of Model-driven Telemetry Streaming.

The options to initialize a telemetry session between the router and destination is based on two modes:

  • Dial-out mode: The router initiates a session to the destinations based on the subscription.

  • Dial-in mode: The destination initiates a session to the router and subscribes to data to be streamed.


    Note

    Dial-in mode is supported only over gRPC.



Important

From Release 6.1.1 onwards, Cisco introduces support for the 64-bit Linux-based IOS XR operating system. The 64-bit platforms, such as NCS5500, NCS5000, ASR9000 support gRPC, UDP and TCP protocols. All 32-bit IOS XR platforms, such as CRS and legacy ASR9000, support only TCP protocol.


Streaming model-driven telemetry data to the intended receiver involves these tasks:

Configure Dial-out Mode

In a dial-out mode, the router initiates a session to the destinations based on the subscription.

All 64-bit IOS XR platforms (except for NCS 6000 series routers) support gRPC and TCP protocols. All 32-bit IOS XR platforms support only TCP.

For more information about the dial-out mode, see Dial-out Mode.

The process to configure a dial-out mode involves:

Create a Destination Group

The destination group specifies the destination address, port, encoding and transport that the router uses to send out telemetry data.

  1. Identify the destination address, port, transport, and encoding format.

  2. Create a destination group.
    
    Router(config)#telemetry model-driven
    Router(config-model-driven)#destination-group <group-name>
     
    Router(config-model-driven-dest)#address family ipv4 <IP-address> port <port-number>  
    Router(config-model-driven-dest-addr)#encoding <encoding-format>  
    Router(config-model-driven-dest-addr)#protocol <transport> 
    Router(config-model-driven-dest-addr)#commit   
    

Example: Destination Group for TCP Dial-out

The following example shows a destination group DGroup1 created for TCP dial-out configuration with key-value Google Protocol Buffers (also called self-describing-gpb) encoding:

Router(config)#telemetry model-driven
Router(config-model-driven)#destination-group DGroup1 
Router(config-model-driven-dest)#address family ipv4 172.0.0.0 port 5432  
Router(config-model-driven-dest-addr)#encoding self-describing-gpb  
Router(config-model-driven-dest-addr)#protocol tcp  
Router(config-model-driven-dest-addr)#commit   

Create a Sensor Group

The sensor-group specifies a list of YANG models that are to be streamed.

  1. Identify the sensor path for XR YANG model.

  2. Create a sensor group.
    
    Router(config)#telemetry model-driven
    Router(config-model-driven)#sensor-group <group-name>
    Router(config-model-driven-snsr-grp)# sensor-path <XR YANG model>
    Router(config-model-driven-snsr-grp)# commit
    

Example: Sensor Group for Dial-out


Note

gRPC is supported in only 64-bit platforms.


The following example shows a sensor group SGroup1 created for dial-out configuration with the YANG model for interface statistics:

Router(config)#telemetry model-driven
Router(config-model-driven)#sensor-group SGroup1
Router(config-model-driven-snsr-grp)# sensor-path Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters
Router(config-model-driven-snsr-grp)# commit

What to Do Next:

Create a subscription.

Create a Subscription

The subscription associates a destination-group with a sensor-group and sets the streaming method.

A source interface in the subscription group specifies the interface that will be used for establishing the session to stream data to the destination. If both VRF and source interface are configured, the source interface must be in the same VRF as the one specified under destination group for the session to be established.


Router(config)#telemetry model-driven  
Router(config-model-driven)#subscription <subscription-name>  
Router(config-model-driven-subs)#sensor-group-id <sensor-group> sample-interval <interval>  
Router(config-model-driven-subs)#destination-id <destination-group>
Router(config-model-driven-subs)#source-interface <source-interface>
Router(config-mdt-subscription)#commit  

Example: Subscription for Cadence-based Dial-out Configuration

The following example shows a subscription Sub1 that is created to associate the sensor-group and destination-group, and configure an interval of 30 seconds to stream data:

Router(config)#telemetry model-driven  
Router(config-model-driven)#subscription Sub1  
Router(config-model-driven-subs)#sensor-group-id SGroup1 sample-interval 30000  
Router(config-model-driven-subs)#destination-id DGroup1  
Router(config-mdt-subscription)# commit  

Validate Dial-out Configuration

Use the following command to verify that you have correctly configured the router for dial-out.


Router#show telemetry model-driven subscription <subscription-group-name>

Example: Validation for TCP Dial-out


Router#show telemetry model-driven subscription Sub1
Thu Jul 21 15:42:27.751 UTC
Subscription:  Sub1                     State: ACTIVE
-------------
  Sensor groups:
  Id                Interval(ms)        State
  SGroup1           30000               Resolved

  Destination Groups:
  Id                Encoding            Transport   State   Port    IP
  DGroup1           self-describing-gpb tcp         Active  5432    172.0.0.0