Cloud-Native Telemetry

Overview

This tutorial is mainly focused on creating and retrieving statistics for CN Telemetry gNMI subscription and CN Telemetry accounting subscription in NSP.

The basic steps are:

  • Add the necessary feature packs to NSP config file.
  • Import and install the required artifacts.
  • Create a gNMI subscription with file option disabled.
  • Create an accounting subscription with file option enabled.
  • Listen to the Kafka topic for statistics.

Prerequisites

Feature pack:

Before NSP installation, add the following installation option for feature pack 'networkInfrastructureManagement' in nsp-config.yml file.

- name: "Network Infrastructure Management - GNMI Telemetry"
  id: networkInfrastructureManagement-gnmiTelemetry
- name: "Network Infrastructure Management - Accounting Telemetry"
  id: networkInfrastructureManagement-accountingTelemetry

This file can be found in the NSP deployer host in the path, /opt/nsp/NSP-CN--DEP-release-ID/NSP-CN-release-ID/config/nsp-config.yml

Telemetry Artifacts:

  1. Install the Telemetry YANG model using yang-files.bash in deployer host.
  2. Install Transformer and Device helper CRs for gNMI and accounting types. gNMI has cut-through and vendor-agnostic CRs.

Please follow the steps included in How do I install telemetry artifacts?

Setup FTP mediation policy:

NSP uses SFTP for the transfer of accounting files, so the initial step is to create a new FTP mediation policy and apply it to all NEs in your system that will collect stats.

POST https://{{server}}/mdm-necontrol-rest-api-app/api/v1/restconf/data/nsp-mediation:mediation-policy

{
    "ftp-mediation:ftp": [
        {
            "name": "ftp-policy-test123",
            "description": "new-ftp-policy",
            "user-name": "admin",
            "password": "admin",
            "port": 22,
            "connect-timeout": 30,
            "read-timeout": 30,
            "secure": "true"
        }
    ]
}

Use the GET API to fetch all the discovered NEs. From the response, the user can select the FDN of the NE they wish to apply this FTP mediation policy. Additionally, GET API for a specific NE, mentioning the FDN (retrieved from GET all discovered NEs API), retrieves the same information. Now, modify the PUT API to include necessary information like, neId, cliProfile, etc.,

PUT https://{{server}}/mdm-necontrol-rest-api-app/api/v1/neControl/discoveryrule/fdn:model:necontrol:DiscoveredNe:4274

{
    "type": "DiscoveredNe",
    "dto": {
        "neId": "fded:fade:face:ffff::34f",
        "cliProfile": "sr-7750",
        "neName": "node_sanity",
        "neROMedPolicies": [
            "fdn:model:mediationpolicy:NeMediationPolicy:1144",
            "fdn:model:mediationpolicy:NeMediationPolicy:1145",
            "fdn:model:mediationpolicy:NeMediationPolicy:1142",
            "fdn:model:mediationpolicy:NeMediationPolicy:1143",
            "fdn:yang:nsp-mediation:/nsp-mediation:mediation-policy/ftp-mediation:ftp[name='ftp-policy-test123']"
        ]
    }
}

Ensure the correct FDN is used in the API. Please refer to this Postman collection for setting up the FTP mediation.

Configure Accounting and File Policy

Currently, there is no API for creating accounting and file policies on the NE; instead, the user can create the policies from NSP GUI.

From Model Driven Configurator, select the NE and follow the path, 'Nokia-conf:/configure > Log'

Create the File Policy:

Select option 'File List' under log and provide the following details,

  • File-policy-name: a number
  • Description: details about the file policy
  • Rollover: a number (minutes)
  • Retention: a number (hours)

Now click on 'Add to Config Basket'. The config is saved but not applied to the node. Select the saved config, now the user can see a new option, 'Compact-flash-location'. From the drop-down, select 'cf3:' as primary location. NE places the accounting files in this path.

Telemetry Tutorial - File Policy

Create the Accounting Policy:

Select option 'Accounting-policy List' under log and provide the following details,

  • Policy-id: a number
  • Description: about the accounting policy
  • Admin-state: enable
  • Collection-interval(minutes): a number (default is 15 minutes)
  • Record: select the "Telemetry Type"

Now click on 'Add to Config Basket'. The configuration gets saved but is not applied to the node. Select the saved config, and a new option, 'Destination', will appear. From the drop-down menu, select 'file' as the destination and provide file-policy id.

Telemetry Tutorial - Accounting Policy

Telemetry tutorial - file in accounting policy

Release

This tutorial has been tested with and is supported in NSP 24.8.

Note

FTP mediation policy and accounting/file policies are only required if user wants to collect accounting statistics; otherwise, these steps can be ignored.

Test Cases

Create CN Telemetry gNMI Subscription

A subscription represents a request for statistics information management. When you configure a telemetry subscription, you specify a set of statistics data along with notification and storage options for the data. To configure the data set, you select the type of statistics you are interested in, the frequency of collection, and configure filtering by NE and counters as needed.

Here is an example of how to create subscription for Telemetry type - telemetry:/base/interfaces/interface

POST  https://{{server}}/restconf/data/md-subscription:/subscriptions/subscription

{
  "subscription" : [{
	 "name" : "Interface Stats",
	 "description": "interface stats",
	 "period": 10,
	 "sync-time" : "00:00",
	 "state" : "enabled",
	 "type" : "telemetry:/base/interfaces/interface",
	 "notification" : "enabled",
	 "db" : "enabled"
  }]
}

Test Results

Use GET API to fetch the subscriptions created.

GET https://{{server}}/restconf/data/md-subscription:/subscriptions

The result is as follows,

{
    "subscriptions": {
        "subscription": [
            {
                "name": "Interface Stats",
                "description": "interface stats",
                "site-selector": null,
                "filter": null,
                "type": "telemetry:/base/interfaces/interface",
                "period": 10,
                "state": "enabled",
                "sync-time": "00:00",
                "db": "enabled",
                "notification": "enabled",
                "rta-notification": "disabled",
                "rta-indicator-notification": "disabled",
                "file": "disabled",
                "file-prefix": null,
                "file-path": null,
                "fields": [],
                "notif-topic": "ns-eg-73503032-ba81-4666-9e05-69f7297968ae",
                "client-id": "73503032-ba81-4666-9e05-69f7297968ae"
            }
        ]
    }
}

'notif-topic' becomes the Kafka topic for this subscription. Results of the statistics are also notified using 'notif-topic' value as the Kafka topic. In this case, 'ns-eg-73503032-ba81-4666-9e05-69f7297968ae' is the Kafka topic.

{"data":
	{"ietf-restconf:notification":
		{
			"eventTime":"2024-08-27T12:14:42Z",
			"nsp-kpi:real_time_kpi-event":{
				"dataType":1,
				"kpiType":"telemetry:/base/interfaces/interface",
				"name":"1/1/c1/3",
				"neId":"fded:fade:face:ffff::34f",
				"objectId":"fdn:app:mdm-ami-cmodel:fded:fade:face:ffff::34f:equipment:Equipment:/port[port-id='1/1/c1/3']",
				"received-broadcast-packets":0,
				"received-broadcast-packets-periodic":0,
				"received-multicast-packets":0,
				"received-multicast-packets-periodic":0,
				"received-octets":0,
				"received-octets-periodic":0,
				"received-unicast-packets":0,
				"received-unicast-packets-periodic":0,
				"speed":10000000,
				"system-id":"fded:fade:face:ffff::34f",
				"time-captured":1724760882685,
				"time-captured-periodic":10000,
				"transmitted-broadcast-packets":0,
				"transmitted-broadcast-packets-periodic":0,
				"transmitted-multicast-packets":10566,
				"transmitted-multicast-packets-periodic":1,
				"transmitted-octets":676224,
				"transmitted-octets-periodic":64,
				"transmitted-unicast-packets":0,
				"transmitted-unicast-packets-periodic":0
			}
		}
	}
}

Create CN Telemetry accounting Subscription

Create a L2 interface in epipe/vpls service and associate the accounting policy in it. Please refer to this Service Configuration Tutorial.

The user have to specify the same Telemetry type as specified in the Accounting policy in the subscription. Here is an example of how to create subscription for Telemetry type - telemetry:/base/accounting/service-ingress-octets

POST  https://{{server}}/restconf/data/md-subscription:/subscriptions/subscription

{
    "subscription": [
        {
            "name": "Service_Ingress_Octets",
            "description": "Service Ingress Octets accounting stats with file-path value",
            "period": 300,
            "sync-time": "00:00",
            "state": "enabled",
            "type": "telemetry:/base/accounting/service-ingress-octets",
            "notification": "disabled",
            "db": "enabled",
            "file": "enabled",
            "file-path": "sio"
        }
    ]
}

Test Results

CN Accounting Telemetry uses ' accounting-file-ready ', a pre-defined kafka topic for the result.

{
    "data":
    {
        "ietf-restconf:notification":
        {
            "eventTime": "2024-08-27T13:30:50Z",
            "telemetry:file-available":
            {
                "input-file-name": "act5555_20240827-094501.xml.gz",
                "ne-Id": "fded:fade:face:ffff::34f",
                "output-file-name": "sio/fded:fade:face:ffff::34f-20240827-070850.json.gz",
                "telemetry-subscription-name": "Service_Ingress_Octets"
            }
        }
    }
}

Please refer to this Postman collection for more examples.

On this page