gNOI

gRPC Network Operations Interface (gNOI) defines a set of gRPC-based services for executing operational commands on network devices. The individual RPCs and messages that perform the gNOI operations required on the node are defined at the following location: https://github.com/openconfig/gnoi. This repository also stores the various per-service protos in subdirectories.

SR Linux supports the following gNOI services:

gNOI OS service

The gNOI OS service provides an interface to install an OS package on a target node. SR Linux supports the gNOI OS service on both the active and standby CPMs (referred to as supervisors in gNOI).

To perform the OS installation, the client progresses through the following three gNOI OS RPCs:

  • Install RPC
  • Activate RPC
  • Verify RPC

The protos used to define the OS service were pulled from the following hash: https://github.com/openconfig/gnoi/commit/79709cdf28e160f0732ff0086902c06c9c2d74f8.

Install RPC

The Install RPC transfers the OS package to the target node. The target node first attempts to copy the specified OS package between the CPMs before it accepts the transfer from the client.

To refer to the OS version, SR Linux uses the same string in gNOI as the one used with ZTP (version string-build number) , for example: v22.11.1-010. The download folder for the OS is located at: /var/run/srlinux/gnoi. To validate that the transferred OS package is valid and bootable before installation, the platform performs a hash check against the md5sum that is embedded in the .bin file.

On a dual CPM node, only the active CPM runs the gNOI service. The Install RPC transfers the OS to the active CPM.
Note: SR Linux does not support the standby_supervisor option. On a dual CPM node, the transferred image is synced automatically to the standby CPM using ZTP.

One Install RPC is required for each CPM. Concurrent Install RPCs are not allowed on the same target node.

Install RPC structure

 rpc Install(stream InstallRequest) returns (stream InstallResponse);

Activate RPC

The Activate RPC sets the requested OS version for the target node to use at the next reboot. It also reboots the target node if the no_reboot flag is not set.

Note: If the requested image fails to boot, SR Linux cannot attempt to boot a secondary image. In this case, the system can revert to the rescue image.
On a dual CPM node, if you perform this RPC on the active CPM, it triggers a switchover to the standby CPM before rebooting the previously active CPM.

Activate RPC structure

rpc Activate(ActivateRequest) returns (ActivateResponse);

Verify RPC

The Verify RPC checks the OS version running on the target node. The client can call this RPC multiple times while the target node boots until the activation is successful.

Note: The activation_fail_message is not supported because if the target node does not boot, it remains in a failure state and does not revert to a previous version of OS.

Verify RPC structure

rpc Verify(VerifyRequest) returns (VerifyResponse);

gNOI file service

The gNOI file service allows the client to transfer files to and from the target node. The main use for this service is extracting debugging information through the transfer of system logs and core files.

SR Linux supports the following gNOI file RPCs:

Note: The TransferToRemote RPC is not supported.

The protos used to define the gNOI file service were pulled from the following hash: https://github.com/openconfig/gnoi/commit/79709cdf28e160f0732ff0086902c06c9c2d74f8.

Get RPC

The Get RPC reads and streams the contents of a file from a target node to the client using sequential messages, and sends a final message containing the hash of the streamed data before closing the stream.

The target node returns an error if:

  • An error occurs while reading the file.
  • The file does not exist.

Get RPC structure

rpc Get(GetRequest) returns (stream GetResponse) {}

Put RPC

The Put RPC streams data to the target node and writes the data to a file. The client streams the file using sequential messages. The initial message contains information about the filename and permissions. The final message includes the hash of the streamed data.

The target node returns an error if:

  • An error occurs while writing the data.
  • The location does not exist.

Put RPC structure

rpc Put(stream PutRequest) returns (PutResponse) {}

Stat RPC

The Stat RPC returns metadata about files on the target node.

If the path specified in the StatRequest references a directory, the StatResponse returns the metadata for all files and folders, including the parent directory. If the path references a direct path to a file, the StatResponse returns metadata for the specified file only.

The target node returns an error if:
  • The file does not exist.
  • An error occurs while accessing the metadata.

Stat RPC structure

rpc Stat(StatRequest) returns (StatResponse) {}

Remove RPC

The Remove RPC removes the specified file from the target node.

The target node returns an error if:

  • An error occurs during the remove operation (for example, permission denied).
  • The file does not exist.
  • The path references a directory instead of a file.

Remove RPC structure

rpc Remove(RemoveRequest) returns (RemoveResponse) {}

gNOI system service

The gNOI system service defines an interface that allows a client to perform operational tasks on target network nodes. SR Linux supports the following gNOI system RPCs:

The protos used to define the gNOI system service were pulled from the following hash: https://github.com/openconfig/gnoi/commit/79709cdf28e160f0732ff0086902c06c9c2d74f8.

Ping RPC

The Ping RPC allows the client to execute the ping command on the target node. The target node streams the results back to the client. Some targets do not stream any results until they receive all results. If the RPC does not specify a packet count, the ping operation uses a default of five packets.

Note:
  • The Ping RPC does not currently support specification of a network-instance. The ping is executed in the network-instance where the gNMI server is running.
  • SR Linux does not support setting the interval field in the PingRequest to -1 (flood ping).

Ping RPC structure

rpc Ping(PingRequest) returns (stream PingResponse) {}

Traceroute RPC

The Traceroute RPC allows the client to execute the traceroute command on the target node. The target node streams the results back to the client. Some targets do not stream any results until they receive all results. If the RPC does not specify a hop count, the traceroute operation uses a default of 30.

Note:
  • The Traceroute RPC does not currently support specification of a network-instance. The traceroute is executed in the network-instance where the gNMI server is running.
  • In the TracerouteResponse, SR Linux does not support the mpls and as_path fields.

Traceroute RPC structure

rpc Traceroute(TracerouteRequest) returns (stream TracerouteResponse) {}

Time RPC

The Time RPC returns the current time on the target node. It is typically used to test whether the target is currently responding.

Time RPC structure

rpc Time(TimeRequest) returns (TimeResponse) {}

SwitchControlProcessor RPC

The SwitchControlProcessor RPC switches the active control processing module (CPM) on the target node to the control slot (A or B) that is specified in the request message.

SwitchControlProcessor RPC structure

rpc SwitchControlProcessor(SwitchControlProcessorRequest)
    returns (SwitchControlProcessorResponse) {}

Reboot RPC

The Reboot RPC allows the client to reboot a target node, either immediately or at some time in the future. It triggers the reboot of the entire chassis. It also supports specification of a reboot method (for example, cold or warm reboot), however, if the target node does not support the specified reboot method, the Reboot RPC fails.

Note: SR Linux supports only the cold reboot method, and does not support rebooting of subcomponents.

If a reboot is pending on the active control processor, the service rejects all other reboot requests.

Reboot RPC structure

rpc Reboot(RebootRequest) returns (RebootResponse) {}

CancelReboot RPC

The CancelReboot RPC allows the client to cancel any pending reboot requests on the target node.

Note: SR Linux does not support canceling a reboot for a subcomponent.

CancelReboot RPC structure

message CancelRebootResponse { }

RebootStatus RPC

The RebootStatus RPC allows the client to query the status of a reboot on the target node.

Note: SR Linux does not support querying on a single component at a time.

RebootStatus RPC structure

rpc RebootStatus(RebootStatusRequest) returns (RebootStatusResponse) {}

KillProcess RPC

The KillProcess RPC allows a client to kill an OS process and optionally restart it on the target node.

To specify the process to kill, the RPC must match the application name referenced in the tools system app-management application <name> command.

Mapping of termination signals to SR Linux commands

The KillProcess RPC termination signals map to SR Linux commands as follows:

Table 1. Mapping of termination signals to SR Linux commands
Termination signal SR Linux command Command if restart field is true
SIGNAL_TERM stop restart

(this option runs a warm or cold restart based on what is supported(

SIGNAL_KILL kill restart cold
SIGNAL_HUP reload

KillProcess RPC structure

rpc KillProcess(KillProcessRequest) returns (KillProcessResponse) {}

gNOI configuration

SR Linux supports gNOI services using the existing gNMI server configuration. To enable gNOI support, enable the gNMI server.

Like gNMI, the session between the gNOI client and SR Linux must be encrypted using TLS.

See the "Management servers" chapter in the SR Linux Configuration Basics Guide for information about how to configure the gNMI server.