In this CIDR tutorial we will learn about supernet calculation.
After this CIDR tutorial you will be able to find Subnet Mask, Wildcard Mask, Network Address, Broadcast Address, maximum host per subnet, number of subnets for any given IP Address.
Let's do calculation for IP address 112.3.2.3 /25
We will calculate stepwise.
Step # 1 : Find Subnetmask
How to calculate Subnet Mask from given prefix?
The prefix number represents the
We know that IPv4 address is made up of 32 bits binary number (4 Octets).
To get subnet mask, we will take a 32 bits binary number in which first 25 bits (here prefix /25) are '1' and remaining are '0'.
11111111 11111111 111111111 0000000 which is the Subnet Mask!!
11111111.11111111.11111111.10000000
255 . 255 . 255 . 128
So the Subnet Mask for prefix /25 is 255.255.255.128.
Step # 2 : Find Network bits and Host bits
How to find Network Bits and Host Bits?
Network Bits(NB) are same as the prefix#, and Host Bits(HB) are 32 - NB.
We know that SM = 32 (Subnetmask is 32 bit binary number). which means NB + HB = 32 (SM = NB + HB)
NB = 25
HB = 32 - 25
= 7
So Network Bits are 25 and Host Bits are 7 for /25 network.
Step # 3 : Find Maximum Hosts per Subnet.
How to get maximum hosts per subnet?
Hosts per subnet = 2^HB
Hosts = 2^7
= 128
126 valid hosts, excluding Network Address and Broadcast Address.
Step # 4 : Find total subnets in given Network.
How to find maximum number of possible subnets in network?
Number of subnets = 2^NBSubnets = 2^25
= 33554432
With /25 network maximum 33554432 unique subnets possible.
Step # 5 : Find Network Address and Broadcast Address
How to find Network Address and Broadcast Address?
If you have IP address and Subnet Mask (or prefix) you can easily find the Network Address.
All we need to do is Bitwise AND operation between IP address and Subnetmask to get Network Address.
IP Address: | 01110000.00000011.00000010.00000011 | 112.3.2.3 |
---|---|---|
Subnetmask: | 11111111.11111111.11111111.10000000 | 255.255.255.128 |
BITWISE AND | ||
Network Address: | 01110000.00000011.00000010.00000000 | 112.3.2.0 |
To get Broadcast Address we need to find Wildcard Mask, which is inverted Subnet Mask.
Perform Bitwise OR operation between IP Address and Wildcard Mask to get Broadcast Address.
IP Address: | 01110000.00000011.00000010.00000011 | 112.3.2.3 |
---|---|---|
Wildcard Mask: | 00000000.00000000.00000000.01111111 | 0.0.0.127 |
BITWISE OR | ||
Broadcast Address: | 01110000.00000011.00000010.01111111 | 112.3.2.127 |
This is it! We have found Subnetmask, Wildcard Mask, Hostbits, Networkbits, Maximum Hosts per Subnet, Total Subnets in Network, Network Address, and Broadcast Address.
Network Bits | 25 |
---|---|
Host Bits | 7 |
Maximum Hosts per Subnet | 128 (126 Valid hosts) |
Maximum Subnets in Network | 33554432 |
Subnetmask | 255.255.255.128 |
Wildcard Mask | 0.0.0.127 |
Network Address | 112.3.2.0 |
Broadcast Address | 112.3.2.127 |
Hope you like this CIDR tutorial. Subnetting is foundation, you have to build it as strong as you can!!. You will be able to do subnetting on the fly, Practice is the key. You can verify your answers using CIDR Calculator while practicing.
If you have any questions regarding CIDR tutorial, feel free to Contact Us at any time.