Return Home

Chapter 1

Addressing and Subnetting Basics

IP Address Basics

Classful Addressing–Structure and Size of Each Type

What Is a Network?

Class A

Class B

Class C

Address Assignments

Single Address per Interface

Multihomed Devices

Multinetting—Multiple Addresses per Interface

Examples

Purpose of Subnetting

The Basic Fixed Length Mask

What the Mask Does

Components of a Mask

Binary Determination of Mask Values

Decimal Equivalent Mask Values

Creating Masks for Various Networking Problems

Addresses and Mask Interaction

Reserved and Restricted Addresses

Determining the Range of Addresses within Subnets

Determining Subnet Addresses Given a Single Address and Mask

Interpreting Masks

Reserved Addresses

Summary

FAQs

 

This chapter covers:

·        IP Address Basics

·        Purpose of Subnetting

·        The Basic Fixed Length Mask

IP Address Basics

For IT Professionals Only

In this chapter you will see references to the term RFC. An RFC, Request For Comment, is a document created by the Internet community to define processes, procedures, and standards that control how the Internet and associated protocols work. Each RFC is assigned a number and a title that describes the contents. As an example, RFC791 is entitled “Internet Protocol” and is the standard that defines the features, functions, and processes of the IP protocol. RFCs are free and the whole text of any RFC can be downloaded from the Internet. You can find them at the following URL: http://www.isi.edu/in-notes.

As an IT Professional, you may often ask “Why did they do that?” Since the RFC is the official documentation of the Internet, you can often gain insight into why things are the way they are by reading RFCs related to your question.

Classful Addressing–Structure and Size of Each Type

IPv4 addressing is used to assign a logical address to a physical device. That sounds like a lot to think about, but actually it is very simple. Two devices in an Ethernet network can exchange information because each of them has a network interface card with a unique Ethernet address that exists in the physical Ethernet network. If device A wants to send information to device B, device A will need to know the Ethernet address of device B. Protocols like Microsoft NetBIOS require that each device broadcast its address so that the other devices may learn it. IP uses a process called the Address Resolution Protocol. In either case, the addresses are hardware addresses and can be used on the local physical network.

What happens if device B, on an Ethernet network, wants to send information to device C on a token-ring network? They cannot communicate directly because they are on different physical networks. To solve the addressing problems of both device A and B, we use a higher layer protocol such as IPv4. IPv4 allows us to assign a logical address to a physical device. No matter what communication method is in use, we can identify a device by a unique logical address that can be translated to a physical address for actual information transfer.

The designers of IPv4 faced an addressing dilemma. In the early days of Internet development, networks were small and networking devices were big. Another issue was the future. In the early 1970s, the engineers creating the Internet were not aware of the coming changes in computers and communications. The invention of local area networking and personal computers were to have a momentous impact on future networks. Developers understood their current environment and created a logical addressing strategy based on their understanding of networks at the time.

They knew they needed logical addressing and determined that an address containing 32 bits was sufficient for their needs. As a matter of fact, a 32-bit address is large enough to provide 232 or 4,294,967,296 individual addresses. Since all networks were not going to be the same size, the addresses needed to be grouped together for administrative purposes. Some groups needed to be large, some of moderate size, and some small. These administrative groupings were called address classes.

For IT Professionals Only

From RFC791, page 7:

Addressing

    A distinction is made between names, addresses, and routes [4].  A

    name indicates what we seek. An address indicates where it is. A

    route indicates how to get there. The internet protocol deals

    primarily with addresses. It is the task of higher level (i.e.,

    host-to-host or application) protocols to make the mapping from

    names to addresses. The internet module maps internet addresses to

    local net addresses. It is the task of lower level (i.e., local net

    or gateways) procedures to make the mapping from local net addresses

    to routes.

    Addresses are fixed length of four octets (32 bits). An address

    begins with a network number, followed by local address (called the

    "rest" field). There are three formats or classes of internet

    addresses: in class a, the high order bit is zero, the next 7 bits

    are the network, and the last 24 bits are the local address; in

    class b, the high order two bits are one-zero, the next 14 bits are

    the network and the last 16 bits are the local address; in class c,

    the high order three bits are one-one-zero, the next 21 bits are the

    network and the last 8 bits are the local address.

IPv4 addresses are expressed in dotted decimal notation. For example, a 32-bit address may look like this in binary:

To make it easier to read, we take the 32-bit address and group it in blocks of eight bits like this:

Finally, we convert each eight-bit block to decimal and separate the decimal values with periods or “dots”. The converted IPv4 address, expressed as a dotted decimal address, is:

It is certainly easier to remember that your IP address is 126.136.1.47 instead of remembering a string of bits such as 01111110100010000000000100101111.

What Is a Network?

When talking about IP addressing, it is important to understand what the word “network” means. A network is a group of computing devices connected together by some telecommunications medium. It may be as small as a workgroup in the accounting department or as large as all of the computers in a large company, such as General Motors. From an addressing perspective, all computers in a network come under the administration of the same organization. If you want to send information to a computer, you can identify the computer by its IP address and know that the IP address is assigned to a company. The IP network can locate the computing resources of the company by locating the network. The network is identified by a network number.

Figure 2.1 Networks and the Internet.

Network numbers are actually IP addresses that identify all of the IP resources within an organization. As you can see in Figure 2.1, some organizations will require very large networks with lots of addresses. Other networks will be smaller, and still other networks will need a limited number of addresses. The design of the IPv4 address space took this factor into account.

Class A

The largest grouping of addresses is the class A group. Class A network addresses can be identified by a unique bit pattern in the 32bit address.

Figure 2.2 Class A address structure.

In the preceding group, you will see a 32-bit representation of a class A address. The first eight bits of a class A address indicate the network number. The remaining 24 bits can be modified by the administrative user of the network address to represent addresses found on their “local” devices. In the representation in Figure 2.2, the “n's" indicate the location of the network number bits in the address. The “l's" represent the locally administered portion of the address. As you can see, the first bit of a class A network address is always a zero.

With the first bit of class A address always zero, the class A network numbers begin at 1 and end at 127. With a 24-bit locally administered address space, the total number of addresses in a class A network is 224 or 16,777,216. Each network administrator who receives a class A network can support 16 million hosts. But remember, there are only 127 possible class A addresses in the design, so only 127 large networks are possible.

Here is a list of class A network numbers:

10.0.0.0

44.0.0.0

101.0.0.0

127.0.0.0

Notice that these network numbers range between 1.0.0.0 and .127.0.0.0, the minimum and maximum numbers.

Class B

The next grouping of addresses is the class B group. Class B network addresses can be identified by a unique bit pattern in the 32-bit address.

Figure 2.3 Class B address structure.

In Figure 2.3, you will see a 32-bit representation of a class B address. The first 16 bits of a class B address indicate the network number. The remaining 16 bits can be modified by the administrative user of the network address to represent addresses found on their “local” hosts. A class B address is identified by the 10 in the first two bits.

With the first two bits of class B address containing 10, the class B network numbers begin at 128 and end at 191. The second dotted decimal in a class B address is also part of the network number. A 16-bit locally administered address space allows each class B network to contain 216 or 65,536 addresses. The number of class B networks available for administration is 16,384.

Here is a list of class B network numbers:

137.55.0.0

129.33.0.0

190.254.0.0

150.0.0.0

168.30.0.0

Notice that these network numbers range between 128.0.0.0 and 191.255.0.0, the minimum and maximum numbers, respectively. And remember that the first two dotted decimal numbers are included in the network number since the network number in a class B address is 16 bits long.

Class C

The next grouping of addresses is the class C group. Class C network addresses can be identified by a unique bit pattern in the 32bit address.

Figure 2.4 Class C address structure.

In Figure 2.4, you will see a 32-bit representation of a class C address. The first 24 bits of a class C address indicate the network number. The remaining 8 bits can be modified by the administrative user of the network address to represent addresses found on their “local” hosts. A class C address is identified by the 110 in the first three bits.

With the first three bits of class C address containing 110, the class C network numbers begin at 192 and end at 223. The second and third dotted decimals in a class C address are also part of the network number. An 8-bit locally administered address space allows each class C network to contain 28 or 256 addresses. The number of class C networks available for administration is 2,097,152.

Here is a list of class C network numbers:

204.238.7.0

192.153.186.0

199.0.44.0

191.0.0.0

222.222.31.0

Notice that these network numbers range between 192.0.0.0 and 223.255.255.0, the minimum and maximum numbers, respectively. And remember that the first three dotted decimal numbers are included in the network number since the network number in a class C address is 24 bits long.

To summarize, each of the three IP address classes has the characteristics shown in Figure 2.5.

Figure 2.5 Address class characteristics.

Address Assignments

For IT Professionals Only

From RFC791, page 7:

Care must be taken in mapping internet addresses to local net addresses; a single physical host must be able to act as if it were several distinct hosts to the extent of using several distinct internet addresses. Some hosts will also have several physical interfaces (multi-homing). That is, provision must be made for a host to have several physical interfaces to the network with each having several logical internet addresses.

One task of address management is address assignment. As you begin the process of address allocation, you must understand how the addresses are used in the network. Some devices will be assigned a single address for a single interface. Other devices will have multiple interfaces, each requiring a single address. Still other devices will have multiple interfaces and some of the interfaces will have multiple addresses.

Single Address per Interface

Figure 2.6 Single address per interface.

A device connected to a network may have one or many networking interfaces that require an IP address. A word processing workstation in your network has a single Ethernet interface (see Figure 2.6). It needs only one IP address.

Multihomed Devices

A router is a networking device used to transfer IP datagrams from one physical network to another. The router by its very nature and function will have more than one interface and will require an IP address for each interface. Devices with more than one interface are called multihomed, and the process is called multihoming.

Figure 2.7 Multihomed device.

In Figure 2.7, the router has two interfaces. One interface is attached to the token-ring network and the other interface is attached to the Ethernet network. This is a multihomed device.

Assigning IP addresses to devices is a simple process (see Figure 2.8). A new device is installed in the network and the address administrator selects an unused address of the group of available addresses. The information is provided to the user of the device and the device is configured. The address given to the user must be from the same address group as all other devices on the same network or the IP data transmission rules will not work. The IP data transmission rules will be discussed in a later chapter.

Figure 2.8 IP address configuration

The actual configuration process for IP addresses varies from operating system to operating system and from device to device, so consult your system documentation for instructions. An important final step requires that a careful notation about assignment of the address be made in the address administrators’ documentation so that the address is not assigned to another device.

Multinetting—Multiple Addresses per Interface

It is also possible that certain devices will have interfaces with more than one IP address assigned. Here is an example.

A new Internet site is under development for a small corporation. The network administrator knows that the site will grow in the future but today there is no need for a complex network. A server is installed that will be used as a web server, ftp server, mail server, and the corporation’s DNS server. Later, when the use of the network services grows, new servers will be used for each of the functions.

When the time comes to address the current server, the administrator has a choice. A single IP address can be used on the server and later, when the new servers are needed, new IP addresses can be assigned to them. Another way of assigning addresses can be used. The administrator can assign four IP addresses to the server. Each IP address will match the IP address to be used in the future on new servers. The administrator now knows what addresses will be used and can create DNS entries for the new devices with the correct addresses. The process of providing more than one IP address on an interface is often called multinetting or secondary addressing.

Examples

Assigning secondary addresses on cisco routers is done using IOS configuration commands. Here is an example of how to assign a primary IP address and two secondary IP addresses to an Ethernet interface:

interface ethernet 0

ip address 183.55.2.77 255.255.255.0

ip address 204.238.7.22 255.255.255.0 secondary

ip address 88.127.6.209 255.255.255.0 secondary

The router’s Ethernet 0 interface now has addresses in the 183.55.0.0 network, the 204.238.7.0 network, and the 88.0.0.0 network.

Purpose of Subnetting

When the IP protocol was designed, the networks and computers are very different than they are today. With the advent of local area networks (LANS) and personal computers, the architecture of the computer networks changed. Instead of having big computers communicating over low-speed, wide area networks, we had small computers communicating over fast, local area networks.

To illustrate why IP subnetting is necessary, let’s take a look at how IP sends datagrams. And to make it easy to understand, let’s compare the process to sending mail at the post office. If you have a message to send to a member of your local family, you can deliver it to the family member by writing it down on a piece of paper and giving it directly to him or her. IP networks do the same thing. If an IP datagram is to be sent to a computer on the same physical network, the two devices can communicate directly (see Figure 2.9).

Figure 2.9 IP network with no subnetting.

The device 200.1.1.98 wants to communicate with 200.1.1.3. Since they are on the same Ethernet network, they can communicate directly. They are also on the same IP network so communication can take place without the help of any other devices.

Let’s go back to our post office analogy. One of the children has now moved out of the house and has gone to college. To communicate with that child, you will need to have some help. You write a letter, put it in an envelope, and mail it. The post office makes sure that your letter reaches the addressee. Computing devices work according to the same principle. To communicate with devices not in the same physical network, the computing device needs some help. Here is how it is done.

Figure 2.10 Two networks, different locations

In the illustration in Figure 2.10, James wants to send a message to Sarah. They are all part of the same IP network, 153.88.0.0, but not a part of the same physical network. As a matter of fact, James’ computer is on a token-ring network in Los Angeles. Sarah’s machine is located on an Ethernet network in Philadelphia. A connection between the two networks is required.

Figure 2.11 Inter/Intranet connectivity.

Just like the post office helps to deliver the letter to the student in college, routers help James to send a message to Sarah over the wide area network from Los Angeles to Philadelphia (see Figure 2.11). The IP process must send the message from James to the router. The router will send it to other routers until the message finally reaches the router on Sarah’s network. Then the router on Sarah’s network will send it to Sarah’s machine.

The routers enable IP to send information from one physical network to another. How does IP know that Sarah’s machine is not on the same physical network as James? IP must determine that Sarah’s machine is on a different physical network by using the logical IP addressing scheme. In this instance, the address administrator must assist the network managers by breaking the 153.88.0.0 network into smaller components and place a block of addresses on each physical network. Each block of addresses that apply to each physical network is known as a subnet.

Figure 2.12 Two locations, subnetted.

In Figure 2.12, James’ machine is now found in the 153.88.240.0 subnet. Sarah's is in the 153.88.3.0 subnet. When James sends a message to Sarah, the IP process determines that Sarah is in a different subnet and sends the message to the router for forwarding.

Let’s see how subnets are determined and how IP devices decide to forward datagrams to a router.

For IT Professionals Only

Numbering Systems—Decimal and Binary

Let’s quickly review numbering systems before we get into subnetting. Our numbering system is based on 10 digits, the decimal system. Computers work on the binary system with two digits, 0 and 1. To group computer data elements together more efficiently, a 16 digit representation system was developed, the hexadecimal system.

There are elements of the decimal system that we understand but may not realize. When you read the number 1245, you say "one thousand two hundred forty five." But how do you know that? Because you use a decimal system that is based on the following information:

 Base

103

102

101

100

Decimal

1000

100

10

1

 

1

2

4

5

1245

   1000

200

40

5

So the number 1245 is actually:

1000  (1 thousands)

  200  (2 hundreds)

    40  (4 tens)

      5  (5 ones)

1245

The binary numbering system is similar, but based on the number 2. We often must convert binary numbers to decimal. In the following chart, you see the breakdown of the binary numbering system and the relative decimal number for each value. Given the binary number 11001011, we can convert it to decimal using the chart.

Base

27

26

25

24

23

22

21

20

Decimal

128

64

32

16

8

4

2

1

 

1

1

0

0

1

0

1

1

11001011

128

64

0

0

   8

0

2

1

So the binary number 10010101 converted to decimal is:

128

  64

    8

    2

    1

203

The Basic Fixed Length Mask

To help the IP device understand the subnetting used in the network, IP designers described the process of using a subnet mask in RFC950.

For IT Professionals Only

From RFC950, page 1—Overview:

   This memo discusses the utility of "subnets" of Internet networks,

   which are logically visible sub-sections of a single Internet

   network.  For administrative or technical reasons, many organizations

   have chosen to divide one Internet network into several subnets,

   instead of acquiring a set of Internet network numbers.  This memo

   specifies procedures for the use of subnets.  These procedures are

   for hosts (e.g., workstations).  The procedures used in and between

   subnet gateways are not fully described.  Important motivation and

   background information for a subnetting standard is provided in

   RFC-940.

What the Mask Does

Simply stated, the mask is used to indicate the location of the subnet field in an IP address. What does that mean? In the previous figures, 153.88.0.0 is the network address. It is a class B address, which means that the first sixteen bits of the address is the network number. James’ machine is in the 153.88.240.0 subnet. How do we determine that?

James is in the 153.88.0.0 network. The administrator reserved the next eight bits to hold the subnet number. In the preceding example, James is in the 240 subnet. If James’ IP address were 153.88.240.22, James would be in the 153.88.0.0 network, in the 240 subnet of that network, and would have a host address of 22 in that subnet. All devices within the 153.88.0.0 network with a third octet of 240 are assumed to be on the same physical network and in the same subnet, the 240 subnet.

The subnet mask is used to interpret addresses to understand how they are subnetted. The mask is made up of 32 bits, just like the IP address. There are certain masks that are natural or default to the three classes of addresses.

For IT Professionals Only

Subnet masks frequently contain a reference to 255. The 255 reference simply indicates that all eight bits of that portion of the mask contain a 1. For instance, the binary representation of the mask 255.0.0.0 is 11111111000000000000000000000000. The mask 255.255.0.0 is 11111111111111110000000000000000.

The default or natural mask for the class A address is 255.0.0.0. In this case the mask indicates that the first eight bits represent the network number and must be used when evaluating a class A address for subnetting. If a device has a class A address assigned and has a mask of 255.0.0.0, there is no subnetting in that network. If a device has a class A address and has a mask that is not 255.0.0.0, the network has been subnetted and the device is in a subnet of the class A network.

Figure 2.13 Addresses with no subnetting.

In Figure 2.13, the 125.0.0.0 network has been subnetted. The mask is not the default mask so we know that the network has been subnetted. What does the rest of the mask mean?

As stated earlier, the mask is used to indicate the location of the subnet field in an IP address. Let’s look at what makes up a mask.

Components of a Mask

The mask is a 32-bit binary number that is expressed in dotted decimal notation. By default, the mask contains two fields, the network field and the host field. These correspond to the network number and the locally administered part of the network address. When you subnet, you are adjusting the way you view the IP address. If you are working with a class B network and are using the standard mask, there is no subnetting. For example, in the address and mask in Figure 2.14 the network is indicated by the first two 255 entries and the host field is indicated by the ending 0.0.

Figure 2.14 Class B address with standard mask.

The network number is 153.88 and the host number is 4.240. In other words, the first sixteen bits are the network number and the remaining sixteen bits are the host number.

When we subnet a network we increase the hierarchy from network and host to network, subnet and host. If we were to subnet the 153.88.0.0 network with a subnet mask of 255.255.255.0, we will be adding an additional piece of information. Our view changes in that we will be adding a subnet field. As with the previous example, the 153.88 is still the network number. With a mask of 255.255.255.0, the third octet is used to tell us where the subnet number is located. The subnet number is .4 and, finally, the host number is 240.

Figure 2.15 Subnet mask fields.

The locally administered portion of the network address can be subdivided into subnetworks by using the mask to tell us the location of the subnet field. We allocate a certain number of bits to the subnet field and the remainder is then the new host field. In Figure 2.15, we took the 16-bit host field that comes with a class B address and broke it down into an 8-bit subnet field and an 8-bit host field.

Binary Determination of Mask Values

How do you determine which mask to use? On the surface it is a fairly simple process. You first determine how many subnets are required in your network. This may require you to do a lot of research into the network architecture and design. Once you know how many subnets you will need, you can decide how many subnet bits are needed to provide you with a subnet field big enough to hold the number of subnets you need.

When a network is in the design phase, the network administrator discusses the design with the address administrator. They conclude that there will be a total of 73 subnets in the current design and that a class B address will be used. To develop the subnet mask, we need to know how big the subnet field must be. The locally administered portion of a class B address contains 16 bits.

Remember that the subnet field is a portion of these 16 bits. The challenge is to determine how many bits are required to store the decimal number 73. Once we know how many bits are needed to store the decimal number 73, we can determine what the mask should be.

The first step is to convert the decimal number 73 to binary.
   The number of bits in the binary number is seven. So we need to reserve the first seven bits of the locally administered portion of the subnet mask for the subnet field and the remainder will be the host field.


In the preceding example we are reserving the first seven bits for the subnet field, indicated by the one bits, and the remainder to the host field, indicated by the zero bits. If we convert this binary information into decimal for the subnet mask and add it to the portion of the mask for the network number, we will have the entire subnet mask necessary.


Remember, 255.255.0.0 is the default mask for a class B address. We have replaced the locally administered portion of the mask, the .0.0, with the 254.0 that depicts the subnetting scheme. The 254.0 portion tells the software that the first seven bits of the locally administered portion of the address is the subnet field and the remainder is the host field. Of course, if the subnet mask numbers change, the interpretation of the subnet field changes.

Decimal Equivalent Mask Values

Tables 2.1, 2.2, and 2.3 show the possible subnet masks that can be used in class A, class B, and class C networks.

Table 2.1 Class A Subnet Table

Subnets

Hosts

Mask

Subnet Bits

Host Bits

2

            4,194,302

255.192.0.0

2

22

6

            2,097,150

255.224.0.0

3

21

14

            1,048,574

255.240.0.0

4

20

30

            524,286

255.248.0.0