RG Understanding TN
RG Understanding TN
RG Understanding TN
November 2016
Contents
Introduction to RIB Groups ........................................................................................................................................ 4
BGP ...................................................................................................................................................................................... 6
Link-State Protocols............................................................................................................................................................. 8
During the export process the protocol scans the routes in the protocol's export RIB. The protocol first applies any
configured export policies to the routes, and then it applies its default export policy. The resulting routes are advertised
to neighbors. With a RIB group you can specify only a single export RIB. The following diagram depicts the export
process:
There are two steps to configuring RIB groups. The first step is to define a named RIB group. The following configuration
defines a RIB group named example-rg:
routing-options {
rib-groups example-rg {
import-rib [ inet.3 inet.2 ];
export-rib vrfa.inet.0;
}
}
The second step is to apply the RIB group to a protocol. The commands for applying a RIB group to each protocol differ.
The following configuration applies the RIB group example-rg to the BGP protocol:
protocols {
bgp {
family inet {
unicast {
rib-group example-rg;
}
}
}
}
In addition to the unicast routing, DVMRP also has a multicast routing component. The router uses DVMRP's primary
import RIB (the first RIB listed in the RIB group configuration) as the RPF RIB for multicast data packets received on
interfaces configured for DVMRP multicast routing.
Interface Routes
An even simpler example of using RIB groups is directly connected routes. The direct protocol only has an import
function. You can use RIB groups to choose which RIBs include the directly connected routes. Note that you must first
have directly connected routes in a RIB before non-directly connected routes learned through IGPs can be installed. The
following configuration places connected routes into both inet.0 and inet.2:
routing-options {
interface-routes {
rib-group if-rg;
}
rib-groups if-rg {
import-rib [ inet.0 inet.2 ];
}
}
The following diagram is a logical representation of what happens with this configuration:
If you configure multiple import RIBs for interface routes, then they have the unique property of only affecting rpd's
routing tables. The forwarding tables in the kernel, and therefore the PFE, do not see the routes in any RIB other than
the instance.inet.0 RIB for the instance to which the interface belongs. It works this way because rpd is permitted only
very limited rights to manipulate interface routes; interface routes are really owned by dcd and the kernel. You might
ask, then, what is the purpose of interface RIB groups? They're used to permit resolution of other routes to directly
connected next hops.
So, in the end, you will not be able to ping the router through any VRF other than the interface's own VRF. If this is a
problem, a workaround is to configure static receive routes (shown just below) for the local addresses. You will also have
to apply an interface-routes import policy to filter out local routes—or don't include an interface routes RIB group—to
allow the statics to work.
BGP
Being a path vector protocol, BGP treats RIB groups similarly to the distance vector protocols. The following
configuration places routes learned from BGP into both inet.0 and inet.2, and instructs BGP to use inet.0 when exporting
routes:
routing-options {
rib-groups bgp-rg {
import-rib [ inet.0 inet.2 ];
export-rib inet.0;
}
}
protocols {
bgp {
family inet {
unicast {
6 © 2016 Juniper Networks, Inc.
Tech Note
rib-group bgp-rg;
}
}
}
}
The following diagram is a logical representation of what happens with this configuration:
Additionally, RIB groups are useful when using multiprotocol BGP (MBGP). MBGP has the capability of tagging routes as
belonging to different virtual topologies. The following configuration specifies MBGP routes tagged as unicast routes to
be imported to and exported from inet.0, while routes tagged as multicast routes are imported to and exported from
inet.2.
routing-options {
rib-groups bgp-rg {
import-rib inet.0;
export-rib inet.0;
}
rib-groups mbgp-rg {
import-rib inet.2;
export-rib inet.2;
}
}
protocols {
bgp {
family inet {
unicast {
rib-group bgp-rg;
}
multicast {
rib-group mbgp-rg;
}
}
}
}
Link-State Protocols
When it comes to link-state protocols things are quite different. Link-state protocols don't advertise routes like distance
and path vector protocols, instead they advertise link states. The link-states are stored in protocol specific link-state
databases; they are not stored in a RIB. Because of this fact, the relationship between link-state routing protocols,
import/export, and RIB groups is unique.
The link-state protocol runs the shortest path first (SPF) algorithm to create a protocol route table. Link-state protocols
generally do not have import policies*; all of the routes created when running the SPF algorithm are accepted and
placed into the protocols import RIBs. The primary use of a link-state protocol's export policy is to accept and advertise
external routes (routes redistributed from other protocols). The protocol scans the export RIB and applies the export
policy to all routes. The routes that are accepted are added to the link-state database as external routes. Link-state
protocols use RIB groups to determine their import and export RIBs.
*OSPF offers limited import-policy functionality to block external routes (Type 5 and Type 7 LSAs) from being installed in
the local device’s routing table. However, the policy does not prevent those LSAs from being flooded. The use of OSPF
import policies is generally discouraged.
Both IS-IS and OSPF work in similar fashion with respect to RIB groups and importing/exporting routes. The following
configuration tells OSPF to import its routes into both inet.0 and inet.2, and to use inet.0 as its export RIB:
routing-options {
rib-groups ospf-rg {
import-rib [ inet.0 inet.2 ];
export-rib inet.0;
}
}
protocols {
ospf {
rib-group ospf-rg;
}
}
In addition to supporting the scenario shown above, IS-IS supports alternate (parallel) topologies for IPv4 and IPv6
unicast and multicast. The following configuration calculates an alternate IPv4 multicast topology, in addition to the
normal IPv4 unicast topology, and adds the corresponding routes to inet.2.
protocols {
isis {
topologies ipv4-multicast;
}
}
The following diagram shows how the IS-IS interacts with the RIBs when topologies ipv4-multicast is
configured:
routing-options {
rib-groups {
inet-2 {
import-rib inet.2;
}
}
}
protocols {
msdp {
rib-group inet inet-2;
}
pim {
rib-group inet inet-2;
}
}
The PIM and MSDP RIB groups really have nothing to do with importing and exporting of route information. PIM imports
routes into and exports routes out of inet.1, and PIM import/export policy affects this route exchange with inet.1.
However, the PIM RIB group has nothing to do with this exchange. Instead the PIM import RIB only sets PIM’s
RPF RIB. To verify that the PIM is now using inet.2 as its RPF table, use the following command:
Likewise, MSDP's RIB group acts in a similar fashion. MSDP imports and exports its control information (called source
actives) to and from inet.4. MSDP import/export policies effect this exchange with inet.4. Yet the MSDP RIB group has
nothing to do with this exchange. Instead the MSDP import RIB identifies the RIB that MSDP uses for its RPF-peer check.
General
Understanding Junos OS Routing Tables
Example: Exporting Specific Routes from One Routing Table Into Another Routing Table
OSPF
IS-IS
IS-IS Multicast Topologies Overview
BGP
Configuring Overlapping VPNs Using Routing Table Groups
PIM/MSDP
Example: Configuring a Dedicated PIM RPF Routing Table