Subnetting : a beginner guide |part2

Musindesarah
3 min readApr 19, 2024

--

Welcome back to the second part of our journey into subnetting.
In part one, we learned the basics of subnetting and why it’s important for managing networks effectively. Now, in part two, our objectives are clear: to learn how to subdivide a network when given a specific number of hosts or a specific number of networks. Let’s get started!

Understanding Subnet Allocation:

To effectively allocate subnets, we rely on a couple of key formulas:

  1. Number of Hosts: Formula: 2^n−2 Here, ’n’ represents the number of bits borrowed from the host portion. Remember, we subtract 2 because the first and last addresses in a subnet are reserved for network and broadcast addresses respectively.
  2. Number of Networks: Formula: 2^n In this formula, ’n’ denotes the number of bits taken from the network portion.

Now, armed with these formulas, let’s navigate through the process of subnet allocation step by step:

  1. Determine the Formula to Use: Assess whether you need to calculate the number of hosts or networks. Depending on the requirement, apply the respective formula.
  2. Steal the Bits for Subnetting: Analyze the given scenario and determine how many bits you need to allocate for subnetting. Remember, for hosts, you take bits from right to left, and for networks, you take bits from left to right.
  3. Allocate Subnets: Experiment with various combinations for the subnet portion of the address. This involves assigning different bit patterns to create distinct subnets.
  4. Adjust Subnet Masks: As you allocate subnets, don’t forget that the subnet mask will also change accordingly. The new subnet mask is formed by combining the original network portion with the bits borrowed from the host portion.

let see some examples to better understand these rules

example 1 :

ABC Ltd has been allocated subnet 10.1.1.0/24 for a small office in London Paul. The network admin needs to split the subnet into smaller subnets each supporting 14 hosts

Solution:

  1. Calculate the Number of Host Bits: Using the formula 2^n−2, where ’n’ is the number of host bits required to support 14 hosts: 2^n−2=14

Solving for ’n’: 2^n=16

n=4

2.Determine the New Subnet Mask: Since we’re borrowing 4 bits for hosts, the new subnet mask will be 24 (original network portion) + 4 (bits borrowed from the host portion) = /28.

3. Calculate the Number of Subnets: Using the formula 2^n, where ’n’ is the number of bits borrowed from the host portion: 2⁴=16 So, we’ll have 16 subnets.

5. Determine Subnet Addresses:

example 2:

ABC Ltd have been allocated subnet 10.28.192.0 /18 . Paul requires 30 subnets with as many hosts possible.

solution:

  1. Calculate the Number of Subnets: We need 30 subnets. Since 2^n gives the number of subnets, we need to find n such that 2^n is greater than or equal to 30. 2⁵=32, so we need at least 5 bits for subnets.
  2. Determine the New Subnet Mask: Since the original subnet mask is /18, and we need to borrow 5 bits for subnets, the new subnet mask will be /23.
  3. Calculate the number of hosts per subnet:

2^n-2 , 2⁵-2= 30 hosts

3.Determine Subnet Addresses:

To wrap up, subnet allocation is a powerful tool for network optimization. By mastering this skill, you gain greater control over network resources and can tailor your infrastructure to meet specific demands efficiently.

--

--

Musindesarah

Tech enthusiast exploring cybersecurity, aspiring SOC Analyst🔐💻