The Ultimate Guide to Subnetting

Subnetting networks

Every computer network needs to be configured properly if it is to perform at optimal capacity. Among the many ways administrators make sure there is a fast, un-interrupted, and collision-free data flow among their connected devices is by subnetting their network.

What is Subnetting?

Subnetting is defined as the configuration method used to divide a single physical network into multiple, smaller logical sub-networks called subnets. An Internet Protocol (IP) address is made up of two parts: a network segment and a host segment. Subnets are created by taking bits from the IP address’ host segment and using them to create a number of smaller sub-networks within the original network.

IP Address Classes

The need for subnetting arose out of the genuine fear that we would soon run out of IPv4 addresses that could be used on the internet. With this technique, organizations can allocate a single network address to all (or as many possible) of the devices connected in one segment (subnet) of its local area network (LAN) while keeping all its segments under one top-level IP address.

What are the Advantages of Subnetting?

The advantages of subnetting a network include:

  • Better Organization – It makes it easy for the organization to organize its gadgets and devices into groups like “HR” and “Payroll” by simply assigning them to subnets
  • Less Noise – Subnets cut network traffic by limiting broadcasting to stay within that particular node of the network
  • Fewer IP Addresses – Subnetting allows an organization to connect its computers to the internet without requiring a new (separate) IP address
  • Grouping of Devices – The configuration helps with the isolation of hosts so they can only connect or communicate with the devices and gadgets in the same subnet (for tighter security or restrictions, for example)
  • Faster Connectivity – Data transmission speeds increase as the size of the domain is reduced which makes it easier for the packets to find their destination
  • More Flexibility – Subnetting allows the organization to scale (up or down) the number of connected devices per subnet with ease
  • Administrative Control – Admins will find it easier to administer a subnet of host devices as opposed to having to work on them on a host-by-host basis
  • Quicker Problem Resolutions – Troubleshooting network issues becomes easier as the faulty network can be easily identified and isolated
  • One Identity – Subnetting conserves IP addresses as a company can connect hundreds of devices using subnets but with a common network name for easy identification

Are there any Disadvantages?

While, as we have just seen, subnetting a network has many advantages there are some disadvantages, too. But, they are  few:

  • Money for Hardware – Subnetting requires an investment in hardware like routers, switches and hubs that could prove expensive. Any organization that wants to make sure it has a safe and secure network will need to invest in quality network devices which could pushes their expenses up.
  • Money for Knowhow – Designing, setting up, and configuring a network architecture that is divided into subnets requires expertise. This means, whether in-house or outsourced manpower is used, it will require the employment of highly-qualified network engineers – that too costs money.

Comparing the advantages to the disadvantages, it can be clearly seen that the scales overwhelming tip in favor of the former. This leads us to confidently state that an organization would indeed improve its network’s performance by adopting a subnetting strategy.

What kind of networks are prime candidates for subnetting?

The ideal candidate for a subnetting strategy would be an organization that has a large number of computers or devices to connect. Subnetting the network will help its administrators tame the chaos while allowing the organization to get optimal use out of its connectivity.

On the contrary, it would be a waste of resources and money to opt for a full-fledged, hardware supported subnetting if the organization has just a handful of connected devices or doesn’t have too many data transmissions on its current network.

How do you subnet a network?

Although all the numbers and digits might suggest that this is a task only a mathematician or computer expert would tackle, subnetting really is a pretty simple and straightforward task.

Subnetting a Class C IP Address – The Quick Way

Before we get into subnetting, we need to talk a little about IP address classes. In today’s networking environment there 5 classes of IP addresses: Classes A, B, C, D, and E. All of these classes have a dedicated range of valid IP addresses of their own.

The first octet in the IP addresses is always used to determine the class. Incidentally, only the IP addresses that have been classified as Classes A, B, and C can be used as host addresses. Classes D and E are normally used for multicasting and experimental purposes. The table below should make things a little easier to understand:

Class 1st Octet Decimal Range 1st Octet High Order Bits Network/Host ID (N=Network, H=Host) Default Subnet Mask Number of Networks Hosts per Network (Usable Addresses)
A 1 – 126 0 N.H.H.H 255.0.0.0 126 (27 – 2) 16,777,214 (224 – 2)
B 128 – 191 10 N.N.H.H 255.255.0.0 16,382 (214 – 2) 65,534 (216 – 2)
C 192 – 223 110 N.N.N.H 255.255.255.0 2,097,150 (221 – 2) 254 (28 – 2)
D 224 – 239 1110 Reserved for Multicasting
E 240 – 254 1111 Experimental or used for research

Let us now have a look at how we can subnet a Class C IP address using a simple method. Let us also assume that the IP address we will be using is 192.168.10.44 with a subnet mask of 255.255.255.248 (/29).

Now, the steps required to do the subnetting are:

Calculate the number of subnets

For this purpose we will need to convert the subnet mask’s (255.255.255.248) fourth octet (248) into binary to get 11111000. This then shows us that five bits (the first “11111” in “11111000”) are used to identify the subnet. You can now calculate the total number of subnets that are available by simply raising 2 to the power of 5 (2^5) which tells us that there are 32 subnets.

These 32 subnets include the all-zeros and all-ones subnets which, not too long ago, weren’t used because of the confusion that came with using these special network and broadcast addresses in a subnetted connection environment. Today, that has become an outdated concept and the use of subnet zero and the all-ones subnet is accepted by most software and hardware vendors.

But, in some older networks and especially on those that have legacy systems and software using them, the use of subnet zero and the all-ones subnet can still lead to conflicts.

Calculate number of hosts in a subnet

The three 0’s in our binary subnet octet (11111000) indicate that there are three bits used to identify a host. Therefore, the total number of hosts per subnet becomes (2^3) – 2. The deductions are made to exclude the subnet and broadcast addresses.

Subnets, hosts, and broadcast addresses in a subnet

To identify the valid subnets for your specific subnet mask you now need to subtract 248 from the full value of the octet – 256. Now, 256-248=8 and this gives us our first available subnet address (255.255.255.8).

As we have just mentioned, the first subnet (albeit a reserved one) is our subnet-zero. Then comes the 8 subnet, then follows 16 (8+8), 24 (16+8) until we get to 248. The following table provides all the calculated information:

Subnet 0 8 16 24 248
First Host 1 9 17 25 249
Last Host 6 14 22 30 254
Broadcast 7 15 23 31 255

CIDR Notation

In the earlier example, you may have noticed that we mentioned a “/29” and then didn’t even bother to use it at all. Well, that notation is known as a Classless Inter-Domain Routing (CIDR) notation and is just another way of representing a network’s subnet mask.

CIDR is, to be more precise, a tally of the number of network bits that have been set to “1” in the binary form of the subnet mask. It is written after a network IP address in the “/XX” format where XX is the number of network bits.

Looking at an example…

Let us consider 192.168.1.0 as our example IP address and assume it has a subnet mask of 255.255.255.0.

The four octets of the subnet mask can be written in binary as:

11111111.11111111.11111111.00000000

Counting the number of 1’s in the three octets (8X3) gives us a total of 24. The CIDR notation of our example, thus, becomes: 192.168.1.0/24.

… and the reverse…

Now, using another example, we will do the reverse: convert the subnet mask from its CIDR notation to the digital octets.

Our example this time is 192.168.60.55/20.

The first step is to convert the 20 into octet bits by representing it with 20 bits:

11111111.11111111.11110000.00000000

The first two octets are obviously 255.255 (all 1’s) while the fourth one is a 0. To find the conversion of the third octet (11110000) we will take the four 1’s and use a simple table:

128 64 32 16 8 4 2 1

The trick here is to add the numbers in the first four cells (if there had been five 1’s you would take the numbers in the first five cells, etc.), and we get:

128+64+32+16=240

Our subnet mask therefore becomes: 255.255.240.0

Variable-Length Subnet Masks

Sometimes, the network needs to be divided into subnets that have a disparate number of hosts under them. Every subnet will have a subnet mask of its own and will encompass the required number of hosts which means the subnet masks will be of variable length. That is when Variable-Length Subnet Masks (VLSM) comes into play.

Now, there are quite a few ways to calculate the network configuration manually and a quick online search will return a trove of tutorials and online lessons. But, anyone looking to do the configuration accurately, efficiently, and with the shortest amount of time need only use SolarWinds Advanced Subnet Calculator.

You’re done!

And there you have it; using this table you can now start assigning IP addresses to all your gadgets without any fear of creating collisions or conflicts.

Leave a Reply