Calculating a Subnet Mask

When contiguous 1s are added to the default mask, making the all-1s field in the mask longer, the definition of the network part of an IP address is extended to include subnets. Adding bits to the network part of an address decreases the number of bits in the host part. Thus, creating additional networks (subnets) is done at the expense of the number of host devices that can occupy each network segment.

The number of subnetworks created is calculated by the formula 2s, where s is the number of bits by which the default mask was extended.

NOTE Subnet 0 (where all the subnet bits are 0) must be explicitly allowed using the ip subnet-zero global configuration command in Cisco IOS releases before 12.0. In Cisco IOS Release 12.0 and later, this command is enabled by default.

The number of hosts available is calculated by the formula 2h - 2, where h is the number of bits in the host portion. In the host counting range, the all-0s bit pattern is reserved as the subnet identifier (sometimes called the wire), and the all-1s bit pattern is reserved as a directed broadcast address, to reach all hosts on that subnet.

Because subnet masks extend the number of network addresses you can use by using bits from the host portion, you do not want to randomly decide how many additional bits to use for the network portion. Instead, you want to do some research to determine how many network addresses you need to derive from your given IP address. For example, suppose you have the IP address, and you want to configure the network shown in Figure B-6. To establish your subnet mask, do the following:

Step 1 Determine the number of networks (subnets) needed. Figure B-6, for example, has five networks.

Figure B-6 Network Used in the Subnet Mask Example

Figure B-6 Network Used in the Subnet Mask Example


- -

Step 2 Determine how many nodes per subnet must be defined. This example has five nodes (two routers and three workstations) on each subnet.

Step 3 Determine future network and node requirements. For example, assume 100 percent growth.

Step 4 Given the information gathered in Steps 1 to 3, determine the total number of subnets required. For this example, ten subnets are required. Refer to the earlier section "IPv4 Addresses and Subnetting Job Aid" to select the appropriate subnet mask value that can accommodate 10 networks.

No mask accommodates exactly 10 subnets. Depending on your network growth trends, you might select 4 subnet bits, resulting in a subnet mask of The binary representation of this subnet mask is as follows:

11111111.11111111.11110000.00000000 The additional 4 subnet bits would give you 24 = 16 subnets.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment