Routing Protocol Design
This chapter will cover the following topics:
Learn advanced routing protocol concepts in our Cisco CCNP ENARSI video course.
A high-level analysis of network routing protocols, with a focus on the architectural aspects that dictate the routing protocol to be selected based on business needs and technical constraints, will be presented in this chapter. Characteristics of both IPv4 and IPv6 routing protocols will be discussed, although from a network design perspective, they are similar in many aspects.
Routing Protocol Concepts
Before analyzing the details of each individual routing protocol, general information about IP routing will be presented first. Network designers should know the key characteristics of different routing protocols because they will be in a position to recommend specific routing protocols for different projects.
The first decision to make is whether you should use static or dynamic routing. Static routing involves manually defining routes on devices and dynamic routing involves the use of a dedicated routing protocol that will build the routing table.
Static Routing
Even though static routes may not seem necessary in modern networks, there are situations in which they can offer granular control and optimization of the information learned by the routing protocols. Static routes can be used in conjunction with dynamic routing protocols to reach specific networks or to provide the default gateway (e.g., pointing to the ISP), useful in situations in which the destination network is not part of the routing protocol database.
Another scenario in which static routes are used is to override some dynamically learned routing information. Static routes can also be used in the form of floating static routes, meaning setting the AD (Administrative Distance) of a particular static route to a higher (worse) value than the AD value of the same route learned via a routing protocol for failover reasons.
Dynamic Routing
Another important decision to make when choosing the routing protocol is whether you need an Interior Gateway Protocol (IGP) or an Exterior Gateway Protocol (EGP). When you are routing between the devices within the organization (i.e., Autonomous System), you can choose one of the many IPv4-based IGPs, such as the following:
- Routing Information Protocol version 1 (RIPv1)
- Routing Information Protocol version 2 (RIPv2)
- Open Shortest Path First (OSPF)
- Intermediate System to Intermediate System (IS-IS)
- Interior Gateway Routing Protocol (IGRP)
- Enhanced Interior Gateway Routing Protocol (EIGRP)
- On Demand Routing (ODR)
Note: RIPv1 and IGRP are considered legacy protocols, and some modern network devices do not support them.
ODR is a Cisco proprietary protocol designed for hub-and-spoke topologies. It offers basic routing functionality and works over Cisco Discovery Protocol (CDP). The most common interior protocols used in non-hub-and-spoke environments are RIPv2, OSPF, IS-IS, and EIGRP.
IPv6 uses the following specially developed versions of these routing protocols:
- IS-IS
- RIPng
- OSPFv3
- EIGRP for IPv6
Routing between autonomous systems (i.e., from large corporations to the Internet or between service providers) is accomplished using EGP, which is a special routing protocol. The most common EGP for both IPv4 and IPv6 is the Border Gateway Protocol (BGP). Some companies are very big and they span the entire globe, so they use BGP inside their network as their IGP.
Large networks, including the Internet, are based on the Autonomous System (AS) concept. An AS defines a group of network devices under a common administration, and most often, this defines a large company or a service provider. Routing protocols can be classified based on different criteria. Depending on the zone in which they operate, they can be considered interior (inter-AS) routing protocols or exterior (intra-AS) routing protocols. Interior routing protocols can be classified further as distance vector protocols or link-state protocols, based on their behavior regarding the router update exchange process. Each routing protocol type will be covered in detail in subsequent sections, along with their respective design considerations.
Interior Routing Protocols
Interior routing protocols (i.e., IGP) are configured on groups of routers from the same AS; thus, the IGP routing activity never leaves the enterprise premises, as illustrated in Figure 7.1 below:
Figure 7.1 – Interior Routing Protocols
An important aspect that must be considered when selecting the routing protocol is the difference between distance vector and link-state routing protocols. Link-state protocols were developed after distance vector protocols, and they are much more sophisticated than distance vector protocols. A special category involves the hybrid routing protocols that feature the best elements of distance vector and link-state technologies. The only hybrid routing protocol used in modern networks is EIGRP.
Distance vector protocols include the following:
- RIPv1
- RIPv2
- IGRP
- RIPng
Link-state protocols include the following:
- OSPF
- IS-IS
- OSPFv3
Distance Vector Routing Protocols
Distance vector routing is a property of certain routing protocols that build an internal picture of the topology by periodically exchanging full routing tables between neighbor devices. The main difference between distance vector routing protocols and link-state routing protocols is the way they exchange routing updates. Distance vector protocols function using the “routing by rumor” technique, where every router relies on its neighbors to maintain correct routing information. This means the entire routing table is sent periodically to all neighbors, as illustrated in Figure 7.2 below:
Figure 7.2 – Distance Vector Routing Protocol Behavior
The most important advantage of distance vector routing protocols is they are easy to implement and maintain. The downside is mainly convergence times. A converged network is one in which every router has the same perspective of the topology. When a topology change occurs, the routers in the respective area propagate the new information to the rest of the network. Considering this is done on a hop-by-hop basis (i.e., every router passes its fully updated routing information to each neighbor), network convergence will not be established until a significant amount of time has passed.
In addition to slow convergence times, distance vector protocols are also bandwidth-intensive, especially in large networks, where routing tables can be of considerable size. Considering these aspects, distance vector protocols are recommended only in small enterprise network implementations.
An example of a distance vector routing protocol still used in modern networks is RIPv2 (Routing Information Protocol described in RFC 2453). RIPv2 uses a metric – hop count – for path selection, with a maximum hop count of 15. RIPv2 updates are sent using multicast by default, although they can be configured as unicast or broadcast, and, unlike its predecessor (RIPv1), RIPv2 permits VLSM on the network.
Devices receive routing information from their neighbors and pass it on to other neighbors. RIP repeats this process every 30 seconds. The downside in this scenario is that when the network is stable and there are no changes in the topology, RIP still sends its routing table every 30 seconds, which is not very effective, as it wastes bandwidth.
Note: Although it is generally believed that all routing table information is exchanged between neighbors during routing updates, only the best routes are actually exchanged, and alternate routes are not included in the routing update packets.
If a router that uses the distance vector protocol has inaccurate information, that information will propagate throughout the entire network. Distance vector routing protocols are also prone to major problems, including routing loops.
Link-State Routing Protocols
Link-state routing protocols do not “route by rumor”. Instead, the routing devices exchange information about their link-states between them. Devices build a map of the network independently and loop-free (i.e., they do not rely on a map of a particular node) based on the link-state information each router generates and propagates to the other routers.
Unlike distance vector routing protocols, link-state routing protocols flood information about its links to a specific area or to all the routers in the network. This means that every router in the topology has detailed knowledge of the entire network, unlike the routers using distance vector routing protocols, where only the best routes are exchanged between neighbors. The routing decisions are made by applying the Shortest Path First (SPF), or Dijkstra’s algorithm, to the information received from various sources. This calculation results in the shortest path to each destination in the network, as illustrated in Figure 7.3 below:
Figure 7.3 – Link-State Routing Protocol Behavior
This is a much more efficient approach to building routing databases, and there is no fixed update timer such as with distance vector technologies. Link-state protocols re-flood their entire routing information every 30 minutes to ensure the network is properly converged.
Link-state protocols offer a series of important advantages compared to distance vector protocols. The most important advantage relates to the convergence factor. Convergence occurs much faster because as soon as a network topology changes, only that specific information is sent to the routers in a given area. The routing updates stop after all the routers learn about the specific change, thus decreasing the need for bandwidth, unlike distance vector protocols, which periodically exchange routing tables, even if no topology change occurs. In link-state routing, updates are triggered only when a link-state changes somewhere in the network. Depending on the routing protocol in use, this can mean a link going up/down or changing some of its parameters (e.g., bandwidth).
Examples of link-state routing protocols are OSPF, described in RFC 2328, and IS-IS, described in RFC 1142.
Note: An interesting and special routing protocol is EIGRP, a Cisco proprietary protocol, which possesses both distance vector and link-state characteristics. EIGRP is also called a hybrid or an advanced distance vector routing protocol.
Exterior Routing Protocols
Exterior routing protocols operate as inter-ASs, and the most common example is BGPv4. The main reason for using different types of routing protocols to carry routes outside the AS boundaries is the need to exchange a large amount of route entries. In this regard, exterior routing protocols support special options and features that are used to implement various policies. The routing metrics for these kinds of protocols include more parameters than for IGP, for example, because of the crucial need for fast convergence and choosing the best possible path.
While IGP is used within enterprise-level networks, BGP is typically used in ISP-to-ISP or ISP-to-enterprise connections. Unlike intra-AS protocols that make routing decisions exclusively based on the metric value, inter-AS protocol policies can also include other factors, such as business decisions or possible AS vulnerabilities. These are technically implemented by configuring different BGP parameters.
A typical scenario in which the use of BGP is beneficial because of its flexible policy implementation is an enterprise connecting to multiple ISPs (i.e., multihoming). BGP can interconnect with any interior routing protocol used inside the enterprise network, so administrators have maximum flexibility when it comes to choosing a suitable interior routing protocol. A simple example of this scenario is presented in Figure 7.4 below:
Figure 7.4 – Enterprise Multihoming Scenario
Other Routing Protocol Considerations
Another key parameter of routing protocols and a measure of their sophistication is whether they have a hierarchical or flat behavior. IS-IS, OSPF, and EIGRP can be configured in a hierarchical manner, which offers improved scalability. For example, OSPF splits the topology into multiple areas and uses the Area 0 (backbone) concept, which connects to every other area in the topology. Routes can be summarized as they enter or leave the backbone, which leads to increased efficiency and bandwidth optimization.
IGRP and RIP are examples of routing protocols that are based on a flat behavior because they are not optimized and they use a single structure, no matter how large the network is.
One of the actions a router performs is deciding on the best way to get to a destination. If a router learns different paths to a destination from different protocols, the router must decide to which prefix it should listen. In order to make this decision, the router uses AD. Lower AD values are preferred over higher AD values, so, for example, OSPF routes (AD=110) will be preferred over RIP routes (AD=120). The AD value represents how trustworthy a particular routing protocol is; the most common AD values are summarized below:
Routing Protocol | AD Value |
Connected | 0 |
Static Pointing at IP Address | 1 |
EIGRP Summary | 5 |
External BGP | 20 |
EIGRP | 90 |
OSPF | 110 |
RIP | 120 |
External EIGRP | 170 |
Internal BGP | 200 |
Using the AD is a way in which a router selects routing based on a particular protocol, but what also must be decided is the way in which the device will select a routing table entry over another entry from the same protocol. Routing protocol metrics are used to make this decision.
Different routing protocols use different metrics. RIP uses the hop count as a metric, selecting the best route based on the lowest number of routers it came through. This is not very efficient because the shortest path can have a lower bandwidth than other paths. OSPF is more evolved and takes bandwidth into consideration, creating a metric called cost. Cost is directly generated from the bandwidth value, so a low bandwidth has a high cost and a high bandwidth has a low cost.
EIGRP is even more sophisticated and uses a metric that considers both bandwidth and delay values when creating the metric value. BGP, the most sophisticated of all, uses many different attributes grouped in path vectors that can be used to calculate the best path.
Note: One of the reasons RIP has a high AD value is that it uses the hop-count metric, which is not very efficient in complex environments. Among the different routing protocols, the more sophisticated the metric calculation is, the lower the AD value assigned.
Routing Problems and Avoidance Mechanisms
As mentioned before, distance vector routing protocols are prone to major problems due to their simplistic “routing by rumor” approach. Distance vector and link-state protocols use different techniques to prevent routing problems. The most important mechanisms include the following:
- Invalidation timers: These are used to mark routes as unreachable when updates for those routes are not received for a long time.
- Hop count limit: This parameter marks routes as unreachable when they are more than a predefined number of hops away. The hop count limit for RIP is 15, as it is not usually used in large networks. Unreachable routes are not installed in the routing table as best routes. Hop count limit prevents updates from looping in the network, as with the TTL field in the IP header.
- Triggered updates: This feature allows the update timer to be bypassed in the case of important updates. For example, the RIP 30-second timer can be ignored if a critical routing update must be propagated throughout the network.
- Hold down timers: If a metric for a particular route keeps getting worse, updates for that route are not accepted for a delayed period.
- Asynchronous updates: These represent another safety mechanism that prevents the routers from flooding the entire routing information at the same time by generating a small delay for every device. This improves bandwidth utilization and processing capabilities. As mentioned before, OSPF does this every 30 minutes.
- Route poisoning: This mechanism prevents routers from sending packets through a route that has become invalid. Distance vector protocols use this to indicate a route is no longer reachable. This is accomplished by setting the route metric to a maximum value.
- Split horizon: Split horizon prevents updates from being sent out of the same interface they came from because routers in that area should already know about that specific update.
- Poison reverse: This is an exception to the split-horizon rule for the poisoned routes.
Routing Information Protocol
Routing Information Protocol (RIP) comes in two versions. RIPv1 is a legacy protocol, but a network designer should know its shortcomings in order to understand the evolution to RIPv2.
RIPv1
The major drawback of RIPv1 is its classful behavior, meaning it does not send subnet mask information in its routing updates. If there is no subnet mask information in the updates about prefixes, then a consistency of the used prefixes is assumed. This means RIPv1 does not offer VLSM support.
Another issue with RIPv1 is that it broadcasts updates. In addition to the unnecessary use of bandwidth, this also means that routers not running RIP will constantly receive unnecessary RIP updates from the network. Modern routing protocols use a multicast approach in order to solve this issue by sending updates only to routers that really need to receive them (i.e., devices that subscribe in order to hear the RIP information).
RIPv1 does not allow authentication so there is no element of security that can be added to the routing protocol to ensure it is not sending information to devices that should not receive it.
RIPv2
When examining RIPv2, you can see that many of the RIPv1 shortcomings have been addressed. RIPv2 has a classless behavior, meaning subnet mask information is sent in updates so VLSM can be achieved. RIPv2 also supports authentication to ensure that the person you are sending the information to is a person authorized to receive that information.
RIPv2 multicasts routing updates instead of broadcasting used by RIPv1, which allows for efficient routing update exchanges. Another special feature of RIPv2 is its automatic summarization feature applied to prefixes on classful boundaries. This behavior can induce problems in real-world scenarios.
Figure 7.5 – RIP Automatic Summarization
In Figure 7.5 above, a router (R1) connects to the following networks: 10.10.10.0, 10.10.20.0, and 10.10.30.0. R1 connects to R2 and then to R3, which has connectivity to the 10.10.40.0 and 10.10.50.0 networks. There are also other networks between the routers, such as 172.16.0.0 between R1 and R2 and 192.168.0.0 between R2 and R3.
Notice the change in classful boundaries that makes RIP automatically summarize the networks behind R1 and R3 as 10.0.0.0/8 toward R2. This leads to a real problem: R2 will receive the same route from both directions. If it gets a packet destined to 10.10.10.0, it can send it in both directions based on the automatically summarized prefixes it received. This problem is called discontiguous subnets and it is generated by the automatic summarization behavior of the routing protocol that aggregates those subnets. Solutions for this problem involve not using discontiguous subnets in different areas in the network topology or disabling the automatic summarization behavior.
Another interesting aspect about RIP is that it relies on a series of timers for its operation, as follows:
- Update: Updates are sent every 30 seconds by default.
- Invalid: The route is invalidated if no update was received before this timer expires.
- Flush: Determines the time a route gets flushed from the RIP table.
- Holddown: Updates are not accepted for a route that keeps getting a bad metric.
- Sleep: Adds a delay to triggered updates.
Note: The holddown and sleep timers are Cisco-specific and are used to enhance RIP functionality. They were not originally specified in the RFCs for RIP.
Enhanced Interior Gateway Routing Protocol
Enhanced Interior Gateway Routing Protocol (EIGRP) is a unique protocol considering it uses a hybrid approach, combining distance vector and link-state characteristics. Combining these features makes EIGRP very robust and allows for fast convergence, even in large topologies.
The first thing a network designer should consider is that EIGRP is a Cisco proprietary protocol, so it can be used only in environments that contain Cisco devices. This protocol is not suitable in a multi-vendor architecture. Similar to RIPv2, EIGRP is a classless protocol that allows for VLSM. Another similarity between the two protocols is their automatic summarization behavior, but this can be disabled easily.
The algorithm that EIGRP uses is called the Diffusing Update Algorithm (DUAL). DUAL is the engine that makes EIGRP such a powerful protocol. DUAL operates based on a topology table that contains all the possible prefixes and information about how to reach those prefixes. The topology table is used to identify the best prefix, called the successor, and puts this route in the routing table. After determining the best route in the topology table, EIGRP identifies the second best route, called the feasible successor. Feasible successors are not installed in the routing table until the best route is lost. At that moment, the next best successor in the topology table is installed in the routing table almost immediately because there is no need for other computations. This is the reason EIGRP provides such fast convergence times.
EIGRP is the only IGP that can perform unequal cost load balancing across different paths, as illustrated in Figure 7.6 below. This is accomplished using the “variance” command, which allows defining a tolerance multiplier that can be applied to the best metric and that will result in the maximum allowed metric.
Figure 7.6 – EIGRP Unequal Cost Load Balancing
In Figure 7.6, there are two routes with a cumulative metric of 100 to a destination and a route with a cumulative metric of 200 to the same destination. By default, EIGRP performs only equal cost load balancing, so it will send traffic across only the first two links, which have the best metric of 100. If you wanted to send traffic over the third link as well, you would set the variance to 2, meaning the maximum allowed metric is 2 times the lowest metric, which equals 200. Traffic will be sent proportionally to the metric, meaning for each packet sent over the third link, two packets are sent over the first two links, because their metric is better.
EIGRP creates neighbor relationships with adjacent routes and exchanges information with them using the Reliable Transport Protocol (RTP). This protocol ensures that neighbors can exchange information in a reliable manner.
Note: Do not confuse the EIGRP-specific RTP with the Real-time Transport Protocol used in VoIP environments.
By default, EIGRP calculates route metrics based on bandwidth and delay but it can use other parameters in the calculation, including the following:
- Load
- Reliability
Enabling the metric calculation based on load and reliability is not recommended by Cisco because the network might become unstable.
Open Shortest Path First
The Open Shortest Path First (OSPF) protocol is one of the most complex routing protocols that can be deployed in modern networks. As opposed to EIGRP, OSPF is an open-standard protocol.
OSPF is a classless routing protocol and this allows it to support VLSM. Similar to EIGRP using DUAL, OSPF uses the SPF (Dijkstra) algorithm to select loop-free paths throughout the topology. OSPF is designed to be very scalable because it is a hierarchical routing protocol, using the concept of “areas” to split the topology into smaller sections.
OSPF may not converge as fast as EIGRP does but it offers efficient updating and convergence, and it takes bandwidth into consideration when calculating route metrics (i.e., costs). A higher bandwidth generates a lower cost, and lower costs are preferred in OSPF. OSPF supports authentication, just as EIGRP and RIPv2 do. OSPF is also very extensible, similar to BGP and IS-IS, meaning the protocol can be modified in the future to handle other forms of traffic.
OSPF Functionality
OSPF discovers neighbors and exchanges topology information with them, acting much as EIGRP does. Based on the collected information and the link costs, OSPF calculates the shortest paths to each destination using the SPF algorithm. The formula for calculating the interface cost is Reference Bandwidth/Link Bandwidth. The default Reference Bandwidth is 100 Mbps but this can be modified, just as the Link Bandwidth can be modified using the “bandwidth” command.
Note: The Reference Bandwidth should be modified in networks that contain a combination of 100 Mbps and 1 Gbps links because, by default, all of these interfaces will be assigned the same OSPF cost.
Another aspect that adds to the design complexity of OSPF is that it can be configured to behave differently depending on the topology in which you are implementing it. OSPF recognizes different network types and this will control the following actions:
- How updates are sent
- How many adjacencies are made between the OSPF speakers
- How the next hop is calculated
OSPF supports the following network types:
- Broadcast
- Non-broadcast
- Point-to-point
- Point-to-multipoint
- Point-to-multipoint non-broadcast
- Loopback
OSPF does a good job of automatically selecting the network type that is most appropriate for a given technology. For example, if you configure OSPF in a broadcast-based Ethernet environment, it will default to the broadcast type. If you configure it on a Frame Relay physical interface, it will default to the non-broadcast type. OSPF configured on a point-to-point serial link will default to the point-to-point network type.
Two network types that are never automatically assigned are point-to-multipoint and point-to-multipoint non-broadcast. These are most appropriate for partial-mesh (hub-and-spoke) environments and must be configured manually.
The network types can influence the underlying OSPF protocol in many ways. The broadcast type will be the default on broadcast media, and once OSPF is configured on a broadcast environment, the systems will elect a Designated Router (DR) and a Backup Designated Router (BDR) on each segment. In order to communicate with the DRs, OSPF will multicast updates to 224.0.0.6, and in order to communicate with every OSPF router, packets are multicasted to 224.0.0.5.
In a broadcast network, the DR is the device that all the other routers will form their adjacency with, and this is a protection mechanism against the network being overwhelmed with a full mesh of adjacencies. In addition to minimizing adjacencies, the DR also helps minimize the amount of OSPF traffic between OSPF nodes because they must communicate only with the DR. The BDR is a node that will take the place of a DR if it fails.
On a broadcast OSPF segment, if every node had to form adjacencies for information exchange with all other neighbors, the total number of neighbor relationships would be n*(n-1)/2, where “n” is the number of routers. Using a DR helps reduce the total number of adjacencies and makes the process more efficient because nodes do not need a full mesh of relationships.
OSPF Router Types
The hierarchical nature of OSPF is based on the concept of areas, which improves the scalability of the protocol. Link-state protocols operate by flooding information about the status of their links, but when the network is divided into areas, only the routers in a specific area have to agree on the topology map. Setting up areas reduces the convergence domain size because of the ability to hide topology details between areas. This leads to the protocol becoming much more efficient.
Area 0 (backbone) is the critical area in an OSPF environment, and every OSPF design must start from this area. It is also called the transit area because all areas must connect to it and traffic between areas must go through Area 0. Another feature of the backbone area is that it must be contiguous, meaning it cannot be broken down into multiple parts. Once the backbone area is designed, other areas, called non-transit areas, can be included and they can be assigned any number. This concept is illustrated in Figure 7.7 below:
Figure 7.7 – OSPF Area Types and Router Roles
Network designers should also understand the different router roles that exist within OSPF, as follows:
- Backbone router: This terminology is given to a router that has at least one link in Area 0.
- Internal router: This router has all links participating in one non-transit area.
- Area Border Router (ABR): The ABR is a router that is positioned between multiple areas. This means the router has at least one link in Area 0 and one link in a non-transit area. ABR areas are used to pass information between the backbone areas and the non-transit areas. They are also used to summarize information between the two areas, thus improving the efficiency and the scalability of the OSPF design.
- Autonomous System Boundary Router (ASBR): An ASBR has at least one link to the OSPF domain and at least one link outside the OSPF domain, touching another routing protocol, such as EIGRP, IS-IS, or BGP. It is used to redistribute information to and from other routing domains and OSPF.
Virtual Links
If the backbone area splits into multiple pieces, you can assure continuity by creating virtual links. A virtual link can be considered an Area 0 tunnel that connects the dispersed backbone areas, as depicted below in Figure 7.8. Virtual links are not considered best design practices but they can be useful in particular situations, such as company mergers.
Figure 7.8 – OSPF Virtual Link (Example 1)
Virtual links are configured between ABRs as a temporary fix to the problem (i.e., split Area 0). The virtual link tunnels the backbone area between the devices, so the topology is repaired until a network redesign.
Another classic case in which you might use virtual links is the situation in which you have an OSPF area not connected to the backbone. Looking at the example in Figure 7.9 below, Area 100 is connected to Area 0 but Area 200 is connected only to Area 100. This poses a design problem because it goes against the principle that every area must be connected to Area 0. The solution in this case would be to configure a virtual link between Area 0 and Area 200 so the backbone is extended to reach Area 200.
Figure 7.9 – OSPF Virtual Link (Example 2)
Note: In the scenario depicted above, virtual links are often considered an extension of the non-transit area (Area 200 in this case) to reach Area 0. However, this is not true because the virtual link is part of Area 0, so Area 0 is extended in order to reach the non-transit area (Area 200 in this case).
Link-State Advertisements
Another important OSPF aspect is represented by the different Link-State Advertisement (LSA) types. Each LSA type has a unique format that is defined by the type of information it contains (either internal or external prefixes). The LSA types are as follows:
- Type 1 – Router LSA: Used by routers in one area to advertise a link to another router in the same area.
- Type 2 – Network LSA: Generated by the DR to send updates about the attached routers.
- Type 3 – Network Summary LSA: Generated by the ABR to advertise information from one area to another.
- Type 4 – ASBR Summary LSA: Generated by the ABR to send information about the location of the ASBR.
- Type 5 – External LSA: Used by the ASBR to advertise external prefixes to the OSPF domain.
- Type 6 – Multicast LSA: Not implemented by Cisco.
- Type 7 – NSSA External LSA: Used in Not-So-Stubby Areas to advertise external prefixes.
- Type 8, 9, 10 – Opaque LSA: Used for extensibility.
The following LSA types allow for a hierarchical structure:
- LSAs that flow only within an area (intra-area routes): Types 1 and 2 (O)
- LSAs that flow between areas (inter-area routes): Types 3 and 4 (O IA)
- External routes: Type 5 (E1/E2) or Type 7 (N1/N2)
OSPF Area Types
OSPF offers the capability to create different area types, which relates to the various LSA types presented below and the way they flow inside a specific area. The different area types are as follows:
- Regular Area: This is the normal OSPF area, with no restrictions to the LSA flow.
- Stub Area: This will prevent the external Type 5 LSAs from entering the area. It will also stop Type 4 LSAs, as they are used only in conjunction with Type 5 LSAs.
- Totally Stubby Area: This prevents Type 3, Type 4, and Type 5 LSAs from entering the area. A default route is automatically injected in order to reach the internal destinations.
- Not-So-Stubby Area (NSSA): NSSAs will block Type 4 and Type 5 LSAs, but it can connect to other domains; in addition, you can have an ASBR in this area. NSSAs will not receive external routes injected in other areas but it can inject external routes into the OSPF domain. The external routes will be injected as Type 7 LSAs, which are converted to Type 5 LSAs by the NSSA ABR (the router that connects to the backbone), so they reach other OSPF areas as Type 5 LSAs.
- NSSA Totally Stubby Area: This area has the same characteristics as the NSSA area, except that it will also block Type 3 LSAs from entering the area.
Note: All routers in an OSPF area must agree on the stub flag.
The various areas and LSA types are summarized in Figure 7.10 below:
Figure 7.10 – OSPF Areas and LSA Types
All of these areas and LSA types make OSPF a very hierarchical and scalable routing protocol. You can tweak and tune it for very large environments because of all these design elements
OSPF allows for summarization, which can be carried out in the following locations:
- Between areas (inter-area summarization), using Type 3 LSAs
- At the ASBR, summarizing external prefixes, using Type 5 and Type 7 LSAs
Intermediate System to Intermediate System
The Intermediate System to Intermediate System (IS-IS) protocol is a pure link-state protocol, similar to OSPF, and it is defined in RFC 1142. IS-IS is currently used mostly in very large service provider environments, as it lost the battle versus OSPF for Internet-wide supremacy. One thing to consider from a network design perspective is that many engineers are not knowledgeable about the IS-IS protocol.
IS-IS has many similarities to OSPF, such as it is a classless routing protocol, it uses VLSM, and it supports authentication. IS-IS also presents some key differences from OSPF, including increased scalability features and built-in efficiency tools that enable it to support more routers in a single area than OSPF can.
Another difference between IS-IS and OSPF is that IS-IS is not as strict with the area concept. The backbone concept does exists in IS-IS but it offers much more flexibility. Routers that make up the IS-IS topology can be classified as Level-1 or Level-2, and the area border concept is simply on a router that supports both levels. Level-1 and Level-2 routers are connected to compose the backbone structure of the topology, and each node from the backbone can connect to Level-1 routers.
The concept of OSPF DR also has an equivalent in IS-IS, which is called Designated Intermediate System (DIS), but the difference is there is no backup DIS in the IS-IS topology. In addition, there is no concept of special area types in IS-IS.
Another difference between IS-IS and OSPF concerns the routing protocol metric. The IS-IS metric is not based on interface bandwidth, and the default metric has a value of 10 on Cisco routers. The IS-IS metric is similar to a hop count and must be manipulated in order to consider bandwidth in the path selection process.
Border Gateway Protocol
Border Gateway Protocol (BGP) is the only exterior gateway protocol in use today, and its role is to exchange routing information between organizations. BGP is a standard-based protocol defined in RFC 4271 and is the successor of EGP.
BGP Necessity
BGP is used to route between ASs and is considered a path vector routing protocol. Its metric is based on multiple attributes that you can tune and control in order to affect which path through ASs data is taken (this is, in fact, the routing decision). This is more of a policy based routing approach, and policy routing is very important for ISPs routing traffic between each other for different ASs.
BGP is a classless routing protocol that supports VLSM and summarization (i.e., route aggregation). While IGPs can scale to thousands of routes, BGP can scale to hundreds of thousands of routes, making it the most scalable routing protocol ever developed. Currently, the global BGP routing table has over 300,000 routes.
Another characteristic of BGP is its high stability, which is a result of never having a solid convergence of the Internet routing table (i.e., something is always changing in such a large routing table). BGP is stable enough to handle routing and decision-making at the same time. With BGP, it is all about the enforcement of policies, so it does not use a simple metric value that might be tied to a single parameter (e.g., bandwidth). Instead, BGP has a group of attributes that can be manipulated in order to dictate a particular routing policy.
BGP is used in the following scenarios:
- Transit networks: ISPs that want to provide transit to other destinations on the public Internet
- Multihomed networks: Big enterprise networks that rely heavily on Internet traffic and have sophisticated connectivity requirements with two or more ISPs; BGP allows them to control inbound and outbound routing policies
The two scenarios are depicted in Figure 7.11 below:
Figure 7.11 – BGP Deployment Scenarios
Most of the enterprise networks do not need BGP because of the following reasons:
- The network requires single ISP connectivity and default routing configuration is sufficient. A default route will point to the ISP, so all Internet traffic is routed to that single ISP.
- The memory and CPU resources are limited and do not support a BGP implementation. The global routing table needs more than 1 GB of memory just for storage.
- You would not use BGP if you did not own the IPv4 address space in use. An example would be company addresses that are owned by an ISP that advertizes the address space on the Internet. This is the case for small- and medium-sized organizations.
BGP Functionality
Similar to OSPF, IS-IS, and EIGRP, BGP uses a three-table data structure, as follows:
- Neighbor table: Contains information about adjacency with the peers.
- BGP table: Topology table that contains all prefixes learned from the peers.
- IP routing table: Contains the best routes from the BGP tables.
The devices running BGP will establish peerings in order to build the neighbor table and will then exchange updates to build the BGP table. After the BGP table is built, the best paths for routing information are chosen and are used to build the IP routing table.
BGP allows the following types of peerings to be created (as illustrated in Figure 7.12 below):
- External BGP (eBGP) peerings create BGP peerings with a neighbor that is outside of the AS.
- Internal BGP (iBGP) peerings create BGP peerings with devices inside the AS.
Figure 7.12 – BGP Peering Types
The BGP peering types a route is being sent to and received from will influence the update and path selection rules. An example of this is when eBGP peers are assumed to be directly connected. If they are not, a special command called “ebgp multihop” must be entered in order to let the devices know they are not directly connected so they can establish the BGP peering. This assumption has no equivalent when considering iBGP peerings, where there is no requirement for direct connectivity.
Another example of iBGP versus eBGP behavior is that an eBGP-learned route will not be advertised between iBGP peers because of a special loop-prevention mechanism that prevents an update learned via iBGP to be sent to other iBGP peers. This happens because BGP assumes all routers within an AS have complete information about each other. The following solutions exist in order to solve this issue:
- Configure a full mesh of iBGP peers
- Use BGP route reflectors
- Organize the AS into BGP confederations
The solution that involves a full mesh of iBGP peers is the least preferred because of the increased number of connections. The total number of connections is n*(n-1)/2, where “n” equals the number of BGP routers, so for 1,000 routers you would have 499,500 peerings. This is very hard to implement and maintain, so the route reflector and confederations solutions are recommended instead.
Route reflectors (RR) are nodes that will reflect the iBGP updates to devices that are configured as RR clients. This solution is easy to design and implement and solves the iBGP split-horizon rule. You still have to configure a full-mesh connection between (RR) nodes and normal nodes (i.e., non-route reflector clients), but you do not have to have a full mesh between the RR and its clients. This concept is illustrated in Figure 7.13 below:
Figure 7.13 – BGP Route Reflectors
BGP confederations are more complex than route reflectors and function by creating sub-ASs within the main AS. The connections between sub-ASs behave like eBGP peerings, while the connections inside sub-ASs are pure iBGP peerings. This means that you need full-mesh configuration only inside sub-ASs, where you can also configure route reflectors, so you have a combination of BGP design technologies at your disposal. The concept behind confederations is illustrated in Figure 7.14 below:
Figure 7.14 – BGP Confederations
Note: AS numbers are defined as 16-bit integers that range from 0 to 65535. Sub-ASs are usually assigned private AS numbers, ranging from 64512 to 65535. Due to the exhaustion of public AS numbers, IANA introduced 32-bit AS numbers, which it begun to allocate in the last few years.
BGP Path Vector Attributes
BGP can use multiple attributes in order to define a routing policy, the most important of which are as follows:
- Next hop: This attribute must be present in each BGP update, and it indicates where the traffic should be sent in order to reach a particular destination.
- AS path: This attribute lists all the Autonomous Systems through which the prefix has passed. The AS path is similar to a hop count, except it uses AS numbers and provides more details about the path.
- Origin: This attribute gives information about how the prefix entered the BGP system: directly advertised into BGP with the “network” command or redistributed from other routing protocols.
- Local preference: This attribute can influence the way traffic comes into the AS and the path it takes.
- Multi-Exist Discriminator (MED): MED can influence the way packets leave the AS and the path they take.
- Atomic aggregate: Used when performing BGP summarization.
- Aggregator: Used when performing BGP summarization.
BGP attributes can be grouped into several categories, which can be either well known or optional, with well-known attributes being supported by all BGP vendors and optional attributes being supported only by certain BGP vendors. The categories can also be either mandatory or discretionary, with mandatory attributes being sent in every routing update, while discretionary attributes may or may not be present in routing updates. Another categorization relies on the path attribute’s transitivity, which can be either transitive (it passes between eBGP and iBGP neighbors) or non-transitive (it passes only between iBGP neighbors).
Valid combinations of BGP attributes are as follows:
- Well-known mandatory (next hop, AS path, origin)
- Well-known discretionary (local preference, atomic aggregate)
- Optional transitive (aggregator, community)
- Optional non-transitive (MED)
BGP systems will analyze all of these attributes and will determine the best path to get to a destination based on this very complex decision-making process. Only the best route is sent to the routing table and to the peers. The first step in this process is checking whether the next hop is reachable. If it is not, the route is dropped, but if it is, the decision-making process involves analyzing the next steps:
- Weight (Cisco-specific attribute) – the highest weight is preferred
- Local preference – the highest local preference is preferred
- Locally originated routes – preferred
- AS path – the shortest AS path is preferred
- Origin – routes with the lowest origin type are preferred
- MED – the lowest MED is preferred
- Neighbor type – prefer routes that came via eBGP over those that were learned via iBGP
- IGP metric – if there is still a tie, the lowest IGP metric wins
IPv6 Routing Concepts
Cisco routers do not route IPv6 by default, so this capability should be activated with the “ipv6 unicast-routing” command. Cisco routers are dual-stack by default, capable of running IPv4 and IPv6 simultaneously on the same interfaces.
IPv6 allows the use of static routing and supports specific dynamic routing protocols (i.e., variations of the IPv4 routing protocols modified or redesigned to support IPv6), as follows:
- RIPng (RIP new generation)
- OSPFv3
- EIGRPv6
- IS-IS
- BGP
Note: IS-IS and BGP experienced the least number of modifications in order to run and support IPv6 because they were built with extensibility in mind.
RIPng, OSPFv3, and EIGRPv6 are new routing protocols that work independently of the IPv4 versions, and they run on a completely separate process on the device. BGP and IS-IS are exceptions to this rule, as they route IPv6 traffic using the same process as IPv4, but they use the concept of address families that hold the entire IPv6 configuration.
Many of the issues with IPv4 (e.g., name resolution or NBMA environments) still exist with IPv6 routing. An important aspect is that IPv6 routing protocols communicate with remote link-local addresses when establishing their adjacencies and exchanging routing information. Therefore, when you examine the routing table of an IPv6 router, you will notice that the next hops are the link-local addresses of the neighbors.
As mentioned, static routing is one of the options you can use with IPv6, and it has the same implications as with IPv4. The route can point to the following:
- The next hop (the next hop must be resolved)
- A multipoint interface (the final destination must be resolved)
- A point-to-point interface (no resolution is required)
RIP new generation (RIPng), also called RIP for IPv6, was specified in RFC 2080, and is similar in operation to RIPv1 and RIPv2. While RIPv2 uses the multicast address 224.0.0.9 to exchange routing information with its neighbors, RIPng uses the similar FF02::9 address and UDP port 521. Another difference between the two versions is that IPv6 is configured at the interface level, while RIPv1 and RIPv2 are configured at the global routing configuration level.
OSPFv3 is defined in RFC 2740 and is similar in operation to OSPFv2 (for IPv4). OSPFv3 even supports the same network types as OSPFv2, such as the following:
- Broadcast
- Non-broadcast
- Point-to-point
- Point-to-multipoint
- Point-to-multipoint non-broadcast
EIGRPv6 is similar in operation to EIGRP for IPv4 and uses IP protocol 88 to multicast updates to FF02::A.
Note: An important aspect to consider when implementing EIGRPv6 is that, unlike EIGRP for IPv4, the process is shut down until you manually enable it by issuing the “no shutdown” command under the routing process.
BGP for IPv6 is configured in the address family configuration mode, but it is based on the same configuration principles used by BGP for IPv4, as follows:
- An underlying transport IGP is required.
- There is an implicit iBGP loop-prevention mechanism that prevents iBGP-learned routes from being advertised to other iBGP neighbors (this can be solved by using route reflectors or confederations).
- There is an implicit eBGP loop-prevention mechanisms that does not accept routes entering an AS that has the same AS in the path.
- It uses the same best-path selection process.
Summary
When designing enterprise routing, network architects should first figure out whether it is best to use static or dynamic routing. Static routing involves manually defining routes on devices, while dynamic routing involves the use of a dedicated routing protocol that will build the routing table.
The most common dynamic routing protocols used in modern networks are as follows:
- RIP
- EIGRP
- OSPF
- BGP
Large networks, including the Internet, are based on the Autonomous System concept. An AS defines a group of network devices under a common administration, and most often, this defines a large company or a service provider. Routing protocols can be classified based on different criteria. Depending on the zone in which they operate, they can be considered interior (inter-AS) routing protocols or exterior (intra-AS) routing protocols.
Interior routing protocols can be classified further as distance vector protocols or link-state protocols, based on their behavior regarding the router update exchange process.
Distance vector routing protocols include the following:
- RIPv1
- RIPv2
- IGRP
- RIPng
Link-state routing protocols include the following:
- OSPF
- IS-IS
- OSPFv3
The main difference between distance vector routing protocols and link-state routing protocols is the way they exchange routing updates. Distance vector protocols function using the “routing by rumor” technique, as every router relies on its neighbors to maintain correct routing information. This means the entire routing table is sent periodically to all the neighbors.
Link-state routing protocols do not “route by rumor”. Instead, the routing devices exchange information between them about their link-states. Devices build a map of the network, independently and loop-free, based on the link-state information each router generates and propagates to the other routers.
Link-state protocols offer a series of important advantages when compared to distance vector protocols. The most important advantage relates to the convergence factor, which occurs much faster because as soon as a network topology changes, only that specific information is sent to the routers in a given area.
Exterior routing protocols run between ASs (inter-AS) and the most common example is BGPv4. The main reason for using different types of routing protocols to carry routes outside the AS boundaries is the need to exchange a large amount of route entries.
Routers use Administrative Distance in order to select the best route when multiple routing protocols advertise the same prefix. The AD value represents how trustworthy a particular routing protocol is.
RIPv2 has a classless behavior, meaning subnet mask information is sent in updates so VLSM can be achieved. RIPv2 also supports authentication to ensure that the person you are sending the information to is authorized to receive that information.
EIGRP is a unique protocol because it uses a hybrid approach, combining distance vector and link-state characteristics. Combining these features makes EIGRP very robust and allows for fast convergence, even in large topologies. EIGRP functions by using DUAL, and it is the only IGP that can perform unequal cost load balancing.
The OSPF protocol is one of the most complex routing protocols that can be deployed in modern networks. Unlike EIGRP, OSPF is an open-standard protocol. OSPF functions by using the Dijkstra SPF algorithm.
OSPF defines the following types of areas:
- The backbone area (Area 0)
- Non-transit areas (which must touch the backbone area)
OSPF defines the following router roles:
- Backbone router
- Internal router
- Area Border Router (ABR)
- Autonomous System Boundary Router (ASBR)
OSPF functions by exchanging Link-State Advertisements between neighbors. LSA types are as follows:
- Type 1 – Router LSA
- Type 2 – Network LSA
- Type 3 – Network Summary LSA
- Type 4 – ASBR Summary LSA
- Type 5 – External LSA
- Type 6 – Multicast LSA
- Type 7 – NSSA External LSA
- Type 8, 9, 10 – Opaque LSA
OSPF offers the capability to create different area types, which relates to the various LSA types presented below and the way they flow inside a specific area. The different area types are as follows:
- Regular Area
- Stub Area
- Totally Stubby Area
- Not-So-Stubby Area (NSSA)
- NSSA Totally Stubby Area
BGP is a highly scalable path vector routing protocol. Its metric is based on multiple attributes that you can tune and control in order to affect which path through ASs data is taken.
BGP can be used in transit networks (i.e., ISPs that want to provide transit to other destinations on the public Internet) or multihomed networks (i.e., big enterprises that connect to multiple ISPs).
BGP can use multiple attributes in order to define a routing policy, the most important of which are as follows:
- Next hop
- AS path
- Origin
- Local preference
- Multi-Exist Discriminator (MED)
- Atomic aggregate
- Aggregator
IPv6 allows the use of static routing and supports specific dynamic routing protocols (i.e., variations of the IPv4 routing protocols modified or redesigned to support IPv6), such as the following:
- RIPng (RIP new generation)
- OSPFv3
- EIGRPv6
- IS-IS
- BGP