Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Decoding Junos Telemetry Interface Data With UNIX Utilities

You can use UNIX utilities to decode Junos telemetry interface data on a server, or collector, that is streaming data from a Juniper Networks device. The example in this section shows you how to decode a single packet of streamed data.

Preparing the Collector to Decode Data

This example requires the following:

  • UNIX OS with the Netcat (nc) utility.

  • Protocol buffers compiler.

  • Junos telemetry interface protocol buffers files.

This procedure shows how to prepare the collector to decode data using the Ubuntu OS.

  1. Install the Netcat utility.

  2. Install the protocol buffers compiler.

  3. Install the protocol buffers developer’s library.

  4. Verify that the library files are installed.

  5. Download and install the latest version of the Junos Telemetry interface protocol buffers files.

    From a Web browser, navigate to the All Junos Platforms software download URL on the Juniper Networks page: https://www.juniper.net/support/downloads/. After you select the name of the Junos OS platform and the release number, go to the Tools section and download the Junos telemetry interface Data Model Files package.

    Note:

    Be sure to note the location of the extracted files.

Decoding Data on the Collector

This procedure shows you how to capture data, decode raw data, and use the protocol buffers files to decode data.

To decode data:

  1. Capture the data.

    Run netcat on a destination streaming telemetry server, or collector, in UDP listener mode to store all incoming datagrams into a file. Use the destination port number configured in streaming-server profile on your Juniper Networks device.

    Note:

    This command stores datagrams into a file named data.gpb. Run this program to capture data. When you want to stop receiving data, stop with the program by sending the break signal (Control + C)

  2. Decode raw data.

    Note:

    This step is optional. It is not required if you know the encoded message type of the data.

    Decode the message from the data.gpb file.

    The next nested structure under 2636 identifies the sensor type. The numerical value 2636 identifies the JuniperNetworksSensor message, which is defined in the telemetry_top.proto file. In this example, the numerical identifier 7 corresponds to the LogicalPort message defined in the logical_port.proto file. Use this information in the next step to generate more detailed output.

  3. Decode the message to include field names.

    Run the protocol buffers compiler with the decode option. Additionally, specify the top-level message type (TelemetryStream) and the file with the message definition, logical_port.proto. You must also include the Goggle protocol buffers (gpb) library.

Decoding Junos Telemetry Interface UDP Data at the Collector

The collector must start a listener on the remote address or port combination to read the incoming data. The incoming data can be decoded using the telemetry_top.proto and the sensor proto files.

To simplify the decoding procedure, the collectors can load all the proto files shipped as part of the Telemetry Software package to decode the incoming data.

Note:
  1. Verify streaming data on both management and WAN interfaces. Specify the appropriate address in the streaming server profile.
  2. Enums and float are streamed as strings for UDP streaming. Enums will be retained as strings as gNMI uses the same format.
  3. The handling of float data type is scoped for a future release.

When telemetry data is streamed over UDP, ensure that data is decoded correctly, and unknown fields are not decoded at the collector.

Below are some issues observed while streaming telemetry data over UDP:

  1. Incorrect Decoding: Incorrect decoding implies that telemetry data is not correctly streamed over UDP. In the following example, the data highlighted in bold indicates that the data was not decoded correctly. This behaviour is either due to incorrect encoding or wrong proto file packaging.

    Below is the example of the data being decoded correctly:

  2. Incomplete data streaming: Streaming of incomplete data must be verified through data validation in the output file.