Navigation Basics: Driving to the Right Destination


When you want to drive somewhere near your house, you get in your car, drive on the local roads, and get there. When you need to drive a longer distance, say to another town, you probably start off on those same local roads but then get on a highway. After you drive far enough to get to that town, you get off the highway and use the town's local roads to get to where you want to go.

Now, imagine that you have a visitor staying at your house, and he wants to drive to that next town. You could tell him to drive down the road that runs past your house until he reaches the first intersection, and then follow the road signs. Your friend could simply look at the road sign at that intersection, which tells him where to turn. If he reads the road sign at each intersection, he might make a lot of turns, but he will eventually get where he wants to go, as long as the road signs list the town to which he wants to drive.

In TCP/IP networks, routers act as intersections, with the router making the choice about what direction to forward data packets. In a typical large network, many routers and LAN switches sit between a client PC and a server. When one computer sends data to another computer, the routers make decisions about where to forward the data so that it reaches the correct destination. For example, in Figure 10-1, a user (Hannah) on a LAN in Mason wants to get a web page from a web server (http://www.cisco.com) on a LAN in Cincinnati. At some point, Hannah's PC sends the initial HTTP GET request to the web server. The figure shows that initial request, with the routers deciding where to forward the data so that it reaches the web server.

Figure 10-1. Navigating (Routing) When Going from Mason and Cincinnati


The cylindrical icons in the figure represent routers, and the rectangular icons represent Ethernet LAN switches. Routers are networking devices that connect to multiple physical networks, such as the multiple Ethernet networks in the figure. Routers also forward data from one network to the next. When you drive in your car and reach an intersection, the road signs tell you where to turn; in networking, the routers create the equivalent of a road sign, but the router tells the data packets which way to turn. The complete process by which a computer sends the data, passing though all the routers and eventually arriving at the destination, is called routing. The following list shows the three main routing steps in Figure 10-1:

1.

Hannah sends her data to R1, much like a driver might drive to where he can get on the interstate highway. To send the data to R1, Hannah's PC sends an Ethernet frame to R1's MAC address, much like a driver might use local roads to reach the on-ramp to the highway.

2.

R1 knows that to get the data to a computer in Cincinnati, it must forward the data to R2, instead of sending the data to R3 next. This process is much like a driver choosing which direction to go on the interstate highway, based on the road signs. (Because the physical network between R1 and R2 is an Ethernet, R1 forwards the data to R2 using an Ethernet frame.)

3.

R2 sends the data to the destination computer over the LAN much like the driver finishes his trip by getting off the interstate highway and driving over the local roads in Cincinnati.

If you consider these steps a little more closely, three devices need to forward the data at some point: Hannah, R1, and R2, in succession. Each time, to get the data to the next device, the devices need to send the data over an Ethernet LANand you already know how that works from reading Chapters 4, "How to Build a Local (Network) Roadway," through 7, "Adding Local (Network) Roadways for No Extra Money." In sequence, Hannah uses Ethernet to send the data to R1; R1 uses the second Ethernet network to send the data to R2; finally, R2 uses the third Ethernet to send the data to the web server.

note

As I mentioned before, the word "network" can be used in a lot of different ways. In one way of thinking, Figure 10-1 shows a single network, but in another way of thinking, it shows four Ethernet networks, which are then separated by three routers. Another related term, called internetwork, is sometimes used when you need a more exact term. If you consider each of the four Ethernets in Figure 10-1 as individual networks, you can think of the whole diagram as an internetwork, which is short for "interconnected networks." Keep in mind that people use the term "network" in a lot of different ways.


Although Figure 10-1 shows only LANs, the routers could be connected to a wide-area network (WAN). In fact, one of the main benefits of routers, besides helping forward data through the network, is to connect to many different types of physical networks. In later chapters, particularly in Chapters 14, "Leasing a (Network) Roadway Between Two Points," and Chapter 15, "Leasing a (Network) Roadway Between Lots of Places," you will learn how routers use WANs to transmit data, much like they can use LANs to transmit data. Regardless, the basic process of routing happens the same way, whether you use LANs, WANs, or a combination of the two. In fact, one of the reasons that routers are popular is because they can connect many different types of physical networks with ease.

This first simple example portrays the concepts of routing, which is the overall process by which computers and routers together forward the data to the correct destination. To appreciate more of the details of routing, you need to have a better understanding of IP, IP addresses, and how they affect routing.

IP as the Postmaster General of the Network

The U.S. Postal Service (USPS) uses an address system that consists of a number, street name on which the building is located, town or city, state, and zip code. The USPS intended for each address in the country to be unique in some way. In a given state, all towns must have different names. In each town, each street must have a different name. Finally, on each street, each building must have a different number. This system allows each address in the country to be unique. By having unique addresses, the postal service doesn't get confused about where to send a letter.

The postal service includes information in the address so that sorting the mail is made as easy as possible. A postal worker in Georgia can see a letter addressed to someone in Ohio and make a choice to immediately sort that letter into the bag that's being sent to Ohio. After the letter is in Ohio, the mail sorter can look for the name of the town and send the letter there. At the local post office for that town, the postal sorter can look at the street address. So, the process of sorting is simplified by the information in the address.

IP is the TCP/IP protocol that most closely matches Layer 3 in the OSI networking model. IP defines addressing, as well as routing, including the underlying details of the routing example in Figure 10-1. Like the postal service, IP defines addresses so that they have structure, allowing easy routingthe networking equivalent of mail sorting. IP also states that everyone should have a unique IP address (just like the USPS requires unique postal addresses) to avoid confusion when trying to deliver data to that address. The postal service defines addressing details so that letter carriers can easily and efficiently deliver the mail; similarly, IP defines IP addressing details to facilitate easy and efficient forwarding of IP packets.

Each network interface on a computer needs an IP address. A network interface is simply a card inside a computer that has a physical connector for some type of network, such as an Ethernet network interface card (NIC). The NIC takes care of TCP/IP network interface layer details, which are the equivalent of OSI Layers 1 and 2. The TCP/IP internetworking layer, implemented by the IP protocol, defines these logical IP addresses. Most end user computers have a single network interface, meaning that the computer has only one IP address. However, any device that has at least one IP address can send and receive IP packets and is considered to be a TCP/IP host, or simply host.

Devices that have more than one network interface have more than one IP address. Routers typically have multiple network interfaces, and some servers have multiple interfaces as well.

IP addresses are 32-bit binary numbers, but because humans would find it inconvenient to write down 32-bit numbers, the addresses are written in decimal. The format of IP addresses is often called canonical format; sometimes it's called dotted decimal format. For example, the next two lines show the binary version of an IP address, followed by the same IP address written as a dotted-decimal number. It's obvious from comparing the two that, given a choice, it's much easier to work with the decimal version:

00001000 00000100 00000010 000000001

8.4.2.1

Each of the decimal numbers in an IP address is called an octet. (The term octet is just another term for the word byte.) So, each decimal octet represents 8 bits of the IP address, and with 4 octets (separated by periods), the whole dotted decimal IP address represents 32 bits.

Appendix B, "Converting IP Addresses Between Decimal and Binary," explains how you can convert back and forth between the binary and decimal versions of an IP address. You really don't need to think about IP addresses in binary to learn what's covered in this chapter. However, if you would like to understand more about converting between binary and decimal formats of IP addresses, feel free to read Appendix B.

Knowing the Address Before Driving to the Destination

Let's get back to the more important conceptual details. When you use a shipping company to send a package to someone, you fill out a shipping label, which includes the street address to which you are sending the package. If you fill out the whole label, you also put your return address on the label, so in case there's a problem, the shipper can return the package to you.

Similarly, IP defines a header that includes a source and destination IP address. So, to send data from one computer to the other, the sender puts the destination computer's IP address into the destination IP address field in the IP header. Similarly, the sender puts its own IP address in the source IP address field in the header.

Figure 10-2 shows the same network as Figure 10-1, but it now shows Hannah's IP address, as well the web server's. It shows a single IP packet, sent by Hannah, to the server.

Figure 10-2. Using Addresses on the (IP) Shipping Label


IP defines a 20-byte long header, which includes a 4-byte source IP address and a 4-byte destination IP address. An IP packet includes the IP header, along with any data that follows the IP header. Although other parts of the IP header are interesting, the address fields are crucial.

note

You might recall that Ethernet includes a source and destination Ethernet address field in the Ethernet header, and that those addresses are 6 bytes long each. The IP addresses mentioned here are indeed different addresses, and they are used to allow networking devices to send data over a large network that includes other types of physical networks besides Ethernet.


When sending a packet, the destination IP address field in the IP header defines where the packet should be sent. The computers, and the routers between them, understand that the packet should be forwarded based on the destination IP address. The source IP address in the header is also important because after the packet is delivered to the destination computer, it will want to reply. That computer knows the IP address of the computer that sent the original packet by looking at the source IP address. For instance, in Figure 10-2, when the web server gets the packet and needs to respond, it knows to send the response packet to 1.1.1.1.

The term "packet" has a specific meaning in networking. It implies some data that includes the Layer 3 header, plus any encapsulated data. In the TCP/IP networking model, IP is the Layer 3 protocol, so an IP header and the data that follows it are IP packets. The term "segment," which you read about in Chapter 9, "Choosing Shipping Options When Transporting Goods over the (Network) Roadway," refers to data that includes the Layer 4 header (TCP) and any encapsulated data. The difference between a packet and a segment is that a segment does not include the Layer 3 header, but a packet does.

As a reminder, you might also recall from Chapter 5, "Rules of the Road: How to Use the Local (Network) Roadway," that the term "frame" refers to a data link header and its encapsulated data. In that chapter, an Ethernet header and trailer encapsulated some data to send the data over an Ethernet LAN. It's common to use the term "frame" to refer to the data link header, trailer, and data; "packet" to refer to the network layer (IP) header and data; and "segment" to refer to the transport layer (TCP) header and data.

When sending data, the IP software on a computer (Hannah in this example) encapsulates the higher-layer data inside an IP packet. For a more detailed appreciation of that concept, think back to the HTTP coverage in Chapter 8, "Shipping Goods over a (Network) Roadway," and Chapter 9's coverage of TCP. For Hannah to get the web page, she must send an HTTP GET request. To send HTTP messages, she must use TCP. As it turns out, to deliver the TCP segment to the other computer, TCP must use IP. Figure 10-3 shows the process of getting a home page with more detail, including the IP headers and IP packets.

Figure 10-3. IP Packets, Including Details About the Data


On a single computer, the different layers in the TCP/IP model work together to accomplish the ultimate goal, which is to give the end user the data that he needs. HTTP is concerned about getting a web page to the user. TCP is concerned about segmentation, error recovery, and other things, on behalf of HTTP. So, as you read in Chapter 9, TCP provides service to the application layerin this case, HTTP.

Similarly, IP (network layer) provides a service to the layer above it, namely TCP (transport layer): the service of end-to-end delivery of packets. TCP wants to send each segment to the other computer, but TCP does not define details about how the segment is delivered. Instead, TCP just asks IP for help. The IP software on Hannah puts an IP header around the segment. That header includes the correct source and destination IP address, which allows the IP protocol to deliver the packet to the web server.

Figure 10-3 shows what is inside the packet; however, just as a shipper does not care about what's in a package, IP does not care about the TCP header, the HTTP header, or the end user data. IP just needs to know the destination address so that it can forward the packet toward the destination. So, from IP's perspective, the IP packet looks like Figure 10-4.

Figure 10-4. IP Packets Ignoring Details About the Data


Putting a Name on the Shipping Label

The IP protocol defines how computers forward IP packets from end to end across an internetwork. However, most people tend to use names instead of addresses. Before a computer can send a packet to a particular destination IP address, the user must either supply the IP address of the other computer or a name for the other computer. For instance, Hannah probably typed in something like http://www.fredsco.com; she must somehow correlate the name (such as http://www.fredsco.com) to the corresponding IP address (such as 3.3.3.3).

The process by which Hannah figures out the IP address of another computer, based on the name, is called name resolution. Name resolution is covered in Chapter 13. For now, just to help complete the circle, keep in mind that people do refer to the name of the other computer, and the sending computer figures out the corresponding IP address.

Now that you know some of the basics of IP addressing and IP routing, the rest of this chapter looks into more details about IP addresses. After that, Chapter 11, "Knowing Where to Turn at Each Intersection (Router)," looks more closely at routing. Chapter 12, "Painting the Road Signs on Your Interstate (Internetwork)," examines how routers learn routes, and Chapter 13 covers how a computer resolves the name used by the user into the IP address that name implies.




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