The Route Table

To understand the kind of information that exists in the route table, it is useful to begin with an examination of what happens when a framed packet arrives at one of a router's interfaces. The data-link identifier in the frame's destination address field is examined. If it contains either the identifier of the router's interface or a broadcast identifier, the router strips off the frame and passes the enclosed packet to the network layer. At the network layer, the destination address of the packet is examined. If the destination address is either the IP address of the router's interface or an all-hosts broadcast address, the protocol field of the packet is examined and the enclosed data is sent to the appropriate internal process. [1]

[1] There is also the special case of a multicast address, which is destined for a group of devices, but not for all devices. An example of a multicast address is the class D address 224.0.0.5, reserved for all OSPF-speaking routers.

Any other destination address calls for routing. The address may be for a host on another network to which the router is attached (including the router interface attached to that network) or for a host on a network not directly connected to the router. The address may also be a directed broadcast, in which there is a distinct network or subnet address, and the remaining host bits are all ones. These addresses are also routable.

If the packet is to be routed, the router will do a route table lookup to acquire the correct route. At a minimum, each route entry in the database must contain two items:

• A destination address. This is the address of the network the router can reach. As this chapter explains, the router may have more than one route to the same address and/or a group of subnets of the same or of varying lengths grouped under the same major IP network address.

• A pointer to the destination. This pointer either will indicate that the destination network is directly connected to the router or it will indicate the address of another router on a directly connected network. That router, which will be one router hop closer to the destination, is a next-hop router.

The router will match the most specific address it can.[2] In descending order of specificity, the address may be one of the following:

[2] There are two basic procedures for finding the best match, depending upon whether the router is behaving classfully or classlessly. Classful table lookups are explained in more detail in Chapter 5, "Routing Information Protocol (RIP), and classless table lookups are explained in Chapter 7, "Routing Information Protocol Version 2."

• A group of subnets (a summary route)

• A major network number

• A group of major network numbers (a supernet)

• A default address

This chapter provides examples of the first four types. Supernets are covered in Chapter 7, "Routing Information Protocol Version 2." A default address is considered a least-specific address and is matched only if no other match can be found. Default addressing is the topic of Chapter 12, "Default Routes and On-Demand Routing."

If the destination address of the packet cannot be matched to any route table entry, the packet is dropped and a Destination Unreachable ICMP message is sent to the source address.

Figure 3.1 shows a simple internetwork and the route table entries required by each router. Of primary importance here is the "big picture," seeing how the route tables work as a whole to transport packets correctly and efficiently. The destination addresses that the router can reach are listed in the Network column of the route tables. The pointers to the destinations are in the Next Hop column.

Figure 3.1. The minimum information needed for each route table entry consists of the destination networks and the pointers to those networks.

Figure 3.1. The minimum information needed for each route table entry consists of the destination networks and the pointers to those networks.

Routing Table

If router Carroll in Figure 3.1 receives a packet with a source address of 10.1.1.97 and a destination address of 10.1.7.35, a route table lookup determines that the best match for the destination address is subnet 10.1.7.0, reachable via next-hop address 10.1.2.2, on interface S0. The packet is sent to that next router (Dahl), which does a lookup in its own table and sees that network 10.1.7.0 is reachable via next-hop address 10.1.4.2, out interface S1. The process continues until the packet reaches router Baum. That router, receiving the packet on its interface S0, does a lookup, and sees that the destination is on one of its directly connected networks, out E0. Routing is completed, and the packet is delivered to host 10.1.7.35 on the Ethernet link.

The routing process, as explained, assumes that the router can match its listed next-hop addresses to its interfaces. For example, router Dahl must know that Lewis's address 10.1.4.2 is reachable via interface S1. Dahl will know from the IP address and subnet mask assigned to S1 that S1 is directly connected to subnet 10.1.4.0. It then knows that 10.1.4.2, a member of the same subnet, must be connected to the same network.

Notice that every router must have consistent and accurate information for correct packet switching to occur. For example, in Figure 3.1 an entry for network 10.1.1.0 is missing from Dahl's route table. A packet from 10.1.1.97 to 10.1.7.35 will be delivered, but when a reply is sent from 10.1.7.35 to 10.1.1.97, the packet is passed from Baum to Lewis to Dahl. Dahl does a lookup and finds that it has no entry for subnet 10.1.1.0, so the packet is dropped, and an ICMP Destination Unreachable message is sent to host 10.1.7.35.

Figure 3.2 shows the actual Cisco route table from router Lewis of Figure 3.1. The command for examining the IP route table of a Cisco router is show ip route.

Figure 3.2. The Cisco route table for router Lewis of Figure 3.1.

Cctlfls: C connected, ii static, i I<3W>, k RIP, U mobile, ej BGP,

0 ElGRP, ¡_x EIGFP external, (j ospf , ia inter area,

N1 ti^Pl NSSA external type 1. N2 ti^P1 NSiA external 2, Li Oisr*i external tyjie okhi extendi type 2, l ,

L IS [5. .1 [3 f3 level ?, I? IS IS level * candidate default,

Examine the contents of this database and compare it with the generic table shown for Lewis in Figure 3.1. A key at the top of the table explains the letters down the left side of the table. These letters indicate how each route entry was learned; in Figure 3.2 all routes are tagged with either a C for "directly connected," or an S for "static entry." The statement "gateway of last resort is not set" refers to a default route.

At the top of the table is a statement indicating that the route table knows of seven subnets of the major network address 10.0.0.0, subnetted with a 24-bit mask. For each of the seven route entries, the destination subnet is shown; for the entries that are not directly connected—routes for which the packet must be forwarded to a next-hop router—a bracketed tuple indicates [administrative distance/metric] for that route. Administrative distances are introduced later in this chapter and are covered in detail in Chapter 11, "Route Redistribution."

Metrics, discussed in greater detail in Chapter 4, "Dynamic Routing Protocols," are a way for routes to be rated by preference—the lower the metric, the "shorter" the path. Notice that the static routes shown in Figure 3.2 have a metric of 0. Finally, either the address of the directly connected interface of the next-hop router or the interface to which the destination is connected is shown.

Continue reading here: Configuring Static Routes

Was this article helpful?

0 0

Readers' Questions

  • Hamilcar Bolger
    Which routing protocol does an exterior router use to collect data to build its routing tables?
    4 months ago
  • An exterior router typically uses the Border Gateway Protocol (BGP) to collect data and build its routing tables. BGP is the principal routing protocol used for exchanging routing information between autonomous systems (AS) on the internet. It allows an exterior router to gather information about available routes and determine the best path to forward packets.
    • nicole
      Which routing table gateway value indicates that there is no gateway needed for a network id?
      6 months ago
    • The gateway value that indicates that there is no gateway needed for a network ID is "0.0.0.0".
      • Lisa Frankfurter
        How does a router use a routing table to determine over which path to send a packet?
        6 months ago
      • A router uses a routing table to determine the best path for sending a packet by following these general steps:
        1. Destination IP Address Extraction: When a packet arrives at the router, it analyzes the destination IP address of the packet.
        2. Longest Prefix Match: The router compares the destination IP address with the entries in its routing table. It looks for the longest matching prefix among the available routes.
        3. Next Hop Determination: Once the longest matching prefix is identified, the router selects the route that matches the IP address range. This route entry contains information about the next hop, which is the IP address of the next router along the path to the destination.
        4. Address Resolution: If the next hop IP address is not directly connected to the router, the router may need to perform an Address Resolution Protocol (ARP) to obtain the MAC address of the next hop router.
        5. Packet Forwarding: Finally, the router forwards the packet to the determined next hop router using the appropriate outgoing interface based on the information in the routing table.This process repeats at each successive router along the path until the packet reaches its destination. Routers continuously update their routing tables to adjust for changes in the network topology or routing policies.
        • MATTHIAS
          Which letter is used in the routing table to indicate that the route was learned via the rip?
          11 months ago
        • In RIP routing tables, the letter R is used to indicate that a route was learned via the RIP protocol.
          • bobby
            How to read a routing table?
            1 year ago
            1. Identify the routing table. Most routing tables are labeled and may include the header "Destination" and "Next Hop."
            2. Look for active routing protocols. Common protocols used in routing tables include OSPF, BGP and RIP.
            3. Locate the active routes. Active routes are usually denoted with asterisks or a special color. These routes are used to reach specific destinations or networks.
            4. Observe the columns of the routing table. The columns will usually provide information about the route's destination, next hop, cost and administrative distance.
            5. Determine the route's destination. This will usually be the IP address, subnet mask or name of the destination network or host.
            6. Locate the route's next hop. This will usually be an IP address or name of the gateway or router.
            7. Determine the route's cost. This is usually measured by the number of hops or by milliseconds.
            8. Look for the administrative distance. This is a numerical value that is used to determine which route to use when multiple paths to the same destination exist.
            • daphne milani
              What routing table entry has a next hop address associated with a destination network?
              1 year ago
            • A Route Table Entry with a Next Hop address associated with a Destination Network would look like this: Destination Network | Next Hop Address ---------------------|--------------------- 192.168.10.0/24 | 192.168.20.100
              • wolfgang
                When examining IP routing table, an RIP route will be shown as which letter?
                1 year ago
              • When examining an IP routing table, an RIP (Routing Information Protocol) route will be shown as the letter "R."