Recent Posts

Friday, 11 August 2017

Subnetting Basics

Subnetting

What is Subnetting ?
Subnetting is a process of dividing large network into the smaller networks based on layer 3 IP address. Every computer on network has an IP address that represent its location on network. Two version of IP addresses are available IPv4 and IPv6. 

This is a basic to know about subnetting but we can also say like this form to understand in easy and simple meaning which is very effective to memorize in our mind with this meaning of subnetting given below;

“Subnetting” means we borrow some bits from the Host part to add to the Network part. This allows us to have more networks than using the default subnet mask. For example, we can borrow some bits in the next octet to make the address 11.1.0.1 belong to a different network from 11.0.0.1





Default subnet mask                                               Range
Class A 255.0.0.0 (/8)                                1.0.0.0 – 126.255.255.255
Class B 255.255.0.0 (/16)                          128.0.0.0 – 191.255.255.255
Class C 255.255.255.0 (/24)                      192.0.0.0 – 223.255.255.255

Network bits                                                            Host bits
Class A  first 8 bits are turned as 1            Last 24 bits are turned as 0
Class B  first 16 bits are turned as 1          Last 16 bits are turned as 0
Class C  first 24 bits are turned as 1          Last 8 bits are turned as 0


Slash Notation
The slash notation (following with a number) is equivalent to a subnet mask. If you know the slash notation you can figure out the subnet mask.

For example: “/8” is equivalent to “255.0.0.0”; “/12” is equivalent to “255.240.0.0”; “/28” is equivalent to “255.255.255.240”; “/32” is equivalent to “255.255.255.255”.

From the “default subnet mask” shown above, we can identify the network and host part of each class. Notice that in the subnet mask, bit 1 represents for Network part while bit 0 presents for Host part (255 equals to 1111 1111 and 0 equals to 0000 0000 in binary form).

You can make note these examples to find out the subnets and host-per-subnet.
 
Example 1:
In a company they have been assigned the network 1.0.0.0. How many subnets and hosts-per-subnet you can create with a subnet mask of 255.255.255.0?

Solution:
First of all you have to specify which class this network belongs to. According to the question given it belongs to class A (simply, class A ranges from 1 to 126) and its default subnet mask is 255.0.0.0. Therefore if we use a subnet mask of 255.255.255.0, it means we borrowed 16 bits (to convert from 0 to 1).
255.0.0.0 = 1111 1111.0000 0000.0000 0000.0000 0000
255.255.255.0 = 1111 1111.1111 1111.1111 1111.0000 0000

Therefore,
The number of newly created subnets = 216 = 65536 (with 16 is the borrowed bits)
The number of hosts per subnet = 28 – 2 = 254 (with 8 is the bit “0”s left in the 255.255.255.0 subnet mask)

Example 2:
In a company they have been assigned the network 150.0.0.0. How many subnets and hosts-per-subnet you can create with a subnet mask of 255.255.128.0?


Solution:
150.0.0.0 belongs to class B with the default subnet mask of 255.255.0.0 .The subnet mask of 255.255.128.0 is given below;
255.255.128.0 = 1111 1111.1111 1111.1000 0000.0000 0000 
This is a valid subnet because all bit “1”s and “0”s are successive. Comparing to the default subnet mask, we borrowed only 1 bit:
255.255.0.0 = 1111 1111.1111 1111.0000 0000.0000 0000
Therefore:
The number of newly created subnets = 21 = 2 (with 1 is the borrowed bits)
The number of hosts per subnet = 215 – 2 = 32766 (with 15 is the bit “0”s left in the 255.255.128.0 subnet mask).

Example 3:
In a company they has been assigned the network 192.23.16.0/28. How many subnets and hosts-per-subnet you can create with a subnet mask of 255.255.255.252?

Solution:

192.23.16.0 belongs to class C with a default subnet mask 255.255.255.0 . 
In your company they has given a “subnetted” network from the beginning and it is not using the default subnet mask. So we will compare two subnet masks above:
/28 = 1111 1111.1111 1111.1111 1111.1111 0000 (=255.255.255.240)
255.255.255.252 = 1111 1111.1111 1111.1111 1111.1111 1100 (= /30) in this example we have borrowed 2 bits. 

Therefore,
The number of newly created subnets = 22 = 4 (with 2 is the borrowed bits)
The number of hosts per subnet = 22 – 2 = 2 (with 2 is the bit “0”s left in the 255.255.255.252 subnet mask)





No comments:

Post a Comment

Popular Posts