2.2 Classes of Subnets and Subnet Masks

Basics

Many networks are divided into smaller networks referred to as subnets. “Sub” in this use refers to a subsection or part of your network. The process of subnetting your network, or dividing it into smaller networks, means you can get more IPv4 addresses out of your network. Instead of each device needing a unique global address based solely on the base IP address of your network, when you apply subnets, each device will have an IP address in which part refers to your overall network IP address, and a part that refers to its corresponding subnet. Each IP address is unique internally to your network, but they will all share the same parts that relate to your network IP address.

You should know the following terms:

  • Subnet
  • Subnetting
  • Broadcasting or Broadcast message
  • Subnet mask
  • Subnet mask classes
  • Classless Inter-Domain Routing (CIDR)
  • Netmask

Subnetting can make your network more efficient and secure. Using subnets targets data directly to where it should be transmitted as opposed to sharing the data across an entire network until it finds the correct device. This latter type of data transfer, called broadcasting or broadcast traffic, is inefficient but is sometimes used, as was presented under the topic MAC addresses. 

Subnets reduce the amount of traffic on a network overall and improve the speed at which data is transferred. Subnets can also improve the security of your network, because if one subnet is attacked or compromised, it’s possible it can be contained to just that subnet and not impact your entire network. You can also limit network access within a subnet to create a more secure place to store files or support secure communications.

Once you have divided your network into subnets, you need a way to help computers find the right IP address within those subnets. In addition to a unique IP address, all of the computing devices on your network require a subnet mask. A subnet mask is always paired with an IP address.

There are different classes of subnets, the ones you will mostly commonly use are likely to be Class A, Class B, and Class C. These classes help to identify which parts of an IP address correspond to the network address and which correspond to the host address.

Subnet Mask Classes

Class First Octet Address Default Subnet Mask Hosts per Network
A 1-127 255.0.0.0 16,777,214
B 128-191 255.255.0.0 65,534
C 192-223 255.255.255.0 254

Subnet Chart

Based on your current subnet mask, you can use the following table to determine how many hosts are available on that subnet. How many hosts are possible on your subnets?

Your DHCP server might run out of hosts if your subnet isn’t large enough. If you need more hosts, you may be able to use a different CIDR (Classless Inter-Domain Routing (first column) or supernetting. You might hear someone mention they are using a “slash 24 (/24)” and moving to a “ slash 23 (/23)” which will double the amount of hosts available in that subnet mask from 256 to 512. This process can include reconfiguring your DHCP server, scopes, IP helpers, and static addresses. Because this can result in a domino effect, be sure to check with your CTO, IT Director, or a network engineer before changing subnet masks.

The Netmask will also indicate whether a host is or is not on a specific subnet. If not, you’ll need to connect the two subnets through one or more routers. You may need to configure your router to connect the subnets, and if this is something you’re not familiar with, be sure to work with an expert.

CIDR Hosts Netmask Amount of a Class C
/30 4 255.255.255.252 1/64
/29 8 255.255.255.248 1/32
/28 16 255.255.255.240 1/16
/27 32 255.255.255.224 1/8
/26 64 255.255.255.192 1/4
/25 128 255.255.255.128 1/2
/24 256 255.255.255.0 1
/23 512 255.255.254.0 2
/22 1,024 255.255.252.0 4
/21 2,048 255.255.248.0 8
/20 4,096 255.255.240.0 16
/19 8,192 255.255.224.0 32
/18 16,384 255.255.192.0 64
/17 32,768 255.255.128.0 128
/16 65,536 255.255.0.0 256

 

Here are additional resources you may find useful:

Complete the following task or self-assessment:

WARNING: Changing your subnet mask configuration can require reconfiguring your DHCP server and shouldn’t be done unless necessary.

  • How many subnets are deployed on your network?
  • What are the subnet masks?

If necessary, work with a network administrator to determine your subnet configuration and subnet masks.