Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

BGP Optimal Route Reflection

Understanding BGP Optimal Route Reflection

When BGP performs best-path selection, it evaluates multiple attributes in a defined order. One of these steps is to prefer the path whose next hop is resolved through the IGP with the lowest metric. This comparison is performed from the perspective of the router making the path selection decision.

For more information about BGP path selection, see Understanding BGP Path Selection.

In networks where route reflectors are deployed on a per–point of presence basis, this behavior typically produces the desired forwarding outcome. Each route reflector reflects routes to its clients based on IGP costs that closely align with the clients’ forwarding topology.

However, in large-scale networks, a route reflector may serve client and non-client peers that are distributed across multiple geographic locations. In these deployments, the IGP metric used during BGP path selection reflects the topology from the route reflector’s location, not from the perspective of the receiving clients.

As a result, the route that appears optimal to the route reflector may not represent the best forwarding path for all clients. This mismatch can lead to suboptimal traffic forwarding, even though BGP path selection is operating correctly.

BGP optimal route reflection addresses this limitation by allowing path selection to better align with the IGP topology of the clients receiving reflected routes, rather than relying solely on the route reflector’s local view.

You can configure BGP Optimal Route Reflection (BGP-ORR), described in RFC 9107, with IS-IS and OSPF as the interior gateway protocol (IGP) on a route reflector to advertise the best path to the BGP-ORR client groups. This is done by using the shortest IGP metric from a client's perspective, instead of the route reflector's view.

Client groups sharing the same or similar IGP topology can be grouped as one BGP peer group. You can configure optimal-route-reflection to enable BGP-ORR in that BGP peer group. You can also configure one of the reflector nodes as the primary node (igp-primary) in a BGP peer group so that the IGP metric from that primary node is used to select the best path and advertise it to the clients in the same BGP peer group. Optionally, you can also select another reflector node as the backup node (igp-backup), which is used when the primary reflector node (igp-primary) goes down or is unreachable.

To enable BGP-ORR, include the optimal-route-reflection statement at the [edit protocols bgp group group-name] hierarchy level.

Note:

BGP-ORR only works when IGP is used for BGP route resolution. BGP-ORR does not work when MPLS/LDP/RSVP is used for route resolution.

Note:

For BGP-ORR to work, the BGP prefix should be resolved through an IGP. In normal Layer 3 VPN, or Layer 2 VPN, or VPLS, or MVPN, or EVPN scenarios, the prefixes are resolved over inet.3. In inet.3, the primary route for the protocol-next-hop of the prefix would be either RSVP or LDP ( and not an IGP protocol like IS-IS or OSPF). For BGP-ORR to work, you need to configure the router to use inet.0 for the route-resolution of Layer 3 VPN, or Layer 2 VPN, or VPLS, or MVPN, or EVPN prefixes. You can do this through the following commands:

  • For Layer 3 VPN prefix:

  • For Layer 2 VPN, or VPLS prefix:

  • For EVPN prefix:

  • For MVPN prefix:

Another method is to leak the IGP routes into inet.3 and make them as the primary route in inet.3.

Use the following CLI hierarchy to configure BGP-ORR:

Configuring BGP Optimal Route Reflection on a Route Reflector to Advertise the Best Path

You can configure BGP Optimal Route Reflection (BGP-ORR) with IS-IS and OSPF as the interior gateway protocol (IGP) on a route reflector to advertise the best path to the BGP-ORR client groups. This is done by using the shortest IGP metric from a client's perspective, instead of the route reflector's view.

To enable BGP-ORR, include the optimal-route-reflection statement at the [edit protocols bgp group group-name] hierarchy level.

Client groups sharing the same or similar IGP topology can be grouped as one BGP peer group. You can configure optimal-route-reflection to enable BGP-ORR in that BGP peer group.

To configure BGP-ORR:

  1. Configure optimal route reflection.
  2. Configure one of the client nodes as the primary node (igp-primary) in a BGP peer group so that the IGP metric from that primary node is used to select the best path and advertise it to the clients in the same BGP peer group.
  3. (Optional) Configure another client node as the backup node (igp-backup), which is used when the primary node (igp-primary) goes down or is unreachable.

Use the following CLI commands to monitor and troubleshoot the configuration for BGP-ORR:

  • show bgp group—View the primary and backup configurations of BGP-ORR.

  • show isis bgp-orr—View the IS-IS BGP-ORR metric (RIB).

  • show ospf bgp-orr—View the OSPF BGP-ORR metric (RIB).

  • show ospf route—View the entries in the OSPF routing table

  • show route—View the active entries in the routing tables.

  • show route advertising protocol bgp peer—Verify whether the routes are being advertised according to the BGP-ORR rules.

Example: Configuring Optimal Route Reflection in BGP Networks

Use this example to configure optimal route reflection with OSPF as the interior gateway protocol (IGP) on a route reflector to advertise the best path to the BGP client groups. The route reflector calculates the optimal route using the shortest IGP metric from a client's perspective.

Note:

Our content testing team has validated this example.

Tip:
Table 1: Readability Score and Time Estimates

Readability Score

64.26

Reading Time

30 minutes

Configuration Time

30 minutes

Example Prerequisites

Table 2: Requirements

Hardware requirements

Five MX Series routers.

Software requirements

Junos OS Release 15.2R1 or later

Before You Begin

Table 3: Benefits and what's next

Benefits

  • Reduce the need for full mesh of internal BGP peers while still ensuring optimal path propogation.

  • Better route selection accuracy, the RR adverties the best path for each client

  • Facilitates large scale deployments.

  • Simplifies the network design and reduces operational complexity.

Know more

https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/topic-map/bgp-rr.html#id-understanding-bgp-optimal-route-reflection

Hands-on experience

https://jlabs.juniper.net/vlabs/portal/standalone-vrr/

Learn more

https://learningportal.juniper.net/juniper/user_activity_info.aspx?id=EDU-JUN-WBT-OD-AJER-25#:~:text=This%20module%20describes%20the%20purpose,to%20purchase%20the%20full%20course.

Functional Overview

Routers in the same BGP autonomous system usually exchange routes with each other. IBGP requires a full-mesh connectivity, which is cumbersome and slow. Maintaining a full mesh does not scale well in large deployments. Instead of creating a full mesh, route reflectors readvertise routes learned from an internal peer to other internal peers, which simplifies the full-mesh configuration. Route reflection requires the route reflector be fully meshed with all internal peers. Client groups sharing similar IGP topology can be grouped as one BGP peer group. Configure one of the reflector nodes as the primary node in a BGP peer group and an optional backup node. Optimal route reflection only works with IGP and does not work when you use MPLSLDP or RSVP for route resolution.

Table 4: Verification Tasks

Technologies used

Routing Protocols: OSPF, BGP

Primary verification tasks

  1. Verify the configured BGP group and devices assigned as primary and backup for BGP-ORR.
  2. Verify whether the routes are being advertised according to the BGP-ORR rules.

Topology Overview

Device RR is the Route Reflector using ORR (Optimal Route Reflection). Device R1 is the ingress PE and Devices R2 and R3 are the egress PEs. With ORR configured, RR reflects routes optimally based on the ingress PE’s (R1) view instead of its own. OSPF is configured as the IGP and there is IBGP peering between the devices.

For illustration purpose, we increase the R1-to-R3 metric to 100 and have Devices R2 and R3 advertise the same prefix of 10.10.10.0/24. On R1, the ‘show route’ output should have R2 as the protocol next-hop (egress PE). On deactivating the BGP-ORR configuration on RR and repeating the same steps, we see that R3 is the egress PE for the advertised prefix.

Table 5: List of Devices

Hostname

Role

Function

RR RR is configured as the route reflecor and is configured with optimal route reflection. RR is configured with OSPF and internal BGP. RR reflects routes optimally based on R1's view instead of its own.
R1 The device is the ingress PE OSPF is configured as the IGP and BGP is configures for internal BGP peering between the devices.

R2, R3 and R11

These devices are the egress PEs.

OSPF is configured as the IGP and internal BGP.

Topology Illustration

Figure 1: BGP Optimal Route Reflection BGP Optimal Route Reflection

Configure Optimal Route Reflection on RR

Note:

For complete sample configurations on the DUT and other devices, see:

  1. This section lists the main configuration tasks required to configure the Route Reflector with the optimal route reflection feature.
    1. Configure the interfaces with IP addresses.
    2. Assign a loopback address.
    3. Configure the router ID and autonomous system (AS) number to propagate routing information.
    4. Enable BGP and configure Internal BGP (IBGP) groups and BGP peers.
    5. Configure OSPF.
  2. Configure optimal route reflection. Configure one of the client nodes as the primary node (igp-primary) in a BGP peer group so that the IGP metric from that primary node is used to select the best path and advertise it to the clients in the same BGP peer group.
  3. (Optional) Configure another client node as the backup node that BGP uses when the primary node goes down or is unreachable.

Verification

Command Verification Task
show bgp group Verify the assigned BGP-Optimal Route Reflector
show ospf bgp-orr Verify the configured OSPF BGP-Optimal Route Reflector metric
show route advertising-protocol bgp Verify that the routes are optimally advertised by the Route Reflector

Verify the assigned BGP-ORR

Purpose

View the configured BGP group and devices assigned as primary and backup for BGP-ORR.

Action

From operational mode, run the show bgp group command to verify the assigned BGP-ORR.

Meaning

The output includes the configured primary and backup optimal route reflectors and their loopback addresses.

Verify the configured OSPF BGP-ORR metric in the Routing information base (RIB)

Purpose

Verify the configured OSPF BGP-ORR metric in the Routing information base (RIB)

Action

From operational mode, run the show ospf bgp-orr command.

Meaning

The output displays the assigned metric of the primary and backup optimal route reflector.

Verify that the routes are optimally advertised by the Route Reflector

Purpose

Verify whether the routes are being advertised according to the BGP-ORR rules.

Action

From operational mode, run the show route advertising-protocol bgp command.

Meaning

The output illustrates that the IP address of Device R2 is selected as the next hop when BGP ORR is enabled on the RR.

When you deactivate BGP ORR configuration on the RR, Device R3 is chosen as the egress PE chosen to reach Device R1.

Meaning

The output illustrates that the IP address of Device R3 is selected as the next hop when BGP ORR is deactivated on the RR.

Set Commands on all Devices

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

RR

R1 (Ingress PE)

R2

R3

R11

Show Configuration Output on all Devices

Show command output on the RR and other devices.

Ingress Device R1

Device R2

Device R3

Device R11