8 The Routing Table: A Closer Look

8.0 Chapter Introduction

8.0.1 Chapter Introduction

Page 1:
In previous chapters, we examined the routing table using the show ip route command. We saw how directly connected, static, and dynamic routes are added and deleted from the routing table.

As a network administrator, it is important to know the routing table in depth when troubleshooting network issues. Understanding the structure and lookup process of the routing table will help you diagnose any routing table issue - regardless of your level of familiarity with a particular routing protocol. For example, you may encounter a situation in which the routing table has all of the routes you would expect to see, but packet forwarding is not performing as expected. Knowing how to step through the lookup process of a destination IP address for a packet will give you the ability to determine if the packet is being forwarded as expected, if and why the packet is being sent elsewhere, or if the packet has been discarded.

In this chapter, we will take a closer look at the routing table. The first part of the chapter focuses on the structure of Cisco's IP routing table. We will examine the format of the routing table and learn about level 1 and level 2 routes. The second part of the chapter analyzes the lookup process of the routing table. We will discuss classful routing behavior, as well as classless routing behavior, which uses the no ip classless and ip classless commands.

Many of the details regarding the structure and lookup process of the Cisco IP routing table have been omitted from this chapter. If you are interested in reading more about this subject and the inner workings of the Cisco IOS as it pertains to routing, see Cisco IP Routing, by Alex Zinin (ISBN 0-201-60473-6).

Note: This book is not a beginner's book on routing protocols - it is a thorough examination of the protocols, processes, and algorithms used by the Cisco IOS.


8.0.1 - Chapter Introduction
The diagram depicts output from the show i p route command next to a disk storage icon labeled Routing Table Database. In this chapter, you learn to:
- Describe the various route types found in the routing table structure.
- Describe the route lookup process.
- Describe the routing behavior in routed networks.


8.1 The Routing Table Structure

8.1.1 Lab Topology

Page 1:
In this chapter, we will be using a simple three router network, as shown in the figure. R1 and R2 share a common 172.16.0.0/16 network with 172.16.0.0/24 subnets. R2 and R3 are connected by the 192.168.1.0/24 network. Notice that R3 also has a 172.16.4.0/24 subnet that is disconnected, or discontiguous, from the 172.16.0.0 network that R1 and R2 share. The effects of this discontiguous subnet will be examined later in this chapter when we look at the route lookup process.

Click R1 and R3 in the figure.

The interface configurations for R1 and R3 are also shown in the figure. In a later section, we will configure the interfaces for R2.


8.1.1 - Lab Topology
The diagram depicts the lab topology and addressing scheme used in this chapter. The configuration of the FastEthernet and serial interfaces is shown for routers R1 and R3. The diagram is based on the following network topology.

Network Topology:
There are three routers, R1, R2, and R3, and three LAN switches, S1, S2, and S3.
Switch S1 is connected to router R1 interface FA0/0.
Switch S2 is connected to router R2 interface FA0/0.
Router R1 interface S0/0/0 is connected to router R2 interface S0/0/0.
Switch S3 is connected to router R3 interface FA0/0.
Router R2 interface S0/0/1 is connected to router R3 interface S0/0/1.
Switch S4 is connected to R3 interface FA0/0.

Router Interface Addresses:
R1 FA0/0 IP address: 172.16.1.1/24
R1 S0/0/0 IP address: 172.16.2.1/24
R2 FA0/0 IP address: 172.16.3.1/24
R2 S0/0/0 IP address: 172.16.2.2/24
R2 S0/0/1 IP address: 192.168.1.1/24
R3 FA0/0 IP address: 172.16.4.1/24
R3 S0/0/1 IP address: 192.168.1.2/24


8.1.2 Routing Table Entries

Page 1:
The sample routing table in the figure consists of route entries from the following sources:
  • Directly connected networks
  • Static routes
  • Dynamic routing protocols
The source of the route does not affect the structure of the routing table. The figure shows a sample routing table with directly connected, static, and dynamic routes. Notice that the 172.16.0.0/24 subnets have a combination of all three types of routing sources.

Note: The routing table hierarchy in Cisco IOS was originally implemented with the classful routing scheme. Although the routing table incorporates both classful and classless addressing, the overall structure is still built around this classful scheme.


8.1.2 - Routing Table Entries
The diagram depicts a sample routing table that consists of route entries from the following sources:
- Directly connected networks
- Static routes
- Dynamic routing protocols

The following output from the show i p route command is highlighted:
172.16.0.0/24 is subnetted, 4 subnets
S 172.16.4.0 is directly connected, Serial0/0/1
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:08, Serial0/0/0
C 172.16.2.0 is directly connected, Serial0/0/0
C 172.16.3.0 is directly connected, FastEthernet0/0


8.1.3 Level 1 Routes

Page 1:
Routers R1 and R3 already have their interfaces configured with the appropriate IP addresses and subnet masks. We will now configure the interfaces for R2 and use debug ip routing to view the routing table process that is used to add these entries.

The figure shows what happens as the Serial 0/0/1 interface for R2 is configured with the 192.168.1.1/24 address. As soon as no shutdown is entered, the output from debug ip routing shows that this route has been added to the routing table.


8.1.3 - Level 1 Routes
The diagram depicts what happens as the Serial 0/0/1 interface for R2 is configured. As soon as the no shutdown command is entered, the output from the debug i p routing command shows that this route has been added to the routing table.

The following output from the debug i p routing command is highlighted:
RT: add 192.168.1.0/24 via 0.0.0.0, connected metric [0/0]
RT: interface Serial 0/0/1 added to routing table

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 2:
In the figure, show ip route displays the directly connected network in the routing table that we just added to R2.

The Cisco IP routing table is not a flat database. The routing table is actually a hierarchical structure that is used to speed up the lookup process when locating routes and forwarding packets. Within this structure, the hierarchy includes several levels. For simplicity, we will discuss all routes as one of two levels: level 1 or level 2.


8.1.3 - Level 1 Routes
The diagram depicts output from the show i p route command, which displays the directly connected network in the routing table that was added to R2. The following output from the show i p route command is highlighted:

C 192.168.1.0/24 is directly connected, Serial0/0/1

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 3:
Let's learn about level 1 and level 2 routes by reviewing the routing table entry in more detail.

C 192.168.1.0/24 is directly connected, Serial0/0/1

A level 1 route is a route with a subnet mask equal to or less than the classful mask of the network address. 192.168.1.0/24 is a level 1 network route, because the subnet mask is equal to the network's classful mask. /24 is the classful mask for class C networks, such as the 192.168.1.0 network.

A level 1 route can function as a:
  • Default route - A default route is a static route with the address 0.0.0.0/0.
  • Supernet route - A supernet route is a network address with a mask less than the classful mask.
  • Network route - A network route is a route that has a subnet mask equal to that of the classful mask. A network route can also be a parent route. Parent routes will be discussed in the next section.
The source of the level 1 route can be a directly connected network, static route, or a dynamic routing protocol.


8.1.3 - Level 1 Routes
The diagram depicts routing table level 1 routes.

The following output from the show i p route command is highlighted:
C 192.168.1.0/24 is directly connected, Serial0/0/1

192.168.1.0/24 is a level 1 network route, because the subnet mask is equal to the network's classful mask. A level 1 route can function as the following:

Default route - static route with the address 0.0.0.0/0.
Supernet route - a network address with a mask less than the classful mask.
Network route - a network route that has a subnet mask equal to that of the classful mask.


Page 4:
Ultimate Route

The level 1 route 192.168.1.0/24 can be further defined as an ultimate route. An ultimate route is a route that includes:
  • either a next-hop IP address (another path)
  • and/or an exit interface
The directly connected network 192.168.1.0/24 is a level 1 network route because it has a subnet mask that is the same as its classful mask. This same route is also an ultimate route because it contains the exit interface Serial 0/0/1.

C 192.168.1.0/24 is directly connected, Serial0/0/1

We will see in the next topic that level 2 routes are also ultimate routes.


8.1.3 - Level 1 Routes
The diagram depicts the 192.168.1.0/24 level 1 network route as an ultimate route. An ultimate route is a route that includes either a next-hop IP address (another path) or an exit interface. A default route, supernet route, and network route are all ultimate routes.


8.1.4 Parent and Child Routes: Classful Networks

Page 1:
In the previous topic, we saw a level 1 network route that was also an ultimate route. Now let's take a look at another type of level 1 network route, a parent route. The figure shows the configuration of the 172.16.3.1/24 interface on R2 and the output from the show ip route command. Notice that there are actually two additional entries in the routing table. One entry is the parent route and the other entry is the child route. Why are there two entries instead of one?

Click Parent and Child in the figure.

When the 172.16.3.0 subnet was added to the routing table, another route, 172.16.0.0, was also added. The first entry, 172.16.0.0/24, does not contain any next-hop IP address or exit interface information. This route is known as a level 1 parent route.


8.1.4 - Parent and Child Routes: Classful Networks
The diagram depicts a level 1 network parent route. The diagram shows the configuration of the 172.16.3.1/24 interface on R2 and the output from the show i p route command. There are two additional entries in the routing table. One entry is the parent route, and the other entry is the child route.

Level 1 Parent Route. The following output from the show i p route command is highlighted:
172.16.0.0/24 is subnetted, 1 subnets

Level 2 Child Route. The following output from the show i p route command is highlighted:
C 172.16.3.0 is directly connected, FastEthernet0/0

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 2:
A level 1 parent route is a network route that does not contain a next-hop IP address or exit interface for any network. A parent route is actually a heading that indicates the presence of level 2 routes, also known as child routes. A level 1 parent route is automatically created any time a subnet is added to the routing table. In other words, a parent route is created whenever a route with a mask greater than the classful mask is entered into the routing table. The subnet is the level 2 child route of the parent route. In this case, the level 1 parent route that was automatically created is:

172.16.0.0/24 is subnetted, 1 subnets

A level 2 route is a route that is a subnet of a classful network address. Like a level 1 route, the source of a level 2 route can be a directly connected network, a static route, or a dynamic routing protocol. In this case, the level 2 route is the actual subnet route that was added to the network when we configured the FastEthernet 0/0 interface:

C 172.16.3.0 is directly connected, FastEthernet0/0

Note: Remember that the routing table hierarchy in Cisco IOS has a classful routing scheme. A level 1 parent route is the classful network address of the subnet route. This is the case even if a classless routing protocol is the source of the subnet route.


8.1.4 - Parent and Child Routes: Classful Networks
The diagram depicts the 172.16.3.0/24 level 2 route, which is a subnet of the level 1 parent route of 172.16.0.0/24, a classful network address. In this case, the level 2 route is the subnet route that was added to the network when the FastEthernet 0/0 interface was configured.


Page 3:
Click Play to view the animation.

Let's analyze the routing table entries for both the level 1 parent route and the level 2 child route (subnet).

Level 1 Parent Route

This parent route contains the following information:
  • 172.16.0.0 - The classful network address for our subnet. Remember, the Cisco IP routing table is structured in a classful manner.
  • /24 - The subnet mask for all of the child routes. If the child routes have variable length subnet masks (VLSM), the subnet mask will be excluded from the parent route and included with the individual child routes. This will be shown in a later section.
  • is subnetted, 1 subnet - This part of the route specifies that this is a parent route and in this case has one child route, that is, 1 subnet.
Level 2 Child Route

The second entry, 172.16.3.0, is the actual route for our directly connected network. This is a level 2 route, also known as a child route, and contains the following information:
  • C - The route code for directly connected network.
  • 172.16.3.0 - The specific route entry.
  • is directly connected - Along with the route code of C, this specifies that this is a directly connected network with an administrative distance of 0.
  • FastEthernet0/0 - The exit interface for forwarding packets that match this specific route entry.
The level 2 child route is the specific route entry for the 172,16.3.0/24 subnet. Notice that the subnet mask is not included with the subnet, the level 2 child route. The subnet mask for this child route (subnet) is the /24 mask included in its parent route, 172.16.0.0.

Level 2 child routes contain the route source and the network address of the route. Level 2 child routes are also considered ultimate routes because they will contain the next-hop IP address and/or exit interface.


8.1.4 - Parent and Child Routes: Classful Networks
The animation depicts parent and child route component details for the previous entries described.

Classful network: 172.16.0.0
Subnet mask for child routes: /24
Parent route with one child: is subnetted
Source is connected route: C
Specific child route: 172.16.3.0
Exit interface: FastEthernet0/0


Page 4:
The figure shows the configuration of the Serial 0/0/0 interface on R2.

Click 2 and 3 in the figure.

The routing table shows two child routes for the same 172.16.0.0/24 parent route. Both 172.16.2.0 and 172.16.3.0 are members of the same parent route, because they are both members of the 172.16.0.0/16 classful network.


8.1.4 - Parent and Child Routes: Classful Networks
The diagram depicts adding another child route by configuring the Serial 0/0/0 interface on R2. The routing table shows two child routes, 172.16.2.0 and 172.16.3.0, for the same 172.16.0.0/24 parent route.

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 5:
Because both child routes have the same subnet mask, the parent route still maintains the /24 mask, but now shows 2 subnets. The role of the parent route will be examined when we discuss the route lookup process.

Note: If there is only a single level 2 child route and that route is removed, the level 1 parent route will be automatically deleted. A level 1 parent route exists only when there is at least one level 2 child route.


8.1.4 - Parent and Child Routes: Classful Networks
The diagram depicts the routing table parent-child relationship.

Parent route:
172.16.0.0/24 is subnetted, 2 subnets
Child routes:
C 172.16.2.0 is directly connected, Serial0/0/0
C 172.16.3.0 is directly connected, FastEthernet0/0


8.1.5 Parent and Child Routes: Classless Networks

Page 1:
For this discussion, we will use the topology shown in the figure. Using RouterX with the VLSM configuration shown, we can examine the effect of VLSM on the routing table. RouterX has three directly connected networks. All three subnets belong to the classful network 172.16.0.0/16 and are therefore level 2 child routes.

Click 2, 3, and 4 in the figure.

Notice that our child routes do not share the same subnet mask, as was in the case in the classful example. In this case, we are implementing a network addressing scheme with VLSM.

Click 1 in the figure.

Whenever there are two or more child routes with different subnet masks belonging to the same classful network, the routing table presents a slightly different view, which states that this parent network is variably subnetted.

Although the parent/child relationship uses a classful structure to display networks and their subnets, this format can be used with both classful and classless addressing. Regardless of the addressing scheme used by the network (classless or classful), the routing table will use a classful scheme.


8.1.5 - Parent and Child Routes: Classless Networks
The diagram depicts parent and child routes with VLSM.

The level 1 parent route is highlighted:
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks

The following level 2 child routes are highlighted:
C 172.16.1.4/30 is directly connected, Serial0/0/0
C 172.16.1.8/30 is directly connected, Serial0/0/1
C 172.16.3.0/24 is directly connected, FastEthernet0/0

The diagram is based on the following network topology.

Network Topology:
Router X has three interfaces, FA0/0, S0/0/0, and S0/0/1. FA0/0, with IP address 172.16.3.1/24, is connected to a switch. S0/0/0, with IP address 172.16.1.5/30, is connected to a WAN link. S0/0/1, with IP address 172.16.1.9/30, is connected to a WAN link.


Page 2:
Click Play to view the animation.

There are several distinct differences with this parent route and its child routes compared to the classful example discussed earlier. First, the parent route of 172.16.0.0 now contains the classful mask /16. In the classful example earlier, the classful mask was not displayed.

Also notice that the parent route states that the child routes are "variably subnetted". Like the classful example, the parent route displays the number of subnets, but now it also includes the number of different masks of the child routes.

The final difference between classful and classless networks exists in the child routes. Each child route now contains the subnet mask for that specific route. In the non-VLSM example, both child routes shared the same subnet mask and the parent displayed their common subnet mask. With VLSM, the various subnet masks are displayed with the specific child routes.

The parent route contains the following information:
  • 172.16.0.0 - The parent route, the classful network address associated with all child routes.
  • /16 - The classful subnet mask of the parent route.
  • variably subnetted - States that the child routes are variably subnetted and that there are multiple masks for this classful network.
  • 3 subnets, 2 masks - Indicates the number of subnets and the number of different subnet masks for the child routes under this parent route.
Using one of the child routes as an example, we can see the following information:
  • C - The route code for a directly connected network.
  • 172.16.1.4 - The specific route entry.
  • /30 - The subnet mask for this specific route.
  • is directly connected - Along with the route code of C, specifies that this is a directly connected network with an administrative distance of 0.
  • Serial0/0/0 - The exit interface for forwarding packets that match this specific route entry.
So, why does Cisco use the classful routing table format? We will understand the answer to this in the following sections when the route lookup process is discussed.


8.1.5 - Parent and Child Routes: Classless Networks
The animation depicts parent and child route component details in a classless environment.

Classful parent route: 172.16.0.0
Classful mask: /16
Child routes have different masks: variably subnetted
Number of subnet and masks for this parent route: 3 subnets, 2 masks
Source is connected route: C
Child route (one of three): 172.16.3.0
Mask for the child route (one of two): /24
Exit interface (one of three): FastEthernet0/0


8.2 Routing Table Lookup Process

8.2.1 Steps in the Route Lookup Process

Page 1:
In this topology, RIPv1, a classful routing protocol, is now configured. Notice that we have specifically chosen a classful routing protocol with our discontiguous 172.16.0.0 subnets. The reason for this will become evident in a later section.

Click the buttons in the figure to review the RIP configuration and resulting routing tables.

As you would expect with this addressing scheme and a classful routing protocol, there are reachability problems. Neither R1 nor R2 has a route to 172.16.4.0. Also, R3 does not have routes to subnets 172.16.1.0/24, 172.16.2.0/24, or 172.16.3.0/24.

Let's examine in more depth how the routers determine the best routes to use when sending packets and why classful routing protocols do not work with discontiguous designs. We will consider:

1. What happens when a router receives an IP packet, examines the IP destination address, and looks that address up in the routing table?

2. How does the router decide which route in the routing table is the best match?

3. What effect does the subnet mask have on the routing table lookup process?

4. How does the router decide whether or not to use a supernet or default route if a better match is not found?

Let's begin to answer these questions by examining the steps in the route lookup process.


8.2.1 - Steps in the Route Lookup Process
The diagram depicts a discontiguous subnet topology configured with RIP v1, a classful routing protocol. The diagram shows the RIP configuration and resulting routing tables. This addressing scheme and classful routing protocol have reachability problems. Neither R1 nor R2 has a route to 172.16.4.0. Also, R3 does not have routes to subnets 172.16.1.0/24, 172.16.2.0/24, or 172.16.3.0/24.

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 2:
The Route Lookup Process

Follow these steps in the figure to see the route lookup process. Don't worry about fully understanding the steps right now. You will better understand this process when we examine a few examples in the following sections.

Click Step 1.

The router examines level 1 routes, including network routes and supernet routes, for the best match with the destination address of the IP packet.

Click Step 1a.

If the best match is a level 1 ultimate route - a classful network, supernet, or default route - this route is used to forward the packet.

Click Step 1b.

If the best match is a level 1 parent route, proceed to Step 2.

Click Step 2.

The router examines child routes (the subnet routes) of the parent route for a best match.

Click Step 2a.

If there is a match with a level 2 child route, that subnet will be used to forward the packet.

Click Step 2b.

If there is not a match with any of the level 2 child routes, proceed to Step 3.Click Step 3.Is the router implementing classful or classless routing behavior?

Click Step 3a.

Classful routing behavior: If classful routing behavior is in effect, terminate the lookup process and drop the packet.

Click Step 3b.

Classless routing behavior: If classless routing behavior is in effect, continue searching level 1 supernet routes in the routing table for a match, including the default route, if there is one.

Click Step 4.

If there is now a lesser match with a level 1 supernet or default routes, the router uses that route to forward the packet.

Click Step 5.

If there is not a match with any route in the routing table, the router drops the packet.

Classful and classless routing behavior will be discussed in more detail in a later section.

Note: A route referencing only a next-hop IP address and not an exit interface must be resolved to a route with an exit interface. A recursive lookup is performed on the next-hop IP address until the route is resolved to an exit interface.


8.2.1 - Steps in the Route Lookup Process
The diagram depicts the routing table lookup process as described below.

Step 1. Examines level 1 routes for the best match with the packet's destination address.

Step 1a. If the best match is a level 1 ultimate route, use it to forward the packet.

Step 1b. If the best match is a level 1 parent route, proceed to Step 2.

Step 2. Child routes are examined for a best match.

Step 2a. Match! Use this subnet to forward the packet.

Step 2b. No match. Proceed to Step 3.

Step 3. Classful or classless routing behavior?

Step 3a. Classful routing behavior: Drop the packet.

Step 3b. Classless routing behavior: search level 1 routes.

Step 4. Match with a level 1 supernet or default route. Use it to forward the packet. Supernet routes are checked first, and then default routes are checked if necessary.

Step 5. No match, and no default route is found; therefore, drop the packet.


8.2.2 Longest Match: Level 1 Network Routes

Page 1:
Longest Match

The term best match was used in the previous route lookup discussion. What is meant by the best match? Best match is also referred to as longest match.

First of all, what is a match? For there to be a match between the destination IP address of a packet and a route in the routing table, a minimum number of left-most bits must match between the IP address of the packet and the route in the routing table. The subnet mask of the route in the routing table is used to determine the minimum number of left-most bits that must match. (Remember, an IP packet only contains the IP address and not the subnet mask.)

The best match or longest match is the route in the routing table that has the most number of left-most matching bits with the destination IP address of the packet. The route with the most number of equivalent left-most bits, or the longest match, is always the preferred route.

For example, in the figure we have a packet destined for 172.16.0.10. Many possible routes could match this packet. Three possible routes are shown that do match this packet: 172.16.0.0/12, 172.16.0.0/18, and 172.16.0.0/26. Of the three routes, 172.16.0.0/26 has the longest match. Remember, for any of these routes to be considered a match there must be at least the number of matching bits indicated by the subnet mask of the route.


8.2.2 - Longest Match: Level 1 Network Routes
The diagram depicts the longest bit match as the preferred route.

IP Packet Destination: 172.16.0.10

Route 1: 172.16.0.0/12 matches the first 12 bits.

Route 2: 172.16.0.0/18 matches the first 18 bits.

Route 3: 172.16.0.0/26 matches the first 26 bits. This route has the longest bit match to the IP packet destination and is the preferred route.


Page 2:
Example: Level 1 Ultimate Route

The subnet mask that is used to determine the longest match is not always obvious. Let's examine this concept in more detail, using several examples.

Click Play to view the animation.

In this example, PC1 sends a ping to 192.168.1.2, the interface on R3. R1 receives the packet.

Click Route Info and then R1 Routing Table in the figure.

Remember the first part of Step 1 in the route lookup process? The figure demonstrates this step.

Click Step 1 in the figure.

The router first examines level 1 routes for the best match. In our example, there is a match between the destination IP address 192.168.1.2 and the level 1 ultimate route of 192.168.1.0/24.

Click Step 1a in the figure.

R 192.168.1.0/24 [120/1] via 172.16.2.2, 00:00:25, Serial0/0/0

R1 uses this route and forwards the packet out interface Serial 0/0/0.


8.2.2 - Longest Match: Level 1 Network Routes
The animation depicts an example of a level 1 ultimate route lookup. In this example, PC1 sends a ping to 192.168.1.2, the interface on R3. R1 receives the packet and examines level 1 routes for the best match. In this example, there is a match between the destination IP address 192.168.1.2 and the level 1 ultimate route of 192.168.1.0/24. R1 uses this route and forwards the packet out interface Serial 0/0/0.

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 3:
Why is there a match with the 192.168.1.0/24 level 1 route and not with one of the 172.16.0.0 subnets? This may seem obvious. We say, "Of course the router will use 192.168.1.0/24." But the lookup process is comparing 32 bit addresses with 32 bit route entries, looking for the longest match.

The algorithm used by the IOS to search the routing table is beyond the scope of this chapter. What is important is to understand why a route entry matches or doesn't match the packet's destination IP address.

Why is there not a match with any of the 172.16.0.0/24 subnets in the routing table?

The 172.16.0.0/24 is a parent route of three subnets or child routes. Before a child route is examined for a match, there must be at least a match between the destination IP address of the packet and the classful address of the parent route, or 172.16.0.0/16.

Do at least 16 of the left-most bits of the parent route match the first 16 bits of the packet's destination IP address of 192.168.1.2? The answer, no, is obvious to us. But in the figure, you will see that the router actually checks the first bit and finds a match. The router then moves to the second bit. Because there is not a match, the lookup process will search other route entries.


8.2.2 - Longest Match: Level 1 Network Routes
The diagram depicts the process by which the router rejects the 172.16.0.0/16 level 1 parent route as a match.

Destination of IP Packet: 192.168.1.2
First eight bits of the packet: 11000000

Level 1 Parent Route: 172.16.0.0/16
First eight bits of the route: 10101100

Humans see dotted-decimal addresses. The router sees bits, and checks the bits for a match starting from the left. Only one bit matches. The second bit does not match. The mask is /16, therefore the first 16 bits must match. The router skips this route and moves to the next route entry.


Page 4:
Now let's see how the router finds a match between the packet's destination IP address of 192.168.1.2 and the next route in the routing table, 192.168.1.0/24, an ultimate route.

R 192.168.1.0/24 [120/1] via 172.16.2.2, 00:00:25, Serial0/0/0

The route, 192.168.1.0, is a level 1 ultimate route and, therefore, it also contains the subnet mask, /24. In the figure, notice that at least the first 24 left-most bits match.

Not only does the minimum of 24 bits match, but a total of 30 bits match, as shown in the figure. Is this important? As we will see later, there can be situations in which there are multiple potential routes with different subnet masks in the routing table for the same destination IP address. Which one is the preferred route? The one with the most number of matching bits, the longest match.

In this example, there is a match between the destination IP address 192.168.1.0 and the level 1 ultimate route 192.168.1.0/24. Because there is not a longer, more specific match, the packet is forwarded out the exit interface Serial 0/0/0.

Note: Remember that the route lookup process will need to do a recursive lookup on any route that references only a next-hop IP address and not an exit interface. For a review of recursive lookups, refer to Chapter 2, "Static Routing."


8.2.2 - Longest Match: Level 1 Network Routes
The diagram depicts the process by which the router chooses the 192.168.1.0/24 level 1 ultimate route as a match.

Destination of IP Packet: 192.168.1.2
Bits in address: 11000000.10101000.00000001.00000010

Level 1 Route: 192.168.1.0/24
Bits in route: 11000000.10101000.00000001.00000000

The router checks the bits for a match starting from the left. The first 24 bits match. The router forwards the packet out Serial0/0/0. The next 6 bits match too, but the mask does not require that they be checked.


8.2.3 Longest Match: Level 1 Parent and Level 2 Child Routes

Page 1:
Let's examine what happens when there is a match with a level 1 parent route.

Click Route Info in the figure.

As shown in the figure, a parent route does not include a next-hop address or an exit interface but is only a "header" for its level 2 child routes, the subnets.

The subnet mask for the child routes - /24 in the figure - is displayed in the parent route, 172.16.0.0, for subnets that use the same subnet mask.

Before any level 2 child routes are examined for a match, there must first be a match between the classful address of the level 1 parent route and the destination IP address of the packet.


8.2.3 - Longest Match: Level 1 Parent and Level 2 Child Routes
The diagram depicts how the level 1 parent route must match before the level 2 child routes are checked. The following output for the show i p route command is highlighted.

172.16.0.0/24 is subnetted, 3 subnets

This is the level 1 parent route header for the child route.

The diagram is based on the network topology described in 8.1.1 diagram 1.


Page 2:
Example: Level 1 Parent Route and Level 2 Child Routes

In the example in the figure, PC1 sends a ping to PC2 at 172.16.3.10. R1 receives the packet and begins to search the routing table for a route.

Click Step 1b in the figure.

The first match that occurs is with the level 1 parent route, 172.16.0.0. Remember, with non-VLSM subnets the classful mask of the parent is not displayed. Before any child routes (subnets) are examined for a match, there must first be a match with the classful address of the parent route.

Because the first route entry is a level 1 parent route that matches the destination address (Step 1b of the route lookup process), the route lookup process moves to Step 2.

Click Step 2 in the figure.

Because there is a match with the parent route, the level 2 child routes will be examined for a match. However, this time the actual subnet mask of /24 is used for the minimum number of left-most bits that must match.

Click Step 2a in the figure.

The route lookup process searches the child routes for a match. In this case, there must be a minimum of 24 bits that match.


8.2.3 - Longest Match: Level 1 Parent and Level 2 Child Routes
The diagram depicts the selection process, with an example of a level 1 parent route and level 2 child routes.

The diagram is based on the network topology described in 8.1.1 diagram 1.

Step 1. PC1 sends a ping to PC2 at 172.16.3.10. R1 receives the packet and begins to search the routing table for a route.

Step 2. The first match that occurs is with the level 1 parent route, 172.16.0.0.

Step 3. Because there is a match with the parent route, the level 2 child routes are examined for a match. The subnet mask of /24 is used for the minimum number of leftmost bits that must match.

Step 4. The route lookup process searches the child routes for a match and finds one with the network 172.16.3.0 route.


Page 3:
Let's see how the router finds a match with one of the level 2 child routes.

First, the router examines the parent route for a match. In this example, the first 16 bits of the IP address must match that of the parent route. The left-most 16 bits must match because that is the classful mask of the parent route, /16.

If there is a match with the parent route, then the router checks the 172.16.1.0 route. Child routes are only examined when there is a match with the classful mask of the parent.

Click 2 in the figure.

Checking the first subnet, 172.16.1.0, the 23rd bit does not match; therefore, this route is rejected because the first 24 bits do not match.

Click 3 in the figure.

Next, the router checks the 172.16.2.0/24 route. Because the 24th bit does not match, this route is also rejected. All 24 bits must match.

Click 4 in the figure.

The router checks the last child route for 172.16.3.0/24 and finds a match. The first 24 bits do match. The routing table process will use this route, 172.16.3.0/24, to forward the packet with the destination IP address of 172.16.3.10 out the exit interface of Serial 0/0/0.

R 172.16.3.0 [120/1] via 172.16.2.2, 00:00:25, Serial0/0/0

What happens if the router does not have a route? Then it discards the packet.


8.2.3 - Longest Match: Level 1 Parent and Level 2 Child Routes
The diagram depicts the process of the router rejecting the level 2 child routes.

Destination of IP Packet: 172.16.3.10
First 24 bits of the packet: 10101100.00010000.00000011

Level 1 parent route: 172.16.0.0/16
First 16 bits of the route: 10101100.00010000
The first 16 bits match the parent route.

First level 2 child route: 172.16.1.0/24
First 24 bits of the route: 10101100.00010000.00000001
The 23rd bit does not match. The first 24 bits must match. The router skips this route and moves to the next route entry.

Second level 2 child route: 172.16.2.0/24
First 24 bits of the route: 10101100.00010000.00000010
The 24th bit does not match. The first 24 bits must match. The router skips this route and moves to the next route entry.

Third level 2 child route: 172.16.3.0/24
First 24 bits of the route: 10101100.00010000.00000011
The first 24 bits match, and this route is used.


Page 4:
Example: Route Lookup Process with VLSM

What about our RouterX topology, which is using a VLSM addressing scheme? How does this change the lookup process?

Click 1 in the figure.

Using VSLM does not change the lookup process. With VLSM, the /16 classful mask is displayed with the level 1 parent route (172.16.0.0/16 in the figure).

Click 2, 3, and 4 in the figure.

As with non-VLSM networks, if there is a match between the packet's destination IP address and the classful mask of the level 1 parent route, the level 2 child routes will be searched.

The only difference with VLSM is that child routes display their own specific subnet masks. These subnet masks are used to determine the number of left-most bits that must match the packet's destination IP address. For example, for there to be a match with the 172.16.1.4 child route, a minimum of 30 left-most bits must match because the subnet mask is /30.


8.2.3 - Longest Match: Level 1 Parent and Level 2 Child Routes
The diagram depicts the route lookup process with VLSM. As with non-VLSM networks, if there is a match between the packet's destination IP address and the classful mask of the level 1 parent route, the level 2 child routes are searched. The only difference with VLSM is that child routes display their own specific subnet masks. The output from the show i p route output is displayed. The diagram is based on the following network topology.

Network Topology:
Router X has three interfaces. FA0/0, with IP address 172.16.3.1/24, is connected to a switch. S0/0/0, with IP address 172.16.1.5/30, is connected to a WAN link. S0/0/1, with IP address 172.16.1.9/30, is connected to a WAN link.

The Level 1 parent route is highlighted:
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks

The following Level 2 child routes are highlighted:
C 172.16.1.4/30 is directly connected, Serial0/0/0
C 172.16.1.8/30 is directly connected, Serial0/0/1
C 172.16.3.0/24 is directly connected, FastEthernet0/0


8.3 Routing Behavior

8.3.1 Classful and Classless Routing Behavior

Page 1:
The next step in the route lookup process (Step 3) looks at routing behavior. Routing behavior influences the process of searching for the preferred route using the no ip classless or ip classless commands.

Classless and classful routing behaviors are not the same as classless and classful routing protocols. Classful and classless routing protocols affect how the routing table is populated. Classful and classless routing behaviors determine how the routing table is searched after it is populated. In the figure, the routing sources (including classful and classless routing protocols) are the inputs used to populate the routing table. The routing behavior, specified by the ip classless or no ip classless commands, determines how the route lookup process will proceed at Step 3.

As you can see, routing protocols and routing behaviors are completely independent of each other. The routing table could be populated with routes from a classless routing protocol like RIPv2 yet implement classful routing behavior because the no ip classless command is configured.


8.3.1 - Classful and Classless Routing Behavior
The diagram depicts routing protocols and routing behaviors. Routing sources (including protocols) are used to build the routing table. Multiple sources and routing protocols can be used. The following routing sources are listed:

Directly Connected Networks
Static Routes
Classful Routing Protocols
- RIP v1
- IGRP
Classless Routing Protocols
- RIP v2
- EIGRP
- OSPF
- I S-I S

Routing behaviors are used to locate information in the routing table. Only a single routing behavior can be used. Routing behaviors include:
Classful
- no i p classless
IP Classless
- i p classless


Page 2:
Topology Changes

In Chapter 7, "RIPv2," we learned that classful routing protocols like RIPv1 do not support discontiguous networks. Even though our current topology has discontiguous networks, we can configure static routes to reach those networks.

Click R2 Configuration in the figure.

First, we add a static "quad-zero" route on R2 for sending default traffic to R3. We then add the default-information originate command to the RIP routing process so that R2 will send R1 the default route. This will allow R1 and R2 the capability of reaching all other networks, including 172.16.4.0/24 on R3. Finally, we enter the command no network 192.168.1.0 because we no longer want to exchange RIP updates with R3.

Click R3 Configuration in the figure.

To finish our configuration, we remove RIP routing on R3 and add a static route on R3 for sending traffic for the major network 172.16.0.0/16, which does not have a longer match in the routing table, to R2.

We are not going to test the connectivity at this time. Connectivity will be tested in the following sections.


8.3.1 - Classful and Classless Routing Behavior
The diagram depicts using a static default route and a regular static route to overcome the limitations of RIP v1 with discontiguous networks.

First, a static quad-zero route is added on R2 for sending default traffic to R3. The default-information originate command is added to the RIP routing process so that R2 will send R1 the default route. The no network 192.168.1.0 command is issued on R2 to prevent the exchange of RIP updates with R3.

To finish the configuration, RIP routing is removed on R3 with the no router rip command. A static route is added on R3 for sending traffic to the 172.16.0.0/16 major network on R1 and R2.

The following R2 show i p route output is highlighted:
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
S* 0.0.0.0/0 is directly connected, Serial0/0/1

The following R3 show i p route output is highlighted:
S 172.16.0.0/16 is directly connected, Serial0/0/1

The diagram is based on the network topology described in 8.1.1 diagram 1.


8.3.2 Classful Routing Behavior: no ip classless

Page 1:
We now focus on Step 3 in the route lookup process. Namely, what happens after Step 2b when there is not a match with any of the level 2 child routes of the parent. Later, you will see a specific example.

As you recall from the previous section, in Steps 1 and 2, the router examines level 1 and child routes looking for the best match with the IP packet's destination address. Let's assume there is no match and resume our review of the route lookup process with Step 3.

Click through Steps 3 and 3a in the figure to review how classful routing behavior impacts the route lookup process.

Click Step 3 in the figure.

Is the router implementing classful or classless routing behavior?

Click Step 3a in the figure.

If classful routing behavior is in effect, terminate the lookup process and drop the packet.

Note: Under classful routing behavior, the process never goes to Step 4.


8.3.2 - Classful Routing Behavior: no i p classless
The diagram depicts the route table lookup process behavior with a classful routing protocol.

The router examines the level 1 parent route and level 2 child routes, looking for the best match with the IP packet's destination address. If there is no match with the level 2 child routes and the router is implementing classful routing behavior, the lookup process is terminated and the packet is dropped.


Page 2:
Prior to IOS 11.3, no ip classless was the default behavior for Cisco routers. The command no ip classless means that the route lookup process uses classful routing table lookups by default. This will be explained in the following sections.

The commands no ip classless and ip classless are global configuration commands and can be viewed by typing show running-config. In IOS versions 11.3 and later, the command ip classless is the default, implementing a classless route lookup process.

What is the effect of classful routing behavior when all the routers are configured with the no ip classless command?

R1(config)#no ip classless
R2(config)#no ip classless
R3(config)#no ip classless


Let's examine what happens when the router is performing classful routing behavior - that is, when the no ip classless command is configured.


8.3.2 - Classful Routing Behavior: no i p classless
The diagram depicts the R2 running configuration output with the no i p classless command highlighted.


8.3.3 Classful Routing Behavior - Search Process

Page 1:
In our routing table lookup process, Step 3a states that when classful routing behavior is in effect (no ip classless) the process will not continue searching level 1 routes in the routing table. If a packet doesn't match a child route for the parent network route, then the router drops the packet. Let's see an example.

Example: R2 operating with Classful Routing Behavior

In this example, R2 receives a packet destined for PC3 at 172.16.4.10.

Click R2 Routing Table and Parent in the figure.

The routing process searches the routing table and finds a 16-bit match with the parent route 172.16.0.0, as shown in the figure. According to Step 1b of the routing process, if a match is made in the parent route, the child routes are checked.

Now let's look at the actual bit-matching process that is taking place as the child routes are checked.

Click 1, 2, and 3 in the figure.

Notice that none of the 24 left-most bits of the child routes matches the destination IP address of 172.16.4.10. At most, only 21 bits match. There is no match with the level 2 child routes.



8.3.3 - Classful Routing Behavior - Search Process
The diagram depicts an example of a router operating with classful routing behavior using the no i p classless command.

The diagram is based on the network topology described in 8.1.1 diagram 1, except that there is a static route from R3 to R2 and a default route from R2 to R3.

In this example, R2 receives a packet destined for PC3 at 172.16.4.10. The routing process searches the routing table and finds a 16-bit match with the parent route 172.16.0.0. Because a match was made in the parent route, the child routes are checked.

In the bit-matching process, the child routes are checked. None of the 24 leftmost bits of the child routes matches the destination IP address of 172.16.4.10. At most, only 21 bits match. There is no match with the level 2 child routes.


Page 2:
So what happens next? Router R2 drops the packet.

Click No Matches in the figure.

Because router R2 is using classful routing behavior, no ip classless, the router will not search beyond the child routes for a lesser match.

Click Drop Packet in the figure.

The routing table process will not use the default route, 0.0.0.0/0, or any other route.

A common error is to assume that a default route will always be used if the router does not have a better route. In our example, R2's default route is not examined nor used, although it is a match. This is often a very surprising result when a network administrator does not understand the difference between classful and classless routing behavior.

Note: We will also see another example in Chapter 9 EIGRP where understanding the routing table lookup process will assist you in troubleshooting why a default route does not get used - even with classless routing behavior.

Why does classful routing behavior perform like this? The general idea of classful routing behavior comes from the time when all networks were of a classful nature. At the beginning of the Internet's growth, an organization received a class A, class B, or class C major network address. Once an organization had a classful IP major network address, that organization would also administer all of the subnets for that classful address. All routers belonging to the organization would know about all of the subnets for the major network. If a subnet was not in the routing table, then the subnet did not exist. As you learned in Chapter 6, "VLSM and CIDR," IP addresses are no longer allocated based on class.


8.3.3 - Classful Routing Behavior - Search Process
The diagram depicts that, with a classful routing protocol, the packet is dropped if there is no match with the level 2 child routes. Even if there is a default route or other level 1 route, it is not used.

The diagram is based on the network topology described in 8.1.1 diagram 1, except that there is a static route from R3 to R2, and a default route from R2 to R3.


8.3.4 Classless Routing Behavior: ip classless

Page 1:
Starting with IOS 11.3, Cisco changed the default routing behavior from classful to classless. The ip classless command is configured by default. The show running-config command displays the routing behavior. Classless routing behavior means that the routing process no longer assumes that all subnets for a major classful network can only be reached within the child routes of the parent. Classless routing behavior works well for discontiguous networks and CIDR supernets.

In this section, we will examine the effect of classless routing behavior. All routers are configured with the ip classless command.

R1(config)#ip classless
R2(config)#ip classless
R3(config)#ip classless


We will discuss what happens to a packet when there is a match with a level 1 parent route but there is not a match with any of the level 2 child routes or subnets. This takes us to Step 3b, Classless routing behavior.


8.3.4 - Classless Routing Behavior: i p classless
The diagram depicts an example of a router operating with classless routing behavior using the i p classless command.


Page 2:
As you recall from the routing table process, in Steps 1 and 2, the routing table process examines level 1 and level 2 child routes looking for the best match with the IP packet's destination address. Let's assume there is no match and resume our review of the route lookup process with Step 3.

The Route Lookup Process:

Follow these steps in the figure to see the route lookup process:

Click Step 3.

Is the router implementing classful or classless routing behavior?

Click Step 3a.

Classful routing behavior: If classful routing behavior is in effect, terminate the lookup process and drop the packet.

Click Step 3b.

Classless routing behavior: If classless routing behavior is in effect, continue searching level 1 supernet routes in the routing table for a match, including the default route, if there is one.

Click Step 4.

If there is now a lesser match with a level 1 supernet or default routes, the router uses that route to forward the packet.

Click Step 5.

If there is not a match with any route in the routing table, the router drops the packet.


8.3.4 - Classless Routing Behavior: i p classless
The diagram depicts the routing table lookup process with classless routing behavior in which there is no match with the level 2 child routes and a default route exists. If classless routing behavior is in effect, the router continues searching level 1 supernet routes in the routing table for a match, including the default route, if there is one. If there is now a lesser match with a level 1 supernet or default routes, the router uses that route to forward the packet. If there is not a match with any route in the routing table, the router drops the packet.


8.3.5 Classless Routing Behavior - Search Process

Page 1:
Let's revisit our sample topology and look at the bit matching that happens when classless routing behavior (ip classless) is in effect.

Example: R2 Operating with Classless Routing Behavior

Click R2 Routing Table and Parent in the figure.

Again, R2 receives a packet destined for PC3 at 172.16.4.10. Just as it did with the classful routing behavior, the router searches the routing table and finds a 16-bit match with the parent route 172.16.0.0, as shown in the figure. According to Step1b of the routing process, if there is a match with a parent route, then the child routes are checked.

Click 1, 2, 3 in the figure.

As before, none of the 24 left-most bits of the child routes matches the destination IP address of 172.16.4.10. At most, only 21 bits match. There is no match with the level 2 child routes.


8.3.5 - Classless Routing Behavior - Search Process
The diagram depicts router R2 operating with classless routing behavior. The diagram is based on the network topology described in 8.1.1 diagram 1, except that there is a static and default route.

Router R2 receives a packet destined for PC3 at 172.16.4.10. The router searches the routing table and finds a 16-bit match with the parent route 172.16.0.0. Because there is a match with a parent route, the child routes are checked. As before, none of the 24 leftmost bits of the child routes match the destination IP address of 172.16.4.10. At most, only 21 bits match. There is no match with the level 2 child routes.


Page 2:
Because we are using classless routing behavior (ip classless), the router continues searching the routing table, beyond this parent route and its child routes. The routing process will continue to search the routing table for a route with a subnet mask fewer than the 16 bits of the previous parent route. In other words, the router will now continue to search the other routes in the routing table where there may be fewer bits that match, but still a match.

Click Network Route in the figure.

The 192.168.1.0/24 route does not have 24 left-most bits that match the destination IP address.

C 192.168.1.0/24 is directly connected, Serial0/0/1

Click Default Route in the figure.

How about the default route? How many bits need to match?

S* 0.0.0.0/0 is directly connected, Serial0/0/1

The mask is /0, which means that zero or no bits need to match. A default route will be the lowest-bit match. In classless routing behavior, if no other route matches, the default route will match.

Click Forward Packet in the figure.

In this case the router will use the default route, because it is the best match. The packet will be forwarded out the Serial 0/0/1 interface.

Classful Route on R3

Click R3 Routing Table in the figure.

What does R3 do with return traffic back to PC2 at 172.16.2.10? In the figure, you'll see that in the routing table for R3, both the 172.16.4.0/24 subnet route and the 172.16.0.0/16 classful network route are level 2 child routes of the 172.16.0.0/16 parent route. Whenever there are routes for both the subnets of a classful network and a route for the classful network route itself, the classful route is considered a level 2 child route, just like the subnets.

In this case, R3 uses the 172.16.0.0/16 child route and forwards the traffic out Serial 0/0/1 back to R2.


8.3.5 - Classless Routing Behavior - Search Process
The diagram depicts the example previously described except, with classless routing behavior, the router searches level 1 routes and is able to use the default route to forward the packet.

When using the level 1 default route of 0.0.0.0/0, the /0 mask means that no bits have to match to use it as the default route. As a result, router R2 uses this default route and forwards the packet.

The diagram is based on the network topology described in 8.1.1 diagram 1, except there is a static and default route.


Page 3:
Classful vs. Classless Routing Behavior in the Real World

Remember that classful and classless routing behaviors are independent from classful and classless routing protocols. A router could be configured with classful routing behavior (no ip classless) and a classless routing protocol, such as RIPv2. A router could also be configured with classless routing behavior (ip classless) and a classful routing protocol, such as RIPv1.

In today's networks, it is recommended to use classless routing behavior so that supernet and default routes can be used whenever needed.


8.3.5 - Classless Routing Behavior - Search Process
The diagram depicts routing protocols and routing behaviors. Routing sources (including protocols) are used to build the routing table. Multiple sources and routing protocols can be used. The following routing sources are listed:

Directly Connected Networks
Static Routes
Classful Routing Protocols
- RIP v1
- IGRP
Classless Routing Protocols
- RIP v2
- EIGRP
- OSPF
- I S-I S

Routing behaviors are used to locate information in the routing table. Only a single routing behavior can be used. Routing behaviors include.
Classful
- no i p classless
IP Classless
- i p classless


8.4 Routing Table Labs

8.4.1 Investigating the Routing Table Lookup Process

Page 1:
In this lab, you will be able to investigate classless and classful routing behavior.

Click the lab icon for more details.


8.4.1 - Investigating the Routing Table Lookup Process
Link to Hands-on Lab: Investigating the Routing Table Lookup Process.

In this lab, you investigate classless and classful routing behavior.


Page 2:
In this Packet Tracer activity, you will be able to investigate classless and classful routing behavior.

Click the Packet Tracer icon for more details.


8.4.1 - Investigating the Routing Table Lookup Process
Link to Packet Tracer Exploration: Investigating the Routing Table Lookup Process

In this lab, you investigate classless and classful routing behavior.


8.4.2 The show ip route Challenge Lab

Page 1:
In this lab activity, you will determine the topology of a network using the outputs from the show ip route command. You must draw a topology diagram and determine the interface addressing on each router. Then you must build and configure the network based on the outputs. The DTE and DCE assignment is at your discretion. When complete, the outputs from your network must match those given below.

Click the lab icon for more details.


8.4.2 - The show i p route Challenge Lab
Link to Hands-on Lab: The show i p route Challenge Lab

In this lab activity, you determine the topology of a network using the outputs from the show i p route command.

You draw a topology diagram and determine the interface addressing on each router. Next, you build and configure the network based on the outputs. The D T E and DCE assignment is at your discretion. When complete, the outputs from your network must match those given below.


Page 2:
In this lab activity, you will determine the topology of a network using the outputs from the show ip route command.

You must draw a topology diagram and determine the interface addressing on each router. Next, you must build and configure the network based on the outputs. The DTE and DCE assignment is at your discretion. When complete, the outputs from your network must match those given below.

Click the Packet Tracer icon for more details.


8.4.2 - The show i p route Challenge Lab
Link to Packet Tracer Exploration: The show i p route Challenge Lab

In this lab activity, you determine the topology of a network using the outputs from the show i p route command.

You draw a topology diagram and determine the interface addressing on each router. Next, you build and configure the network based on the outputs. The D T E and DCE assignment is at your discretion. When complete, the outputs from your network must match those given.


8.5 Chapter Summary

8.5.1 Summary and Review

Page 1:
Summary

Understanding the structure and lookup process of the routing table can be an important tool in verifying and troubleshooting networks. Knowing which routes should be included and which routes should not be included in the routing table is a critical skill when troubleshooting routing issues.

The Cisco IP routing table is structured in a classful manner, which means that it uses to the default, classful addresses, to organize the route entries. The source of a routing entry can be a directly connected network, static route, or a route learned dynamically from a routing protocol.

In this chapter, you learned that there are level 1 and level 2 routes. A level 1 route can be either an ultimate route or a parent route. A level 1 ultimate route is a route with a subnet mask equal to, or less than the default classful mask of the network; and either a next hop address or an exit interface. For example, a route learned through RIP with the network address of 192.168.1.0 and a /24 network mask is a level 1 ultimate route. These routes are displayed in the routing table as a single route entry, such as:

R 192.168.1.0/24 [120/1] via 172.16.2.2, 00:00:25, Serial0/0/0

Another type of level 1 route is a parent route. A level 1 parent route is automatically created when a subnet route is added to the routing table. The subnet route is known as a level 2 child route. The parent route is a header for level 2 child routes. Here is an example of a level 1 parent route and a level 2 child route:

172.16.0.0/24 is subnetted, 1 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:07, Serial0/0/0


The subnet mask of the child routes are displayed in the parent route unless VLSM is used. With VLSM, the parent route displays the default classful mask and the subnet mask is included with the individual VLSM route entries.

You were also introduced to the routing table lookup process in this chapter. When a packet is received by the router, it looks for the longest match with one of the routes in the routing table. The longest match is the route with the largest number of left-most bits that match between the destination IP address of the packet and the network address of the route in the routing table. The subnet mask associated with the network address in the routing table defines the minimum number of bits that must match for that route to be a match.

Before examining any level 2 child routes (subnets) for a match there must first be a match with the level 1 parent route. The classful mask of the parent determines how many bits must match the parent route. If there is a match with the parent route, then the child routes will be searched for a match.

What happens when there is a match with the parent route but none of the child routes? If the router is using classful routing behavior, no other routes will be searched and the packet will be discarded. Classful routing behavior was the default routing behavior on Cisco routers prior to IOS 11.3. Classful routing behavior can be implemented using the no ip classless command.

Starting with IOS 11.3 classless routing behavior became the default. If there is a match with a parent route but none of the child routes, the routing table process will continue to search other routes in the routing table including a default route should one exist. Classless routing behavior is implemented by using the ip classless command.

Routes to networks get added to the routing table from various sources including directly connected networks, static routes, classful routing protocols and classless routing protocols. The lookup process, classful or classless routing behavior, is independent of the source of the route. A routing table may have routes learned from a classful routing protocol such as RIPv1, but uses classless routing behavior, no ip classless, for the lookup process.


8.5.1 - Summary and Review
The diagram depicts output from the show i p route command next to a disk storage icon labeled Routing Table Database.

In this chapter, you learned to:
- Describe the various route types found in the routing table structure.
- Describe the route lookup process.
- Describe the routing behavior in routed networks.


Page 2:


8.5.1 - Summary and Review
This is a review and is not a quiz. Questions and answers are provided.
Question 1. What makes a level 1 or level 2 route an ultimate route?
Answer: When the route also contains a next-hop IP address or an exit interface.

Question 2. When is the subnet mask displayed with the child route and not the parent route?
Answer: When using VLSM or classless protocols.

Question 3. Does the Network Administrator configure the parent route?
Answer: No, it is created when the subnet (level 2 child) route is added to the routing table.

Question 4. Can there be a parent route without any child routes?
Answer: No. A parent route does not contain a next-hop address or an exit interface. This information is contained in the child routes.

Question 5. Before any level 2 child routes are examined for a match, what must first match?
Answer: There must be a match with the level 1 parent route.

Question 6. What determines how many bits must match between the destination IP address of a packet and a route in the routing table?
Answer: The subnet mask for that entry in the routing table.

Question 7. What is the default routing behavior on Cisco routers and what command can be used to modify this?
Answer: The default routing behavior is classless. The no i p classless command can be used to modify the routing behavior.

Question 8. Refer to the following routing table output to answer the question. Which of the routes are considered level 2 child routes and what is their level 1 parent route?

172.16.0.0/24 is subnetted, 3 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
C 172.16.2.0 is directly connected, Serial0/0/0
C 172.16.3.0 is directly connected, FastEthernet0/0

172.30.0.0/16 is variably subnetted, 3 subnets, 2 masks
R 172.30.1.4/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.1.8/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.3.0/24 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0

C 192.168.1.0/24 is directly connected, Serial0/0/1
S* 0.0.0.0/0 is directly connected, Serial0/0/1

Answer:
Parent: 172.16.0.0/24 is subnetted, 3 subnets
Child: R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
Child: C 172.16.2.0 is directly connected, Serial0/0/0
Child: C 172.16.3.0 is directly connected, FastEthernet0/0

Parent: 172.30.0.0/16 is variably subnetted, 3 subnets, 2 masks
Child: R 172.30.1.4/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
Child: R 172.30.1.8/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
Child: R 172.30.3.0/24 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0

Question 9. Refer to the following routing table output to answer the question. Before the 172.16.1.0, 172.16.2.0 and 172.16.3.0 routes can be examined for a match, what route must match first? How many bits must match this route before the subnets are examined?

172.16.0.0/24 is subnetted, 3 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
C 172.16.2.0 is directly connected, Serial0/0/0
C 172.16.3.0 is directly connected, FastEthernet0/0

172.30.0.0/16 is variably subnetted, 3 subnets, 2 masks
R 172.30.1.4/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.1.8/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.3.0/24 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0

C 192.168.1.0/24 is directly connected, Serial0/0/1
S* 0.0.0.0/0 is directly connected, Serial0/0/1

Answer:
There must first be a match with the 172.16.0.0 parent route. 16 bits must match the parent route (/16 is the classful mask of the parent).

Question 10. Refer to the following routing table output to answer the question. If the no i p classless command was configured on this router, what would happen to a packet with the destination IP address 172.16.4.5? Would any of the child routes of the level 1 parent be examined for a match?

172.16.0.0/24 is subnetted, 3 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
C 172.16.2.0 is directly connected, Serial0/0/0
C 172.16.3.0 is directly connected, FastEthernet0/0

172.30.0.0/16 is variably subnetted, 3 subnets, 2 masks
R 172.30.1.4/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.1.8/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.3.0/24 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0

C 192.168.1.0/24 is directly connected, Serial0/0/1
S* 0.0.0.0/0 is directly connected, Serial0/0/1

Answer: The packet would be dropped. The packet matches the level 1 parent 172.16.0.0, but does not match any of the child routes. Because of classful routing behavior, the routing table lookup process would not continue searching supernet and default routes.

Question 11. Refer to the following routing table output to answer the question. If the i p classless command was configured on this router, what would happen to a packet with the destination IP address 172.16.4.5? What route would it use, if any? Would any of the child routes of the level 1 parent be examined for a match?

172.16.0.0/24 is subnetted, 3 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
C 172.16.2.0 is directly connected, Serial0/0/0
C 172.16.3.0 is directly connected, FastEthernet0/0

172.30.0.0/16 is variably subnetted, 3 subnets, 2 masks
R 172.30.1.4/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.1.8/30 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0
R 172.30.3.0/24 [120/1] via 172.16.2.1, 00:00:00, Serial0/0/0

C 192.168.1.0/24 is directly connected, Serial0/0/1
S* 0.0.0.0/0 is directly connected, Serial0/0/1

Answer: The packet would be forwarded using the default route. The packet matches the level 1 parent 172.16.0.0, but does not match any of the child routes. Because of classless routing behavior, the routing table lookup process continues to search supernet and default routes.


Page 3:
Packet Tracer Skills Integration Instructions (PDF)

Click the Packet Tracer icon for more details.


8.5.1 - Summary and Review
Link to Packet Tracer Exploration: Chapter 8 Packet Tracer Skills Integration Challenge.


Page 4:
To Learn More

An excellent source on the routing table structure and the lookup process is Alex Zinin's book, Cisco IP Routing, which goes into more detail than was discussed in this chapter.

Cisco IP Routing, Chapter 4: Routing Table Maintenance includes:
  • Comparison of Route Sources
  • Representation of Routing Information and Interfaces
  • Routing Table Structure
  • Route Source Selection
  • Routing Table Initialization
  • Asynchronous Table Maintenance
  • Route Resolvability
  • Dynamic Route Processing
  • Static Route Processing
  • Manual Routing Table Clearance
  • Default Route Selection


8.5.1 - Summary and Review
The diagram depicts a collage of people using computers and networks.


8.6 Chapter Quiz

8.6.1 Chapter Quiz

Page 1:


8.6.1 - Chapter Quiz
1.Refer to the show i p route output below. Which three types of routes are displayed in this routing table? (Choose three.)

output omitted
172.16.0.0/16 is variably subnetted, 4 subnets
S172.16.4.0 is directly connected, Serial0/0/1
R172.16.1.0 [120/1] via 172.16.2.1, 00:00:08, Serial0/0/0
C172.16.4.0 is directly connected, Serial0/0/0
C172.16.3.0 is directly connected, FastEthernet0/0
10.1.0.0 is directly connected, Serial0/0/1
S10.1.0.0 is directly connected, Serial0/0/1
C192.168.1.0/24 is directly connected, Serial0/0/1
S192.168.100.0/24 is directly connected, Serial0/0/1
output omitted

A.networks local to this router
B.default route for this router
C.static routes on this router
D.mobile routes
E.routes learned from dynamic routing protocols
F.routes learned from a non-Cisco router

2.What characteristic can be used to determine if a route is an ultimate route?
A.The route displays a subnet mask.
B.The route is a parent route.
C.The route was configured by an administrator.
D.The route includes an exit interface.

3.Refer to the show i p route output below. Which two routes are considered parent routes? (Choose two.)
172.16.0.0/24 is subnetted, 4 subnets
S172.16.4.0 is directly connected, Serial0/0/1
R172.16.1.0 [120/1] via 172.16.2.1, 00:00:08, Serial0/0/0
C172.16.2.0 is directly connected, Serial0/0/0
C172.16.3.0 is directly connected, FastEthernet0/0
10.0.0.0/16 is subnetted, 1 subnets
S10.1.0.0 is directly connected, Serial0/0/1
C192.168.1.0/24 is directly connected, Serial0/0/1
S192.168.100.0/24 is directly connected, Serial0/0/1

Answers:
A.172.16.0.0/24
B.172.16.4.0
C.172.16.1.0
D.10.0.0.0/16
E.192.168.1.0/24
F.192.168.100.0/24

4.Router R1 is configured with the commands R1(config)#i p classless and R1(config)#i p route 0.0.0.0 0.0.0.0 s0/0/0. What will R1 do with a packet that matches a parent route, but does not match any associated child routes?
A.forward the packet using the longest parent route match
B.forward the packet via the default route
C.return the packet with an ICMP "destination unreachable" message to the source address
D.drop the packet

5.What action enables classful routing behavior on a router?
A.configuring RIP v1 on IGRP
B.configuring a link-state routing protocol
C.using only classful netmasks on all networks
D.issuing the no i p classless command

6.In the route lookup process, what constitutes the preferred route?
A.ultimate route
B.longest match of leftmost bits
C.shortest prefix length
D.first route that resolves to an exit interface

7.If a packet matches a level 1 parent route in the routing table, what occurs next in the lookup process?
A.The router drops the packet because level 1 requires an exit interface.
B.The router looks for the level 2 child route with an exit interface.
C.The router sends the packet out all interfaces, except the one in which it was received.
D.The router uses ARP on all connected networks to find the interface with the destination on it.

8.What do the i p classless and no i p classless commands do?
A.determine the address lookup behavior of the routing process
B.specify whether the router accepts subnet masks in routing updates
C.restrict the use of classful or classless routing protocols
D.allow the router to accept or not accept VLSM for interface addresses

9.Router R1 is configured with the commands R1(config)#no i p classless and R1(config)#i p route 0.0.0.0 0.0.0.0 s0/0/0. What will R1 do with a packet that matches a parent route, but does not match any associated child routes?
A.forward the packet using the longest parent route match
B.forward the packet via the default route
C.return the packet with an ICMP "destination unreachable" message to the source address
D.drop the packet

10. Refer the show i p route output below. Router C is running Cisco I O S Release 12.3. The router receives a packet with a destination of 172.16.1.130. Which route does router C use to forward the packet?
RouterC#show i p route
output omitted
Gateway of last resort is 0.0.0.0 to network 0.0.0.0

172.16.0.0/13 is subnetted, 1 subnets
S172.16.0.0 is directly connected, FastEthernet0/0
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R172.16.0.0/24 [120/3] via 172.16.1.1, 00:00:03, FastEthernet0/0
C172.16.1.0/25 is directly connected, FastEthernet0/0
172.17.0.0/25 is subnetted, 1 subnets
C172.17.1.0 is directly connected, FastEthernet0/1
S*0.0.0.0/0 is directly connected, FastEthernet0/0

Answers:
A.172.16.1.0/25
B.172.16.0.0/16
C.192.16.0.0/24
D.172.16.0.0/16
E.default route

0 comments:

Post a Comment