Other Rules of the Road


Although a single example might help you understand routing, one example can't cover every nuance of how routing works. Before wrapping up this chapter, you should be aware of a few additional short topics about routing. These last few topics do not change the rules of routing, but they do clarify what happens in a couple of different instances.

Routing with Subnets

In the example used throughout this chapter, three different IP networks were used, with no subnetting. As it turns out, even with subnetting in use, routing works basically the same way. For example, look at Figure 11-13, which has the same internetwork with two routers, but now with subnets of Class B network 150.1.0.0 in use.

Figure 11-13. R2's Routing TableSame Destinations, Different Instructions


In this new internetwork, a single Class B IP network, 150.1.0.0, is used. This IP network is subdivided into three subnetsnamely, 150.1.1.0, 150.1.2.0, and 150.1.3.0. In this case, subnetting has been set up to work like it did in Chapter 10, with all hosts in the same IP subnet having the same value in the first 3 octets of their IP addresses. (Notice that the IP addresses of the host computers, as well as the routers, have changed, as compared to the earlier examples in this chapter.)

Now take a closer look at the routing tables. In the earlier example, the list of destinations was a list of Class A, B, and C network numbers. In this case, the list shows the IP subnet numbers. To route packets correctly, the router needs a routing table that lists all the possible groups of IP addresses. As you read in Chapter 10, a subnet is just a subset of a larger class A, B, or C networkin other words, just a smaller group of addresses.

Hannah, R1, and R2 use the same basic logic as before. When Hannah sends a packet to the web server, the destination address is 150.1.3.3. Hannah's default gateway still points to R1's Ethernet1 IP address. Hannah's logic works like it did without subnettting, with Hannah sending an ARP broadcast for IP address 150.1.1.250, R1 replying, and Hannah sending a frame to R1 with the IP packet inside the Ethernet frame.

R1's logic is also the same as before. R1 receives the frame, and if it is error free, it extracts the IP packet. The destination address is 150.1.3.3 in this case, so R1 looks at its IP routing table and finds an entry for 150.1.3.0. R1 knows that this subnet includes addresses 150.1.3.1 through 150.1.3.254, so the packet's destination address matches this entry. Just like before, the routing table entry tells R1 to forward the packet out its Ethernet2 interface, to R2 next. The only difference this time is that R2's IP address is different (150.1.2.2).

Finally, when R2 receives the frame, it does the usual error check and extracts the IP packet. R2 then compares the destination IP address to its own routing table and finds an entry for 150.1.3.0. In this case, there's no next-hop router listed, so R2 can forward the packet directly to the web server, just like before.

In short, whether or not an internetwork uses subnetting, the basic routing logic remains the same.

How to Drive When You Aren't Leaving the Neighborhood (Subnet)

The examples in this chapter always started with Hannah sending the packet to her default router. But what if Hannah needs to send a packet to someone who's on the same subnet? It would be better, of course, for Hannah to send the packet directly to the destination. Figure 11-14 depicts the topology and the solution.

Figure 11-14. Decision Process with Local Subnet Destinations


Hosts do not always send packets to their default gateway. Instead, they start by asking a simple question: "Is the destination address of this packet in the same subnet that I am in?" If so, the host needs to send the packet directly, as shown in Figure 11-14. If the packet's destination is in a different subnet, the host simply needs to send the packet to its default router. So, each host computer knows the range of valid IP addresses in its own subnet, so all the computer has to do is compare the destination IP address of the packet to that list of valid addresses.

By the way, in either case, the host might need to use ARP to learn the MAC address either of the other host computer or the default gateway.




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