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:
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
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 DeterminedFor 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 :
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
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 . |