Dividing a large network into multiple small networks called Subnetting. It prevents you from the wastage of IP Address. In this post, I have shared with you the best and easiest IPv4 Subnetting Tutorial. Using this trick. you can easily understand
- How to do Subnetting
- How to calculate the Subnet Mask
- Calculation of the number of networks
- How to calculate the number of IP Addresses on each network.
- Calculation of the number of hosts on each network
- How to calculate network ID and Broadcast ID from a CIDR value.
Before starting the IPv4 Subnetting tutorial, we must know the few basic information about different classes of IP Address.
Basics of IPv4 Address
Class A IP Address
- CIDR Value: /8 (CIDR is the value of the number of network bits)
- IP Address: 1-126
- Default Subnet Mask: 255.0.0.0
- Here, 8 bits are reserved for the network, and the remaining 24 bits are reserved for the host.
Class B IP Address
- CIDR Value: /16 (CIDR is the value of the number of network bits)
- IP Address: 128-191
- Default Subnet Mask: 255.255.0.0
- Here, 16 bits are reserved for the network, and the remaining 16 bits are reserved for the host.
Class C IP Address
- CIDR Value: /24 (CIDR is the value of the number of network bits)
- IP Address: 192-223
- Default Subnet Mask: 255.255.255.0
- Here, 24 bits are reserved for the network, and the remaining 8 bits are reserved for the host.
IPv4 Subnetting Tutorial
Let’s take an example, from the IP Address i.e. 192.168.10.0/24, we are going to find the subnet mask.
How to calculate subnet Mask
Hence the IP Address starts from 192, it indicates it is a Class C address. By default, in Class C IP Address, 24 bits are reserved for the network and 8 bits are reserved for the host. In the given table, 1 indicates the number of network bits and 0 indicates the number of host bits.
If you count the value of this network bits on each block (27+26+25+24+23+22+21+20 . 27+26+25+24+23+22+21+20 . 27+26+25+24+23+22+21+20 . 00000000) the total answer you will get is 255.255.255.0.
Let’s take another example, from the IP Address 192.168.10.0/25 we are going to find the subnet mask and this time we are also going to find, how to count the number of networks, number of IP Address on each network, number of hosts on each network, the network ID and the broadcast ID.
Calculate Subnet Mask
Hence, the IP Address starts from 192, it indicates it is a Class C address. By default, in Class C IP Address, 24 bits are reserved for the network and 8 bits are reserved for the host. But, in this example, the CIDR value is /25. It means you have to borrow one bit from the host part to make it total /25. Follow the below-given table, where 1 indicates the number of network bits and 0 indicates the number of host bits.
If you count the value of all the network bits on each block (27+26+25+24+23+22+21+20 . 27+26+25+24+23+22+21+20 . 27+26+25+24+23+22+21+20 . 27 0000000). the total answer you will get is 255.255.255.128.
How to calculate the number of networks
You can calculate the number of networks with the help of a simple formula:
2n (Here, n indicates the total number of bits borrowed from the host.)
Hence, we have borrowed only 1 bit from the host part. So, our answer will be
2n
21 = 2 (You can create 2 networks from this address.)
How to calculate the IP Address
You can calculate the number of IP Address on each network with the help of simple formula:
2n (Here, n indicates the total number of remaining host bits.)
Hence, we have borrowed one bit from the host part to make network bits /25. So, the remaining bits on the host side is only seven. So our answer will be,
2n
27 = 128 (There will be 128 IP Address on both the two networks)
How to calculate the host address
The formula for calculating the host address is 2n – 2 (Here, n indicates the total number of remaining host bits). Here we have subtracted 2, this is because on every network the first address is always reserved for the network ID, and the last address is always reserved for the broadcast ID.
2n – 2
27 – 2 = 126 (You can assign 126 host address on each network)
IPv4 Subnetting Tutorial Video