This chapter discusses the history and structure of the TCP/IP suite. The topics of this chapter are:
The purpose of an IP address is to identify each unique node on a network. On an IP network, each device is known as a host, and every host must have an address. The addresses we discuss first are actually IP version 4 addresses. (IPv6 addresses will be 16 bytes, or 128 bits long.) They are numeric addresses, stored as four bytes, which is equal to 32 bits. When we write these addresses, we usually place dots between the bytes, but you must understand that the dots do not exist in the addresses as used. This notation is sometimes referred to as dotted octet or dotted quad. (Each byte is called an octet because it has eight bits; there are four bytes in the address.)
Since the IP protocol stack was invented with networking in mind, IP addresses contain two parts: one to identify the address of the network a host is on, and the other part to identify the host itself. Every network is assigned an address which could be one, two, or three bytes, depending on the class of the network (A, B, or C). The remaining byte or bytes are typically used for hosts on networks.
Each byte in an IP address will be a number in the range 0 through 255, expressed in base 10 (decimal notation). To pass the certification test for this course, you will need to be able to convert decimal notation to binary notation and vice versa, by hand. No calculator conversion is currently allowed. You will need to know a conversion method to pass the test, so we will discuss one in class. The method presented in the text is similar to the one used in this course for several years.
The largest number that can be stored in one byte is 255. The is the sum of the values of all the the positions in the byte. Converting a binary number to decimal is simple: add the values of all the positions that hold a one. The only trick is to have a clear memory of the value of each position. They are all powers of two. Start on the right with 1, and double the value for the next position to the left: 2, 4, 8, 16, 32, 64, and 128.
When you convert a decimal number to binary, do a series of subtraction problems, one for each position in the byte, starting from the left. For example, let's convert 175 to binary.
Page 10-7 shows a chart of the five address classes you need to know. The first three classes can be described by the number of bytes assigned to the network portion of their addresses:
Class D and E addresses use portions of the fourth byte as well for network addressing. You may wish to know that only class A, B, and C addresses are in general use. Class D addresses are for multicasting (messages to groups of machines), and class E addresses are for experimental use.
One way to recognize the class of a given address is to know the range of possible addresses in each class, also shown on page 10-7. The five classes of addresses are defined as limited to specific ranges of values of the first byte. The numeric ranges are hard to remember until you see a chart that explains what the ranges have to do with the binary version of the first octet.
Some basic training in binary notation: a byte has eight bits. Each bit can be a digit in a binary number. Since we can only use 1s and 0s in binary notation, we either have (1) or don't have (0) the number of units represented by a position in the binary number.
Reading from left to right, if the first bit (position 7, above) of the first octet is a zero, that octet must represent a number less than 128. This defines a class A address: the first octet must be 127 or less. Consider it this way:
So, if you can convert the first octet of an address to binary notation, you can tell the address class by the position of the first 0 in it.
Most possible network addresses (not host addresses) have been assigned already. We will discuss how network administrators work around this.
The list below shows some specific addresses that have special meanings:
Consider the task of assigning addresses to hosts within your network. Host addresses should follow the network address scheme you are assigned. If your network address was 18.104.22.168, you would have a class B address, and all host IP addresses should begin with 150.60.
If you do not have an assigned address, you could use any address scheme you wanted as long as you did not attach to the Internet. However, in reality, everyone wants or needs the Internet, so you should use a private address scheme, as shown in the chart below. You can choose any address scheme for your network that gives you enough host IDs.
Private addresses work inside a network, but they cannot be routed to other networks, nor can you send signals to another network if you have a private address. (Great, then how do I get to the Internet? More magic in a minute.) To understand this, you need to know that all IP addresses in the world were meant to be unique. These are called registered or public addresses. This scheme would allow any IP addressed machine to contact any other (in theory) because the address would identify the network and the host uniquely. At a certain point, however, the world began to run out of addresses. (It was also believed that there would be networks that would have no need to contact other networks. Yeah, right...)
So the Internet Assigned Numbers Authority (IANA) has designated some address ranges as private or unregistered addresses. They are also called nonroutable addresses:
Any address beginning with a 10, for example, is assumed to be a private address. This is the format used in many networks, because it provides lots of addresses for hosts, and lots of room for subnets. (Later in this chapter.)
Within any organization, addresses in these ranges may be used without registering the addresses with IANA. Each address you use within your network must still be unique in your network. The problem is that there is no guarantee whatsoever that any address I use in my organization is not already in use in your organization, which makes direct networking between our networks unreliable, if not impossible.
The magic part: To access the Internet, traffic from a private address network passes through a router that acts as a proxy server, providing a shared connection with a registered address. That router has both a private address on your network, and a registered public address that lets it communicate with other networks. The proxy server shares its public address with the devices on your network, allowing them to send signals to other networks through it. The service that does this sharing of the address is called Network Address Translation (NAT).
The graphic and paragraph on page 10-12 give an introduction to the concept of subnets. Suppose your company has six divisions or locations, and logically needs six networks. Logically, you would want to be assigned six different network addresses (such as 22.214.171.124). Suppose, however, that you either cannot get or cannot afford licenses for six networks. Then you take the one network address that you do have and create six subnets. (Six, by the way, is not a magic number, it is just an example.)
Subnetting works by borrowing bits from the host portion of an address, and using those bits to identify subsections of your network. The use of borrowed bits only works because of subnet masks. A subnet mask tells hosts on a network which bits in an address are network address bits and which bits are host address bits. It does it by the use of 1s and 0s. Consider the table below:
Network devices read a mask to learn how to interpret addresses. Address positions marked by 1s in a mask are considered network address positions. Address positions marked by 0s in a mask are considered host address positions. Another way of saying this is that certain address bits are considered to be network address bits and the rest are considered host address bits. The actual method used involves Boolean math, but understanding it is not critical to understanding or using the concept. When a device reads an actual IP address, the rule from the subnet mask is applied, and the device understands which bits are the net address and which are the host address.
By borrowing one bit, two subnets are theoretically possible.
However, as a general rule, subnet numbers using all 1s and all 0s are
not used, so borrowing one bit will probably not yield any usable subnet
addresses. This is why the formula for number of usable subnets is:
Assume we borrow two bits in each of the three classes above. Borrowed bits are shown in red in the resulting subnet mask numbers below:
Note that the subnet masks above do not match the standard masks from the previous table. The standard masks are classful masks, because they match the intended use of class address schemes. The masks above are classless, because they do not match any network class.
Be aware that routers on the Internet only use the network bits of an address for routing. Routers connecting subnets within a network must use the network, subnet, and host bits for routing.
Page 10-13 begins the topic of assigning subnet addresses.
TCP/IP support is expected on networks. It was optional, previously, but the Internet has made it the common protocol suite for all networks of any note.
In an IP network, each device needs a unique IP address. Assignment of these addresses takes some planning. First, there are two major approaches:
Dynamic Host Configuration Protocol (DHCP) service allows us to dynamically assign IP addresses to hosts on an IP network. You need to understand that, as far as IP is concerned, "host" means any device on the network. Three methods for assigning addresses are listed:
Whether you use dynamic or static assignment, you can assign more than the IP address of a device. You can also specify what server to use for Domain Name Service (DNS), and what server to use for Gateway service (route to other networks). A DHCP server can provide this information when the device powers up, or it can be configured by hand as shown in the text.
A concept that is not covered in your book, but that belongs in this chapter is Classless Inter-Domain Routing (CIDR). CIDR is a router standard that allows the use of classless subnet masks. In the CIDR standard, IP addresses are followed by a slash and the decimal number of bits used in the network portion of the subnet mask.
An example of CIDR notation might be 126.96.36.199/24. This example shows a network address, 188.8.131.52. It is followed by a forward slash, and the number 24. The number 24 means that the subnet mask for addresses on this network uses 24 bits as network identifiers. This is the same thing as saying that the subnet mask for this network uses 3 bytes as network identifiers, which is the same thing as saying the subnet mask is 255.255.255.0. In the table below, the same network is described three ways. Each is telling us the same thing: IP addresses on this network hold network information in the first three numbers, and host information in the fourth.
When addresses are sent on networks that allow CIDR notation, they can include this helpful notation that is the equivalent of sending the subnet mask along with the address. This is particularly helpful in networks that use subnetting. In such cases, the number following the forward slash probably will not be a multiple of 8.