- For a classful network total bits is 8. So Total bits = Tb = 8.
- Sub-net mask can be 0, 128, 192, 224, 240, 248, 252, 254 and 255.
- Below table gives you the "Number of bits used for subnetting"(n) to their corresponding subnet mask.
- For subnet mask 255 is default, so it'll not consider for subnet masking.
- For example:
Let, IP address = 210.1.1.100 and Sub-net mask = 255.255.255.224
Total bits = Tb = 8 Number of bits used for subnetting = n = 3 (as subnet mask = 224 and its corresponding "No. of bits used for Subnetting" is 3 from above table)
-
2
From the previous step, you got the "Number of bits used for subnetting"(n) and you know the "Tb", then you can get "Number of bits left for host"(m) = Tb - n as total bits is the summation of number of bits used for subnetting and number bits left for host i.e. Tb = m+n. -
3
Now you have to calculate "Number of subnets" = 2n and "Value of last bit used for subnet masking"(Δ) = 2m. Number of host per subnet = 2m - 2. -
4
Now you can find previously calculated number of subnets by separating subnets each having "Value of last bit used for subnet masking" or Δ addresses.- The 8 subnets (as calculated in previous step) are shown above.
- Each of them has 32 addresses.
-
5
Now you have to find that your IP address is in which subnet, that subnet's first address is network address and last address is broadcast address.
Method 2
For CIDR
-
1
In CIDR, you have a IP address followed by bit-length prefix separated by slash(/). Now you have to convert bit-length prefix to quad-dotted decimal representation. To do this follow below steps.- Write the the bit-prefix in below format.
- If it's 27, then write it as 8 + 8 + 8 + 3 .
- If it's 12, then write it as 8 + 4 + 0 + 0 .
- Default is 32, which is 8 + 8 + 8 + 8.
- Convert the corresponding bit according to the below table and represent in quad-dotted decimal format.
- Let an IP address be 170.1.0.0/26 . Using above table, you can write:
Now the IP address is 170.1.0.0 and subnet mask in quad-dotted decimal format is 255.255.255.192 .26 = 8 + 8 + 8 + 2 255 . 255 . 255 . 192
- Write the the bit-prefix in below format.
-
2
Total bits = Tb = 8.- Sub-net mask can be 0, 128, 192, 224, 240, 248, 252, 254 and 255.
- Below table gives you the "Number of bits used for subnetting"(n) to their corresponding subnet mask.
- For subnet mask 255 is default, so it'll not consider for subnet masking.
- From the previous step, you got IP address = 170.1.0.0 and Sub-net mask = 255.255.255.192
Total bits = Tb = 8 Number of bits used for subnetting = n = 2 (as subnet mask = 192 and its corresponding "No. of bits used for Subnetting" is 2 from above table)
-
3
From the previous step, you got the "Number of bits used for subnetting"(n) and you know the "Tb", then you can get "Number of bits left for host"(m) = Tb - n as total bits is the summation of number of bits used for subnetting and number bits left for host i.e. Tb = m+n.- Number of bits left for host = m = Tb - n = 8 - 2 = 6
-
4
Now you have to calculate "Number of subnets" = 2n and "Value of last bit used for subnet masking"(Δ) = 2m. Number of host per subnet = 2m - 2. -
5
Now you can find previously calculated number of subnets by separating subnets each having "Value of last bit used for subnet masking" or Δ addresses. -
6
Now you have to find that your IP address is in which subnet, that subnet's first address is network address and last address is broadcast address.