Skip to main content

What Is gNMI (gRPC Network Management Interface)?

What is gNMI (gRPC Network Management Interface)?

gNMI (gRPC Network Management Interface) is a network management protocol that uses gRPC for configuration and state data retrieval from network devices. gNMI offers a standardized approach to messages about telemetry and network automation. Unlike legacy protocols such as SNMP or NETCONF, gNMI leverages modern remote procedure call (RPC) frameworks that support real-time streaming telemetry and provide efficient configuration management.

What are the key components of gRPC Network Management Interface (gNMI)?

Instead of retrieving operational data with disparate protocols, gNMI provides a standardized application programming interface (API)-based framework that simplifies access to network device data. This allows organizations to overcome network inefficiencies, reduce overhead, and view operational data of network devices on a single solution.

In a gNMI setup, you encounter the following terms:

  • Client: refers to the network management system that runs the gRPC client software
  • Server: refers to network devices such as routers, switches, and load balancers that run a gRPC server

Both clients and servers use the following gNMI components to send and receive messages.

gNMI service definition

gNMI uses gRPC to define key services for sending and receiving data from network devices. Although gRPC allows software to define numerous custom functions, gNMI uses only the Get, Set, Capabilities, and Subscribe as its core functions.

Path addressing

A client sends message requests that are addressed to a specific device using a YANG-modeled path structure. YANG is a data modelling language for network management protocols. A YANG file describes the schematic structure, configuration, and hierarchical relationships of network devices. Additionally, clients can use a referencing method called path wildcarding to retrieve multiple elements from the same device.

Notification messages

The gNMI server sends notification messages for every update and delete operation it successfully processes. In a telemetry subscription, the device continuously sends streams of messages in real time.

Atomic transactions

gNMI supports atomic transactions for configuration updates. An atomic transaction means that an update is considered successful only if all parameters are processed successfully. If one or more parameters fail to update, there is no change to the server.

What are the types of gNMI operations?

gNMI uses these core functions to manage network devices.

Capabilities operations

The Capabilities RPC function allows the client to retrieve the server’s network capabilities. For example, a network device provides the gNMI version it uses, its data encoding method, and the data model it supports as a response to the Capabilities request. The client uses these parameters when sending operational requests in subsequent exchanges.

Get operations

The Get operation allows the client to view the configuration or status data of the server target device in real time. After a request is received, the server processes the request and returns a message containing the requested data.

Set operations

The Set operation allows the client to update, replace, or delete specific configuration from the server. You can set multiple configuration values in a single request, which the server must process in a single transaction. If the server encounters an issue processing any value, it discards the changes and reverts to the original value.

Subscribe operations

The Subscribe operation is when the client registers its interest in a specific network parameter for continuous monitoring. When sending the SUBSCRIBE request, the client can specify the sample interval and conditions for telemetry stream transmission.

How does gNMI work?

The gNMI protocol provides a gRPC-based network management method for telemetry streaming and mechanisms for configuring routers, switches, and other network devices. gRPC is an advanced remote procedure call (RPC) framework that enables faster communication over a network than some other similar protocols. With gRPC, a client makes calls to a server’s functions as if they were local functions. gNMI uses gRPC as its communication foundation between a centralized management hub and connected network devices.

Here are the layers of gNMI processes.

gRPC transport layer

The gRPC transport layer enables bidirectional streaming between gNMI-supported clients and servers. A client can connect to multiple servers to retrieve and consolidate various operational data in a single location. Additionally, the client can send the configuration data to the respective servers or network devices. By default, all gNMI communication occurs over a TLS-encrypted HTTP/2 connection. This helps to protect network configuration data from access by unauthorized parties.

Data encoding

Network devices efficiently transfer structured data over gNMI using gRPC’s protocol buffers (Protobuf) for binary encoding, or JSON, including JSON_IETF. The protocol buffer allows fast serialization, which results in smaller data packets than JSON, although JSON data types offer better human readability.

Subscription operations

gNMI uses gRPC to stream telemetry data from network devices. Instead of polling each device for its status, the client software can subscribe to telemetry streams for specific network parameters.

Here is an example of the message exchange for streaming data:

  • The client sends a Capabilities request to a network switch
  • Network switch returns its data model, data encoding method, and other capabilities
  • The client sends a gNMI Subscribe RPC specifying the switch’s operational status and a message timing interval
  • The client receives the switch’s operational status at each specified interval

Subscription modes

gNMI supports periodic and on-change subscription.

  • Periodic subscription enables network devices to send status updates at the pre-determined interval.
  • On-change subscription triggers an update message when the monitored parameter has changed. For example, a device can stream routing table changes as they occur. This is important in time-sensitive operations.

What are the benefits of gNMI?

These are how gNMI benefits organizations.

Vendor neutrality for network devices

gNMI is an open standard that uses YANG data models, including those from the OpenConfig Working Group or from specific vendors. Due to the YANG standardization, organizations can manage devices from various manufacturers using a single protocol.

Performance efficiency

Compared with other protocols, such as SNMP, gNMI is more efficient at encoding data when using Protobuf. gNMI transfers data across HTTP/2, which allows devices to maintain an open connection after sending a message.

Real-time telemetry

Organizations innovating with modern network devices can improve network visibility with gNMI’s low latency and high-throughput data exchange. Instead of polling devices for updates, gNMI client software can collect network data in real time.

Transactional integrity in configuration management

gNMI transactions support atomic operations. When updating network configurations, either all parameters are updated, or none are. This allows network administrators to avoid misconfigurations from interrupted state changes. With these atomic operations, you can install, change, or delete network device configurations.

Scalability

Organizations face operational challenges as they scale their network infrastructure with traditional network management methods. As they add more devices to the network, the network operations team can use gNMI to overcome configuration, management, and troubleshooting complexities. gNMI is designed to handle high traffic volumes over a push telemetry model. Organizations can expand network management across large-scale networks more rapidly than traditional SNMP.

What is gNMI-gateway?

gNMI-gateway is a gateway for gNMI and OpenConfig telemetry data, that acts as an intermediary between network devices and telemetry monitoring and data visualization systems such as Prometheus and Apache Kafka. gNMI-gateway both consumes and distributes gNMI data across the network, and is helpful for greater scalability. The gnmi-gateway is modular, so it can be deployed in a distributed, highly available, fault-tolerant configuration for streaming data.

How does gNMI compare to NETCONF?

NETCONF is a network configuration management protocol that uses XML over SSH to send configuration data. NETCONF can use a subscription or polling approach, in which the client sends request messages that network devices respond to. NETCONF uses a staging model for testing and rollback.

Meanwhile, gNMI transfers configuration and telemetry data across using gRPC over HTTP/2. Generally, gNMI data is smaller in size than NETCONF data, due to the size of Protobuf versus XML, resulting in faster server response times.

NETCONF is more suitable for critical network management systems with advanced safety requirements. gNMI is more suitable for simple, real-time network telemetry streaming from modern network devices.

How does gNMI compare to SNMP?

Simple Network Management Protocol (SNMP) is a protocol originating in 1988 for retrieving operational data from network devices. Traditional SNMP works by polling network data from devices, which can be inefficient and difficult to scale.

gNMI, meanwhile, is a modern network management protocol built for scalability. Unlike SNMP, gNMI uses a push model in which network devices actively push operational data to the client. gNMI transfers data over a TLS-encrypted HTTP/2 channel with binary encoding, whereas SNMP typically uses the User Datagram Protocol (UDP), although TCP is available. SNMP is still used throughout traditional networking monitoring, while gNMI provides the flexibility for high-volume streaming networks in real time.

How can AWS support your gNMI requirements?

AWS offers network automation and streaming telemetry services that can integrate with gNMI-enabled infrastructure:

  • Amazon CloudWatch is an intelligent observability service that lets you monitor and optimize your entire technology stack, providing actionable insights across applications and infrastructure.
  • AWS IoT Core helps you connect, manage, and scale your IoT device fleets easily and reliably without provisioning or managing servers.
  • AWS Lambda is a serverless runtime that natively integrates with both AWS and third-party real-time data sources, enabling you to process real-time data without the overhead of managing streaming client libraries or learning specialized data processing frameworks.

Get started with network automation on AWS by creating a free account today.

Browse all cloud computing concepts

Browse all cloud computing concepts content here:

Loading
Loading
Loading
Loading
Loading

Did you find what you were looking for today?

Let us know so we can improve the quality of the content on our pages