let us see some examples.
Example 1:
We have a class C address 192.20.20.0 with default subnet mask 255.255.255.0
We need to extract 8 subnets from this address.
First step is to write the last byte in binary as follows.
|
192.20.20. |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
Since we need 8 subnets, then 3 bits must be borrowed 2^3=8
So the number of subnets will be 2^3=8 and number of usable subnets addresses is 8-2=6.
Accordingly, number of hosts per subnet is 2^5= 32 and number of usable Host addresses is 32-2=30.
Now a new subnet mask is formed, we can calculate it by adding the three bits at left of the vertical line 128+64+32=224, so the new subnet mask will be 255.255.255.224
Now we can write down the range of subnets available as follows.
|
|
Network addr. |
|
Broadcast addr. |
Remarks |
|
First subnet |
192.20.20.0 |
to |
192.20.20.31 |
(Not valid) |
|
Second subnet |
192.20.20.32 |
to |
192.20.20.63 |
Add 32 to last byte |
|
Third subnet |
192.20.20.64 |
to |
192.20.20.95 |
|
|
Fourth subnet |
192.20.20.96 |
to |
192.20.20.127 |
|
|
Fifth subnet |
192.20.20.128 |
to |
192.20.20.159 |
|
|
Sixth subnet |
192.20.20.160 |
to |
192.20.20.191 |
|
|
Seventh subnet |
192.20.20.192 |
to |
192.20.20.223 |
|
|
Eighth subnet |
192.20.20.224 |
to |
192.20.20.255 |
(Not valid) |
Example 2:
|
IP Address 204.15.6.0 |
11001100.00001111.00000101.0000 |
0000 |
|
Subnet mask 255.255.255.240 |
11111111.11111111.11111111.1111 |
0000 |
|
|
sub |
|
In this example from subnet mask we can find number of subnets and host per subnet by looking in to the last byte
of subnet mask.
Four bits were borrowed for subnet and four bits remained for host, therefore 2^4=16 Subnet and 16 hosts.
(Remember we can
assign only 14 addresses to devices)