Separate BGP RIBs for Labeled Routes

This chapter provides information about separate border gateway protocol (BGP) route information bases (RIBs) for labeled-unicast routes.

Applicability

This chapter was initially written for SR OS Release 14.0.R4. The MD-CLI in the the latest update corresponds to SR OS Release 26.3.R3.

Overview

BGP separate labeled-IPv4 RIB implementation

RR-1 with separate labeled-IPv4 RIB implementation shows how RR-1 sends a labeled-IPv4 route to PE-2 with label X and next hop PE-1.

Figure 1. RR-1 with separate labeled-IPv4 RIB implementation

In SR OS, a separate RIB is used for labeled-IPv4 routes. With this implementation, client PE-2 learns the best labeled-IPv4 route and client PE-4 learns the best unlabeled IPv4 route. RR-1 does not need to set next-hop-self and traffic can be sent directly from PE-2 to PE-1 and from PE-4 to PE-3. The RR is used only for control traffic, as intended.

Seamless MPLS - Separate labeled-IPv4 implementation shows a seamless MPLS use case, which is a good example of the coexistence of labeled (AFI 1/SAFI 4) and unlabeled (AFI 1/SAFI 1) BGP sessions.

Figure 2. Seamless MPLS - Separate labeled-IPv4 implementation

RIB architecture

System architecture with separate RIBs for labeled-unicast and unlabeled routes shows the system architecture with four separate RIBs for IPv4 and IPv6 routes.

Figure 3. System architecture with separate RIBs for labeled-unicast and unlabeled routes

Labeled-unicast routes from peers are stored in a labeled RIB and unlabeled routes from the same or different peers are stored in a non-labeled RIB. Both labeled and unlabeled routes can be sent and received to and from the same peer. Different sets of routes can be advertised to labeled/unlabeled peers. Labeled and unlabeled BGP sessions are using the common equal cost multipath (ECMP) and multipath limit.

More user control is provided over the RTM route import process. By default, a RIB imports all non-BGP active routes from RTM, but a user-defined route policy can be applied. Route policies can be used to reduce BGP memory usage.

The address families mapped to the RIBs are: ipv4, label-ipv4, ipv6, label-ipv6. In route policies, protocol types bgp and bgp-label can be used.

The default RTM preference for labeled IP routes is configurable (label-preference) in the bgp context of the base router or a VPRN. The default preference is 170.

Configuration

All the examples are based on labeled and unlabeled IPv4 addresses. For IPv6, the configuration is similar.

Example IPv4 topology shows the example topology using IPv4 addresses.

Figure 4. Example IPv4 topology

The initial configuration includes:

  • Cards, MDAs, ports

  • Router interfaces

  • IS-IS in AS 64500 (PE-1, PE-2, PE-4)

  • LDP in AS 64500

  • Loopback addresses 10.3.3.3/32 in PE-3 and 10.4.4.4/32 in PE-4

  • Import policy "import-bgp" accepting BGP routes on PE-1

  • Export policy "export-bgp" accepting routes from protocol direct and with prefix within subnet 10.0.0.0/8 on PE-3, PE-4:

# on PE-3, PE-4 (, PE-1):
configure {
    policy-options {
        prefix-list "10.0.0.0/8" {
            prefix 10.0.0.0/8 type range {
                start-length 32
                end-length 32
            }
        }
        policy-statement "export-bgp" {
            entry 10 {
                from {
                    prefix-list ["10.0.0.0/8"]
                    protocol {
                        name [direct]
                    }
                }
                action {
                    action-type accept
                }
            }
        }

The following examples are configured and verified:

  1. Coexistence of labeled and unlabeled address families for BGP

  2. Applying next-hop-self

  3. Export policy to advertise routes as labeled or unlabeled

  4. RR behavior with a mix of labeled and unlabeled BGP sessions

Coexistence of labeled and unlabeled address families for BGP

BGP sessions shows the EBGP and IBGP sessions that are established between the nodes and the routes advertised for the loopback addresses.

Figure 5. BGP sessions

PE-1 acts as RR for PE-2 and PE-4, and it is an autonomous system border router (ASBR) toward PE-3. PE-1 has two single-family connections: unlabeled IPv4 to PE-3 and labeled IPv4 to PE-4. PE-1 also has one dual-family connection to PE-2. The BGP configuration on PE-1 is as follows:

# on PE-1:
configure {
    router "Base" {
        autonomous-system 64500
        bgp {
            split-horizon true
            group "EBGP" {
                peer-as 64501
                import {
                    policy ["import-bgp"]
                }
            }
            group "IBGP" {
                peer-as 64500
                cluster {
                    cluster-id 192.0.2.1
                }
                export {
                    policy ["export-bgp"]        # only needed in a later example 
                }
            }
            neighbor "192.0.2.2" {
                group "IBGP"
                family {
                    ipv4 true
                    label-ipv4 true
                }
            }
            neighbor "192.168.13.2" {
                group "EBGP"
                family {
                    ipv4 true
                }
            }
            neighbor "192.0.2.4" {
                group "IBGP"
                family {
                    label-ipv4 true
                }
            }

The BGP configuration on PE-2 is as follows:

# on PE-2:
configure {
    router "Base" {
        autonomous-system 64500
        bgp {
            split-horizon true
            group "IBGP" {
                peer-as 64500
            }
            neighbor "192.0.2.1" {
                group "IBGP"
                family {
                    ipv4 true
                    label-ipv4 true
                }
            }

The BGP configuration on PE-3 in AS 64501 is as follows:

# on PE-3:
configure {
    router "Base" {
        autonomous-system 64501
        bgp {
            split-horizon true
            export {
                policy ["export-bgp"]
            }
            group "EBGP" {
                peer-as 64500
            }
            neighbor "192.168.13.1" {
                group "EBGP"
                family {
                    ipv4 true
                }
            }
        }

The BGP configuration on PE-4 is as follows:

# on PE-4:
configure {
    router "Base" {
        autonomous-system 64500
        bgp {
            split-horizon true
            group "IBGP" {
                peer-as 64500
                export {
                    policy ["export-bgp"]
                }
            }
            neighbor "192.0.2.1" {
                group "IBGP"
                family {
                    label-ipv4 true
                }
            }

The following BGP summary on PE-1 shows that there is a dual-family connection with PE-2: IPv4 and labeled IPv4. PE-1 has a labeled IPv4 connection with PE-4 and an IPv4 connection with PE-3. PE-1 receives and uses one unlabeled route from PE-3 and re-advertises it to PE-2. PE-1 receives and uses one labeled route from PE-4 and re-advertises it to PE-2.

[/]
A:admin@PE-1# show router bgp summary all

===============================================================================
BGP Summary
===============================================================================
Legend : D - Dynamic Neighbor
===============================================================================
Neighbor
Description
ServiceId          AS PktRcvd InQ  Up/Down   State|Rcv/Act/Sent (Addr Family)
                      PktSent OutQ
-------------------------------------------------------------------------------
192.0.2.2
Def. Inst       64500       8    0 00h01m53s 0/0/1 (IPv4)
                           10    0           0/0/1 (Lbl-IPv4)
192.0.2.4
Def. Inst       64500       8    0 00h01m43s 1/1/0 (Lbl-IPv4)
                            7    0
192.168.13.2
Def. Inst       64501       9    0 00h02m12s 1/1/0 (IPv4)
                            8    0

The unlabeled IPv4 routes on PE-1 include unlabeled routes imported from other PEs, in this case, only the loopback address 10.3.3.3/32 advertised by PE-3, as follows:

[/]
A:admin@PE-1# show router bgp routes ipv4
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.3.3.3/32                                        None        None
      192.168.13.2                                       None        0
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The labeled-unicast IPv4 routes on PE-1 include labeled routes imported from other PEs, in this case, only the loopback address 10.4.4.4/32 advertised by PE-4, as follows:

[/]
A:admin@PE-1# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.4.4.4/32                                        100         None
      192.0.2.4                                          None        10
      No As-Path                                                     524284
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

PE-1 re-advertises prefix 10.3.3.3/32 as an unlabeled route with next-hop 192.168.13.2 and PE-2 imports the prefix 10.3.3.3/32 in its unlabeled RIB, as follows:

[/]
A:admin@PE-2# show router bgp routes ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.3.3.3/32                                        100         None
      192.168.13.2                                       None        20
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

PE-1 re-advertises prefix 10.4.4.4/32 as a labeled IPv4 route with next-hop 192.0.2.4 and PE-2 imports the prefix 10.4.4.4/32 in its labeled RIB:

[/]
A:admin@PE-2# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.4.4.4/32                                        100         None
      192.0.2.4                                          None        20
      No As-Path                                                     524284
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

As expected, the prefixes from address family label-ipv4 are advertised independently from the prefixes from address family ipv4.

Applying next-hop-self

PE-1 applies next-hop-self toward neighbor PE-2 shows that PE-1 applies next-hop-self for BGP updates toward PE-2.

Figure 6. PE-1 applies next-hop-self toward neighbor PE-2

On PE-1, next-hop-self is enabled for neighbor PE-2 only, as follows:

# on PE-1:
configure {
    router "Base" {
        bgp {
            neighbor 192.0.2.2 { 
                next-hop-self true
            } 

This applies to both address families. The next hop for unlabeled route 10.3.3.3/32 is 192.0.2.1, as follows:

[/]
A:admin@PE-2# show router bgp routes 10.3.3.3/32
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.3.3.3/32                                        100         None
      192.0.2.1                                          None        10
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The labeled-unicast route 10.4.4.4/32 also has next hop 192.0.2.1, as follows:

[/]
A:admin@PE-2# show router bgp routes 10.4.4.4/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.4.4.4/32                                        100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524284
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

On PE-1, the next-hop-self configuration for neighbor PE-2 is removed as follows:

# on PE-1:
configure {
    router "Base" {
        bgp {
            neighbor 192.0.2.2 { 
                delete next-hop-self
            }

An export policy is configured to ensure that next-hop-self is only applied for address family ipv4. The route policy is configured as follows:

# on PE-1:
configure {
    policy-options {
        policy-statement "export-nhs" {
            entry 10 {
                from {
                    protocol {
                        name [bgp]
                    }
                }
                action {
                    action-type accept
                    next-hop self
                }
            }
            entry 20 {
                from {
                    protocol {
                        name [bgp-label]
                    }
                }
                action {
                    action-type accept
                }
            }
        }

The export policy "export-nhs" is configured for neighbor PE-2, as follows:

# on PE-1:
configure {
    router "Base" {
        bgp {
            neighbor "192.0.2.2" {
                export {
                    policy ["export-nhs"]
                }
            }

Applying next-hop-self to unlabeled IP-4 routes to neighbor PE-2 shows that next-hop-self is applied to unlabeled IPv4 routes only.

Figure 7. Applying next-hop-self to unlabeled IP-4 routes to neighbor PE-2

With this export policy, only the unlabeled route 10.3.3.3/32 has next hop 192.0.2.1, while the BGP labeled-unicast (BGP-LU) route 10.4.4.4/32 has next hop 192.0.2.4, as follows:

[/]
A:admin@PE-2# show router bgp routes 10.3.3.3/32
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.3.3.3/32                                        100         None
      192.0.2.1                                          None        10
      64501                                                          -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================
[/]
A:admin@PE-2# show router bgp routes 10.4.4.4/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.4.4.4/32                                        100         None
      192.0.2.4                                          None        20
      No As-Path                                                     524284
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The export policy "export-nhs" toward neighbor PE-2 is removed as follows:

# on PE-1:
configure {
    router "Base" {
        bgp {
            neighbor "192.0.2.2" {
                delete export 
            }

Export policy to advertise routes as labeled or unlabeled

PE-1 advertises prefixes 10.1.1.1/32 and 10.11.11.11/32 shows that two loopback addresses are configured in PE-1 to be advertised: prefix 10.1.1.1/32 and 10.11.11.11/32. Initially, the export policy on PE-1 is identical to the export policy on PE-3 and PE-4, so there is no route policy applied for a selective export as labeled or unlabeled route.

Figure 8. PE-1 advertises prefixes 10.1.1.1/32 and 10.11.11.11/32

By default, these prefixes are advertised as both labeled and unlabeled routes toward dual-family neighbor PE-2. On PE-2, the unlabeled IPv4 RIB contains prefixes 10.1.1.1/32 and 10.11.11.11/32, as follows:

[/]
A:admin@PE-2# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.1.1.1/32                                        100         None
      192.0.2.1                                          None        10
      No As-Path                                                     -
---snip---
u*>i  10.11.11.11/32                                     100         None
      192.0.2.1                                          None        10
      No As-Path                                                     -
---snip---

The labeled-IPv4 RIB on PE-2 also contains prefixes 10.1.1.1/32 and 10.11.11.11/32, as follows:

[/]
A:admin@PE-2# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
*>i   10.1.1.1/32                                        100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524284
---snip---
*>i   10.11.11.11/32                                     100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524284
---snip---

In many cases, it is not required to advertise both a labeled route and an unlabeled route. The following policy is configured to advertise prefix 10.1.1.1/32 as a labeled-IPv4 route and prefix 10.11.11.11/32 as an unlabeled IPv4 route:

# on PE-1:
configure {
    policy-options {
        prefix-list "10.1.1.1/32" {
            prefix 10.1.1.1/32 type exact {
            }
        }
        prefix-list "10.11.11.11/32" {
            prefix 10.11.11.11/32 type exact {
            }
        }
        policy-statement "export-bgp1" {
            entry 10 {
                from {
                    prefix-list ["10.1.1.1/32"]
                }
                to {
                    protocol {
                        name [bgp-label]
                    }
                }
                action {
                    action-type accept
                }
            }
            entry 20 {
                from {
                    prefix-list ["10.11.11.11/32"]
                }
                to {
                    protocol {
                        name [bgp]
                    }
                }
                action {
                    action-type accept
                }
            }
            default-action {
                action-type reject
            }

This policy is applied on PE-1 as an export policy for neighbor PE-2, as follows:

# on PE-1:
configure {
    router "Base" {
        bgp {
            neighbor 192.0.2.2 {
                export {
                    policy ["export-bgp1"]
                }
            } 

Prefix 10.11.11.11/32 is received as an unlabeled route on PE-2 and stored in the unlabeled RIB, but prefix 10.1.1.1/32 is not, as follows:

[/]
A:admin@PE-2# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.11.11.11/32                                     100         None
      192.0.2.1                                          None        10
      No As-Path                                                     -
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

On PE-2, prefix 10.1.1.1/32 is received as a labeled route and stored in the labeled-IPv4 RIB, but prefix 10.11.11.11/32 is not, as follows:

[/]
A:admin@PE-2# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.1.1.1/32                                        100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524284
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

This selective route advertisement from PE-1 reduces the memory usage for the RIBs on PE-2.

RR behavior with a mix of labeled and unlabeled BGP sessions

RR with labeled and unlabeled BGP sessions shows a slightly different setup, with all PEs in the AS 64500 and RR-1 acting as the RR for all PEs. There are no dual-family connections. PE-3 and PE-4 have an unlabeled BGP session with RR-1 and PE-2 has a labeled BGP connection with RR-1. RR-1 has add-path=2 capability configured for neighbor PE-2. RR-1 receives the same prefix 10.7.7.7/32 from two neighbors: PE-3 and PE-4.

Figure 9. RR with labeled and unlabeled BGP sessions

On RR-1, BGP is configured as follows:

# on RR-1:
configure {
    router "Base" {
        bgp {
            group "IBGP" {
                peer-as 64500
                cluster {
                    cluster-id 192.0.2.1
                }
                export {
                    policy ["export-bgp"]
                }
            }
            neighbor "192.0.2.2" {
                group "IBGP"
                family {
                    label-ipv4 true
                }
                add-paths {
                    label-ipv4 {
                        send 2
                        receive true
                    }
                }
            }
            neighbor "192.0.2.3" {
                group "IBGP"
                family {
                    ipv4 true
                }
            }
            neighbor "192.0.2.4" {
                group "IBGP"
                family {
                    ipv4 true
                }
            }

RR-1 receives the prefix 10.7.7.7/32 from neighbors PE-3 and PE-4, as follows:

[/]
A:admin@RR-1# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.7.7.7/32                                        100         None
      192.0.2.3                                          None        10
      No As-Path                                                     -
*i    10.7.7.7/32                                        100         None
      192.0.2.4                                          None        10
      No As-Path                                                     -
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

Both routes are unlabeled and BGP updates from unlabeled sessions are by default not exported to a labeled-IPv4 session, as shown in Updates from unlabeled sessions not propagated to labeled sessions (default).

Figure 10. Updates from unlabeled sessions not propagated to labeled sessions (default)

PE-2 does not receive prefix 10.7.7.7/32, neither as unlabeled route, nor as labeled route, as follows:

[/]
A:admin@PE-2# show router bgp routes
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
No Matching Entries Found.
===============================================================================
[/]
A:admin@PE-2# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
No Matching Entries Found.
===============================================================================

A route policy is created on RR-1 to accept both labeled and unlabeled routes, as follows:

# on RR-1:
configure {
    policy-options {
        policy-statement "import-all" {
            entry 10 {
                from {
                    protocol {
                        name [bgp]
                    }
                }
                action {
                    action-type accept
                }
            }
            entry 20 {
                from {
                    protocol {
                        name [bgp-label]
                    }
                }
                action {
                    action-type accept
                }
            }

This policy accepts all routes, labeled and unlabeled. For route 10.7.7.7/32 to be advertised to the labeled peer PE-2, it is sufficient to have a policy with only entry 10 that says from protocol bgp action accept. However, the preceding policy can also be used to import labeled routes to be advertised to unlabeled peers.

The following policy is applied as route-table-import policy in BGP RIB management, both for unlabeled IPv4 routes and labeled-IPv4 routes on RR-1:

# on RR-1:
configure {
    router "Base" {
        bgp {
            rib-management {
                ipv4 {
                    route-table-import {
                        policy-name "import-all"
                    }
                }
                label-ipv4 {
                    route-table-import {
                        policy-name "import-all"
                    }
                }
            }

For allowing unlabeled route 10.7.7.7/32 to be advertised on a labeled session, it is sufficient to have a route-table-import for labeled-IPv4 only. However, the configuration allows for RIB leaking in both ways: from unlabeled IPv4 BGP RIB to labeled-IPv4 BGP RIB and vice versa.

RIB leaking from IPv4 BGP RIB to labeled-IPv4 BGP RIB shows this RIB leaking process.

Figure 11. RIB leaking from IPv4 BGP RIB to labeled-IPv4 BGP RIB

After applying this RIB leaking, RR-1 advertises prefix 10.7.7.7/32 to PE-2. Therefore, RR-1 needs to add a label to the route and RR-1 needs to set next-hop-self. RR-1 advertises only one labeled route for prefix 10.7.7.7/32, with next hop 192.0.2.1, as follows:

[/]
A:admin@RR-1# show router bgp neighbor 192.0.2.2 label-ipv4 advertised-routes
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
i     10.7.7.7/32                                        100         None
      192.0.2.1                                          None        n/a
      No As-Path                                                     524283
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The BGP update message is as follows:

4 2026/06/01 07:07:02.286 UTC MINOR: DEBUG #2001 Base Peer 1: 192.0.2.2
"Peer 1: 192.0.2.2: UPDATE
Peer 1: 192.0.2.2 - Send BGP UPDATE:
    Withdrawn Length = 0
    Total Path Attr Length = 49
    Flag: 0x90 Type: 14 Len: 17 Multiprotocol Reachable NLRI:
        Address Family LBL-IPV4
        NextHop len 4 NextHop 192.0.2.1
        10.7.7.7/32 Label 524283
    Flag: 0x40 Type: 1 Len: 1 Origin: 0
    Flag: 0x40 Type: 2 Len: 0 AS Path:
    Flag: 0x40 Type: 5 Len: 4 Local Preference: 100
    Flag: 0x80 Type: 9 Len: 4 Originator ID: 192.0.2.3
    Flag: 0x80 Type: 10 Len: 4 Cluster ID:
        192.0.2.1
"

On PE-2, the following labeled BGP route is imported:

[/]
A:admin@PE-2# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64500       Local AS:64500
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge,
                 w - unused-weight-only
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  10.7.7.7/32                                        100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524283
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

Conclusion

The BGP RIB architecture with separate RIBs for unlabeled and labeled-unicast routes supports unlabeled sessions and labeled sessions in parallel. By default, labeled routes are not advertised to unlabeled sessions and vice versa. Route-table import policies for RIB management allow route leaking between separate RIBs: unlabeled BGP RIB and labeled-unicast BGP RIB.