Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


gNOI Diagnostic (Diag) Service

SUMMARY Use the gNOI diagnostic (Diag) service to test the reliability of a link between two devices.


Use the Diag service RPCs to perform a bit error rate test (BERT) on a pair of connected ports. The Diag service proto definition file is located at

A BERT, also known as a pseudo-random binary sequence (PRBS) test, tests the reliability of a link. The StartBERT() gNOI RPC initiates a bidirectional BERT on a pair of connected physical interfaces. The devices exchange a set pattern of 1s and 0s across the link. The devices compare the received message to the sent message and count the number of errors. The lower the number of errors, the higher the quality of the link.

You must run a gNOI BERT on both sides of the link so the devices can compare results. The link you are testing goes down during the BERT and comes back up after the BERT ends. However, if one of the devices where you are running the BERT reboots, the link remains down unless you stop the BERT on the other device.

You can choose the test pattern from several predetermined types. BERT or PRBS test patterns are titled in the form PRBSx, where x is a number. Junos devices support the following test patterns for gNOI BERTs:

  • PRBS7
  • PRBS9
  • PRBS15
  • PRBS23
  • PRBS31

You must give each gNOI BERT a unique operation ID. The RPCs to start the BERT, stop the BERT, and get the BERT results are linked by the BERT operation ID. When you run a new BERT, you must change the operation ID to a new string. Because the RPCs identify each BERT by its operation ID, you can run multiple BERTs on different interfaces with the same ID.

The device keeps the results of the last 5 BERT operations. However, the saved BERT results are not persistent. They are lost if the system reboots.

To view the result of a specific saved BERT operation, send the GetBERTResultRequest message for the desired BERT operation ID and set the result_from_all_ports field to False. To view all request results for different IDs, set the result_from_all_ports field in the GetBERTResultRequest message to True.

When you run the GetBERTResult() RPC on a device, the RPC displays the number of mismatched bits that particular device detected during the BERT. Since the RPC does not have pass or fail criteria configured, it is up to the user to evaluate the results. You might see a high number of errors for several reasons, including:

  • The quality of the link is poor.
  • One of the devices went offline during the BERT.
  • The BERT only ran on one device.
  • The BERT did not start and stop on both devices simultaneously.

To avoid the last error, we recommend sending the StartBERT() RPC to both devices simultaneously. If you start a BERT on one device before the other, the first device doesn't receive a response until the BERT starts on the other device. The first device records the lack of response as mismatched bits. The first device continues to report errors until BERT starts on the second device. If it is not possible to start the BERT simultaneously, we recommend running the GetBERTResult() RPC on the device that started the BERT last. Since the BERT was already running on the first device, the second device should not report any false missing bits.

Supported RPCs

Table 1: Supported diag.proto RPCs
RPC Description Introduced in Release

Start a BERT on a set of ports. Junos devices support the following PRBS patterns for gNOI BERTs:

  • PRBS7
  • PRBS9
  • PRBS15
  • PRBS23
  • PRBS31

Junos OS Evolved 22.2R1


Stop an already in-progress BERT on a set of ports.

Junos OS Evolved 22.2R1


Get BERT results during the BERT or after it completes.

Junos OS Evolved 22.2R1

Network Device Configuration

  • For the link you want to run the BERT on, configure the server and peer interfaces speeds to match. BERT only runs if the interface speeds match.

Example: Run a BERT


While a BERT is in progress on an interface, the physical link on that interface goes down.

After you have configured the gNOI client and server, you are ready to write and execute your application to run the BERT. In this example, the client executes the Python application to test a link between the server and a peer device. The application can start the BERT, stop the BERT, or get the BERT results depending on the arguments.

First, the client uses to send the StartBERT() RPC to start the BERT on the server and the peer. While the BERT is running, the server and peer exchange BERT test packets across the link between the et-1/0/2 and et-1/0/3 interfaces.

Figure 1: Network Topology During the BERTNetwork Topology During the BERT

The BERT ends after the set time expires. Then the client executes the application a second time with the GetBERTResult() RPC to get the BERT results from the server.

The parameters for the StartBERTRequest message are stored in the input_bert_start.json JSON file. This file specifies that the BERT should run for 60 seconds using PRBS pattern 31. The parameters for the GetBERTResultRequest message are stored in the input_bert_get.json JSON file. The result_from_all_ports field is set to False, so the GetBERTResult() RPC only retrieves the result for this particular BERT from this port. The BERT operation ID is BERT-operation id 1 in both JSON files.

The application imports the grpc_channel module to establish the channel. The grpc_channel module is described in Configure gNOI Services. The application file and JSON files are presented here.



Execute the Application

  1. From the client, run the application to start the BERT on the peer (not shown). Then run the application to start the BERT on the server (shown below). To start the BERT, set message to StartBERTRequest and set input_file to the input_bert_start.json file path. For each device, the input file should specify the interface tested on that device. The BERT_STATUS_OK status indicates that the BERT started successfully.

  2. (Optional) While you are running the BERT, use the show interfaces command on the server or peer device to view the ongoing BERT results. When a BERT is running, the PRBS Mode is Enabled. The output in this example has been truncated for clarity.

  3. After the BERT is finished, run the application again with message set to GetBERTResultRequest and input_file set to the input_bert_get.json file path to get the results of the test. In this example, the BERT found zero errors during a one-minute test.

    The BERT completed successfully and shows the quality of the link is good.