subnetting explained – Expert Network Consultant https://www.expertnetworkconsultant.com Networking | Cloud | DevOps | IaC Fri, 12 Feb 2021 12:58:49 +0000 en-GB hourly 1 https://wordpress.org/?v=6.3.5 Step by Step Guide to Understanding IP Subnetting https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/step-by-step-guide-to-understanding-ip-subnetting/ Mon, 15 Feb 2021 09:00:42 +0000 http://www.expertnetworkconsultant.com/?p=4333 Continue readingStep by Step Guide to Understanding IP Subnetting]]> In my previous article, I showed you a smarter way to solve subnetting questions but that was quite an intermediate approach as I expected some prior understanding. The article also indicated provisioned subnet mask information which made it simple for the network engineer to carry out subnetting. In this article on the Step by Step Guide to Understanding IP Subnetting, I attempt to start from the basics all the way to solving any subnetting questions with an approach that is reliably accurate at all times. You may not always have the subnet address or mask to identify what the ip address is. This tutorial will take you through the best way in calculating subnetting requirements.




Step by Step Guide to Understanding IP Subnetting – Private IP Address Classes Table
It is extremely important to remember this table as it is a required knowledge for every subnetting task you may encounter. It is like knowing the Periodic Table in Chemistry.

Class Example # of Networks # of Hosts on each network Default Mask
A:1-127 24. 0 .0 .0 127 16,777,214 255.0.0.0
B:128-191 150.18. 0 .0 16,384 65,534 255.255.0.0
C:192-223 198.23.210. 0 2,097,152 254 255.255.255.0
D:224-239 224.0.0.10 Multicast
E:240-255 Reserved

Referencing the above table, can you perform a detective work in identifying which class the following ip addresses belong?

Step by Step Guide to Understanding IP Subnetting -What Class does each IP below belong to?

  1. 10.1.0.200
  2. 190.16.21.10
  3. 192.16.2.210
  4. 128.215.3.199
  5. 126.7.10.40

How was that exercise? Let us move on to understanding subnetting with this step by step guide.

Learn this table | Finger Table 1.1

Finger 1 2 3 4 5 6 7 8 Number of Subnets
Block Size 128 64 32 16 8 4 2 1 Subnet Incremental Coverage
Mask Value 128 192 224 240 248 252 254 255 Subnet Prefix
Prefix /25 /26 /27 /28 /29 /30 /31 /32 /XY

Step by Step Guide to Understanding IP Subnetting – The Process for Subnetting

  1. Firstly classify the address | This is exactly what we did in the exercise above
  2. Write down the Class it belongs to | Is it Class A, B, or C ?
  3. Write down the default Subnet Mask.

As a network engineer, as part of design or expansions you may from time to time be required to provision a number of subnets based on an Subnet ID. You are usually given a subnet address and asked to provision a number of subnets.

Let’s take an example…

Subnetting Question 1: We have an address 172.18.0.0 and we need 60 subnets.

Step 1 – Locate the Private IP Class
The first thing is to check what private ip address class the given address belongs to. The above address belongs to the Class B IP Address Group – Class B(128-191) as 172 falls within that range of addresses.

Step by Step Guide to Understanding IP Subnetting

Step 2 – Write down the default subnet mask
Default Mask : 255.255.0.0

Step by Step Guide to Understanding IP Subnetting | how to calculate subnet mask from ip address
Step 3 – Write down the full address with the prefix
Our address is 172.18.0.0/16.

Step 4 – Calculate and provision the number of subnets required.
In this example you have been asked to provision 60 subnets. From the finger table 1.1 we know that 2 raised to the power of 6 gives us 64 subnets which is more than enough for our needs.

how to calculate subnet mask from finger table

  1. Finger Number = 6
  2. Block Size = 4
  3. Mask Value = 252

Now that we have calculated the number of subnets required, we move to the next step. Calculate the new subnet mask.

Step 5 – Calculate What Subnet Mask to Use
256 minus the block size is what gives you the subnet mask.
256 – 4 = 252 which is equal to the prefix /22

how to calculate subnet mask from the block size

Step 6 | Write down the new address based on the calculation so far
The new address is 172.18.0.0/22.

how to calculate subnet mask from the borrowed binary bits

Subnetting Question 2: What is the last valid host on the subnetwork 172.18.41.128 255.255.255.128

The approach for this is pretty straight forward. We know that the last octect in the subnet mask is 128.

Step 1: Calculate the Block Size
256 – 128 will determine which block size this belongs to. 256 – 128 = 128. From our finger table 1.1, the block size is 128 with mask value of 128(10000000).

Step 2: Calculate the Prefix
The known 3 octets forms a prefix of (255.255.255.X) = /24 + 1 = /25. Where did we get + 1 from? This is the finger position from our subnet table.

Step 3: Identify Subnet Block of IP Address
Since the block size is 128, this means that the increments for this subnet will be 128. So starting from 0, our address 172.18.41.128 would be on the second subnet block 172.18.41.128.

Starting from 0, the first subnet address will be 172.18.41.0 with Valid Start Host as 172.18.41.1 and Valid End Host as 172.18.41.126 with 172.18.41.127 being the broadcast address.

Remember that the block size indicates that the subnet address 172.18.41.0 is part of the block size count.

0 is a valid count in computing.

Since 172.18.41.128 is not within the valid host range of the first subnet block, it is clearly going to be on the second subnet block of Subnet ID 172.18.41.128. The first valid host in this subnet starts from 172.18.41.129 and the last valid host is 172.18.41.254 with 172.18.41.255 as the broadcast address.

172.18.41.0 | 0 — 127 (Subnet 1) – Block Size 128.
172.18.41.128 | 128 — 254 (Subnet 2) – Block Size 128.

Let’s take another example.

Subnetting Question 3:How many subnets and hosts per subnet can you get from the network 172.18.0.0/26?

Let us solve this interesting question together by following these steps;

Step 1: Identify the Block Size for /26

From the finger table 1.1, /26 is Finger 2 which sits on block size 64 which has the Mask Value of 192(11000000).

2 bits are used to identify the subnet and so to find the total subnets available, we simply raise 2 to the power of 2 (2^2) and you will find the result is 4 subnets.

Step 2: Calculate the number of Hosts per subnet

Since the 2 bits (11 which identifies the network(subnets)) has been used, we calculate the number of valid hosts from the remainder 0’s. We have (000000) which is equal to 6 bits. Hosts are calculated as 2 raised to the power of host bits – 2. 2^6 = 2 x 2 x 2 x 2 x 2 x 2 = 64.
Valid Hosts = 64-2 = 62 Hosts.

Shortcut Way to calculate the number of hosts per subnet
Since the subnet is identified by the block size, the number of valid hosts will always be the Block Size – 2.
The block size for /26 prefix is 64. 64 – 2 = 62 Hosts.

With the above explanations, can we take another example together?

Subnetting Question 4: What is the last valid host on the subnetwork 192.168.241.200/29.
From the prefix of /29, the block size is 8 and the mask value is 248. /29 = 255.255.255.11111000.
The number of subnets is 2^5 = 32 Maximum Subnets
The number of hosts per subnet = 2^3 – 2 = 8 – 2 = 6 Hosts per Subnet
Now let us go ahead and find the last valid host on the subnetwork 192.168.241.200/29

We determined the block size to be 8 and so the incremental will be blocks of 8. Let’s tackle the blocks;

1st Subnet – 192.168.241.0 – 192.168.241.7
2nd Subnet – 192.168.241.8 – 192.168.241.15
3rd Subnet – 192.168.241.16 – 192.168.241.23
4th Subnet – 192.168.241.24 – 192.168.241.31

Subnet Address – 192.168.241.200
Host Range192.168.241.201 – 192.168.241.206
Broadcast Address192.168.241.207

Last Subnet – 192.168.241.248 – 192.168.241.255

The last valid host on the subnetwork 192.168.241.200/29 is 192.168.241.206.

Subnetting Question 5
You are designing a subnet mask for the 172.30.0.0 network. You want 1300 subnets with up to 28 hosts on each subnet. What subnet mask should you use?

This is a very good subnetting question you are likely to encounter in an interview and also in your networking exams.
From the question, we have not been given any subnet mask and so the first step is to locate which private ip address class it sits on.

Calculating CIDR based on the Private IP Address Classes Table
From the Private IP Address Classes Table, 172.30.0.0 belongs to the Class B CIDR which has the default subnet mask of 255.255.0.0 and the prefix of /16.

We want 1300 subnets. What block size satisfies this requirement? The number of subnets is determined by 2 raised to the power of the number of bits. From the 3rd octet we need to start stealing some bits to get our subnet. After stealing 8 bits we realise that 2^8= 256 which is below the required target. So we head over to the 4th octet and we steal some more… 2^10 = 1024 which is still short and so let us try 2^11. Aha, 2^11 = 2048 which is more than sufficient and satisfies the requirements laid out.

Calculate the New Subnet Mask
Since we borrowed 11 bits, we are going to have 255.255.11111111.11100000.

The new subnet mask is: /27 (11111111.11111111.11111111.11100000) = 255.255.255.224

The 0 bits are what our hosts will use and so let us calculate the number of hosts on each subnet.
2^5 = 32 – 2 = 30 hosts per network. The requirement was for us to have 28 hosts per subnet and so this subnet mask satisfies the requirement sufficiently.

It is always a good practice to calculate the number of subnets before dealing with the hosts.

Question Number 6: What is the first valid host on the subnetwork that the node 172.20.58.157 255.255.240.0 belongs to?

Solve the above question by following this framework;

  1. Locate the Block Size
  2. Identify Subnet Mask Value
  3. Calculate the number of subnets
  4. Calculate the number of hosts per subnet
  5. Locate the Node’s IP address in the appropriate block and the first valid host on the subnetwork

Answer = 172.20.48.1

Follow Cisco’s guide to subnetting in the following link.

]]>
How to Calculate Subnet Mask from IP Address Step by Step https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/how-to-calculate-subnet-mask-from-ip-address-step-by-step/ Wed, 06 May 2020 20:46:30 +0000 http://www.expertnetworkconsultant.com/?p=3742 Continue readingHow to Calculate Subnet Mask from IP Address Step by Step]]> In as much as there are a great number of articles on the subject of subnetting, I have also taken a bold step in creating a step by step guide “How to Calculate Subnet Mask from IP Address Step by Step” to bring you the understanding I have gained in the real world where subnetting is concerned.





Have you been faced with a task laced with many prefixes you find intimidating? Well, you are in the right place at the right time to improve your understanding of subnetting once and for all.

You can read more on the subject broadly from Cisco’s website here.

Step by step guide to IP Subnetting Video

Below is a simple 6 step by step method I use to perform subnetting calculations.

Let us look at this question below;

1: You have been given an IP Address 10.20.4.13/29 and been asked to find out the following pieces;

  1. Subnet Address
  2. First Valid Host Address
  3. Last Valid Host Address
  4. Broadcast Address
  5. Subnet Mask

How to Calculate Subnet Mask from IP Address Step by Step

Step 1: Find Subnet Number
Subtract Prefix Number from /32
32-29=3

Calculate Subnet Mask
8 Bits – 3 Bits = 5 Bits(Network Bits Turned On)

You might be asking why 8 Bits, 8 Bits are required for each octet.

128 64 32 16 8 4 2 1
1 1 1 1 1 0 0 0
128 + 64 + 32 + 16 + 8 = 248

Subnet Mask = 255.255.255.248

Step 2: Find Subnet Size
Raise 2 to the power of deduction (8-3 =5 Bits). Let’s call the bits n!
2**n = Subnet Size
2**5 = Subnet Sizes for each subnet.
2*2*2 = 8

Note: 8 is the block size for the subnet so for example, the increments will now be 0 8 16 32 40 and so on!

Step 3: Find Broadcast Address
Subnet Size – 1
(2**n) – 1 = Broadcast Address
(2**3) – 1 = (8-1) = 7

Step 4: Locate IP Address Subnet
Identify Subnet Block for IP Address:
Where in each increment is the address 10.20.4.13/29 located 0 8 16 32 40?

13 falls between 8 and 16 and therefore the address is in the valid host range of the subnet 10.20.4.8/29

Step 5: Calculate Valid Hosts | How to calculate number of hosts in the subnet
2**n – 2 = Valid Host Range
2**3 – 2 = (8-2) = 6

Answer for question now is as follows;

Subnet Address: 10.20.4.8/29
Min Host Address: 10.20.4.9/29
Max Host Address: 10.20.4.14/29
Broadcast Address: 10.20.4.15/29

There you have it. A simple 6 step by step guide to subnetting effectively.

Variable Length Subnets Mask Table

Prefix size Network mask Usable hosts per subnet
/1 128.0.0.0 2,147,483,646
/2 192.0.0.0 1,073,741,822
/3 224.0.0.0 536,870,910
/4 240.0.0.0 268,435,454
/5 248.0.0.0 134,217,726
/6 252.0.0.0 67,108,862
/7 254.0.0.0 33,554,430
Class A
/8 255.0.0.0 16,777,214
/9 255.128.0.0 8,388,606
/10 255.192.0.0 4,194,302
/11 255.224.0.0 2,097,150
/12 255.240.0.0 1,048,574
/13 255.248.0.0 524,286
/14 255.252.0.0 262,142
/15 255.254.0.0 131,070
Class B
/16 255.255.0.0 65,534
/17 255.255.128.0 32,766
/18 255.255.192.0 16,382
/19 255.255.224.0 8,190
/20 255.255.240.0 4,094
/21 255.255.248.0 2,046
/22 255.255.252.0 1,022
/23 255.255.254.0 510
Class C
/24 255.255.255.0 254
/25 255.255.255.128 126
/26 255.255.255.192 62
/27 255.255.255.224 30
/28 255.255.255.240 14
/29 255.255.255.248 6
/30 255.255.255.252 2
/31 255.255.255.254 0
/32 255.255.255.255 0
    Related Posts:

How to connect GNS3 to a Physical Network Step by Step

]]>
Introduction to Subnetting from the Perspective of Design and Operation https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/introduction-to-subnetting-from-the-perspective-of-design-and-operation/ https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/introduction-to-subnetting-from-the-perspective-of-design-and-operation/#respond Fri, 13 Apr 2018 17:08:21 +0000 http://www.expertnetworkconsultant.com/?p=1282 Continue readingIntroduction to Subnetting from the Perspective of Design and Operation]]>

Have you considered the operational view versus design view of subnetting yet?

Imagine you’ve gone to the beach with a team of friends and each person has been charged with building a sand castle or an object from sand, perhaps you may say, what has this got to do with Introduction to Subnetting from the Perspective of Design and Operation, well it does indeed have everything to do with it. The beach has an endless heap of sand readily available to your use and the weather is fantastic. You go on a nice trip to work on sand projects with the aim to create a competition amongst some friends.

Now each member of the team has been given a container to fill up with sand for their object but you have been delegated as the person responsible for giving the right amount to each individual for their selected objects based on the sizes chosen.

John has chosen to create a full size motorcycle, Jenny has chosen to create a mouse, Rebecca has chosen to create her pet dog, Kwabena has chosen to create a joystick and then the twins have decided to become the Wright brothers, you guessed it, they are creating an aircraft. Knowing the estimated sizes of their objects, you have provided each one a container to work within and have started to heap the sand for each of them.

Before undertaking a task as per the above scenario, what do you personally think should be his approach so no one is deficient of sand enough to cater for their sand objects?

 

Let us consider the following key points;

  • Analyse Needs
  • Choose Size Requirements (Sand)
  • Plan how to apportion the Sand.

 

A big question to ask is this, will you give Jenny the same amount of sand as the Twins who wants to create a full sized aircraft? The answer is obvious, No! Someone may argue that this is a competition and so it does not matter, give them all the same portion and let them get on with it. This is not the best mindset as this will only incur waste.

So the best thing to do is measure a quantity equivalent or just slightly over the size of the object they are about to create so there is enough room for the creation of the object and any unforseeable adjustments they might need.

 

Translate our beach creation to the world of subnetting from the perspective of design and operation.

Consider the following diagram – Figure 1.0

subnet design per networks

Subnet Design: Class B 172.16.0.0 | First 3 Octets are Equal. | Figure 1.0 is our Sample Subnet Plan Document

 

In the design above, the entire network design depicts 5 separate networks broken down into three LANs and one each for the WAN links. Each subnet has the same value in the first 3 octets. For example, for the LAN on the left, the number shows 172.16.1._ meaning all addresses that begin with 172.16.1. Since this is a class B network and not all the subnets have been used, there is a great deal of room for improvement.

 

The skill of subnetting in designing is crucial for the network engineer. Do note that most times the role you take would have had some engineers beforehand who would have designed the network and planned the subnets before you arrived there. The concept is still very essential for you as will need to interpret what someone before you has already chosen. To completely grasp IP addressing and subnetting, you need to have a mindset from the perspective of design and operation. In our earlier example of Figure 1.0, I mentioned that the Subnet Design states that the first three octets of all the subnets were equal. A question you may ask is why was this convention chosen? Could there not have been any alternatives? Would the alternatives be better for the network today. As you can see, subnetting require a great deal of planned design rather than to operation. Let’s consider the following flow;

Figure 1.1

Analyse Needs

  • Number of Subnets
  • Number of Hosts per Subnet
  • Size of Subnet

Design Subnets

  • Choose Network
  • Choose 1 Mask
  • List all Subnets

Plan Implementation

  • Subnets and their Locations
  • Static IP
  • DHCP Ranges

Let us break these down so we can have a deeper understanding of what needs doing.

Analyse Subnetting and Addressing Needs

  • Which hosts should be grouped together into a subnet?
  • How many sunbets does this network require?
  • How many host IP addresses does each subnet require?
  • Will we use a single subnet size for simplicity, or not?

Figure 1.2

 

 

Rules to consider for devices in each subnet

Every device that connects to an IP internetwork needs to have an IP address in order to do so. These devices include printers,IP phones, servers, mobile phones, tablets and end devices used by users. Major network devices like routers, switches, and firewalls must also have IP’s in order to internetwork.

Figure 1.3 – Identifying the Subnets

Rules about which hosts are in which subnet

IP addresses must be assigned according to some fundamental rules and for for good reasons. To make routing work efficiently, IP addressing rules group addresses into groups called subnets. The rules are as follows:

Addresses in the same subnet are not separated by a router – look at figure 2.1
Addresses in different subnets are separated by at least one router – look at figure 2.2

same subnet and different subnet ip addressing rules per design

Notice that PC A and B are in one subnet and PC C is in another subnet. For PC A to speak with PC C, at least one router (R1) would be required.

Determine the Number of Subnets

You would be given a document detailing the entire detail of your organisation’s internetwork. Once you have been given this document start applying the rules.

Consider the following:
Network Diagrams
VLAN configuration details
WAN technology used( MPLS, Frame-Relay, VPLS, Metronet, etc) Based on this information, use the above rules and plan one subnet for every;

  1. VLAN
  2. Point-to-point Serial link
  3. Ethernet emulation WAN link (EoMPLS)
  4. Frame Relay PVC.

 

In the above diagram, there is a clear indication of expected hosts per subnet and so it makes out design and implemention of a subnet scheme a little less daunting. I will be going through a simple method in performing subnetting in another article. Look out for more and You might also enjoy reading my article on Inter-VLAN Routing.

 

Good Resource for Further Study:
Get more advanced in-depth knowledge in Routing and Switching from the world’s most renown author in Networking.

]]>
https://www.expertnetworkconsultant.com/expert-approach-in-successfully-networking-devices/introduction-to-subnetting-from-the-perspective-of-design-and-operation/feed/ 0