Verifying Static and Default Routes
The best way to verify a static or default route configuration is by checking that the route is evident in the routing table. The command to view the IP routing table is show ip route. If you want to see the routing entry for a specific network, you can append that subnet to the show ip route command (for example, show ip route 192.168.23.0). The following example displays the output of the show ip route command:
Router> show 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, * - candidate default U - per-user static route, o - ODR, P - periodic downloaded static route T - traffic engineered route Gateway of last resort is not set S 172.17.0.0/16 [1/0] via 192.168.1.10 C 172.16.0.0/16 is directly connected, FastEthernet0/0 192.168.1.0/30 is subnetted, 1 subnets C 192.168.1.8 is directly connected, Serial0/0/0 S* 0.0.0.0/0 [1/0] via 192.168.1.10
Notice that the beginning of the output has a legend identifying the possible codes that can be listed in the routing table. In the table itself, you can see the two directly connected networks signified by the letter C. In addition, you can also see the static route to 172.17.0.0 and the static default route entries (indicated by the letter S), using 192.168.1.10 as the next hop. Also notice that the routing table identifies that the gateway of last resort (192.168.1.10) is set on this router because a default route was configured with the next hop to that address.
NOTE
You can clear out an entry in your routing table by using the clear command followed by the network or * for all networks in privileged EXEC mode. For example, to clear the 192.168.1.0 network from your routing table, you would enter the following:
Router# clear ip route 192.168.1.0
Dynamic Routing Protocols
Objective:
- Compare and contrast methods of routing and routing protocols
When complex networks contain multiple interconnections, static routes are no longer a practical solution because they cannot adapt or react to changes in the topology. Not to mention, the configuration complexity can grow exponentially as you add more devices to the network.
EXAM ALERT
Do not confuse routing protocols with routed protocols on the exam. Routed protocols are protocols such as those in the IP protocol suite that are used to carry the data across our network. Routing protocols are exchanged between routing devices to determine the optimal path to route the routed protocols.
For example, given the network design shown in Figure 10.8, Router A knows only the three directly connected networks attached to the router. For IP packets to reach the 172.17.0.0 network via static routes, you would have to configure Router A to go through one of its neighbor routers, such as Router B. However, Router B also requires a static route to 172.17.0.0 because that network is not directly connected to it. Supposing that the router is using Router F as its next hop, that router does not require a static route because it is directly connected.Unfortunately, our configuration undertaking does not stop there because we have to configure a static route in Router F and Router B back to the 172.16.0.0 network.
Granted, the configuration scenario shown in Figure 10.8 is not drastically difficult or strenuous, but imagine if the network contained 20 more routers. More importantly, consider what would happen if the link between A and B went down. Because the routes are statically configured in the routers, you must now go back and remove the static routes in Routers A and B and redirect the traffic by configuring static routes to go through Routers C, D, and E. Not to mention, you must remove and reconfigure static routes back to the 172.16.0.0 network in Routers F, E, D, and C.
To alleviate the administrative calamity you might have to encounter with static routes in complex networks, you can use dynamic routing protocols. If you configure routing protocols, the routers advertise their connected networks to the rest of the routers in the network, thus minimizing the amount of configuration required. In addition, routing protocols can detect and
adapt to topology changes in the internetwork.
Routing Metrics
Because one of the core responsibilities of routing protocols is to build routing tables to determine optimal routing paths, you need to have some means of measuring which routes are preferred when there are multiple pathways to a destination. Routing protocols use some measure of metrics to identify which routes are optimal to reach a destination network. The lowest cumulative metric to a destination is the preferred path and the one that ultimately enters the routing table. Different routing protocols use one or several of the following metrics to calculate the best path:
- Hop count: The number of routing devices that the packet must travel to reach a destination network.
- Bandwidth: The cumulative bandwidth of the links to the destination in kilobits per second.
- Delay: The length of time (measured in microseconds) a packet takes from source to destination.
- Reliability: The consistency of the links and paths toward the destination based on error rates of the interfaces.
- Load: The cumulative amount of congestion or saturation of the links toward the destination.
- MTU: The maximum frame size that is allowed to traverse the links to the destination.
- Cost: An arbitrary number typically based on the bandwidth of the link.
Classful and Classless Routing Updates
As you will see in the following sections, routing protocols are categorized into several different classifications based on common characteristics and properties that they share. The first of these classifications revolves around the contents of routing updates that Layer 3 devices advertise to their neighbors. Specifically, if the routing updates do not contain the subnet mask
along with their respective advertised networks, they are said to be classful routing protocols.
Conversely, if the subnet mask is transmitted along with the network information, it is characterized as a classless routing protocol. This may seem like a trivial characteristic to define routing protocols, but as you will see, the results of the subnet mask being present or not in routing updates can affect the routing protocols you choose and how efficiently you can design your entire network.
With classful routing protocols, you assume that your network’s design conforms to the class boundaries of IP subnets. In other words, major networks in your design use their default classful subnet masks as described in Chapter 5, “Implementing IP Addressing” (for example, Class A uses 255.0.0.0, Class B uses 255.255.0.0, and Class C uses 255.255.255.0). If you happen to subnet a major network into smaller subnets, classful routing protocols are disadvantageous, because they do not receive the revised subnet mask. For this reason, classful routing protocols process updates in one of two ways:
- If the network in the updates matches the same major classful network on the interface through which it was received, it uses the subnet mask of the interface and places it in the routing table.
- If the router advertises a network to a different major network out an interface that is not in the same major network, it automatically summarizes the network to its classful boundary.
For example, when Router B in Figure 10.9 sends an update to Router A using a classful routing protocol (RIPv1 in this example), it summarizes the 172.17.30.0/24 to a default Class B 172.17.0.0 network because it is going out the serial 0/0 interface, which does not contain a subnet in that major network. The 192.168.1.60 network, on the other hand, is in the same major network, so it does not automatically summarize that subnet. When Router A receives that update, it adds the 172.17.0.0 network to its routing table, specifying Router B’s serial interface IP (192.168.1.10) as the next hop to reach that network. In addition, it adds the 192.168.1.60 network as well, using its interface mask because it is in that same major network.
Now consider if the Ethernet segment of Router B’s 192.168.1.60 network had a /29 subnet mask. The end result would still be the same as before in that Router B would advertise the 192.168.1.60 subnet and Router A would use its interface’s subnet mask of /30. In these instances, classful routing protocols are not the optimal choice because Router A has a route to only a third of the 192.168.1.60 /29 subnet. For this reason, when you subnet a major network, you must be sure that you use the same subnet mask throughout your network design with classful routing protocols. This same subnet design is commonly referred to as a FixedLength Subnet Mask (FLSM) network design.
Classful routing protocols can also be problematic when major classful networks are subnetted and are haphazardly dispersed throughout the network, as illustrated in Figure 10.10. When Routers A and C summarize their networks to Router B, Router B thinks that the 172.16.0.0 network is out both of its serial interfaces. This could easily result in traffic destined for 172.16.10.0 and 172.16.50.0 being load balanced out each interface, resulting in 50% packet loss because the packets are sent in a round robin fashion between both interfaces.
EXAM ALERT
Be sure to know that classful routing protocols support automatic summarization and must have a FLSM network design without any discontiguous networks.
Because classless routing protocols advertise the subnet masks in their routing updates, discontiguous networks are no longer an issue because routing devices are aware of the subnetted networks. In addition, the requirement of using the same subnet mask throughout the network ceases to apply because the routers do not automatically summarize the networks to a classful boundary. No longer inhibited by these constraints, you are free to use different subnet masks, known as Variable-Length Subnet Masks (VLSMs) in your network design. In addition, you now have full autonomy to manually summarize networks as you wish to help keep routing tables small to conserve resources. VLSM and route summarization are described in greater detail in the following sections.
EXAM ALERT
Be sure to know that classless routing protocols support discontiguous networks, VLSM, and route summarization.
VLSM
Using classless routing protocols affords you the luxury of having support for a VLSM network design. This is advantageous in your network planning because you can allot the appropriate number of IP addresses required for each link. Not to mention, by assigning the minimal number of IP addresses required for a given link, you conserve IP addresses. For example, you can use a /30 subnet mask for point-to-point links because you need only two available IP addresses and a /27 subnet mask on an Ethernet segment to accommodate 30 hosts. If you were using classless routing protocols, you would have to use a /27 for all links, which would inevitably waste 28 IP addresses on the point-to-point links.
EXAM ALERT
Remember that point-to-point links require only a /30 (255.255.255.252) subnet mask because you need only two usable IP addresses for the router’s interfaces on each side of the link.
Throughout your certification and career, it is quite possible you will have to design your network given a usable subnet and host requirements for all your links. When tackling this designing task, be sure to adhere to the following guidelines:
- If possible, start with the larger subnets first.
- Write out the ranges that you have assigned to ensure that you do not accidentally overlap subnets.
- Make sure your networks start on incremental boundaries (128, 64, 32, and so on).
EXAM ALERT
Be prepared to use VLSM to assign subnets to links given the subnettable network and host requirements.
Challenge
Given the design shown in Figure 10.11, determine how you can use VLSM to ensure that you are using the appropriate subnets given a design scenario. In this example, the zero subnets are available for use.
- Remember to add 2 to each network to accommodate the network ID and broadcast address.
- Calculate the network and subnet mask for Network D (the largest network).
- Given the remaining IP addresses, calculate the network and subnet mask for Network C.
- Given the remaining IP addresses, calculate the network and subnet mask for Network B.
- Given the remaining IP addresses, calculate the network and subnet mask for Network E.
- Given the remaining IP addresses, calculate the network and subnet mask for the four point-to-point links.
Challenge Answer
Network D needs to have a subnet that accommodates 128 addresses. A subnet mask of 255.255.255.128 or /25 provides enough hosts for that network. The next subnet for Network C begins at 192.168.1.128 (because you just took 128 IPs) and use a subnet mask of 255.255.255.192 or /26 to accommodate the 64 IP addresses. Network B is assigned the network of 192.168.1.192 with a subnet mask of 255.255.255.224 or /27 to give you 32 IPs. A subnet mask of 255.255.255.240 or /28 with a network ID of 192.168.1.224 is assigned to Network E for the 16 IPs required for that link. The four point-topoint links all use a 255.255.255.252 or /30 subnet mask using the last four networks: 192.168.1.240, 192.168.1.244, 192.168.1.248, 192.168.1.252. To summarize:
- Network D: 192.168.1.0 /25
- Network C: 192.168.1.128 /26
- Network B: 192.168.1.192 /27
- Network E: 192.168.1.224 /28
- Point-to-point links: 192.168.1.240 /30, 192.168.1.244 /30, 192.168.1.248 /30, and 192.168.1.252 /30.
Route Summarization
As already mentioned, classful routing protocols automatically summarize advertised networks to the classful subnet boundaries. Classless routing protocols, on the other hand, require you to manually control the networks being summarized to your neighbors in the router configuration. By aggregating a contiguous set of networks into an advertised summarized route, you keep the size of the routing tables to a minimum. Neighbors that receive the summarized route do not need to know about the individual subnets you create behind your router because they inevitably have to go through your router to get to them.
The additional offshoot of this summarized picture is that your classless routing protocols do not need to notify those neighbors if one of those subnets goes down because they do not even have that subnet in their routing tables. Thus, you can isolate topology changes to be contained behind that summarizing router. Because you are required to manually specify the networks you are to advertise, you must learn how to accurately summarize smaller subnets into one or several larger networks, or supernets. The rules for supernetting are similar to subnetting, except in this case, you are stealing bits from the network portion of an IP network to create a larger network. The rules for supernetting are as follows:
- Be sure that the networks are contiguous (otherwise you would be summarizing networks that you do not have behind the router).
- Count the number of networks you want to summarize.
- Determine an increment that is equal to or less than the number of networks.
- Make sure your base networks start on incremental boundaries (128, 64, 32, and so on) for the number of networks you are summarizing.
- Calculate the subnet mask by the number of bits you need to steal from the original subnet to equal that incremental value.
The beauty of supernetting is that the resultant network and subnet mask will designate many IP address networks in a single entry. The fact that you are stealing bits from the network portion of an IP address could quite easily violate the traditional barriers of classful addressing, known as Classless Interdomain Routing (CIDR).
For instance, it would not be uncommon to see a summary entry look like the following: 192.168.16.0 /20. This single entry used to be a Class C (/24), but four bits were stolen from the network portion to represent 16 networks (2 4 = 16). When you advertise this supernet to neighbors, they know that they must go through your router to get to networks 192.168.16.0
through 192.168.31.0 (16 total networks).
EXAM ALERT
Be prepared to determine the networks being advertised in a given supernet or determine the summary network, given the networks to be summarized.
Figure 10.12 illustrates a typical route summarization example in which Router B is summarizing all its subnetted networks to Router A as one supernetted network. Following the steps outlined previously, you can determine the aggregate network entry to advertise, as follows:
- The networks are all contiguous, so you can summarize them accurately.
- A total of 32 networks need to be summarized.
- 32 conveniently falls on an incremental boundary.
- Because the network is 192.168.64.0, 64 is an increment of 32 so we can use that as the base network for the summary route.
- You must steal 5 bits (2 5 = 32) from the /24 network, so /19 (24 – 5 = 19).
By creating the summary route 192.168.64.0 /19, Router A is required to maintain only that one entry in its routing table as opposed to the individual 32 subnets. If a topology change occurs in one of the subnets behind Router B, there is no need to advertise that change to Router A because it knows about only the summarized network.
NOTE
The number of summarized networks or the base network do not always conveniently fall on incremental boundaries. In those instances, it may take several summary network entries to encompass all the net works you want to summarize.
Interior and Exterior Gateway Routing Protocols
Routing protocols can fall under two major categories depending on the autonomy of the network on which the routing protocol exists. The identifying characteristic of the category to which the routing protocol belongs ultimately depends on whether the routing protocol exchanges updates within a network that is under your administrative control. When the network is under your control in your own administrative domain, it is known as an autonomous system. Routing protocols used to disseminate information to maintain routing tables and establish pathways inside an autonomous system are categorized as Interior Gateway Protocols (IGPs)
Conversely, the other category of routing protocols is designed to route in between these autonomous systems. For instance, Border Gateway Protocol (BGP) is a routing protocol that is used by ISPs for routing traffic over the Internet. Because the Internet comprises thousands of networks, each under different administrative control, you need to use an Exterior Gateway Protocol such as BGP to route in between these autonomous systems.
Distance Vector Routing Protocols
In addition to being an IGP/EGP or classful/classless, routing protocols can also fall into one of three classes. Again, the functionality and characteristics of the routing protocol dictate under which class it falls. The most long-standing of these classes is distance vector routing protocols.
Distance vector routing protocols concern themselves with the direction (vector) in which the destination lies and some means of measurement (metric) it takes to reach that destination. Distance vector routing protocols inform their directly connected neighbors of all the connected and learned networks they know about in their routing tables. In fact, they broadcast the contents of the entire routing table to their neighbors periodically, regardless of whether there is a change in the network topology.
When the neighbors receive that routing information, they identify and add any new networks to their routing tables and update the metric before eventually passing it on to their neighbors. Because the routing table information is updated before it is sent on to neighbors, downstream routers do not learn that information first hand. For this reason, distance vector routing protocol update processing is often referred to as “routing by rumor.” Distance vector routing protocols are discussed in greater detail in Chapter 11, “Distance Vector Routing Protocols.”
Link-State Routing Protocols
As the name states, link-state routing protocols advertise the state of the links in the network. In fact, they advertise the states and metrics (cost) of all the links they know about for the entire topology to their neighbors, as opposed to just the best routes in your routing table. This detailed overview of the entire routing domain enables each router to calculate and make a decision on the best route from this first-hand information, rather than listen to what its neighbor believes is the best route. In fact, link-state routing protocols keep three tables: a neighbor table of all discovered neighbors, a topology table of all the possible routes to reachable networks learned, and a routing table that contains the best route based on the lowest metric calculated from the topology table.
At first, this may sound like a lot of information to be exchanged between routers; however, link-state routing protocols initially discover their neighbors when they first boot up and synchronize their topology tables. After the neighbor discovery and topology synchronization, they send only periodic hello messages to let their neighbors know they are still functioning.
This is significantly different from distance vector routing protocols that periodically exchange the entire routing table, which can contain a large amount of information, depending on the size of the network.
In addition, link-state routing protocols react much faster when a topology change occurs in the network. In fact, these protocols were initially created in response to the slow convergence issues that you typically encounter with distance vector routing protocols. The downfall to these routing protocols is the resources they consume in the router. Namely, maintaining and processing three tables consume quite a bit of memory and processor power. Link-state routing protocols are discussed in greater detail in Chapter 12, “Link-State and Hybrid Routing Protocols.”
Advanced Distance Vector/Hybrid Routing Protocols
They say it usually takes three tries to get something absolutely right. The truth behind this saying is that you learn from the mistakes of the previous two attempts. Such is the case with advanced distance vector, often referred to as hybrid or balanced hybrid routing protocols. Because they take the best features and avoid the pitfalls of both distance vector and link-state routing protocols, hybrid routing protocols are a more proficient breed of routing protocols than their predecessors.
The Routing Table Revisited
Now that you have learned about the several types of routing sources, including static routes and dynamic routing protocols, it’s time to revisit the routing table and solidify how network entries are added and used in routing decisions. To help illustrate this process, refer to the following show ip route output :
RouterA> show 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, * - candidate default U - per-user static route, o - ODR, P - periodic downloaded static route T - traffic engineered route Gateway of last resort is not set R 172.17.0.0/16 [120/1] via 192.168.1.10, Serial0/0/0 C 172.16.0.0/16 is directly connected, FastEthernet0/0 10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks D 10.2.0.0/16 [90/2297856] via 192.168.1.10, Serial0/0/0 D 10.3.0.0/16 [90/2297856] via 192.168.1.10, Serial0/0/0 R 10.0.0.0/8 [120/2] via 192.168.1.6, Serial0/0/1 D 10.1.0.0/16 [90/2297856] via 192.168.1.10, Serial0/0/0 D 10.4.0.0/16 [90/2297856] via 192.168.1.10, Serial0/0/0 O 10.4.0.1/32 [110/65] via 172.16.0.1, FastEthernet0/0 192.168.1.0/30 is subnetted, 2 subnets C 192.168.1.8 is directly connected, Serial 0/0/0 C 192.168.1.4 is directly connected, Serial 0/0/1
Notice that there are now several entries for directly connected networks, a static route, and several dynamic routing protocol entries from EIGRP, RIP, and OSPF. For each dynamic routing protocol, the network and subnet mask are being advertised by neighbor routers, followed by two numbers in brackets separated by a slash (/). The number to the left of the forward slash is the administrative distance of the routing protocol. The number to the right of the forward slash represents the metric that is being used by the routing protocol to determine the best path to the destination network. This information is immediately followed by the router from which it learned this information (thus, the next-hop address). The last item in the routing entry represents the interface packets must exit to reach those networks.
EXAM ALERT
You must be adept at deciphering the output of a routing table.
Assuming that several of the routing protocols advertised the same networks, how did these specific network entries come to be in the routing table? The obvious answer is that the interfaces, a static route, and multiple routing protocols were configured and the resultant table just appeared. However, to answer the question more specifically, each routing protocol determined which routes should be entered in the routing table based on the lowest metric to those destinations. In the chance that one or more routing sources is trying to place a network entry in the routing table for exactly the same subnet, the routing protocol with the lowest administrative distance is chosen because it is the most trustworthy.
After the routing table is built, packets are routed to their destinations by examination of the destination IP address in an IP packet and associating the network in the routing table with that IP address. If there isn’t a match for the network lookup, the packet is forwarded to its default route. If the gateway of last resort is not set (as in this show ip route output), the packet is dropped, and an ICMP destination unreachable message is sent back to the source to indicate that the destination cannot be reached.
EXAM ALERT
Routing of packets is based on the destination IP address in a packet. If the router does not have an entry for the packet’s associated network or does not have a default route, it sends an ICMP destina tion unreachable message back to the source.
In the show ip route output, several entries for the 10.0.0.0 network are listed in the routing table. Interestingly, there is a RIP entry for the 10.0.0.0 /8 network to go out serial 0/0/1 and four EIGRP-learned networks for 10.1.0.0 /16, 10.2.0.0 /16, 10.3.0.0 /16, and 10.4.0.0 /16, all destined for interface serial 0/0/0. Because the EIGRP networks are subnets of the major 10.0.0.0 network, which interface will the router use to route a packet destined, for example, for 10.1.0.3?
Cisco’s routing logic answers this question by using a rule called the longest match. The longest match rule states that when a packet has multiple possible network entries to use, the more specific subnet is used over the less specific. In other words, the longer the number of bits in the subnet mask (thus the smaller subnet), the more chance it has of being the chosen network. In the routing table example, a packet destined for 10.1.0.3 would use the subnet with the longest prefix (subnet mask), which is the EIGRP route for 10.1.0.0/16 exiting interface Serial 0/0/0.
Routing Redistribution
You are likely to encounter in your Cisco travels certain situations in which you must run multiple routing protocols in your network. For instance, your company is in the process of merging with another company’s network, and their routers are running a different routing protocol than yours. In addition, you may have to connect your Cisco router network to a non-Cisco
routing infrastructure and you are using Cisco proprietary routing protocols.
In instances where you are running multiple routing protocols, it may be necessary to have networks advertised in one routing protocol injected into the other. Unfortunately, because routing protocols are so diverse in nature, they do not inherently interact or exchange information with each other when multiple routing protocols are running in the network. The transferal of network information from one routing protocol into another is a manual configuration called redistribution.
The redistribution configuration is typically done at one or a couple of routers that sit on the boundary between each routing protocol, as illustrated in Figure 10.13. These devices run both routing protocols and must be manually configured to inject the networks learned from one routing protocol into the next. Redistribution can occur in one of two fashions:
- One-way redistribution: Networks from an edge protocol are injected into a more robust core routing protocol, but not the other way around. This method is the safest way to perform redistribution.
- Two-way redistribution: Networks from each routing protocol are injected into the other. This is the least preferred method because it is possible that suboptimal routing or routing loops may occur because of the network design or the difference in convergence times when a topology change occurs. Figure 10.13 is an example of two-way redistribution.
EXAM ALERT
Remember that one-way redistribution translates networks from one routing protocol in another, but not vice versa. Two-way routing redistribution dispenses networks from each routing protocol into the other.