The RIB API service proto definition requires the client to provide values for all of the parameters listed in Table: MPLS LFIB programming when performing an add or replace of an MPLS LFIB entry. When performing a delete operation, only the bolded parameters (the lookup keys) are required. Table: MPLS LFIB programming describes the meaning of each parameter and its valid range.
Parameter | Type | Description |
---|---|---|
prefix |
string |
Incoming label value |
preferences |
uint32 (0-65535) |
RIB API preference, used to compare one RIB API entry to another one; the lowest preference wins |
next-hop-group[id] |
list |
A list of next-hop groups; required for a SWAP operation; omitted when the operation is a POP |
id |
uint32 (1-32) |
Unique identifier of the next-hop group; selected by the client |
weight |
uint32 |
Weight assigned to the next-hop-group when weighted ECMP is needed between next-hop-groups |
primary |
— |
Mandatory |
ip_address |
string |
IPv4 or IPv6 address on a local subnet; can be a secondary address |
pushed_label_stack |
list of uint32 |
A list of zero or more MPLS labels, up to ten MPLS labels |
backup |
— |
Optional |
ip_address |
string |
IPv4 or IPv6 address on a local subnet; can be a secondary address |
pushed_label_stack |
list of uint32 |
A list of up to ten MPLS labels |
ingress-statistics |
— |
— |
enable |
bool |
— |
type |
enum 0, 1, 2 |
INVALID = 0 POP = 1 SWAP = 2 |
egress-statistics |
— |
— |
enable |
boolean |
Indicates whether statistics collection is to be enabled for this entry |
The router's RIB API database can hold up to eight different gPRC-programmed entries per MPLS label value. Typically N entries would be associated with N different gRPC clients although the same client can program multiple entries for the same label value as long as the preference values are unique.
When an MPLS label entry is successfully added or modified in the RIB API database, the router assesses whether the entry is valid or invalid and constantly re-evaluates this status. The label entry is invalid if it is a SWAP operation and none of the primary next hops can be resolved to an interface that is up or if MPLS programming using the RIB API is administratively disabled or if the requested incoming label has already been allocated to another owner sharing the same reserved label block or if the requested incoming label is outside the reserved label block range.
If the label entry is valid the router compares it to all other valid API-programmed entries for the same label value. The router chooses any non-stale entry over a stale entry, then the entry with the lowest preference value, and then if there is a tie, the entry from the client with the lowest 128-bit IP address (an IPv4 address is encoded in the lower 32 bits).
If the label entry is valid and best relative to other RIB API entries then it is programmed into the forwarding plane.