TCP/IP's Big Three
An IP address is actually a combination of two required parameters, the IP address and the subnet mask. A third parameter, the default gateway, is not required unless you want your computer to be able to reach other networks besides the one you're on. That is, if you want to reach the Internet, you need a default gateway. For this reason, I've christened these three parameters TCP/IP's "Big Three":
Required. The IP address is the number that uniquely identifies your computer, just as a phone number uniquely identifies a phone. It's composed of four binary octets (a group of eight 1s and 0s), which, when expressed in decimal notation, look something like this:
Each of the four decimal numbers ranges from 0 to 255. And, just like a phone number, the IP address identifies which network the computer is on. On a computer internetwork, every network must be unique, and every device (or host) on a given network must be unique as well.
Again, I'll use the phone system to illustrate. The phone number (913) 555-2427 includes the network identifier of 913 and the host identifier of 555-2427. There can't be two networks with the 913 network number, and there can't be two phones in the 913 area code with a phone number of 555-2427.
So too the IP address, although the IP address needs some help to determine which of its octets are the network number and which are the host number. This is the job of the subnet mask.
Required. The subnet mask is used to divide the IP address into its network portion and host portion. Without the subnet mask, the computer has no idea what network it belongs to. Like the IP address, it's composed of four octets that look something like this when broken down for human consumption:
You can probably hazard a guess as to how this works. When communicating, your computer compares the IP address and subnet mask. The computer uses the 255s to calculate, or mask, the network portion of the IP address, and it uses the 0s to calculate the host number, as shown in Figure 9-2.
Figure 9-2. Masking determines the network number.
Your computer then uses this information to determine where to send the outgoing data. If the source network and destination network addresses match, the data is sent for delivery to the local network. If, on the other hand, the source and destination network addresses are different, the data package is delivered to the default gateway, as explained in the following chunk.
If you combined the IP address and subnet mask in the previous example, you would have a network identifier of 192.168.1 and a host identifier of .23.
Where the phone systemTCP/IP analogy breaks down is in the length of the network identifier. With the phone system, the "network number" (area code) always consists of three digits. With TCP/IP, the network numbers can vary, depending on the length of the subnet mask.
Another applicable TCP/IP analogy is the mail system. That is, each "packet" of mail has a destination address and a source (return) address. This information is used to help the computer answer a very fundamental question about outgoing "mail": Is this "package" destined for a computer that's on the same network I'm on, or is it destined for another network? If the answer is "another network," the default gateway steps in to perform its magic.