Pages

Monday 25 February 2013

How to subnetting IP

How to subnetting IP ?

In this article we will know how to make subnet of a classfull or classless network. Subnetting means break a large network into a some small network. It's depends on your requirement that how much subnet or small network you need. Okay, first we discuss about some steps of subnetting and then we will see some example.
If you have any given network i.e; 192.168.1.0/24 and you are asked to break this classfull network into 6 subnets. What will you do ? You know that to make more network you need more network bits. Okay, relax, follow the given steps.
Step 1: Convert subnet mask into binary form

In my case 192.168.1.0/24 has a subnet mask 255.255.255.0, binary format of subnet mask 
will be 11111111.11111111.11111111.00000000
Step 2: Consider how many network bits you need to make subnet of given number. You can use this formula to find out network bit you need. 2^x =>n where n is number of subnet you need and 2^x
!=>n*2

We have to make 6 subnet: use the formula 2^x=>6 and 2^x != 12, so = 3. We need 3 bits.
Step 3: We need 3 bits, so, Change the 3 host bits into network bits from left hand side.

original subnet mask is 11111111.11111111.11111111.00000000
After changing 11111111.11111111.11111111.11100000
Step 4: Calculate new subnet mask.

New subnet mask is 255.255.255.224
Step 5 : Find out total number of sub network , you created 2^s, where s = number of network bit you changed

I changed 3 bits then 2^3=8 subnetwork we created.
Step 5 : Find out Total number of ip on each subnet, 2^h, where h = number of host bits.

In my subnet mask only 5 host bits are remaining, then 2^5 = 32 Ip per sub network
Step 6 : Find the host per sub network, Number of IP - 2

In my case every sub network has 32 IP, then host or valid ip will be 32-2 = 30
Step 7 : Find out range for each and every sub network.
Step 7.1 : Find out block, Block = 2^B, where B = host bit of only subnetted octet.

In my case 4th octet has been subnetted and it has 5 host bits, then, 2^5 = 32 is block size
Step 7.2 : Use this block of 32 from 0 until you reach 255 on the subnetted octet only

In my case. 192.168.1.0 - 192.168.1.31   first three octet is same 192.168.1 because subnetting 
occur in 4rth subnet. 0-31 in 4rth subnet is the range of first sub network, because block size is 32. 
The next network would be
 
192.168.1.32 -  192.168.1.63
192.168.1.64 - 192.168.1.95
192.168.1.96 - 192.168.1.127
192.168.1.128 - 192.168.1.159
192.168.1.160 - 192.168.1.191
192.168.1.192 - 192.168.1.223 and last subnetwork will be
192.168.1.224 192.168.1.255
Every subnetwork has 32 ip, block size on forth octet is 32 and total number of network is 8. Thus, 8 * 32 = 256, Your 8 host bits property.
Okay Now take a another example. You are given a IP address 172.168.16.0/16 and you are asked to make 4 sub network.
1. Change the subnet mask into binary = 11111111.11111111.00000000.00000000
2. Consider how many network bit you need. We need actually 2 bits
3. Change the subnet mask : 11111111.1111111.11000000.00000000
4. Calculate new subnet mask : 255.255.192.0
5. Find out sub network : 2^2 = 4
6. Find out IP and host per sub network: 2^14= 8192 IP and 8290 host per sub network
7. Find out Block size = 2^6 = 64 because we subnetted only in 3rd octet.
8. Find out range :
172.16.0.0 - 172.16.63.255 (first two octet are same 172.16 because we subnetted in 3rd octet, then we start 3rd octet from 0 to 63, because range is 64 and in 4th Octet 0 to 255 because very first IP of any network has all host bits off and very last IP or any network has all bits on)
then the next subnet would be :
172.16.64.0 - 172.16.127.255
172.16.128.0 - 172.16.191.255 and last would be
172.16.192.0 - 172.16.255.255
I hope This article is useful for you.
Thank you

No comments:

Post a Comment