The Architecture of an IP Address
IP addresses, as you notice when checking your computer's IP configuration, use a dotted quad format. That is, they consist of four decimal numbers separated by dots. Therefore, 10.28.118.225 is a valid IP address expressed in dotted quad format. That's nice, but those are decimal numbers. Remember: People think in Base10, but computers are designed to work with Base2. Using decimal numbers to identify computers seems a bit contradictory.The truth is, those decimal numbers aren't your computer's IP address! They're a façade for the real IP address. That façade, more properly known as a mask, hides your real IP address because the real address would be utterly impossible to work with.
The Real Deal
The real deal on IP addresses is that they are deceptive. They're not made with decimal numbers, nor do they consist of four parts. The fact is that the dotted quad format was developed to make it easier for human beings to use IP addresses. The real IP address is a binary number. In fact, it is a 32-bit binary number. The term 32-bit warrants closer examination. A bit is a computer term. Certainly you've heard of bits and bytes, but take a moment to ensure this book's use and your understanding are the same.Although bit is a word with many different definitions, it is used here as an abbreviation. A bit is an abbreviation of binary digit. It is the smallest unit of data and can have a value of either 0 or 1. See the connection: binary digita value of either 0 or 1?The potential for confusion here is tremendous: Bits can have a value of either 0 or 1, but please don't confuse them with the actual characters 0 and 1! You see, a single character is known in computer terms as a byte or a binary term. That byte is made up of usually 8 bits. You need all 8 bits to identify a specific character or byte. A binary digit, or bit, cannot be an entire character for the simple reason that there are only two of them: the 0 and the 1. When you see the term bit, think of it as the smallest unit of datanot a character unto itself. Bytes convey individual characters.Given no design criteria other than a 32-bit binary number, an IP address could be this:11000000101010000000101011101101
One look should tell you that such an address is not usableat least not usable by humans! There are too many digits, and limiting your symbols to just two (0 and 1) means that the pattern will likely be highly repetitive. That repetitiveness makes it even harder to remember any given number. Clearly, if IP addresses were to be usable there had to be a better way.
User-Friendly IP Addresses
Although IP addresses are assigned to printers, servers, and even desktop computers that are attached to a networkand those devices are all quite comfortable with binary numbersit is the user community that must use them. People tend to think more naturally in the Base10 or decimal number system. More importantly, people tend not to remember lots of long numbers.Those simple facts raised a great challenge to the Internet Engineering Task Force (IETF): How do we make the Internet's addressing system efficient enough for the world's computers and friendly enough for people to use? There is no one correct answer. In fact, this quandary has three main solutions:Break the 32 bits into smaller pieces that are easier to remember.Use decimal numbers instead of binary.Support the use of user-friendly names that can be automatically translated to numeric addresses.
Of these three solutions, only the first two are architectural features of IP addresses. The last one is a critical function, but it's more an add-on than a native attribute. As such, you look at it much later in this book in Chapter 11, "How Do I Get There from Here?"
Decimal Numbers Are Easy to Remember
The absolute maximum number of unique addresses you can create with a 32-bit address is 2 to the 32nd power, or 4,294,967,296 addresses. Converting any given 32-bit string of binary numbers into decimal numbers would, at least in theory, make the number more human friendly.Unfortunately, a 32-bit binary number can translate into a decimal number so large that it, too, is meaningless to human beings. Imagine trying to remember whether your computer's address is 4,217,824,125 or 4,217,842,125. Those numbers are much easier to remember than their binary equivalents (which are 11111011011001101110001101111101 and 11111011011001110010100111001101, respectively, in the Base2 number system). They are still far too cumbersome to be useful. You would have great difficulty remembering your own IP address, much less trying to remember the IP addresses of useful destination machines.Clearly, converting binary numbers to decimal was a step in the right direction. However, large decimal numbers are only slightly easier to use than large binary numbers. If the Internet's address system was going to be accepted, it had to be even more user friendly.
Smaller Numbers Are Easier to Remember
One way to make a lengthy digit string easier to remember is to break it into smaller pieces. With an IP address, you start with a single binary number that is 32 bits long. Trying to subdivide that poses a couple of interesting challenges. For example, you first have to decide how finely you'd like to divide those 32 bits. The IETF has taken care of this by deciding that an IP address should be broken into four equal-sized pieces of 8 bits each. Then you need some way to identify the boundaries between those pieces. Such a device is known as a delimiter and can literally be any symbol. The IETF has decreed that a dot or period is the right delimiter for use in this case.Thus, the convention was set: IP addresses would take the following format:11000000.10101000.00001010.11101101
One interesting implication of arbitrarily sticking dots between the bits is that you must break away from the mathematical tradition of zero suppression. Did you notice the third group of bits in the preceding example starts with four 0s? If that were a number by itself, the value of the bit string would be the same with or without those leading 0s. However, it isn't a separate number. Instead, it's 8 binary digits in the middle of a larger sequence of binary digits. Suppressing those 0s wouldn't change the decimal translation of that group of bits, but it would change the entire address's decimal translation.Smaller numbers are much easier to remember than larger numbers. However, this is still the highly repetitive binary number system and even these small numbers get confusing. Although this is another step in the right direction, it seems only slightly better than the full 32-bit string.
Small Decimal Numbers Are the Easiest to Remember
The best approach seems to be to use small decimal numbers, not unlike those you see when you check your computer's IP configuration settings.When translated to decimal numbers, that bit string becomes 192.168.10.237. It isn't too difficult to see the advantages of using decimal numbers instead of raw binary numbers. That's still a mouthful of numbers and there aren't many people who memorize the numeric IP address of all the machines they access on the Internet. However, this dotted-decimal form of IP address is vastly better than raw binary numbers.