Lesson 2:IP Addressing. (cisco subnet calculator)

The self-contained IP addressing system is one of the most important elements of the TCP/IP protocol suite. IP addresses enable computers running any operating system on any platform to communicate by providing unique identifiers for the computer itself and for the network on which it is located. Understanding how IP addresses are constructed and how they should be assigned is an essential part of TCP/IP network administration.


After this lesson, you will be able to

  • Understand the elements of an IP address
  • List the IP address classes and their properties
  • Understand the function of a subnet mask
  • Describe how to create subnets on a network

Estimated lesson time: 20 minutes


An IP address is a 32-bit value that contains both a network identifier and a host identifier. The address is notated using four decimal numbers ranging from 0 to 255, separated by periods, as in 192.168.1.44. This is known as dotted decimal notation. Each of the four values is the decimal equivalent of an 8-bit binary value. For example, the binary value 10101010 is equal to the decimal value 170. To properly understand some of the concepts of IP addressing, it is important to remember that the familiar decimal numbers have binary equivalents.

In TCP/IP terminology, each of the 8-bit values that make up an IP address is called an octet (or sometimes even a quad), and the combination of four octets is called a word. The more traditional term byte was avoided because some computing platforms use a 7-bit rather than an 8-bit byte. Today, either octet or byte is appropriate.

IP addresses represent network interface adapters, of which there can be more than one in a computer. A router, for example, has interfaces to at least two networks and must therefore have an IP address for each of those network interface adapters. Workstations typically have only a single LAN interface, but in some cases, they use a modem to connect to another network, such as the Internet. When this is the case, the modem interface has its own separate IP address (usually assigned by the server at the other end of the modem connection) in addition to that of the LAN connection. If other systems on the LAN access the Internet through that computer's modem, that system is actually functioning as a router.

IP Address Assignments

Unlike hardware addresses, which are hard-coded into network interface adapters at the factory, network administrators must assign IP addresses to the systems on their networks. It is essential for each network interface adapter to have its own unique IP address; when two systems have the same IP address, they cannot communicate with the network properly.

As mentioned earlier, IP addresses consist of two parts: a network identifier and a host identifier. All of the network interface adapters on a particular subnet have the same network identifier but different host identifiers. For systems that are on the Internet, the Internet Assigned Numbers Authority (IANA) assigns network identifiers to ensure that there is no address duplication on the Internet. When an organization registers its network, it is assigned a network identifier. It is then up to the network administrators to assign unique host identifiers to each of the systems on that network. This two-tiered system of administration is one of the basic organizational principles of the Internet. Domain names are assigned in the same way.

Although the IANA is responsible for maintaining the network address assignments, virtually all of the IP addresses available using the current addressing scheme have already been assigned to Internet service providers (ISPs). When you are building a new network and want to obtain a registered network address, you now get one from an ISP, not directly from the IANA.

IP Address Classes

The most complicated aspect of an IP address is that the division between the network identifier and the host identifier is not always in the same place. A hardware address, for example, consists of 3 bytes assigned to the manufacturer of the network adapter and 3 bytes that the manufacturer itself assigns to each card. IP addresses can have various numbers of bits assigned to the network identifier, depending on the size of the network.

The IANA defines several different classes of IP addresses, which provide support for networks of different sizes, as shown in Figure 8.5. The configurations of the three basic IP address classes are listed in Table 8.2.

Figure 8.5  The three classes of IP addresses have different sized network and host identifiers

Table 8.2  IP Address Classes and Parameters

Class First Bits First Byte Values Network ID Bits Host ID Bits Number of Networks Number of Hosts

A

0

1–127

8

24

126

16,777,2 14

B

10

128–191

16

16

16,384

65,534

C

110

192–223

24

8

2,097,15 2

254

In addition to Classes A, B, and C, there are two more classes: D and E. Class D addresses begin with the bit values 1110 and are reserved for use as multicast addresses. A multicast transmission is one that addresses a specific group of systems on a network. Class E addresses begin with the bit values 11110 and are as yet unused.

To the mathematically adept, the numbers for supported networks and hosts might appear low. An 8-bit binary number can have 256 possible values, for example, not 254, as shown in the table. However, there are a few IP addressing rules that exclude some possible values:

  • All the bits in the network identifier cannot be set to zeros.
  • All the bits in the network identifier cannot be set to ones.
  • All the bits in the host identifier cannot be set to zeros.
  • All the bits in the host identifier cannot be set to ones.

The binary values of the first bits of each address class determine the possible decimal values for the first byte of the address. For example, because the first bit of Class A addresses must be 0, the binary values of the first byte range from 00000001 to 01111111, which in decimal form is 1 to 127. Thus, when you see an IP address in which the first byte is a number from 1 to 127, you know that this is a Class A address. In a Class A address, the network identifier is the first 8 bits and the host identifier is the remaining 24 bits. This means that there are only 126 possible Class A networks (network identifier 127 is reserved for diagnostic purposes), but each network can have up to 16,777,214 network interface adapters on it. Class B and Class C addresses devote more bits to the network identifier, which means that they support a greater number of networks, but at the cost of having fewer host identifier bits. This reduces the number of hosts on each network.

Subnet Masking

It may at first seem odd that IP address classes are assigned in this way. After all, there aren't any private networks that have 16 million hosts on them, so it makes little sense even to have Class A addresses. However, it's possible to subdivide IP addresses even further by creating subnets on them. A subnet is simply a subdivision of a network address that can be used to represent one LAN on an internetwork or the network of one of an ISP's clients. Thus, a large ISP might have a Class A address registered to it, and it might farm out pieces of the address to its clients in the form of subnets. In many cases, a large ISP's clients are smaller ISPs, which in turn supply addresses to their own clients.

To understand the process of creating subnets, you must understand the function of the subnet mask. When you configure a TCP/IP system, you assign it an IP address and a subnet mask. Simply put, the subnet mask specifies which bits of the IP address are the network identifier and which bits are the host identifier. For a Class A address, for example, the correct subnet mask value is 255.0.0.0. When expressed as a binary number, a subnet mask's 1 bits indicate the network identifier, and its 0 bits indicate the host identifier. A mask of 255.0.0.0 in binary form is as follows:

 11111111 00000000 00000000 00000000 

Thus, this mask indicates that the first 8 bits of a Class A IP address are the network identifier bits and the remaining 24 bits are the host identifier. The subnet masks for the three main address classes are listed in Table 8.3.

Table 8.3  Subnet Masks for IP Address Classes

Class Subnet Mask

A

255.0.0.0

B

255.255.0.0

C

255.255.255.0

If all addresses of a particular class used the same number of bits for the network and host identifiers, there would be no need for a subnet mask. The value of the first byte of the address would indicate its class. However, you can create multiple subnets within a given address class by using a different mask. If, for example, you have a Class B address, using a subnet mask of 255.255.0.0 would allocate the first 16 bits for the network identifier and the last 16 bits for the host identifier. If you use a mask of 255.255.255.0, you allocate an additional 8 bits to the network identifier, which you are borrowing from the host identifier. The third byte of the address thus becomes a subnet identifier, as shown in Figure 8.6. You can create up to 254 subnets using that one Class B address, with up to 254 network interface adapters on each subnet. An IP address of 131.24.67.98 would therefore indicate that the network is using the Class B address 131.24.0.0, and that the interface is host number 98 on subnet 67. A large corporate network might use this scheme to create a separate subnet for each of its LANs.

Figure 8.6  Changing the subnet mask enables you to create multiple subnets out of one network address

To complicate matters further, however, the boundary between the network identifier and the host identifier does not have to fall in between two bytes. An IP address can use any number of bits for its network address, and more complex subnet masks are required in this type of environment. Suppose, for example, you have a Class C network address of 199.24.65.0 that you want to subnet. There are already 24 bits devoted to the network address, and you obviously can't allocate the entire fourth byte as a subnet identifier, or there would be no bits left for the host identifier. You can, however, allocate part of the fourth byte. If you use 4 bits of the last byte for the subnet identifier, you have 4 bits left for your host identifier. To do this, the binary form of your subnet mask must appear as follows:

 11111111 11111111 11111111 11110000 

The decimal equivalent of this binary value is 255.255.255.240 because 240 is the decimal equivalent of 11110000. This leaves you with a 4-bit subnet identifier and a 4-bit host identifier, which means that you can create up to 14 subnets with 14 hosts on each one. (Subnet identifiers have the same rules about not using all ones or all zeros as do network identifiers and host identifiers.) Figuring out the correct subnet mask for this type of configuration is relatively easy. Figuring out the IP addresses you must assign to your workstations is harder. To do this, you have to increment the 4 subnet bits separately from the 4 host bits. Once again, this is easier to understand when you look at the binary values. The 4-bit subnet identifier can have any one of the following 14 values:

 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 

The Calculator tool included with Windows has a scientific mode that easily converts numbers between binary and decimal values. After launching the program, from the View menu, choose Scientific and then select either the Dec or the Bin option. You can then enter a value and click the other option to convert it.

Each one of these subnets can have up to 14 workstations, with each host identifier having one of the values from that same set of 14 values. Thus, to calculate the value of the IP address's fourth byte, you must combine the binary values of the subnet and host identifiers and convert them to decimal form. For example, the first host (0001) on the first subnet (0001) would have a fourth byte binary value of 00010001, which in decimal form is 17. Thus, the IP address for this system would be 199.24.65.17 and its subnet mask would be 255.255.255.240. The last host on the first subnet would use 1110 as its host identifier, making the value of the fourth byte 00011110 in binary form, or 30 in decimal form, for an IP address of 199.24.65.30. Then, to proceed to the second subnet, you increment the subnet identifier to 0010 and the host identifier back to 0001, for a binary value of 00100001, or 33 in decimal form. Therefore, the IP addresses you use on a network like this do not increment normally. You must compute them carefully to create the correct values.

Fortunately, there are utilities available that simplify the process of calculating these addresses so that you don't have to do them manually. One of the best of these is a freeware program from Net3 Group called IP Subnet Calculator, which is available for download at http://www.wildpackets.com/products/ipsubnetcalculator.

Run the SubnetMasking video located in the Demos folder on the CD-ROM accompanying this book for a demonstration of subnet masking.

Registered and Unregistered Addresses

Registered IP addresses are required for computers that are accessible from the Internet but not every computer that is connected to the Internet. For security reasons, networks typically use a firewall or some other technology to protect their systems from intrusion by outside computers. These firewalls use various techniques that provide workstations with access to Internet resources without making them accessible to other systems on the Internet.

These workstations typically use unregistered private IP addresses, which the network administrator can freely assign without obtaining them from an ISP or the IANA. There are special network addresses in each class, shown in Table 8.4, that are intended for use on private networks and are not registered to anyone. When building your own private network, you should use these addresses rather than simply choosing an address at random.

Table 8.4  IP Addresses for Private Networks

Class Network Address

A

10.0.0.0 through 10.255.255.255

B

172.16.0.0 through 172.31.255.255

C

192.168.0.0 through 192.168.255.255

IPv6 Addressing

When IP was originally designed, no one could have predicted the growth that the Internet has experienced in recent years. The 32-bit address space allotted to IP, which once seemed so enormous, is now in danger of being depleted. To address this problem, work is proceeding on an upgrade to IP version 4 (the current version), known as IP version 6, or IPv6. In IPv6, the address space is increased from 32 to 128 bits, which is large enough to provide a minimum of 1564 addresses for each square meter of the Earth's surface.

IPv6 addresses are notated as follows:

 XX:XX:XX:XX:XX:XX:XX:XX 

Each X is a hexadecimal representation of a single byte, so some examples of IPv6 would be as follows:

 FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 1080:0:0:0:8:800:200C:417A 

Leading zeros can be omitted from individual byte values, and repeated zero byte values can be replaced with the "::" symbol (but only once in an address). This means that the second address listed here can also be expressed as follows:

 1080::8:800:200C:417A 

The IPv6 unicast addresses assigned to registered computers are split into six variable-length sections instead of the two or three sections used in IPv6 addresses. These sections are as follows:

  • Format prefix.  This section specifies the type of address, such as provider-based unicast or multicast. (There is also a new type of address called an anycast that causes a message to be sent to only one of a specified group of interfaces.)
  • Registry ID.  This section identifies the Internet address registry that assigned the Provider ID.
  • Provider ID.  This section identifies the ISP that assigned this portion of the address space to a particular subscriber.
  • Subscriber ID.  This section identifies a particular subscriber to the service provided by the ISP specified in the Provider ID field.
  • Subnet ID.  This section identifies all or part of a specific physical link on the subscriber's network. Subscribers can create as many subnets as needed.
  • Interface ID.  This section identifies a particular network interface on the subnet specified in the Subnet ID field.

Exercise 1: Variable-Length Subnetting

Specify the subnet mask value you would use for each of the following network configurations:

  1. A Class C network address with a 2-bit subnet identifier
  2. A Class A network address with a 16-bit host identifier
  3. A Class B network address with a 6-bit subnet identifier
  4. A Class A network address with a 21-bit host identifier
  5. A Class B network with a 9-bit host identifier

Lesson Review

  1. Which IP address class provides for the largest number of hosts?
    1. Class A
    2. Class B
    3. Class C
    4. All three classes provide the same number of hosts.
  2. What kind of IP address must a system have to be visible from the Internet?
    1. Subnetted
    2. Registered
    3. Class A
    4. Binary
  3. Which of the following statements about subnet masks is not true?
    1. Subnet masks can have the same range of values as IP addresses.
    2. The subnet mask specifies which bits of an IP address are the network identifier and which bits are the host identifier.
    3. The dividing line between network bits and host bits can fall anywhere in a subnet mask.
    4. Subnet masks are assigned by the IANA, but can be modified by network administrators.

Lesson Summary

  • IP addresses are 32 bits long and expressed as four decimal numbers separated by periods. They consist of a network identifier and a host identifier.
  • Every network interface adapter on a TCP/IP network must have its own unique IP address.
  • The Internet Assigned Numbers Authority (IANA) assigns IP network addresses in three classes, and network administrators assign the host addresses to each individual system.
  • The subnet mask specifies which bits of an IP address identify the network and which bits identify the host.
  • Modifying the subnet mask for an address in a particular class enables you to create subnets by "borrowing" some of the host bits to create a subnet identifier.



Network+ Certification Training Kit
Self-Paced Training Kit Exam 70-642: Configuring Windows Server 2008 Network Infrastructure
ISBN: 0735651604
EAN: 2147483647
Year: 2001
Pages: 105

Similar book on Amazon

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