Showing posts with label Number of Subnets and Number of Hosts if given an network mask. Show all posts
Showing posts with label Number of Subnets and Number of Hosts if given an network mask. Show all posts

Friday, 16 January 2015

Number of Subnets and Number of Hosts if given an network mask

Given a netwok mask
For ex: 255.255.240.0
First identify the class to which it belongs:
Here in the example given, it belongs to class B
The network mask of class B is 255.255.0.0
So first 2 octets belongs to net id and last 2 octets belongs to host id.
Convert last two octets 240.0 to binary and its binary equivalent is 1 1 1 1 0 0 0 0. 0 0 0 0 0 0 0 0
since there are 4 ones's here
Number of subnets = 2^number of ones-2 = 2^4 - 2 = 14
Number of hosts = 2^number of zeros-2 = 2^12 - 2 = 4094