jnx_routing_rib_service.proto

Service

Rib

JET RPC service providing route operations to manage rib services.

Method Name Request Type Response Type Description
RouteAdd RouteAddRequest RouteAddResponse Route Add operation
RouteModify RouteModifyRequest RouteModifyResponse Route Modify operation
RouteUpdate RouteUpdateRequest RouteUpdateResponse Route Update operation
RouteDelete RouteDeleteRequest RouteDeleteResponse Route Delete operation
RouteGet RouteGetRequest RouteGetResponse Route Get operation
RouteSubscribe RouteSubscribeRequest RouteSubscribeResponse Subscribe for the route entries of a table.

RPC(s)

The following APIs are provided by this service:

RouteAdd

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. RouteAddRequest 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 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.

Input: RouteAddRequest

Output: RouteAddResponse

RouteModify

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. RouteModifyRequest may contain from one to 1000 routes to be modified. 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.

Input: RouteModifyRequest

Output: RouteModifyResponse

RouteUpdate

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 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.

Input: RouteUpdateRequest

Output: RouteUpdateResponse

RouteDelete

Delete a static route from the routing table. RouteDelete may be called multiple times for the same prefix to delete 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 deleted. 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.

Input: RouteDeleteRequest

Output: RouteDeleteResponse

RouteGet

Lookup a route from the routing table. Match fields that are not specified or that may match more than one route (e.g. a less-specific destination prefix) may result in multiple routes being returned in the replies. Responses are bulked for performance and the client can specify maximum number of route entries that JUNOS can send in one response message using route_count field. JUNOS may choose to pack less number of entries than that client has specified. Multiple route entries matching a given route prefix may be be counted as one (if its 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.

Input: RouteGetRequest

Output: RouteGetResponse

RouteSubscribe

When clients subscribe for a table all routes that passes policy are streamed to the client. After this the routes that get added or changed or deleted are streamed. Clients can subscribe to more than one table for route monitoring. Each of these subscriptions will have a different stream on which the routes will be streamed. Clients can also change subscription parameters for the table. In this case the parameter will be re-applied for the table and the resulting routes of the table are streamed. For e.g if policy is added to the subscription to notify only static routes, then all non static routes that were sent before are re-sent with a delete subscription operation. Subsequent subscription messages for the table will contain only static routes. For the above case, streaming will happen on the new stream created for the fresh Subscribe request sent. Streaming of routes on the old stream will stop. The response is sent as stream and will be sent as long as subscription is valid. Once the subscription is deleted, then this streaming will be stopped.

Input: RouteSubscribeRequest

Output: RouteSubscribeResponse

Message(s)

This IDL defines the following message type(s)

RouteAddRequest

Route add request message type with repeated route entries.

Field Type Description
routes RouteEntry One or more programmed routes to add.

RouteAddResponse

Response 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.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.
operations_completed uint32 The number of requested operations completed successfully.

RouteModifyRequest

Route modify request message type with repeated route entries.

Field Type Description
routes RouteEntry One or more programmed routes to modify.

RouteModifyResponse

Route modify response containing the status of the operation. Response 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.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.
operations_completed uint32 The number of requested operations completed successfully.

RouteUpdateRequest

Route update request message type with repeated route entries.

Field Type Description
routes RouteEntry One or more programmed routes to update.

RouteUpdateResponse

Response 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.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.
operations_completed uint32 The number of requested operations completed successfully.

RouteDeleteRequest

Route delete request message type with repeated route match entries to be deleted.

Field Type Description
keys RouteMatch Route paramaters for one or more programmed routes to be deleted

RouteDeleteResponse

Response 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.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.
operations_completed uint32 The number of requested operations completed successfully.

RouteGetRequest

Route get request message type with the RPC parameters to get the route entries from the route table.

Field Type Description
key RouteMatch Route matching parameters.
match_type RouteMatchType route match type
active_only bool active_only
reply_address_format AddressFormat The format for IP addresses in the replies to this request.
reply_table_format RouteTableFormat The format to be used for route table in replies to this request
route_count uint32 route count

RouteGetResponse

The response contains the status of the operation and the full or partial set of matching routes, depending on how many response RPCs the stream of routes is split among.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The final return code for the request.
routes RouteEntry One or more matching routes.

RouteSubscribeRequest

Request message to subscribe for route monitoring. The subscribe denotes the routing table for which route subscribe is requested. Parameters in the subscribe request like subscribe policy can be set to influence which of the routes of the table are sent in the subscribe response message.

Field Type Description
table_name RouteTableName Name of the route table for which the route subscribe is requested
operation RouteSubscribeOp Subscribe operation to be performed
flag RouteSubscribeFlags Route subscribe flags
policy RouteSubscribePolicy Policy used to filter notifications.
context uint32 Context expected by clients to be sent back in response message
route_count uint32 Number of routes to be packed in subscribe response message.

RouteSubscribeResponse

Response message which contains the routes of the table subscribed for monitoring.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode Return code to indicate operation status
context uint32 Context send by clients in the subscribe request
table_name RouteTableName Route table to which the route entries of subscribe routes belong
routes RouteSubscribeEntry One or more route entries to be sent to client

RouteEntry

Route entry with route address, mask and attributes

Field Type Description
key RouteMatch Route key attribute.
nexthop RouteNexthop
protocol RouteProtoType Protocol
attributes RouteAttributes Route attributes

RouteGateway

Route gateway contains the parameters which are needed to forward traffic to next router/host. Consists of gateway address, local address and interface.

Field Type Description
gateway_address NetworkAddress Address of nexhop gateway or peer.
interface_name string Outgoing local interface name (IFL).
local_address NetworkAddress Local interface address to be used.
label_stack LabelStack MPLS label stack.
weight uint32 weight
bandwidth float bandwidth

RouteMatch

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

Field Type Description
dest_prefix NetworkAddress Address of the route.
dest_prefix_len uint32 Route prefix length.
table RouteTable Routing table to which the route belongs.
cookie uint64 Differentiate routes of same address set by application. [default value]: 0.

RouteSubscribeEntry

Route subscribe entry is sent to the client in the subscribe response message.

Field Type Description
operation RouteSubscribeRouteOp The subscribe operation
route RouteEntry route entries that are in the subscribe response

RouteSubscribePolicy

Policy to be used for filtering routes send in RouteSubscribeResponse. This policy has to be configured using CLI or NETCONF as currently programmable APIs do not support configuration of policy statements. This is an optional parameter. If not set then all routes for the registred table will be sent in RouteSubscribeResponse message.

Field Type Description
policy string Policy name

RouteNexthop

When a data traffic arrives on a router, route nexthop indicates the next router(s) to which the traffic is to be forwarded. This consists of list of gateways.

Field Type Description
gateways RouteGateway List of nexthop gateways.

RouteAttributes

Route attributes message type with attributes like preference,tags and colors

Field Type Description
preferences PreferencesEntry Route preference
tags TagsEntry tags
colors ColorsEntry

RouteSubscribeFlags

Flags that can be used to change the behavior of routes recevied via the RouteSubscribeResponse. This can be like requesting End of Record. Matches RPD_MSG_FLASH_SUBSCRIBE_REQUEST*.

Field Type Description
request_eor bool Subscribe End of Record
no_eor_to_client bool Requested by clients to NOT send them EOR, by default EOR will be sent to client.
request_no_withdrawal bool clients can use this flag to inform server not send withdrawal messages when last filter is deleted by this client for given table
request_from_eswd bool The following client identification is for backward compatibilty and not to be used by new JAPI clients. To be set when subscribe request is form Junos Process ESWD.
request_from_mcsnoopd bool To be set when subscribe request is form Junos Process MCSNOOPD.
request_from_vrrpd bool To be set when subscribe request is form Junos Process VRRPD.
request_force_re_notif bool If this flag is set, client's re-registration triggers all routes to be notified once again.

Enum(s)

RouteSubscribeRouteOp

matches RPD_ROUTE_FLASH_OP*.

Value Description
ROUTE_SUBSCRIBE_OP_NONE No operation
ROUTE_SUBSCRIBE_OP_ADD Route add operation
ROUTE_SUBSCRIBE_OP_MODIFY Route modification
ROUTE_SUBSCBIBE_OP_DELETE Route delete operation
ROUTE_SUBSCRIBE_OP_NO_ADVERTISE no advertisement
ROUTE_SUBSCRIBE_OP_END_OF_TABLE end of the route table

RouteSubscribeOp

match with RPD_MSG_FLASH_SUBSCRIBE_REQUEST

Value Description
SUBSCRIBE_NONE not subscribed to any route table
SUBSCRIBE_ADD add the subscription for given table
SUBSCRIBE_DELETE delete the subscription for given table

RoutePreference

Route Preferences of the various route types

Value Description
RTPREF_DIRECT Routes to interfaces
RTPREF_STATIC Static routes
RTPREF_OSPF OSPF Internal route
RTPREF_LABELED_ISIS IS-IS level 1 route
RTPREF_ISIS_L1 IS-IS level 1 route
RTPREF_ISIS_L2 IS-IS level 2 route
RTPREF_RIP Berkeley RIP
RTPREF_RIPNG Berkeley RIPng
RTPREF_IGMP Internet Gatway Mgmt
RTPREF_OSPF_ASE OSPF External route
RTPREF_BGP_EXT Border Gateway Protocol - external peer

RouteMatchType

Various ways to match a route for get requests

Value Description
BEST Match the best route
EXACT Match the exact route
EXACT_OR_LONGER Match the exact or longer prefix route

StatusCode

Response sub_code for route add/modify/update/delete/get/subscribe.

Value Description
SUCCESS Request successfully completed in full.
INTERNAL_ERROR Request failed due to an internal server error.
NOT_INITIALIZED The route service has not been initialized
NO_OP Request did not result in any operations
TOO_MANY_OPS Request contained too many operations
TABLE_INVALID Request contained an invalid table.
TABLE_NOT_READY Request contained a table that was not ready for operations.
PREFIX_INVALID Request contained an invalid destination address prefix
PREFIX_LEN_TOO_SHORT Request contained a destination prefix length too short for the supplied address/NLRI.
PREFIX_LEN_TOO_LONG Request contained a destination prefix length too long for the supplied address/NLRI.
GATEWAY_INVALID The server did not have a valid gateway associated with the client.
NEXTHOP_INVALID Request contained an invalid nexthop.
NEXTHOP_ADDRESS_INVALID Request contained a nexthop with an invallid address.
NEXTHOP_LIMIT_EXCEED Request to add paths exceeding maximum ECMP paths for a destination.
ROUTE_EXISTS Request contains a route that is already present in the table.
ROUTE_NOT_FOUND Request contains a route that is NOT present in the table.
PROTOCOL_INVALID Request contains an invalid protocol. Only PROTO_UNSPECIFID or PROTO_BGP_STATIC are allowed in route change operations.
ROUTE_ADD_FAILED Request contains a route that is NOT present in the table.
NOT_READY The protocol daemon is not initialized and ready to accept route change operations.
TRY_AGAIN Request cannot be serviced until current requests are processed.
ROUTE_COUNT_INVALID Request contains a route_count that exceeds the max of 1000
REQUEST_UNSUPPORTED Request contains a parameter that is not currently supported.
REQUEST_INVALID Request contains a parameter that is not valid.
INTERFACE_INVALID Interface name is not valid.
ROUTE_SUBSCRIBE_OPERATION_INVALID Invalid parameters for Route subscribe.
ROUTE_SUBSCRIBE_ENOENT This error is returned when Route subscribe API with delete operation is called for a table which was not subscribed for using a add operation.
ROUTE_SUBSCRIBE_POLICY_INVALID Route Subscribe Policy invalid
ROUTE_SUBSCRIBE_RESPONSE_ROUTE_COUNT_INVALID Route Subscribe request has invalid subscribe_response_route_count. This error is also returned if subscribe_response_route_count is changed for an existing subscription.
ROUTE_SUBSCRIBE_EXISTS Route subscribe registration for same table with same params exist
MPLS_LABEL_INVALID MPLS Label value is invalid
MPLS_ACTION_INVALID MPLS Label stack operation(s) is invalid