IP Subnetting
IP SUBNETTING
General way of sub-netting:
In this way we will be using two different formulas for calculating sub-networks and Hosts.
Calculating Subnets:
Example 1:
IP: 172.16.0.1/18
X.X.11000000.00000000
Formula for calculating subnetworks is 2^n (2 to the power of n).
n = The number of bits used for Networks.
Note: as the first two octets 8+8 = 16 bits have been filled completely we should not consider them. The remaining two bits only we should consider for calculating subnetworks.
Hence, n= 2.
Number of subnets is = 2^2 = 4
4 subnets.
They are:
172.16.0.0/18 - 172.16.63.0/18
172.16.0.64/18 - 172.16.127.0/18
172.16.0.128/18 - 172.16.191.0/18
172.16.192.0/18 - 172.16.255.0/18
Example 2:
IP: 192.168.1.1/28
The bit representation: X.X.X.11110000
As the first 3 octets were filled, we shouldn't consider them.
The number bits filled are : 4
Hence, for calculating number of subnets ; formula is 2^n
n=4.
2^4=16
Hence, we will get 16 subnets per network.
They are:
192.168.1.0-192.168.1.15
192.168.16.0-192.168.31.0
192.168.32.0-192.168.47.0
.. etc.
Example 2:
IP: 192.168.1.1/28
The bit representation: X.X.X.11110000
As the first 3 octets were filled, we shouldn't consider them.
The number bits filled are : 4
Hence, for calculating number of subnets ; formula is 2^n
n=4.
2^4=16
Hence, we will get 16 subnets per network.
They are:
192.168.1.0-192.168.1.15
192.168.16.0-192.168.31.0
192.168.32.0-192.168.47.0
.. etc.
FINDING HOSTS:
Note: With this method you will get Number of Usable hosts directly.
To find the Number of hosts per subnet we should use the formula 2^n-2.
where n is number of bits filled in hosts bits.
Example 1:
IP: 172.16.0.1/18
Bit representation: X.X.11000000.00000000
The number of bits used for networks is 18 bits. The remaining 14 bits or used for hosts.
Hence to find the number of hosts:2^n-2;
That is: 2^14-2
The number of hosts per subnet will be: 16382.
Example 2:
IP: 192.168.1.1/29
The Bit Representation is : X.X.X.11111000
Number of Network bits: 29
Number of Hosts bits: 3
Hence to find the number of hosts 2^n-2;
n=3.
2^3-2= 6
If you have any queries regarding this topic,
Email: poodari.sampathkumar@gmail.com
Comments
Post a Comment