Protocol Documentation

bfd_service.proto

Authentication

Specify the authentication parameters to setup BFD session.

Field Type Label Description
type Authentication.AuthenticationType
keychain string Keychain refers to the name of the keychain configured via the CLI Name of the security keychain to associate security key with the BFD session. The keychain name must match one of the keychains configured in the authentication-key-chains key-chain statement at the [edit security] hierarchy level. Optional.
loose_check bool When loose checking is configured, packets are accepted without authentication being checked at each end of the session. Loose authentication is useful for transitional periods when authentication might not be configured at both ends of the BFD session. Optional, default is false.

DeleteAllRequest

EventResponse

Response message of Subscribe Request.

Notify client about any state changes of programmed BFD sessions.

Field Type Label Description
type EventResponse.EventType Type of event. For now the only type is session state change.
session_id uint32 Identifier of the BFD session.
session_state SessionState The new state after a BFD session state change.
status routing.RpcStatus Return code and error message for Subscribe Request.
sub_code StatusCode

InitializeRequest

InitializeResponse

Field Type Label Description
status routing.RpcStatus Return code and error message for Initialize Request.
sub_code StatusCode

SessionKey

BFD session parameters which are immutable for a given session. Can't be

modified or updated by client once a session is created using session-id.

Field Type Label Description
session_id uint32 Session id is assigned by the BFD service on receiving a Session Add request. Session-id must be 0 Session Add requests. Response includes session_id. Subsequent operations can use session_id as the key. For Session Update and Delete requests, session-id is used as the key.
local_address routing.NetworkAddress Optionally specify the local-address to be used. Usually this is required by multihop BFD session, but in some scenarios this can be derived based on the nexthop address or the outgoing interface. optional for self-ping sessions.
remote_address routing.NetworkAddress Specifies the remote address. This field is mandatory but can be set flexiblely for SELF-PING sessions
interface_name string Optional field. This is required only when routing has to be bypassed.
instance_name string Optional field. NULL for default instance.
local_discriminator uint32 local-discriminator is unique per BFD session and is assigned by the router. must be 0 for ADD request. This field is mainly for future GET requests which will fetch the local-discriminator and fill here.
remote_discriminator uint32 This field is optional for classical and self-ping sessions, but is mandatory for seamless BFD sessions. It can be same as remote IP address.
tunnel_info TunnelAttributes Holds the tunnel info (label stack and nexthop address) for MPLS tunnels.
cookie uint64 Set by the client. JUNOS doesn't interpret it.

SessionOperationResponse

Field Type Label Description
session_id uint32
cookie uint64
status routing.RpcStatus Return code and error message for any Session Operation.
sub_code StatusCode

SessionParameters

Tunable BFD session parameters

Field Type Label Description
minimum_interval uint32 Represents the minimum interval (in milliseconds) at which the local routing device transmits hello packets as well as the minimum interval that the routing device expects to receive a reply from a neighbor with which it has established a BFD session. Value range: 1-255,000. Optional, default value is 1000.
multiplier uint32 Number of hello packets not received from a BFD peer that causes the session to be declared down. Value range: 1-255. Optional, default value is 3.
authentication Authentication Authentication for BFD session. Optional.

SessionRequest

BFD session details

Field Type Label Description
key SessionKey Key is considered to be immutable once a session is added. Required.
params SessionParameters Tunable session paramaters which can be updated via SessionUpdate. Required for SessionAdd and SessionUpdate.
type SessionRequest.SessionType Specifies the BFD signaling type to be used. default: CLASSICAL.
mode SessionRequest.SessionMode Specifies whether the BFD session is single/multi-hop. default: AUTOMATIC.

SubscribeRequest

TunnelAttributes

Holds the tunnel info for MPLS tunnels.

Field Type Label Description
labels routing.LabelEntry repeated Label stack: inner-most first, top-label last Number of labels: minimum 1, maximum 16. Required.
nexthop_address routing.NetworkAddress Nexthop IP address. Required for self-ping. For mpls seamless, label nexthop will be used if this field is not specified.

UnsubscribeRequest

UnsubscribeResponse

Field Type Label Description
status routing.RpcStatus Return code and error message for Initialize Request.
sub_code StatusCode

Authentication.AuthenticationType

Specifies the algorithm used to authenticate the given BFD session default is none.

Name Number Description
NONE 0
PLAIN_TEXT_PASSWORD 1
KEYED_MD5 2
METICULOUS_KEYED_MD5 3
KEYED_SHA1 4
METICULOUS_KEYED_SHA1 5

EventResponse.EventType

Name Number Description
RESERVED 0
SESSION_STATE 1

SessionRequest.SessionMode

Specifies whether the session is single/multi-hop.

Name Number Description
AUTOMATIC 0 session mode will be autodetected based on the destination address.
SINGLE_HOP 1
MULTI_HOP 2

SessionRequest.SessionType

Specifies the BFD control-plane signaling type.

Name Number Description
CLASSICAL 0 Classical BFD: BFD signals the remote-end and learns the remote-discriminator before setting up liveness check probes. IPv4 and IPv6 are supported. MPLS is not supported.
SEAMLESS 1 Use seamless BFD RFC 7880 to setup BFD sessions which is quicker to setup. Client has to provide the remote discriminator which the remote end has to configure as local-discriminator. IPv4 and MPLS are supported. IPv6 is currently not supported.
SELF_PING 2 Use JUNOS BFD Self-ping extension. This type doesn't setup control-plane signaling and detects liveness by having the packets routed back to itself. Currently works only with MPLS. IPv4 and IPv6 sessions are not supported.

SessionState

BFD session state

Name Number Description
UNKNOWN 0
UP 1
DOWN 2
ADMIN_DOWN 3
DESTROYED 4

StatusCode

Name Number Description
SUCCESS 0 Request successfully completed in full.
FAILURE 1
INTERNAL_ERROR 2 Request failed due to an internal server error.
NOT_INITIALIZED 3 The route service has not been initialized
INVALID_SESSION_ID 4
INVALID_SESSION_KEY 5
INVALID_SESSION_TYPE 6
INVALID_SESSION_MODE 7
INVALID_TUNNEL 8
INVALID_AUTH_KEY 9
INVALID_AUTH_TYPE 10
ALREADY_SUBSCRIBED 11
NOT_SUBSCRIBED 12
NOT_SUPPORTED 13

BFD

Method Name Request Type Response Type Description
Initialize InitializeRequest InitializeResponse Must be invoked before invoking any other BFD service APIs.
SessionAdd SessionRequest SessionOperationResponse Add a new BFD session.
SessionUpdate SessionRequest SessionOperationResponse Modify an existing BFD session.
SessionDelete SessionRequest SessionOperationResponse Delete an existing BFD session.
SessionDeleteAll DeleteAllRequest SessionOperationResponse Deletes all BFD sessions owned by this client. Useful to cleanup after a disconnect and reconnect to reset the state.
Subscribe SubscribeRequest EventResponse stream Subscribe for BFD session event notifications.
Unsubscribe UnsubscribeRequest UnsubscribeResponse UnSubscribe for BFD session event notifications.

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 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 int32 int integer Bignum or Fixnum (as required)
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 int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)