google gNMI Protocol Version 0.4.0 — Proto Encoding

Proto Encoding gNMI protocol supports PROTO encoding along with the already supported JSON and JSON_IETF formats. The gnmi.proto file represents the blueprint for generating a complete set of client and server-side procedures that instantiate the framework for the gNMI protocol. The existing encoding procedure for JSON and JSON_IETF formats push the input data that causes the output values to have premature wraps and other issues, causing loss of data precision. PROTO encoding allows the querying of applications to retrieve data in scalar (TypedValue) values; each leaf is sent on its own update as per the gNMI specification.

This allows customers to have access to float and double values for more accuracy. PROTO encoding is supported for all the paths that are supported by gNMI. PROTO encoding supports subscribe RPC, but not GET and SET RPCs. PROTO encoding is part of the gNMI protocol, and is enabled when the gNMI feature is enabled. The following is a sample subscribeRequest RPC with PROTO: subscribe: prefix: origin: "legacy" elem: name: "mdt-oper-v2:mdt-oper-v2-data" > > subscription: path: elem: name: "mdt-subscriptions" > > mode: SAMPLE sample_interval: 10000000000 > mode: STREAM encoding: PROTO > The following is a sample subscribeRequest response with PROTO: update: timestamp: 1652408966709576000 prefix:

origin: "openconfig" elem: name: "oc-if:interfaces" > elem: name: "interface" key: key: "name" value: "*" > > elem: name: "state" > update: path: origin: "openconfig" gNMI Protocol Proto Encoding gNMI Protocol 3