Routing Protocols Concepts


Each IGP routing protocol maintains a database of the routing information it has learned from other routers running the same protocol and uses this information as defined and required by the protocol. IS-IS and OSPF use the routing information they received to maintain link-state databases, which they use to determine which adjacent neighbors are operational and to construct network topology maps. IS-IS and OSPF use the Dijkstra algorithm, and RIP uses the Bellman-Ford algorithm to determine the best route or routes (if there are multiple equal-cost routes) to reach each destination and installs these routes into the JUNOS software routing table.

The JUNOS software routing table is used by the routing protocol process ( rpd ) to maintain its database of routing information. In this table, the routing protocol process stores statically configured routes, directly connected interfaces (also called direct routes or interface routes ), and all routing information learned from all routing protocols. The routing protocol process uses this collected routing information to select the active route to each destination, which is the route that actually is used to forward packets to that destination.

Each routing table is identified by a name , which consists of the protocol family followed by a period and small, nonnegative integer. The protocol family can be inet (Internet Protocol), iso (ISO), or mpls (MPLS). The following names are reserved for the default routing tables maintained by the JUNOS software:

  • inet.0 Default unicast routing table

  • instance-name.inet.0 Unicast routing table for a particular routing instance

  • inet.1 Multicast forwarding cache

  • inet.2 Unicast routes used for multicast reverse- path forwarding (RPF) lookup

  • inet.3 MPLS routing table for path information

  • mpls.0 MPLS routing table for label-switched path (LSP) next hops

The JUNOS software installs all active routes from the routing table into the forwarding table. The active routes are those used to forward packets to their destinations. The JUNOS kernel maintains a master copy of the forwarding table. It copies the forwarding table to the Packet Forwarding Engine, which is the part of the router responsible for forwarding packets.

The JUNOS routing protocol process is responsible for synchronizing the routing information between the routing and forwarding tables (see Figure 9.1). To do this, the routing protocol process calculates the active routes from all the routes in the routing table and installs them into the forwarding table. The routing protocol process then copies the forwarding table to the router's Packet Forwarding Engine, the part of the router that forwards packets.

Figure 9.1. Synchronizing Routing Exchange between the Routing and Forwarding Tables

graphics/09fig01.gif

For unicast routes, the JUNOS routing protocol process uses the information in its routing table, along with the properties set in the configuration file, to choose an active route for each destination. While the JUNOS software might know of many routes to a destination, the active route is the preferred route to that destination and is the one that is installed in the forwarding table and used when actually routing packets.

The routing protocol process generally determines the active route by selecting the route with the lowest preference value. The preference is an arbitrary value in the range 0 through 255 that the software uses to rank routes received from different protocols, interfaces, or remote systems. When routes in the routing table are nearly identical, the routing protocol process prefers the route whose next hop has the lowest IP address.

The preference value is used to select routes to destinations in external ASs or routing domains; it has no effect on the selection of routes within an AS (that is, within an IGP). Routes within an AS are selected by the IGP and are based on that protocol's metric or cost value.

The JUNOS software provides support for alternate and tie-breaker preferences, and some of the routing protocols, including BGP and label switching, use these additional preferences. With these protocols, you can specify a primary route preference, preference , and a secondary preference, preference2 , that are used as a tie breaker. You can also mark route preferences with additional route tie-breaker information by specifying a color , color , and a tie-breaker color, color2 . The route preference is represented as a 4-byte value. When using the preference value to select an active route, the software first compares the primary route preference values, choosing the route with the lowest value. If there is a tie and if a secondary preference has been configured, the software compares the secondary preference values, choosing the route with the lowest value.

How the Active Route Is Determined

For each prefix in the routing table, the routing protocol process selects a single best path, called the active route. The algorithm for determining the active route is as follows :

  1. Choose the path with the lowest preference value (routing protocol process preference). Routes that are not eligible to be used for forwarding (for example, because they were rejected by routing policy or because a next hop is inaccessible) have a preference of 1 and are never chosen .

  2. For BGP, prefer the path with higher local preference. For non-BGP paths, choose the path with the lowest preference2 value.

  3. If the path includes an AS path:

    1. Prefer the route with a shorter AS path. Confederation sequences are considered to have a path length of 0, and AS and confederation sets are considered to have a path length of 1.

    2. Prefer the route with the lower origin code. Routes learned from an IGP have a lower origin code than those learned from an EGP, and both these have lower origin codes than incomplete routes (routes whose origin is unknown).

    3. Depending on whether nondeterministic routing table path selection behavior is configured, there are two possible cases:

      If nondeterministic routing table path selection behavior is not configured (that is, if the path-selection cisco-nondeterministic statement is not included in the BGP configuration), for paths with the same neighboring AS numbers at the front of the AS path, prefer the path with the lowest multiple exit discriminator (MED) metric. Confederation AS numbers are not considered when deciding what the neighbor AS number is. When you display the routes in the routing table using the show route command, they generally appear in order from most preferred to least preferred. Routes that share the same neighbor AS are grouped together in the command output. Within a group , the best route is listed first, and the other routes are marked with the NotBest flag in the State field of the show route detail command.

      To always compare MEDs whether the peer ASs of the compared routes are the same, use the path-selection ( always-compare-med ) statement.

      If nondeterministic routing table path selection behavior is configured (that is, the path-selection cisco-nondeterministic statement is included in the BGP configuration), prefer the path with the lowest multiple exit discriminator (MED) metric. When you display the routes in the routing table using the show route command, they generally appear in order from most preferred to least preferred and are ordered with the best route first, followed by all other routes in order from newest to oldest.

      In both cases, confederations are not considered when determining neighboring ASs. Also, in both cases, a missing metric is treated as if a MED were present but zero.

  4. Prefer strictly internal paths, which include IGP routes and locally generated routes (static, direct, local, and so forth).

  5. Prefer strictly external (EBGP) paths over external paths learned through interior sessions (IBGP).

  6. For BGP, prefer the path whose next hop is resolved through the IGP route with the lowest metric.

  7. Prefer paths from the higher routing table number. For example, inet.3 is preferred to inet.0 .

  8. Prefer paths with a larger number of next hops.

  9. For BGP, prefer the route with the lowest IP address value for the BGP router ID.

  10. Prefer the path that was learned from the neighbor with the lowest peer IP address.

For information about controlling preference with routing policy, see Chapter 8, "Routing Policy and Firewall Filters," on page 301.

The IGPs compute equal-cost multipath next hops, and IBGP picks up these next hops. When multiple, equal-cost next hops are associated with a route, the routing protocol process installs only one of them in the forwarding path with each route, randomly selecting which next hop to install. For example, if there are three equal-cost paths to an exit router and 900 routes leaving through that router, each of the paths ends up with about 300 routes pointing at it. This mechanism provides load distribution among the paths while maintaining packet ordering per destination.

The routing protocol process assigns a default preference value to each route that the routing table receives (see Table 9.1). The default value depends on the source of the route. The preference is a value from 0 through 255, with a lower value indicating a more preferred route. In general, the narrower the scope of the statement, the higher precedence its preference value is given, but the smaller the set of routes it affects. To modify the default preference value for routes learned by routing protocols, you generally apply routing policy when configuring the individual routing protocols. You also can modify some preferences with other configuration statements, which are indicated in the table.

Table 9.1. Default Route Preference Values
How Route Is Learned Default Preference Statement to Modify Default Preference
Directly connected network
Static 5 static (see "Configuring Static, Aggregate, and Generated Routes," on page 382)
MPLS 7 MPLS preference (see Chapter 11, "MPLS Applications," on page 519)
OSPF internal route 10 OSPF export (see "Configuring OSPF," on page 441)
IS-IS Level 1 internal route 15 IS-IS external-preference and preference (see "Configuring IS-IS," on page 421)
IS-IS Level 2 internal route 18 IS-IS external-preference and preference (see "Configuring IS-IS," on page 421)
Redirects 30
RIP 100 RIP preference (see "Configuring RIP," on page 456)
Point-to-point interface 110
Generated or aggregate 130 aggregate and generate (see "Configuring Static, Aggregate, and Generated Routes," on page 382)
OSPF AS external routes 150 OSPF external-preference and preference (see "Configuring OSPF," on page 441)
IS-IS Level 1 external route 160 IS-IS external-preference and preference (see "Configuring IS-IS," on page 421)
IS-IS Level 2 external route 165 IS-IS external-preference and preference (see "Configuring IS-IS," on page 421)
BGP 170 BGP preference , export , and import (see "Configuring BGP," on page 398)

For equal-cost paths, load sharing is based on the BGP next hop. For example, if four prefixes all point to a next hop and there is more than one equal-cost path to that next hop, the routing protocol process randomizes the path chosen among the four prefixes. Also, for each prefix, the routing protocol process installs a single forwarding entry pointing along one of the paths. The routing software does not rerandomize the path taken as prefixes pointing to the next hop come and go, but it does rerandomize if the number of paths to the next-hop changes. Because a prefix is tied to a particular path, packet reordering should not happen. The degree of load sharing improves as the number of prefixes increases .



Juniper Networks Field Guide and Reference
Juniper Networks Field Guide and Reference
ISBN: 0321122445
EAN: 2147483647
Year: 2002
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net