Reverse Path Forwarding (RPF) Route Preferences using MBGP

Last Update: 7/6/01 mmcbride

Prior to forwarding multicast packets, a multicast enabled router will rpf to the unicast source address of multicast packets. When multiple routing protocols are advertising the same source subnet, the router will chose the route with the lowest administrative distance.  If MBGP is less than or equal to the administrative distance of any unicast route, the MBGP route will be chosen. The exception to this is with static routes. Static routes take precedence if their distance is less than or equal to MBGP. For RPF, more specific route preferences only pertain to routes within the same table.  If multiple routes exist within the same table, the longest match will be used. Only distance preferred lookups are performed across tables. The longest match within each table is chosen as the route to then compare across tables using distance.

Having said all that, there is an exception with default routes. A default route is chosen for rpf if there is no matching route in the unicast routing table. For example, if there is an rpf choice between an mbgp prefix (3.0.0.0/8) and a bgp prefix (3.0.0.0/8) having the same distance, the mbgp prefix will be chosen. This is true even if a static default route to null0 (ip route 0.0.0.0 0.0.0.0 null0) exists.

HOWEVER, if there is no 3.0.0.0/8 route in the UNICAST routing table, then the static default route to null0 is used for rpf even over an existing 3.0.0.0/8 mbgp route.

No 3.0.0.0/8 route in unicast routing table:

ip22-72b#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Ethernet2/1
     2.0.0.0/24 is subnetted, 1 subnets
B       2.1.1.0 [20/0] via 1.1.1.1, 00:15:20
     10.0.0.0/26 is subnetted, 1 subnets
C       10.0.119.128 is directly connected, Ethernet2/2
S*   0.0.0.0/0 is directly connected, Null0

But there is a 3/8 route in mbgp table:

ip22-72b#sh ip mbgp
MBGP table version is 6, local router ID is 10.0.119.131
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 3.0.0.0          1.1.1.1                  0             0 1 ?

But the static to null0 is being used:

ip22-72b#sh ip rpf 3.1.1.1
RPF information for ? (3.1.1.1)
  RPF interface: Null0
  RPF neighbor: ? (0.0.0.0)
  RPF route/mask: 0.0.0.0/0
  RPF type: unicast (static)
  RPF recursion count: 0
  Doing distance-preferred lookups across tables

It needs to be yet be determined if this is considered a configuration error (not supported by multicast) or something which can be changed (prefer mbgp route over default route to Null0). Any change in behavior will be tracked by: CSCdt53575 RPF check fails on mbgp routes

To recap, we find the longest match in each table. If there is a unicast match, we'll compare that to a multicast match. Their distances are compared and the lowest one wins. If the unicast match is a 0/0 null0 default, it wins. Here's a matrix of rpf results today:

     +--------+               +--------+
e3/0-|ip22-72a|-e3/1-----e2/1-|ip22-72b|
     +--------+               +--------+
2.1.1.1  AS1   1.1.1.1      .2    AS2

When 72b has the following routes, 72b RPFs for 2.1.1.X accordingly:

2.0.0.0 MBGP     2.0.0.0 BGP     Type of static route         RPF choice
     X                                                        MBGP
                      X                                       BGP
     X                X          default to any int           MBGP
     X                           default to null0             Null0
     X                           default to non pim int       MBGP
     X                           default to any pim int       That PIM int
                      X          default to any int           BGP
                      X          2/8 to any int               That int
     X                           2/8 to any int               That int

More Examples

MBGP vs BGP
MBGP vs static
MBGP vs MBGP
Admin Distances
 
 

MBGP vs BGP (same distance)
Given the following two rpf choices:

ip22-72a#sh ip mbgp 2.1.1.0
BGP routing table entry for 2.1.1.0/24, version 2854
Paths: (1 available, best #1, table NULL)
Flag: 0x208
  Not advertised to any peer
  2
    131.1.1.1 from 131.1.1.1 (131.1.1.1)
      Origin IGP, metric 20, localpref 100, valid, external, best

ip22-72a#sh ip bgp 2.1.1.0
BGP routing table entry for 2.1.1.0/24, version 18
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Not advertised to any peer
  2
    131.1.1.1 from 131.1.1.1 (131.1.1.1)
      Origin IGP, metric 20, localpref 100, valid, external, best

The router will choose the mbgp learned route over the bgp learned route when their distances are the same (20 is default for ebgp):

ip22-72a#sh ip route 2.1.1.1
Routing entry for 2.1.1.0/24
  Known via "bgp 1", distance 20, metric 20
  Tag 2, type external
  Last update from 131.1.1.1 00:00:40 ago
  Routing Descriptor Blocks:
  * 131.1.1.1, from 131.1.1.1, 00:00:40 ago
      Route metric is 20, traffic share count is 1
      AS Hops 1

ip22-72a#sh ip rpf 2.1.1.0
RPF information for ? (2.1.1.0)
  RPF interface: Ethernet3/0
  RPF neighbor: ? (131.1.1.1)
  RPF route/mask: 2.1.1.0/24
  RPF type: mbgp
  RPF recursion count: 0
  Doing distance-preferred lookups across tables
 

If the distance of the bgp route is change to something lower than 20, then that route is then chosen over mbgp:

ip22-72a#sh ip route 2.1.1.1
Routing entry for 2.1.1.0/24
  Known via "bgp 1", distance 10, metric 20
  Tag 2, type external
  Last update from 131.1.1.1 00:02:27 ago
  Routing Descriptor Blocks:
  * 131.1.1.1, from 131.1.1.1, 00:02:27 ago
      Route metric is 20, traffic share count is 1
      AS Hops 1

ip22-72a#sh ip rpf 2.1.1.1
RPF information for ? (2.1.1.1)
  RPF interface: Ethernet3/0
  RPF neighbor: ? (131.1.1.1)
  RPF route/mask: 2.1.1.0/24
  RPF type: unicast (bgp 1)
  RPF recursion count: 1
  Doing distance-preferred lookups across tables
 

MBGP vs static

Given an rpf choice between equal static and mbgp distances, the static route will be chosen:

ip22-72a#sh ip route 2.1.1.1
Routing entry for 2.1.1.1/32
  Known via "static", distance 20, metric 0
  Routing Descriptor Blocks:
  * 131.1.1.3
      Route metric is 0, traffic share count is 1

ip22-72a#sh ip mbgp 2.1.1.1
BGP routing table entry for 2.1.1.0/24, version 6
Paths: (1 available, best #1, table NULL)
Flag: 0x208
  Not advertised to any peer
  2
    131.1.1.1 from 131.1.1.1 (131.1.1.1)
      Origin IGP, metric 20, localpref 100, valid, external, best

ip22-72a#sh ip rpf 2.1.1.1
RPF information for ? (2.1.1.1)
  RPF interface: Ethernet3/0
  RPF neighbor: ? (131.1.1.3)
  RPF route/mask: 2.1.1.1/32
  RPF type: unicast (static)
  RPF recursion count: 1
  Doing distance-preferred lookups across tables

If the static route is equal to or less than the mbgp route's distance, static will be chosen. If the static routes distance is greater than mbgp, mbgp will be used.
 

MBGP vs MBGP (more specific)

We have MBGP and BGP routes with equal distances. So, MBGP routes are chosen. But, we also have multiple MBGP routes to chose from. We chose the more specific MBGP route to RPF:
 

ip22-72a#sh ip bgp
BGP table version is 34, local router ID is 131.1.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.0/24       131.1.1.1                0             0 2 i
*> 2.1.1.0/24       131.1.1.1               20             0 2 i
*> 2.1.1.1/32       131.1.1.1                0             0 2 ?
*> 131.1.0.0        0.0.0.0                  0         32768 i
*> 131.1.1.0/24     131.1.1.1                0             0 2 i

ip22-72a#sh ip mbgp
BGP table version is 24, local router ID is 131.1.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.0/24       131.1.1.1                0             0 2 i
*> 2.1.1.0/24       131.1.1.1               20             0 2 i
*> 2.1.1.1/32       131.1.1.1                0             0 2 i
*> 131.1.0.0        0.0.0.0                  0         32768 i
*> 131.1.1.0/24     131.1.1.1                0             0 2 i

ip22-72a#sh ip rpf 2.1.1.1
RPF information for ? (2.1.1.1)
  RPF interface: Ethernet3/0
  RPF neighbor: ? (131.1.1.1)
  RPF route/mask: 2.1.1.1/32
  RPF type: mbgp
  RPF recursion count: 0
  Doing distance-preferred lookups across tables
 

If there are MBGP routes with the same length, the route chosen is the same as with BGP path selection:

Path selection is based on the following:

1-If NextHop is inaccessible do not consider it.
2-Prefer the largest Weight.
3-If same weight prefer largest Local Preference.
4-If same Local Preference prefer the route that the specified router has
originated.
5-If no route was originated prefer the shorter AS path.
6-If all paths are external prefer the lowest origin code
(IGP<EGP<INCOMPLETE).
7-If origin codes are the same prefer the path with the lowest MED.
8-If path is the same length prefer the External path over Internal.
9-If IGP synchronization is disabled and only internal path remain prefer
the path through the
closest IGP neighbor.
10-Prefer the route with the lowest ip address value for BGP router ID.
 
 

Administrative Distances:

BGP/MBGP
  External:  20
  Internal: 200
  Local:    200
EIGRP
  Internal:  90
  External: 170
ODR
  Default:  160
IGRP
  Default:  100
OSPF
  Default:  110
ISIS
  Default:  115
RIP
  Default:  120
HELLO
  Internal: 130
EGP
  Default:  140
Static
  Default:  1
DVMRP
  Default:  0
Connected
  Default:  0