How to Run a (Network) Postal Service


The postal service provides the public with a wonderful service. You put a letter into the mailbox, and it magically appears at the right addressmost of the time, at least. The IP protocol defines a similar service for networks. By sending an IP packet into the network, with a correct destination address, the networking devices should collectively be able to forward the packet to the right destination.

This section takes you a little deeper into IP addressing. To understand these concepts, I'll sprinkle in a few comments about routing. Why? Well, IP addresses work like they do in part to help routing work well. Chapter 11 covers more details about the routing process.

One Location, One Zip Code, One Network Number

So far, you learned what IP addresses look like when written down4 decimal numbers, between 0 and 255 inclusive, separated by periods. However, you also need to know more about the structure and meaning of these addresses. The structure and meaning of the addresses tells you about how IP addresses are used in an internetwork.

More postal service analogies can help, mainly because the concepts happen to be similar. In addition to the number, street, town, and state, the postal service uses zip codes to make it easy to sort the mail. (For anyone not familiar with zip codes in the U.S., a zip code is the U.S. version of what other countries call postal codes.) The postal service includes a zip code in everyone's address. It also ensures that everyone in the same general geographical area has the same zip code. For instance, everyone who lives in the same town that I do has the same zip code.

Zip codes allow the postal service to easily sort mail using automated mechanical sorting machines. The sorting machines look for the zip code on the front of the letter and ignore the rest of the address. Early technology for looking at and recognizing hand-written numbers and letters worked a lot better when looking for numbers, so the sorting machines were designed to look for the numeric zip code. Also, by sorting based on zip code, the USPS could overcome issues such as misspelled city names. So, the sorters could sort based on zip code, and the postal workers could deliver the letters for a particular zip code to the post office that handles mail for that zip code.

The only time the whole postal address is needed is when the letter gets to the final post officethe one that handles mail for that zip code. For instance, imagine there's a letter in the post office in Cincinnati, with a delivery address in Mason, Ohio, which is a suburb of Cincinnati, zip code 45040. The sorting machine in Cincinnati just looks at the zip code, which sorts the letter into the bin of letters that will be sent to Mason. When the letter is in the Mason post office, the local postal worker looks at the whole address, including the street name and number, so that the letter is given to the right mail carrierthe one who drives past that address each day. Figure 10-5 depicts this simple example.

Figure 10-5. Postal Sorting Using Zip Codes


The following list depicts the process shown in the figure:

1.

Someone has written a letter and addressed it to me at an address in Mason, Ohio. The person either brings the letter to the post office in Cincinnati or drops it in a mailbox in Cincinnati. Either way, the letter ends up in the post office in Cincy, and a decision needs to be made.

2.

Either a postal worker or more likely a mail-sorting machine sorts the letter. The sorter puts the letter shown in the figure into a pile of letters that will be put into a truck and driven to Mason. The letter is sent to the Mason post office.

3.

At the Mason post office, the letter is sorted again. However, in this case, the sorter in Mason looks at the whole address, including the street address. The letter is put on the truck that passes by 1010 Elm street in Mason each day. That way, the driver can stop at that address and leave the letter in the mailbox.

IP routing works somewhat like the way the USPS forwards letters. For instance, the IP routing process relies on the fact that all IP addresses on the same physical networksuch as all IP addresses on one Ethernet LANhave a portion of their IP addresses in common. This part of the address that is the same on all IP addresses on that physical network works just like a zip code. Just as zip codes identify a bunch of postal addresses that are in the same general area, all the IP addresses on the same Ethernet are in the same general area, so routing can take advantage of that fact.

Examples definitely help for this idea. Consider Figure 10-6, which shows a simple internetwork with two routers and three IP networks.

Figure 10-6. IP Zip Codes: Network Numbers


The conventions of IP addressing and IP address grouping make routing easy. In this example, all IP addresses on the Ethernet on the left begin with a first octet of 1. Similarly, all IP addresses that begin with 2 are on the Ethernet in the middle, and all IP addresses that begin with 3 should be on the Ethernet on the right. If you need to put a new computer on the leftmost Ethernet, you just need to give it an IP address that starts with 1, in addition to making sure that no other devices on that LAN are already using that IP address.

These conventions make routing easy. For instance, imagine the logic needed by R1 in Figure 10-6 to forward packets:

  • Packets whose destination begins with 1 should be forwarded to the left.

  • Packets whose destination begins with 2 should be forwarded to the Ethernet on the right.

  • Packets whose destination begins with 3 should be forwarded to the right, sending them to R2 so that R2 can forward the packet.

The routers do not have to know about every IP address in the network; they just need to know about each group of addresses. It's just like the idea that a postal sorting machine in Texas doesn't need to know every street address in Mason, Ohio; it just needs to know that if the zip code is 45040, the letter should be sent to Mason. When Hannah sends a packet to the http://www.fredsco.com web server (IP address 3.3.3.3), Hannah sends the packet to R1. R1 knows that all addresses that start with 3 can be reached by sending the packet to router R2, so R1 just forwards the packet to R2. R2, in turn, knows that all addresses that begin with 3 are on the Ethernet to its right, so it can send the packet directly to the web server on that Ethernet.

IP calls the group of IP addresses that share a common beginning to part of their addresses an IP network. Figure 10-6 shows three IP networks.

note

The term "network" is used in a variety of ways and for slightly different meanings. Back in Chapter 1, "What Is a Network?," I defined a network as "a combination of hardware, software, and cabling, which together allow multiple computing devices to communicate with each other." When talking about IP addressing, the terms "network" and "IP network" have a different and more specific meaning, as will be explained in the upcoming pages of this chapter.


To talk about IP networks, you would use phrases such as "network 1" or "IP network 1" when referring to the group of IP addresses that start with a 1. However, when you're writing something down or typing something when you are working with a networking device, you use a special number that represents each network. That special number for each network is called an IP network number, or simply network number. Each network number represents a network.

Each IP network number has the same first part of the IP address as all the addresses in the network, but it has all 0s for the remaining octets. So, the network number looks like an IP address, but a host cannot use a network number as an IP address in the network. (Remember: A computer that has an IP address is referred to as a "host.") For instance, in the left-side Ethernet in Figure 10-6, all hosts begin their addresses with a single octet of 1. In that case, the network number is 1.0.0.0. Similarly, the other two network numbers in the figure are 2.0.0.0 and 3.0.0.0.

Three Sizes Fit All

How many IP addresses can you have in network 1.0.0.0? As it turns out, you can't use the number 1.0.0.0 because that's the network number. You also can't use 1.255.255.255; that number is reserved for other reasons. However, any other IP address that starts with 1 would be valid. If you counted all the addresses, you would end up with more than 16 million addresses!

IP defines these three sizes of networks as different classes of networks. The three different network classes are called Class A, B, and C. By definition, all addresses in the same Class A, B, or C network have the same numeric value network portion of the addresses. The rest of the address is called the host portion of the address. For example, in a Class A network such as network 1.0.0.0, all addresses begin with the number 1 in the first octet. The last 3 octets of these addresses comprise the host part of the address.

When the TCP/IP RFCs first defined the concept of networks, such as networks 1.0.0.0, 2.0.0.0, and 3.0.0.0, those same RFCs defined two other classes of networks. Whereas networks 1.0.0.0, 2.0.0.0, and 3.0.0.0 provide more than 16 million addresses each, another (class B) of network gives us a little more than 65,000 addresses. Still another (class C) gives us 254 addresses per IP network. The people who designed TCP/IP addressing simply decided that the world would need three sizes of networks.

Comparing Class A, B, and C addresses, they each have a different length for the network and host part of the addresses. By doing so, each class of network allows a different number of host addresses. To understand that fully, first consider the formats of the three classes of IP networks, as listed in Table 10-1.

Table 10-1. Sizes of Network and Host Parts of IP Addresses

Any Network of This Class

Number of Network Bytes (Bits)

Number of Host Bytes (Bits)

Number of Addresses per Network[*]

A

1 (8)

3 (24)

224 2, or 16,777,214

B

2 (16)

2 (16)

216 2, or 65,534

C

3 (24)

1 (8)

28 2, or 254


[*] Each network has two reserved host addresses.

Class A networks have 1 octet (byte) in the network part of the address, and 3 octets in the host part. Because you can have any values in the host part of the address, you can have 224 different IP addresses that all start with the same number in the first octet. Of those 224 addresses, two are reserved. So, each Class A network has a ton of addressesmore than 16 million.

Each Class B network requires that all addresses in the network use the same first 2 octets. That means the network part of these addresses is 2 octets long, leaving only 2 octets for the host part. Because the host part can have any value in it (except the two reserved values), you can have 2162 host addresses in each Class B network.

Similarly, Class C networks have 3 octets in the network part of the addresses, meaning that every address in one Class C network must have the same value in the first 3 octets. That leaves 1 octet as the host part, implying 282, or 254, host addresses per Class C network.

Figure 10-7 shows the same network diagram as in Figure 10-6, but this time with three different classes of IP network numbers shown.

Figure 10-7. Small, Medium, and Large IP Networks


This internetwork still uses three different IP network numbers, as does Figure 10-6. By using one IP network number for each physical network, this internetwork conforms to the rules that allow easy routing. Each network sits on a LAN, with routers separating the networks. However, two of the networksClass B network 130.4.0.0 and Class C network 199.1.1.0are much smaller than the Class A networks used in Figure 10-6.

For a closer look, consider network 8.0.0.0 for a moment. It is a Class A network, which means that only 1 byte is used for the network part of the address. As mentioned before, all hosts in network 8.0.0.0 begin with 8. So, 8.0.0.1 is a valid IP address in that network, as is 8.0.0.2, 8.0.0.3, 8.0.0.4, 8.0.0.5, and so on. The actual number of valid host addresses in Class A network 8.0.0.0 is 16,777,214.

Similarly, Class B network 130.4.0.0 has a 2-octet network part, leaving 2 octets for the host part. The valid IP addresses in this network begin with 130.4.0.1 and proceed to 130.4.0.2, 130.4.0.3, 130.4.0.4, and so onin this case, there are 65,534 addresses in Class B network 130.4.0.0. With Class C network 199.1.1.0, the first valid host address is 199.1.1.1, the second is 199.1.1.2, and so on, with a total of 254 valid host addresses in the network.

The beauty of using one IP network per physical networksuch as one IP network per Ethernet LANis that routing works well whether you have 10 computers installed or 10,000. In Figure 10-7, R1 and R2 still need only three facts to route packets: where to send packets destined for network 8.0.0.0, where to send packets to network 199.1.1.0, and where to send packets destined for network 130.4.0.0.

Simply put, Class A networks allow for a ton of IP addresses in a single IP network, Class B networks allow for a pretty large number, and Class C networks allow for a smaller number of host IP addresses. The people who made up IP addressing chose three sizes of networks because one size doesn't fit all companies and organizations. Larger companies can use Class A, medium-sized companies can use Class B, and small companies can use Class C.

The Actual Class A, B, and C Network Numbers

The previous example included three networks: Class A network 8.0.0.0, Class B network 130.4.0.0, and Class C network 199.1.1.0. There are other Class A, B, and C networks, however.

The different Class A, B, and C network numbers do not overlap in order to prevent address duplication. If TCP/IP allowed a Class A network 8.0.0.0 and a Class B network 8.1.0.0, IP address 8.1.1.1 would appear to be in both networks, which would cause a lot of confusion. Likewise, if some house on the other side of town had the same mailing address as yours, the postal service would probably get confused.

To avoid such confusion, IP defines a range of Class A, B, and C network numbers. Table 10-2 summarizes the network numbers, the total number of each type, and the number of hosts in each Class A, B, and C network.

Table 10-1. List of All Possible Valid Class A, B, and C Network Numbers[*]

Class

First Octet Range

Valid Network Numbers

Total Number of Networks of This Class

A

1 to 126

1.0.0.0 to 126.0.0.0

272, or 126

B

128 to 191

128.1.0.0 to 191.254.0.0

2142, or 16,382

C

192 to 223

192.0.1.0 to 223.255.254.0

2212, or 2,097,150


[*] The Valid Network Numbers column shows actual network numbers. There are several reserved cases. For example, network 0.0.0.0 (originally defined for use as a broadcast address) and 127.0.0.0 (still available for use as the loopback address) are reserved. Networks 128.0.0.0, 191.255.0.0, 192.0.0.0, and 223.255.255.0 also are reserved.

You can see that Class A networks can begin with anything from 1 to 126 in the first octet. So, 1.0.0.0, 2.0.0.0, 3.0.0.0, 4.0.0.0, and so on, up to 126.0.0.0, are valid Class A network numbers. Similarly, Class B networks start with anything from 128 through 191. However, because a Class B network has a 2-octet network part, the network numbers are 128.1.0.0, 128.2.0.0, 128.3.0.0, and so on, up through 191.254.0.0. Finally, Class C networks' first octet ranges from 192 through 223, with the first 3 octets comprising the network part of the addresses in those networks.




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