Sources of Routing Information
A router’s routing table can be populated from various sources. As an administrator, you could statically configure a route entry. A route could be learned via a dynamic routing protocol (for example, OSPF or EIGRP), or a router could know how to get to a specific network because the router is physically attached to that network.
Directly Connected Routes
A router that has an interface directly participating in a network knows how to reach that specific destination network. For example, consider Figure 10-5.
In Figure 10-5, router R1’s routing table knows how to reach the 192.168.1.0/24 and 192.168.2.0/30 networks because router R1 has an interface physically attached to each network. Similarly, router R2 has interfaces participating in the 10.1.1.0/30 and 192.168.2.0/30 networks and therefore knows how to reach those networks. The entries currently shown to be in the routing tables of routers R1 and R2 are called directly connected routes.
FIGURE 10-5 Directly Connected Routes
Static Routes
It is also possible to statically configure routes in a router’s routing table. Continuing to expand on the previous example, consider router R1. As shown in Figure 10-6, router R1 does not need knowledge of each route on the Internet. Specifically, router R1 already knows how to reach devices on its locally attached networks. All router R1 really needs to know at this point is how to get out to the rest of the world. As you can see from Figure 10-6, any traffic destined for a nonlocal network (for example, any of the networks available on the public Internet) can simply be sent to router R2. Because R2 is the next router hop along the path to reach all those other networks, router R1 could be configured with a default static route, which says, “If traffic is destined for a network not currently in the routing table, send that traffic out interface Serial 1/1.”
Similarly, router R2 can reach the Internet by sending traffic out its Serial 1/0 interface. However, router R2 does need information about how to reach the 192.168.1.0/24 network available off router R1. To educate router R2 about how this network can be reached, a network administrator can add a static route pointing to 192.168.1.0/24 to router R2’s routing table.
FIGURE 10-6 Static Routes
Dynamic Routing Protocols
In complex networks, such as the topology shown in Figure 10-7, static routing does not scale well. Fortunately, a variety of dynamic routing protocols are available that allow a router’s routing table to be updated as network conditions change.
FIGURE 10-7 Dynamic Routes
In Figure 10-7, router R2 is advertising a default route to its neighbors (routers R1, R3, and R4). What happens if PC1 wants to send traffic to the Internet? PC1’s default gateway is router R3, and router R3 has received three default routes. Which one does it use?
Router R3’s path selection depends on the dynamic routing protocol being used. As you will see later in this chapter, a routing protocol such as Routing Information Protocol (RIP) would make the path selection based on the number of routers that must be used to reach the Internet (that is, hop count). Based on the topology presented, router R3 would select the 128Kbps link (where Kbps stands for kilobits per second, meaning thousands of bits per second) connecting to router R2 because the Internet would be only one hop away. If router R3 instead selected a path pointing to either router R1 or R4, the Internet would be two hops away.
However, based on the link bandwidths, you can see that the path from router R3 to router R2 is suboptimal. Unfortunately, RIP does not consider available bandwidth when making its route selection. Some other protocols, such as Open Shortest Path First (OSPF), can consider available bandwidth when making their routing decisions.
Dynamic routes also allow a router to reroute around a failed link. For example, in Figure 10-8, router R3 prefers to reach the Internet via router R4. However, the link between routers R3 and R4 goes down. Thanks to a dynamic routing protocol, router R3 knows of two other paths to reach the Internet, and it selects the next-best path, which is via router R1 in this example. This process of failing over from one route to a backup route is called convergence.
FIGURE 10-8 Route Redundancy