Routing to Nearby Places


Imagine a sleepy little town with a couple of fellows sitting around at the only gas station. Because I grew up in a town like that, I'll call the town Snellville, after my hometown. These guys are just talking, waiting around for the next customer.

A stranger drives up, rolls down his window, and asks, "Excuse me. Can you tell me how to get to Snellville?" I'm sure a dozen funny or sarcastic answers would probably leap to mind, but the fellows at the gas station would eventually tell the stranger that he had just missed the sign that told him he was already in Snellville. No need to drive any further!

Interestingly, routers first fill their routing tables based on a similar concept. Each router knows which of its physical interfaces are up and working. It knows the IP addresses used on each interface. Each router also knows what IP networks or subnets exist on the physical networks that are connected to those interfaces. The router can add a route to the subnet that exists on the physical networks to which it is attached.

Before a router can add routes to these subnets, it must have an IP address assigned to each network interface. When you buy a brand new router, it doesn't know which IP addresses you want it to use. A network engineer needs to somehow tell the router which IP addresses to use; to do so, the engineer configures the router.

Configuring a router means that the engineer connects to the router and types in some information about what the router should do. For instance, in Figure 12-1, R1 needs to know its IP addresses for interfaces Ethernet1 and Ethernet2. When the engineer configures the IP address for each interface, he also (coincidentally) tells the router which subnets or networks are attached to those two interfaces. Figure 12-1 shows the basic concepts.

Figure 12-1. Configuring a Router with Its IP Addresses and Attached Subnets


Before all the routing in Chapter 11 could work, the routers needed to know what their interfaces' IP addresses were. In this figure, you see that the engineer told R1 that its IP addresses were 150.1.1.250 (Ethernet1) and 150.1.2.1 (Ethernet2). Based on what the engineer told the router, the router can deduce the subnet numbers connected to those two interfaces and the range of valid IP addresses. (Although this book doesn't cover the details, for those of you who have some router configuration experience, the engineer configures an IP address and subnet mask for each interface. The router uses those two numbers to figure out the range of valid IP addresses in each subnet.)

After R1's two interfaces are up and working, R1 knows a few important facts:

  • The subnet numbers of the subnets that are connected to these two interfaces.

  • The outgoing interface it should use to forward packets to those subnets.

  • It does not need to send packets to another router so that it can reach these subnets.

As a result, R1 simply adds a route for each directly connected subnet to its routing table. A directly connected subnet is a subnet that is, well, connected directly to a router. Back in Chapter 10, "Delivering the Goods to the Right Street (IP) Address," you learned how all the IP hosts in the same IP subnet were attached to the same physical network. In Figure 12-1, R1's Ethernet1 interface is attached to the same physical Ethernet as Hannah; therefore, R1's Ethernet1 interface is connected directly to the same subnet as Hannah. By adding a route for that subnet to its routing table, R1 can then forward packets to Hannah and other hosts in that subnet.

Likewise, R2 can add two routes to its routing table after the network engineer has configured R2 and the two interfaces are working. Figure 12-2 shows the routing tables on R1 and R2, this time with the newly added directly connected routes shown.

Figure 12-2. You're Already There: Directly Connected Routes in R1's and R2's Routing Tables


Routers always add routes for directly connected subnets and networks, as long as the interface is both configured and working. Although it is important that the routers include the directly connected subnets in their routing tables, if that's all R1 and R2 know about, then they do not know enough routes in their routing table. For instance, if Hannah tries to send a packet to the web server (150.1.3.3), then R1 will not have a route that matches the packet's destination address, and R1 will simply discard the packet.




Computer Networking first-step
Computer Networking First-Step
ISBN: 1587201011
EAN: 2147483647
Year: 2004
Pages: 173
Authors: Wendell Odom

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