TCP/IP First-Step [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

TCP/IP First-Step [Electronic resources] - نسخه متنی

Mark A. Sportack

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






The Numbers Game


Like so many things in life, numbers are more complicated than initially meets the eye. IP addresses, in particular, are much more complicated than they appear. To truly appreciate them, you need to understand not one, but two number systems!

What's a number system, you ask? A number system is an organized approach to identifying mathematical values. A number system includes such features as a set of symbols and a standard means of correlating each symbol with a specific value. In the case of IP addresses, the address is an easy way to represent a much larger and harder to remember binary number. Done right, a number system with any symbols can represent literally every possible number from negative infinity to 0 to positive infinity, and every number in between. That might sound like a tall order, but number systems are remarkably simple. After you establish the symbols and their corresponding values, the rest builds on that basic foundation.

To understand IP addresses, you need a solid grasp of both the Base10 and Base2 number systems. Those names are just fancy ways of telling you how many symbols form the basis of each system. The Base10 system has 10 symbols, whereas the Base2 system has just 2. Yet, each is equally capable of symbolizing any given mathematical value. The only difference is one of efficiency. After reading the following sections you have all the tools you need to better understand IP addresses.

Before you get too far into the numbers game, it might not be a bad idea to become familiar with IP addresses. How do you find yours?

Finding Your IP Address


Figuring out which IP address your computer uses is remarkably easy to do. Despite how easily you can accomplish this, few people other than network or system administrators ever do so. The reason is simple: TCP/IP works so well and seamlessly that you don't have to worry about minute details.

If curiosity ever gets the best of you, you can run a command called ipconfig from within an MS-DOS window. It tells you which IP address your computer uses. Open an MS-DOS window to run this utility. From most modern Windows operating systems, you can open a DOS window by clicking the Start button in the lower left of your screen, scrolling your mouse pointer upward until you highlight Programs, and then selecting MS-DOS Prompt. This is illustrated in Figure 6-6, which shows a Windows 98 operating system.

Figure 6-6. Opening an MS-DOS Window

[View full size image]

When you open the window, you see a blinking cursor; characters appear when you type them. Type the command ipconfig and press the Enter key. You see your computer's IP configuration. My computer's IP configuration is shown in Figure 6-7. Yours differs slightly, although the numbers adhere to the same format.

Figure 6-7. Running the ipconfig Command

[View full size image]

This command gives you three critical pieces of information about your computer:

IP address

Default gateway

Subnet mask


All three pieces of information have a similar format: four decimal numbers separated by dots. This format is known as dotted quad. However, only two of these octets are IP addresses. The first is your computer's IP address. This is the address it uses when communicating over a network. The ipconfig report's other valid IP address is the third one. That's the IP address of your computer's default gateway. A default gateway is a network device that your computer relies upon to figure out how to find any and all other computers in the network. So, it's extremely important for your computer to know the address of this machine!Chapter 7, "More Fun with IP Addresses."

Decimal Numbers


If you are like most people, you think naturally in the Base10, or decimal number system. Most humans have 10 fingers and 10 toes, so it seems natural to seldom think about other number systems. Base10 is easy to understand; only 10 symbols identify all numeric values.

These symbols are used in the decimal number system: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Virtually every possible number can be represented using just these symbols. You might need them in different combinations, and you might need a lot of them, but you can identify every possible mathematical value using only these symbols.

The key to making this small set of symbols so scalable lies in the architecture of the decimal number system. The actual value represented by each symbol can only be determined by its position. For example, the number 2 can be 2 or it can be 2 groups of 10 (depending on where in the number each symbol is positioned).

Table 6-1 better explains how a symbol's value can vary based on its position in a number. The number dissected in this example is 123. That's actually shorthand notation for 1 group of 10 raised to the second power (which equals 100), 2 groups of 10 raised to the first power (which equals 10), and 3 groups of 10 raised to the zero power (which equals 1). Say it another way: You have 1 group of 100, plus 2 groups of 10, plus 3 groups of 1 for a grand total of 123.

Table 6-1. Values Increase by Powers of 10

Powers of 10

102

101

100

Column Value

100

10

1

Symbol

1

2

3

Although the elementary review of the decimal number system might seem a bit out of place in this book, the intention is to familiarize you with the basic elements of a number system. By introducing these concepts using a familiar number system, you can enjoy a much better frame of reference for understanding an unfamiliar number system.

Binary Numbers


As natural as it is to think using Base10 numbers, it is every bit as logical for computers to "think" in the Base2, or binary number system. Computers are electrical devices. Literally everything they do is done with 1s and 0s. More specifically, each 1 is a momentary electrical current and each 0 is the absence of such a current. A 1 and 0 are the only symbols available in the Base2 number system. How on earth could you count to infinity using just two symbols? That's not as tough as you might think. The only problem is that with so few symbols you need more of them to symbolize any given number!

To better show this, take a look at converting the decimal number 123 into binary. Instead of using columns that identify powers of 10, Base2 uses columns that identify powers of 2. Table 6-2 shows the powers of 2 up to 2 to the eighth power using the decimal number 123 as an example.

Table 6-2. Values Increase by Powers of 2

Powers of 2

8th

7th

6th

5th

4th

3rd

22

21

20

Decimal Value

256

128

64

32

16

8

4

2

1

Binary Symbol

0

0

1

1

1

1

0

1

1

In Table 6-2, you can see that a whole string of symbols identifies the binary equivalent of the decimal number 123. In fact, the binary number representing that value is 1111011.

The key to understanding binary numbers is to recognize that each column where a 1 is present represents a power of 2. Just like Base10, where it is necessary to add 1 group of 100, 2 groups of 10, and 3 groups of 1 to get 123, Base2 requires you to do the same addition. Thus, the Base10 number 123 is expressed in Base2 as 1 group of 64, 1 group of 32, 1 group of 16, 1 group of 8, 0 groups of 4, 1 group of 2, and 1 group of 1. Adding 64 + 32 + 16 + 8 + 2 + 1 equals 123.

It's customary in mathematics to omit any leading 0s, because they have literally no value. A 0 in the middle of a number has great significance; omitting it shifts all the other numbers into different columns! The practice of omitting leading 0s is known as zero suppression. As you see later in this chapter, zero suppression doesn't always apply in the world of IP addresses.

What does any of this have to do with IP addresses? Plenty! These two number systems, and the ability to translate back and forth between them, are critical to appreciating IP addresses. Check out an IP address's architecture.


/ 133