What is “subnetting”?
“Subnetting” means we borrow some bits from the Host part to add to the Network part. This allows us to have more networks than using the default subnet mask. For example, we can borrow some bits in the next octet to make the address 11.1.0.1 belong to a different network from 11.0.0.1.
What's the benefit of subnetting?
Reduce the size of the routing tables.
Reduce network traffic. Broadcast traffic can be isolated within a single logical network.
Provide a way to secure network traffic by isolating it from the rest of the network.
3 main classes of IP address are :
Class A Range 0 - 127 in the first octet
Class B Range 128 - 191 in the first octet
Class C Range 192 - 223 in the first octet
NOTE : 0 and 127 which belongs to Class A are reserved for other purpose.
We can split IP address as mentioned below. IP address consist of 32 bits and we can write it as 4 parts having 8 bits in each
NNNNNNNN . HHHHHHHH . HHHHHHHH . HHHHHHHH
Class A [One network portion and 3 host portion]
NNNNNNNN . NNNNNNNN . HHHHHHHH . HHHHHHHH
Class B [2 network portion and 2 host portion]
NNNNNNNN . NNNNNNNN . NNNNNNNN . HHHHHHHH
Class C [3 network portion and one host portion]
At each dot imagine that there is a boundary, ie there are boundaries after bits 8, 16, 24, and 32. This is an important concept to remember.
While subnetting bits will always move to your right side.No change will occur in Octets having 255
For eg:
255.255.255.0 – here changes will takes place in fourth octect
255.255.128.0 – here changes will takes in third octect
255.255.255.128 – here changes will takes place in fourth octet
“Subnetting” means we borrow some bits from the Host part to add to the Network part. This allows us to have more networks than using the default subnet mask. For example, we can borrow some bits in the next octet to make the address 11.1.0.1 belong to a different network from 11.0.0.1.
What's the benefit of subnetting?
Reduce the size of the routing tables.
Reduce network traffic. Broadcast traffic can be isolated within a single logical network.
Provide a way to secure network traffic by isolating it from the rest of the network.
3 main classes of IP address are :
Class A Range 0 - 127 in the first octet
Class B Range 128 - 191 in the first octet
Class C Range 192 - 223 in the first octet
NOTE : 0 and 127 which belongs to Class A are reserved for other purpose.
We can split IP address as mentioned below. IP address consist of 32 bits and we can write it as 4 parts having 8 bits in each
NNNNNNNN . HHHHHHHH . HHHHHHHH . HHHHHHHH
Class A [One network portion and 3 host portion]
NNNNNNNN . NNNNNNNN . HHHHHHHH . HHHHHHHH
Class B [2 network portion and 2 host portion]
NNNNNNNN . NNNNNNNN . NNNNNNNN . HHHHHHHH
Class C [3 network portion and one host portion]
At each dot imagine that there is a boundary, ie there are boundaries after bits 8, 16, 24, and 32. This is an important concept to remember.
While subnetting bits will always move to your right side.No change will occur in Octets having 255
For eg:
255.255.255.0 – here changes will takes place in fourth octect
255.255.128.0 – here changes will takes in third octect
255.255.255.128 – here changes will takes place in fourth octet
Default subnet mask of Class A : 255.0.0.0 [CIDR /8 ]
Default subnet mask of Class B : 255.255.0.0 [CIDR /16]
Default subnet mask of Class C : 255.255.255.0 [CIDR /24 ]
Now have a look at the block sizes .If you can memorize Block Size subnetting will be so easy
Default subnet mask of Class B : 255.255.0.0 [CIDR /16]
Default subnet mask of Class C : 255.255.255.0 [CIDR /24 ]
Now have a look at the block sizes .If you can memorize Block Size subnetting will be so easy

Important : We can find block size by reducing our CIDR value from next Boundary.
Lets have few examples
Q : What subnet does 192.168.10.25/29 belongs to ?
Our mask is /29. The next boundary is 32. So 32 - 29 = 3. Now 2^3 = 8 which gives us our block size i.e. 2 to the power of 3 equals 8. Subnet mask for /29 is 255.255.255.248
First network address : 192.168.10.0
Second network address : 192.168.10.8
Third network address : 192.168.10.16
Fourth network address :192.168.10.24
Fifth network address : 192.168.10.32
Our IP address comes in 192.168.10.24 range
Q :What is the broadcast address of the network 172.27.216.80/28
Our mask is /28.Next Boundary is 32. So 32-28 = 4 Now 2^4 =16 which gives our block size
Given network is 172.27.216.80/28 .We get block size is 16.So next network will be 172.27.216.96.Broadcast address will be the last ip address of 172.27.216.80 network.So it will be 172.27.216.95
Q : What valid host range is the IP address 172.20.232.102 255.255.255.0 a part of?
Here subnet mask is given as 255.255.255.0
Valid host = 2^[Off bits ] -2 means 2^8 -2 =254.we know 2^8 is 256.
Note :Off bits means number of 0’s . 11111111.11111111.1111111.00000000
Q: What is the first valid host on the subnetwork that the node 172.30.119.235 255.255.255.128 belongs to?
Here subnet mask is 255.255.255.128 .So from above table CIDR is /25.next boundary is 32.So 32-25 = 7 .So block size is 2^7 = 128
Network address of 172.30.119.235 is 172.30.119.128 and first valid host is 172.30.119.129
Q : What subnet does 172.16.16.25/20 belongs to ?
Our mask is /20. The next boundary is 24. So 24 - 20 = 4. Now 2^4 = 16 which gives us our block size i.e. 2 to the power of 4 equals 16. Subnet mask for /20 is 255.255.240.0
First network address : 172.16.0.0
Second network address : 172.16.16.0
Third network address : 172.16.32.0