Lesson 1:Routing Principles

Routing is one of the most important and most complex operations performed by TCP/IP. The protocols were designed with scalability in mind, but no one in the 1970s could have predicted the massive growth of the Internet that would occur two decades later. Whereas packets might pass through a handful of routers on a private internetwork, Internet packets routinely pass through a dozen or more routers on the way to their destinations. Some of the routers on the Internet have to maintain information about several networks, and the process of compiling and maintaining this information makes the Internet routing process very complex.


After this lesson, you will be able to

  • Understand the functions of a router
  • Describe the information in a routing table
  • Understand the process by which a TCP/IP system selects a routing table entry

Estimated lesson time: 30 minutes


Understanding Routing

A router is a system connected to two or more networks that forwards packets from one network to another. Routers operate at the network layer of the OSI reference model, so they can connect networks running different data-link layer protocols and different network media. On a small internetwork, a router's job can be quite simple. When you have two local area networks (LANs) connected by one router, for example, the router simply receives packets from one network and forwards only those destined for the other network. On a large internetwork, however, routers connect several different networks together, and in many cases, networks have more than one router connected to them, as shown in Figure 9.1.

Figure 9.1  Internetworks with redundant routers provide multiple paths between two end systems

This enables packets to take different paths to a given destination. If one router on the network should fail, packets can bypass it and still reach their destinations.

In a complex internetwork, an important part of a router's job is to select the most efficient route to a packet's destination. Usually, this is the path that enables a packet to reach the destination with the fewest number of hops (that is, by passing through the smallest number of routers). Routers share information about the networks to which they are attached with other routers in the immediate vicinity. As a result, a composite picture of the internetwork eventually develops, but on a large internetwork such as the Internet, no single router possesses the entire image. Instead, the routers work together by passing each packet from router to router, one hop at a time.

See Lesson 3: Routing, in Chapter 3, "Network Connections," for more information about the packet-routing process.

Router Products

A router can be a stand-alone hardware device or a regular computer. Operating systems like Microsoft Windows 2000, Microsoft Windows NT, and Novell NetWare have the ability to route IP traffic, so creating a router out of a computer running one of these operating systems is simply a matter of installing two network interface adapters, connecting the computer to two different networks, and configuring it to route traffic between those networks. In TCP/IP parlance, a computer with two or more network interfaces is called a multihomed system. Microsoft Windows 95, Microsoft Windows 98, and Microsoft Windows Me on their own can't route IP traffic between two network interface adapters, but you can use systems running these operating systems as dial-in servers that enable you to access a network from a re mote location using the NetBIOS Enhanced User Interface (NetBEUI) or Internetwork Packet Exchange (IPX) protocols.

Windows 98 Second Edition and Windows Me also include an Internet Connection Sharing (ICS) feature, which enables other computers on the LAN to access the Internet through one computer's dial-up connection to an Internet service provider (ISP). There are also third-party software products that provide Internet connection sharing. In essence, these products are software routers that enable your computer to forward packets between the local network and the network run by your ISP. Using these products, all of the computers on a LAN, such as one installed in a home or a small business, can share a single computer's connection to the Internet, whether it uses a dial-up modem, cable modem, or other type of connection.

When you use a computer as an IP router, each of the network interface adapters must have its own IP address appropriate for the network to which it is attached. When one of the two networks is an ISP connection, the ISP's server typically supplies the address for that interface. The other IP address is the one that you assign to your network interface adapter when you install it.

A stand-alone router is a hardware device that is essentially a special-purpose computer. The unit has multiple built-in network interface adapters, a processor, and memory in which it stores its routing information and temporary packet buffers. Routers are now available for a wide range of prices and with a variety of capabilities. You can purchase an inexpensive stand-alone router that enables you to share an Internet connection with a small network for a few hundred dollars, or you can move up to enormously expensive rack-mounted models that connect the LANs of a large internetwork or provide wide area connectivity to remote offices or ISPs.

Routing Tables

The routing table is the heart of any router; without it, all that's left is mechanics. The routing table holds the information that the router uses to forward packets to the proper destinations. However, it is not only routers that have routing tables; every TCP/IP system has one, which it uses to determine where to send its packets. Routing is essentially the process of determining what data-link layer protocol address the system should use to reach a particular IP address. If a system wants to transmit a packet to a computer on the local network, for example, the routing table instructs it to address the packet directly to that system. This is called a direct route. In this case, the Destination IP Address field in the IP header and the Destination Address field in the data-link layer protocol header refer to the same computer.

If a packet's destination is on another network, the routing table contains the address of the router that the system should use to reach that destination. In this case, the Destination IP Address and Destination Address fields specify different systems because the data-link layer address has to refer to a system on the local network, and for the packet to reach a computer on a different network, that local system must be a router. Because the two addresses refer to different systems, this is called an indirect route.

Routing Table Format

A routing table is essentially a list of networks (and possibly hosts) and addresses of routers that the system can use to reach them. The arrangement of the information in the routing table can differ depending on the operating system, but it generally appears in something like the following format, which is the routing table from a Windows 2000 system.

The functions of the various columns in the table are as follows:

  • Network Address.  This column specifies the address of the network or host for which routing information is provided in the other columns.
  • Netmask.  This column specifies the subnet mask for the value in the Network Address column. As with any subnet mask, the system uses the Netmask value to determine which parts of the Network Address value are the network identifier, the subnet identifier (if any), and the host identifier.
  • Gateway Address.  This column specifies the address of the router that the system should use to send datagrams to the network or host identified in the Network Address column. On a LAN, the hardware address for the system identified by the Gateway Address value will become the Destination Address value in the packet's data-link layer protocol header.
  • Interface.  This column specifies the address of the network interface adapter that the computer should use to transmit packets to the system identified in the Gateway Address column.
  • Metric.  This column contains a value that enables the system to compare the relative efficiency of routes to the same destination.

Network Address Netmask Gateway Address Interface Metric

0.0.0.0

0.0.0.0

192.168.2.99

192.168.2.2

1

127.0.0.0

255.0.0.0

127.0.0.1

127.0.0.1

1

192.168.2.0

255.255.255.0

192.168.2.2

192.168.2.2

1

192.168.2.2

255.255.255.25 5

127.0.0.1

127.0.0.1

1

192.168.2.255

255.255.255.25 5

192.168.2.2

192.168.2.2

1

224.0.0.0

224.0.0.0

192.168.2.2

192.168.2.2

1

255.255.255.25 5

255.255.255.25 5

192.168.2.2

192.168.2.2

1


Routing Table Entries

The sample routing table shown previously contains typical entries for a workstation that is not functioning as a router. The value 0.0.0.0 in the Network Address column, found in the first entry in the table, identifies the default gateway entry. The default gateway is the router on the LAN that the system uses when there are no routing table entries that match the Destination IP Address of an outgoing packet. Even if there are multiple routers available on the local network, a routing table can have only one functional default gateway entry. On a typical workstation that is not a router, the majority of packets go to the default gateway; only packets destined for systems on the local network do not use this router. The Gateway Address column in the default gateway entry contains the IP address of a router on the local network, and the Interface column contains the IP address of the network interface adapter that connects the system to the network.


In TCP/IP terminology, the term gateway is synonymous with the term router. However, this is not the case in other networking disciplines, in which a gateway can refer to a different device that connects networks at the application layer instead of the network layer.

The second entry in the sample routing table contains a special IP address that is designated as the TCP/IP loopback address. IP automatically routes all packets destined for any address on the 127.0.0.0 network right back to the incoming packet queue on the same computer. The packets never reach the data-link layer or leave the computer. The entry ensures this by specifying that the system should use its own loopback address (127.0.0.1) as the "router" to the destination.

The IP address of the network interface adapter in the computer to which this routing table belongs is 192.168.2.2. Therefore, the third entry in the sample routing table contains the address of the local network on which the computer is located. The Network Address and Netmask values indicate that it is a Class C network with the address 192.168.2.0. This is the entry that the system uses for direct routes when it transmits packets to other systems on the local network. The Gateway Address and Interface columns both contain the IP address of the network interface adapter for the computer, indicating that the computer should use itself as the gateway. In other words, the computer should transmit the data-link layer frames to the same computer identified by the Destination IP Address value in the datagrams.

The fourth entry in the sample routing table contains the host address of the computer itself. It instructs the system to transmit data addressed to itself to the loopback address. IP always searches the routing table for host address entries before network address entries, so when processing any packets addressed to the computer's own address (192.168.2.2), IP would select this entry before the entry above it, which specifies the system's network address.

The fifth and seventh entries in the sample routing table contain broadcast addresses, both the generic IP broadcast address (255.255.255.255) and the local network's broadcast address (192.168.2.255). In both of these cases, packets are transmitted to the computers on the local network, so the system again uses itself as a gateway. The sixth entry in the sample routing table contains the network address for the multicast addresses designated by the Internet Assigned Numbers Authority (IANA) for specific purposes.

The routing table on a router is considerably more complex because it contains entries for all of the networks to which it's attached, as well as entries provided manually by administrators or dynamically by routing protocols. A router also makes more use of the Interface and Metric columns. On a system with one network interface adapter, there is only one interface to use, so the Interface column is actually superfluous. Routers and multihomed systems have at least two network interfaces, so the value in the Interface column is a crucial part of transmitting a packet correctly. In the same way, the Metric values in a singlehomed system's routing table are superfluous as well, because the computer has no information about routes more distant than those on the local network. As a result, the Metric value for all of the entries is 1.

Selecting a Table Entry

When a TCP/IP system has data to transmit, the IP protocol selects a route for each packet using the procedure shown in Figure 9.2.

Figure 9.2  TCP/IP systems search the routing table for an address that matches the Destination IP Address value found in the header of each datagram

The IP protocol selects a route using the following procedure:

  1. After packaging the transport layer information into a datagram, IP compares the Destination IP Address for the packet with the routing table, looking for a host address with the same value. A host address entry in the table has a full IP address in the Network Address column and the value 255.255.255.255 in the Netmask column.
  2. If there is no host address entry that exactly matches the Destination IP Address value, the system then scans the routing table's Network Address and Netmask columns for an entry that matches the address's network and subnet identifiers. If there is more than one entry in the routing table that contains the desired network and subnet identifiers, IP uses the entry with the lower value in the Metric column.
  3. If there are no table entries that match the network and subnet identifiers of the Destination IP Address value, the system searches for a default gateway entry that has a value of 0.0.0.0 in the Network Address and Netmask columns.
  4. If there is no default gateway entry, the system generates an error message. If the system transmitting the datagram is a router, it transmits an Internet Control Message Protocol (ICMP) Destination Unreachable message back to the end system that originated the datagram. If the system transmitting the datagram is itself an end system, the error message gets passed back up to the application that generated the data.
  5. When the system locates a viable routing table entry, IP prepares to transmit the datagram to the router identified in the Gateway Address column. The system consults the Address Resolution Protocol (ARP) cache or performs an ARP procedure to obtain the hardware address of the router.
  6. Once it has the router's hardware address, IP passes it and the datagram down to the data-link layer protocol associated with the address specified in the Interface column. The data-link layer protocol constructs a frame using the router's hardware address in its Destination Address field and transmits it out over the designated interface.

Exercise 1: Routing Tables

Place the following steps of the routing table search process in the proper order.

  1. Default gateway search
  2. Host address search
  3. Network address search

Lesson Review

  1. What type of route does a packet in which the Destination IP Address and the data-link layer Destination Address values refer to different computers use?
    1. The default gateway
    2. A direct route
    3. The default route
    4. An indirect route
  2. What is a TCP/IP system with interfaces to two different networks called?
    1. A bridge
    2. Multihomed
    3. A switch
    4. All of the above
  3. In a Windows routing table, what column contains the address of the router that should be used to reach a particular network or host?
    1. Network Destination
    2. Netmask
    3. Gateway
    4. Interface
  4. What does a router do when it fails to find a routing table entry for a particular network or host?
  5. In a Windows routing table, what is the Network Destination value for the default gateway entry?
    1. 0.0.0.0
    2. The address of the network to which the router is connected
    3. 255.255.255.255
    4. The address of the router's network interface

Lesson Summary

  • Routing is one of the complicated functions of IP. Routers receive packets and forward them on to their destinations.
  • Complex internetworks can have redundant routers that provide multiple paths to the same destination. The job of a router is to forward packets using the most efficient path.
  • A router can be a stand-alone hardware device, an operating system, or a separate software product.
  • Routers store information about the network in a routing table. When forwarding a packet, the router searches the table for a route to each destination and transmits the packet to the appropriate destination.
  • When a router fails to locate a route to a particular destination in the table, it sends the packet to the designated default gateway.


Network+ Certification Training Kit
Self-Paced Training Kit Exam 70-642: Configuring Windows Server 2008 Network Infrastructure
ISBN: 0735651604
EAN: 2147483647
Year: 2001
Pages: 105

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net