SONiC gRPC Telemetry with gNMI for Efficient Network Monitoring
written by Asterfuison
Table of Contents
Introduction
In modern data centers and large enterprise networks, operations teams often face three major challenges.

First, they want to use telemetry tools to monitor device status, but due to protocol compatibility issues, they have to switch between multiple systems for different vendors—for example, using SNMP to check bandwidth and NETCONF to modify configurations—making operations cumbersome and prone to errors;
Second, they want to access key metrics like interface traffic and CPU utilization in real time, but traditional protocols respond slowly, so by the time an alert arrives, the issue may have already affected services;
Third, even when data is obtained, it often comes in inconsistent formats and requires manual processing before analysis, which is time-consuming and error-prone.
These “poor protocol compatibility, weak real-time capability, and hard-to-use data” issues make network telemetry a frustrating and inefficient task—exactly the problems that gNMI in SONiC gRPC is designed to solve.
Ⅰ. How gNMI Works Over SONiC gRPC
gNMI (gRPC Network Management Interface) is an open-source interface protocol built on gRPC (gRPC Remote Procedure Calls) for managing target devices, with gRPC itself operating overHTTP/2. gNMI uses YANG data models to define the configuration and state of network devices and leverages the gRPC client-server model for efficient data transmission. Through gNMI, a client can retrieve, modify, or subscribe to YANG data nodes on a network device, where each data node represents a specific configuration or function of the device.
gNMI provides four core service interfaces:
- Capability – Queries the device to determine the supported features and data models.
- Get – Retrieves the current state or configuration of the target device in a single request.
- Set – Sends or modifies configuration on the target device.
- Subscribe – Subscribes to or collects high-frequency data from the device.

Among these, Subscribe is the key interface for real-time network telemetry, allowing clients (such as controllers or monitoring platforms) to declare: 👉 “I want to continuously receive updates for certain YANG data nodes.”
This enables operations systems to continuously track critical configuration and performance metrics without repeated polling, improving both real-time visibility and efficiency.
None of the four services—Capability, Get, Set, or Subscribe—are mandatory; clients can choose which services to use based on their needs for data retrieval, configuration, or real-time monitoring.
All four service interfaces support custom extension fields. This preserves their core behavior, ensuring both protocol extensibility and consistency.
Notably, Asterfusion switches equipped with Falcon or Teralynx chips fully support gNMI, efficiently handling subscription requests at the hardware level and providing a reliable foundation for large-scale deployments.
Ⅱ. The Value of gNMI in SONiC gRPC
Technical Perspective gNMI uses gRPC’s streaming and stateless communication, avoiding the overhead of repeatedly establishing full NETCONF sessions every time. This makes large-scale configuration and batch operations much more efficient, while Set, Capability, and Get services reduce manual work and lighten device load.
Operations Value With the Subscribe service, operations systems can continuously access key YANG data nodes, enabling proactive data push. This allows teams to monitor interface traffic, packet loss, and other metrics in real time, quickly pinpoint issues, and avoid misdiagnosing service problems.
Management Value By combining standardized subscription data and real-time status with visualization platforms, clear and accurate reports can be generated. This supports capacity planning and topology optimization, while also showcasing the observability benefits provided by YANG models.
Ⅲ. Comparing gNMI with Traditional Interfaces
We can compare SNMP, NETCONF, and gNMI from several perspectives:
Protocol | Data Modeling | Configuration Capability | Monitoring Method | Real-time | Large-scale Suitability |
SNMP | MIB | Mostly read-only | Polling | Low | Medium |
NETCONF | YANG | Supported | Polling | Medium | Medium |
gNMI | YANG | Supported | Subscribe / Push / Streaming | High | High |
From the table, the advantages of gNMI are clear:
- Lightweight and efficient: Built on SONiC gRPC, it establishes a single long-lived connection, avoiding the need to recreate sessions each time. This eliminates the overhead of maintaining full device sessions and reduces device load.
- Real-time telemetry: The Subscribe push model delivers instant updates.
- Scalable: Well-suited for modern data centers and cloud environments.
In contrast, traditional interfaces have limitations:
- SNMP: Can provide overall interface traffic and status but lacks fine-grained data, making it impossible to monitor traffic per application or session.
- NETCONF: Supports configuration and state queries but relies on full device sessions, which increases CPU and memory usage, making it less suitable for large-scale real-time telemetry.
Ⅳ. gNMI Deployment in SONiC gRPC Networks

The diagram above shows a typical data center cloud network topology.
By deploying a monitor server alongside the core network and enabling it to communicate with all switches, gNMI subscription requests can be sent to all network devices. This allows high-frequency collection of various device information, including configuration, counters, system status, and any data modeled by the device’s YANG models.
The range of data gNMI can collect is extensive and depends on the YANG models implemented on the devices. YANG defines manageable and observable nodes, such as CPU and memory utilization, ACL match counts, system temperature, power supply, and fan status. Using these YANG data nodes, gNMI enables real-time monitoring of device health, traffic, and system alerts.
From an implementation perspective, configuring the target devices ( network devices) is relatively straightforward, typically involving enabling the gNMI service and specifying the listening port. On the client side, the configuration file specifies the target device’s IP/port, authentication information, and the desired service type (Capability, Get, Set, or Subscribe).
Below is examples of client-side configuration using gnmic from Google:
Use the capabilities service interface:

Send a GET request to read the configuration of VLAN 4000:

Afterwards, time-series data collected from YANG data nodes can be exported by the gNMI client and scraped by Prometheus, then visualized in Grafana as statistical charts.
Ⅴ. Conclusion
gNMI is an efficient protocol designed for modern networks. It is based on the YANG data model and uses a gRPC client/server architecture, supporting both configuration management and real-time network telemetry.
In Asterfusion switch deployments powered by Marvell Falcon and Teralynx chips, gNMI leverages hardware advantages to cover all operational roles: it helps administrators simplify bulk operations and reduce complexity, provides real-time troubleshooting data to network engineers for faster fault localization, and delivers standardized reports to management to support decision-making.
By leveraging the inherent features of Marvell Falcon and Teralynx chips in Asterfusion switches, gNMI delivers low-latency, highly reliable telemetry and management, laying a solid foundation for stable operation in data centers and enterprise networks.