Subnetting without calculator

VIKASH GAUTAM
2 min readMay 1, 2019

Have you ever think, how do people tell end result of subnetting verbally without using any calculator i.e. ipcalc, online sites like http://cidr.xyz/, http://vlsm-calc.net/ etc.

Sometimes “LESS IS MORE” so I came up with a short blog to calculate subnetting quickly by assuming that people reading this must be having a basic knowledge of terms used in subnetting.

Let’s take an example of CIDR 192.168.0.0/24. Here this slash notation simply means that 24 of 32 bits are network bits. So let’s focus on /22, /23, /24 slash notation in below images and try to get IP and subnet mask against them quickly.

You must have seen cheat tables of subnet mask like given below :

Image: 1 ( source )

Quick Method

Get the size of the network (including network and broadcast-address). For networks up to /24, this will be “2^(32-number-of-prefix-bits)”, in case of a /27 network 2^(32–27)=2⁵=32. Now build the difference between 256 and this number: 256–32=224

In the same way for /22, /23, /24 slash notation and refer Image: 2 to cross check your answers.

CIDR: 1st Octet . 2nd Octet . 3rd Octet . 4th Octet/slash notation

/32: 256–2⁰=256–1=255

/31: 256–2¹=256–2=254

/30: 256–2²=256–4=252

/29: 256–2³=256–8=248

/24: 256–2⁸=256-256=0

/24 #NetMask = 255.255.255.0

/23: 256–2⁹ or 256–2⁸*2¹ means will span across two octets

4th octet: 256–2⁸=256–256=0

3rd octet: 256–2¹=256–2=254

/23 #NetMask = 255.255.254.0

/22: 256–2¹⁰ or 256–2⁸*2² means will span across two octets

4th octet: 256–2⁸=256=256=0

3rd octet: 256–2²=256–4=252

/22 #NetMask = 255.255.252.0

Image: 2

Calculation of Number of IP

Quick Method

Always exclude 2 IPs from total number of IP as these are reserved for network and broadcast in every network. Again in case of a /27 network 2^(32–27)-2 = 2⁵-2 = 32–2 = 30

That means we will be getting 30 IPs from CIDR with slash notation /27

Result:

Network: 192.168.0.0/27

HostMin: 192.168.0.1

HostMax: 192.168.0.30

Broadcast: 192.168.0.31

Hosts/Net: 30

Now apply the same trick on /22, /23, /24 slash notation and cross check your answers with image: 2

Now we are all set to calculate number of IP and subnetting value without calculator so take a chill pill and forget about ipcalc and other tools to calculate the same.

--

--