Junos OS routing IDL - Protocol Documentation

Table of Contents

rib_service.proto

Top

$Id$ Vinay K Nallamothu

Copyright (c) 2016, Juniper Networks, Inc. All rights reserved.

RouteEntry

Route entry with route address, mask and attributes

FieldTypeLabelDescription
key RouteMatchFields optional

Route key attribute

[REQUIRED]

nexthop RouteNexthop optional

Next-hop details of the route

[REQUIRED]

RouteGateway

Route gateway contains the parameters which are needed to forward traffic to the next router or host. It consists of a gateway address, a local address, and an interface.

FieldTypeLabelDescription
gateway_address NetworkAddress optional

Address of the gateway or peer [REQUIRED]

interface_name string optional

Outgoing logical interface name (IFL). If provided, a router next-hop is built. If not provided, an indirect next-hop is built. [OPTIONAL]

local_address NetworkAddress optional

Local interface address to be used. This is useful when the application is not aware of the outgoing interface but knows the IP address of the interface.

Local address is used to select a suitable interface.

[OPTIONAL]

RouteGetReply

Route get reply containing the status of the operation and the full or partial set of matching routes, depending on how many reply RPCs the stream of routes is split among.

FieldTypeLabelDescription
status RouteOperStatus optional

The final return code for the request.

routes RouteEntry repeated

One or more matching routes.

RouteGetRequest

Route get operation request parameters.

FieldTypeLabelDescription
key RouteMatchFields optional

Route matching parameters

[REQUIRED]

match_type RouteMatchType optional

If match_type is EXACT only routes for the exact destination prefix and prefix length will be matched.

If match_type is EXACT_OR_LONGER, routes for the given destination prefix or longer prefixes will be matched.

If match_type is BEST, longest prefix match is performed on the prefix.

[OPTIONAL] (default is BEST)

active_only bool optional

If active_only is TRUE, inactive and hidden routes for a matching prefix will be omitted from the results.

If active_only is FALSE, inactive and hidden routes are also returned.

[OPTIONAL] (default is FALSE)

reply_address_format AddressFormat optional

The format for IP addresses in the replies to this request.

[OPTIONAL] (default is string)

reply_table_format RouteTableFormat optional

The format to be used for route table in replies to this request

[OPTIONAL] (default is string)

route_count uint32 optional

The maximum number of routes requested in each reply.

Replies will be streamed in multiple RPCs each having no more routes than given by this value. Counts from 1 through the maximum of 1000 may be specified. A value of zero or above 1000 indicates that the server will choose an appropriate number of routes to include in each reply.

[OPTIONAL] (default is 1)

RouteMatchFields

Route entry's unique fields typically used to match the route

FieldTypeLabelDescription
dest_prefix NetworkAddress optional

Address of the route

REQUIRED

dest_prefix_len uint32 optional

Route prefix length

REQUIRED

table RouteTable optional

Routing table to which the route belongs

REQUIRED

cookie uint64 optional

Differentiate routes of same address set by application. For non programmed routes cookie value returned in route get request will be 0.

[OPTIONAL] (Default is 0)

RouteNexthop

When data traffic arrives on a router, route next-hop indicates the next router or routers to which the traffic should be forwarded. This consists of a list of gateways.

FieldTypeLabelDescription
gateways RouteGateway repeated

List of next-hop gateways. Junos OS currently allows up to 64 gateways per next-hop.

[OPTIONAL] (This defaults to a next-hop that black holes the traffic.)

RouteOperReply

Route operation reply containing the status of the operation.

Replies always returns the final status (either success or the first error encountered) and the number of routes that were successfully processed prior to any error or full completion of the request.

FieldTypeLabelDescription
status RouteOperStatus optional

The final return code for the request.

operations_completed uint32 optional

The number of requested operations for which the operation completed successfully.

Note that in the case of remove operations with or_longer=TRUE or cookie=0, this is not the number of routes matched and removed.

RouteRemoveRequest

Message format for route remove requests

FieldTypeLabelDescription
keys RouteMatchFields repeated

Route match parameters for one or more programmed routes to be deleted

[REQUIRED]

RouteUpdateRequest

FieldTypeLabelDescription
routes RouteEntry repeated

One or more programmed routes to add, update, or modify.

[REQUIRED]

RouteMatchType

Various ways to match a route for get requests

NameNumberDescription
BEST 0

Use best match matching method

EXACT 1

Use exact match matching method

EXACT_OR_LONGER 2

Use exact or-longer matching method

RouteOperStatus

Possible return codes for route add, modify, update, and remove operations.

NameNumberDescription
SUCCESS 0

Request successfully completed in full.

INTERNAL_ERROR 1

Request failed due to an internal server error.

NOT_INITIALIZED 2

The route service has not been initialized

NO_OP 3

Request did not result in any operations

TOO_MANY_OPS 4

Request contained too many operations

TABLE_INVALID 5

Request contained an invalid table.

TABLE_NOT_READY 6

Request contained a table that was not ready for operations.

PREFIX_INVALID 7

Request contained an invalid destination address prefix

PREFIX_LEN_TOO_SHORT 8

Request contained a destination prefix length too short for the supplied address or NLRI.

PREFIX_LEN_TOO_LONG 9

Request contained a destination prefix length too long for the supplied address or NLRI.

GATEWAY_INVALID 10

The server did not have a valid gateway associated with the client.

NEXTHOP_INVALID 11

Request contained an invalid next-hop.

NEXTHOP_ADDRESS_INVALID 12

Request contained a next-hop with an invalid address.

NEXTHOP_LIMIT_EXCEED 13

Request to add paths exceeding maximum ECMP paths for a destination.

ROUTE_EXISTS 14

Request contains a route that is already present in the table.

ROUTE_NOT_FOUND 15

Request contains a route that is NOT present in the table.

PROTOCOL_INVALID 16

Request contains an invalid protocol.

Only PROTO_UNSPECIFID or PROTO_BGP_STATIC are allowed in route change operations.

ROUTE_ADD_FAILED 17

Request contains a route that is NOT present in the table.

NOT_READY 18

The protocol daemon is not initialized and ready to accept route change operations.

TRY_AGAIN 19

Request cannot be serviced until current requests are processed.

ROUTE_COUNT_INVALID 20

Request contains a route_count that exceeds the max of 1000

REQUEST_UNSUPPORTED 21

Request contains a parameter that is not currently supported.

REQUEST_INVALID 22

Request contains a parameter that is not valid.

INTERFACE_INVALID 23

Interface name is not valid.

Rib

Routing information base (RIB) service definition

Method NameRequest TypeResponse TypeDescription
RouteAdd RouteUpdateRequest RouteOperReply

Route Add operation

Add a static route to the routing table.

RouteAdd may be called multiple times for the same prefix to add multiple paths with distinct cookie for the same destination. If a matching route already exists in the given table, then an error will be returned.

RoutingRouteOperRequest may contain from one to 1000 routes to be added.

If the request contains multiple routes, the routes will be processed in the order given and the first error encountered will cause the remainder of the request to abort.

The API always returns the final status (success or first error encountered) and the number of routes that were successfully created prior to any error or full completion of the request.

RouteModify RouteUpdateRequest RouteOperReply

Route Modify operation Modify an existing programmed static route in the routing table. For each route in the request, if the key is matched, the matched route will be updated with the supplied route attributes.

If a matching route does not exist in the given table, then an error will be returned.

RouteUpdateRequest may contain from one to 1000 routes to be added. If the request contains multiple routes, the routes will be processed in the order given and the first error encountered will cause the remainder of the request to abort.

The API always returns the final status (success or first error encountered) and the number of routes that were successfully modified prior to any error or full completion of the request.

RouteUpdate RouteUpdateRequest RouteOperReply

Route Update operation Create a new static route if a matching route does not exist, OR modify an existing static route if it is already present in the routing table.

RouteUpdateRequest may contain from one to 1000 routes to be added. If the request contains multiple routes, the routes will be processed in the order given and the first error encountered will cause the remainder of the request to abort.

The API always returns the final status (success or first error encountered) and the number of routes that were successfully modified prior to any error or full completion of the request.

RouteRemove RouteRemoveRequest RouteOperReply

Route Remove operation

Remove a static route from the routing table. RouteRemove may be called multiple times for the same prefix to remove multiple paths with distinct path_cookie for the same destination. (NOTE: cookie support not yet implemented)

The request may contain from one to 1000 routes to be removed.

If the request contains multiple routes, the routes will be processed in the order given and the first error encountered will cause the request to abort.

The API always returns the final status (success or first error encountered) and the number of routes that were successfully modified prior to any error or full completion of the request.

RouteGet RouteGetRequest RouteGetReply

Route Get operation

Lookup a route from the routing table.

All match parameters are optional.

Match fields that are not specified or that may match more than one route, like a less-specific destination prefix, may result in multiple routes being returned in the replies.

Responses are returned in bulk for performance and the client can specify the maximum number of route entries that Junos OS can send in one response message using route_count field. Junos OS may chose to pack fewer entries than the client has specified.

Multiple route entries matching a given route prefix may be be counted as one (if it is the last one in the response) and may result in exceeding the specified route count.

Replies are streamed until all match routes have been sent. The client will receive a final null message once all routes have been received.

The server's walk of search results is not atomic so route changes during streaming and consumption of replies may or may not be reflected in the results.

See RouteGetReply.

Scalar Value Types

.proto TypeNotesC++ TypeJava TypePython Type
double double double float
float float float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long
uint32 Uses variable-length encoding. uint32 int int/long
uint64 Uses variable-length encoding. uint64 long int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long
sfixed32 Always four bytes. int32 int int
sfixed64 Always eight bytes. int64 long int/long
bool bool boolean boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode
bytes May contain any arbitrary sequence of bytes. string ByteString str