Chapter 6: Dealing with TCPIP


TCP/IP is the basic protocol by which computers on a network talk to each other. Without TCP/IP, networks wouldn't work. In this chapter, I introduce you to the most important concepts of TCP/IP.

Warning 

This chapter is far and away the most technical chapter in this book. It helps you examine the binary system, the details of how IP addresses are constructed, how subnetting works, and how two of the most important TCP/IP services-DHCP and DNS-work. You don't need to understand every detail in this chapter to set up a simple TCP/IP network. However, the more you understand the information in this chapter, the more TCP/IP will start to make sense. Be brave.

Understanding Binary

Before you can understand the details of how TCP/IP-in particular, IP-addressing works, you need to understand how the binary numbering system works because binary is the basis of IP addressing. If you already understand binary, please skip right over this section to the next main section, "Introducing IP Addresses." I don't want to bore you with stuff that's too basic.

Counting by ones

The binary counting system uses only two numerals: 0 and 1. In the decimal system to which most people are accustomed, you use ten numerals: 0 through 9. In an ordinary decimal number, such as 3,482, the rightmost digit represents ones; the next digit to the left, tens; the next, hundreds; the next, thousands; and so on. These digits represent powers of ten: first 100 (which is 1); next, 101 (10); then 102 (100); then 103 (1,000); and so on.

In binary, you have only two numerals rather than ten, which is why binary numbers look somewhat monotonous, as in 110011, 101111, and 100001.

The positions in a binary number (called bits rather than digits) represent powers of two rather than powers of ten: 1, 2, 4, 8, 16, 32, and so on. To figure the decimal value of a binary number, you multiply each bit by its corresponding power of two and then add the results. The decimal value of binary 10101, for example, is calculated as follows:

   1 _ 20  = 1 _   1 =    1 + 0 _ 211 = 0 _   2 =    0 + 1 _ 222 = 1 _   4 =    4 + 0 _ 233 = 0 _   8 =    0 + 1 _ 244 = 1 _  16 =  16                                 21 

Fortunately, a computer is good at converting a number between binary and decimal-so good, in fact, that you're unlikely ever to need to do any conversions yourself. The point of knowing binary isn't to be able to look at a number, such as 1110110110110, and say instantly, "Ah! Decimal 7,606!" (If you could do that, Barbara Walters would probably interview you, and they would even make a movie about you-starring Dustin Hoffman and a vintage Buick.)

Instead, the point is to have a basic understanding of how computers store information and-most important-to understand how the hexadecimal counting system works (which is described in the following section).

Here are some of the more interesting characteristics of binary and how the system is similar to and differs from the decimal system:

  • The number of bits allotted for a binary number determines how large that number can be. If you allot eight bits, the largest value that number can store is 11111111, which happens to be 255 in decimal.

  • Tip 

    To quickly determine how many different values you can store in a binary number of a given length, use the number of bits as an exponent of two. An eight-bit binary number, for example, can hold 28 values. Because 28 is 256, an 8-bit number can have any of 256 different values-which is why a byte, which is eight bits, can have 256 different values.

  • This powers-of-two concept is why computers don't use nice, even, round numbers in measuring such values as memory or disk space. A value of 1K, for example, isn't an even 1,000 bytes-it's 1,024 bytes because 1,024 is 210. Similarly, 1MB isn't an even 1,000,000 bytes but rather is 1,048,576 bytes, which happens to be 220.

Doing the logic thing

One of the great things about binary is that it is very efficient at handling special operations called logical operations. Four basic logical operations exist, although additional operations are derived from the basic four operations. Three of the operations-AND, OR, and XOR-compare two binary digits (bits). The fourth (NOT) works on just a single bit.

The following list summarizes the basic logical operations:

  • AND: An AND operation compares two binary values. If both values are 1, the result of the AND operation is 1. If one or both of the values are 0, the result is 0.

  • OR: An OR operation compares two binary values. If at least one of the values is 1, the result of the OR operation is 1. If both values are 0, the result is 0.

  • XOR: An XOR operation compares two binary values. If exactly one of them is 1, the result is 1. If both values are 0 or if both values are 1, the result is 0.

  • NOT: The NOT operation doesn't compare two values. Instead, it simply changes the value of a single binary value. If the original value is 1, NOT returns 0. If the original value is 0, NOT returns 1.

    Tip 

    Logical operations are applied to binary numbers that have more than one binary digit by applying the operation one bit at a time. The easiest way to do this manually is to

    1. Line one of the two binary numbers on top of the other.

    2. Write the result of the operation beneath each binary digit.

    The following example shows how you calculate 10010100 AND 11011101:

         10010100 AND 11011101     10010100 

    As you can see, the result is 10010100.




Networking For Dummies
Networking For Dummies
ISBN: 0470534052
EAN: 2147483647
Year: 2004
Pages: 254
Authors: Doug Lowe

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net