This tutorial explains the subnet tips in detail with over 50 examples of the subnet. The subnet tips explained in this tutorial not only make the subnet easier, but also allow you to answer any question related to the subnet in less than a minute. Learn the subnet with examples in simple language.

The subnet is one of the most complex and tested topics in any Cisco entry level exam and interview. In other situations, you can use any regular method of sub-networking. But in the exam and interview, where time and accuracy are important, you should always use the simplest and fastest methods of sub-networking, as explained in this tutorial.

Key points of the subnetwork

Before we start working with examples of subnets, let’s quickly summarize the important concepts and terms of subnets in the previous parts of this tutorial.

An IP address is the combination of two addresses; network address and host address. The network address is always written first in order. When reading an IP address, the portion to be treated as a network address and the portion to be treated as a host are determined by another address known as the subnet mask.

An IP address is always used with the subnet mask. Without a subnet mask, an IP address is an ambiguous address and vice versa.

The IP address and the subnet mask are 32 bits. These bits are divided into four bytes. The bytes are separated by periods and written in a sequence.

A subnet mask can be written in two ways; in its complete form and in abridged form. In its full form, a decimal value of each byte is written with the IP address. In abbreviated form, only the number of network bits is written with the IP address. The following table lists some examples of both types.

IP address with full subnet mask IP address with abbreviated subnet mask

10.0.0.0
255.0.0.0

10.0.0.0/8

172.168.1.0
255.255.0.0

172.168.1.0/16

192.168.1.0
255.255.255.0

192.198.1.0/24

In subnet issues, the second type is mainly used.

There are five IP classes A, B, C, D and E. From these, only the first three classes A, B and C are used in the subnet. The subnet cannot be carried out in classes D and E.

In classes A, B and C, the first 8, 16 and 24 bits are reserved for the network address, respectively. In the three classes, the last 2 bits are reserved for host addresses.

If we exclude the reserved network bits and the host bits from the total number of IP bits, we will get the eligible subnet host bits.

The subnet can only be performed in host bits eligible for the subnet.

eligible bit subnet

To find out how many subnet bits are needed to create the number of networks, we use the power of 2.

For example, if we want to know that many networks can be created from 3 subnet bits, we will use the power 2 three times.

23 = 8

We can create 8 networks from 3 subnet host bits.

Power of 2
2X Value 2X Value 2X Value 2X Value
1 2 9 512 17 131072 25 33554432
2 4 ten 1024 18 262144 26 67108864
3 8 11 2048 19 524288 27 134217728
4 16 12 4096 20 1048576 28 268435456
5 32 13 8192 21 2097152 29 536870912
6 64 14 16384 22 4194304 30 1073741824
seven 128 15 32768 23 8388608 31 2147483648
8 256 16 65536 24 16777216 32 4294967296

In each network, the first address and the last address are always reserved respectively for the network address and the broadcast address. In addition to these two addresses, all remaining addresses are considered valid host addresses.

Sub-networking questions

A subnet question can be asked in three ways.

  1. Find the number of networks and the number of host addresses in each network
  2. Find the given address, network ID and broadcast ID type
  3. Create the subnet mask

Let’s understand each type of subnet question in detail with examples.

Find the number of networks and host addresses in each network

In this type of question, we are asked to find the number of networks and host addresses in each network from a given address space. Let’s take a few examples.

The following table lists 15 imaginary networks. Find the number of networks, the total number of hosts, and the valid hosts in each network.

Examples of subnet questions

10.0.0.0/10 130.0.0.0/18 192.168.1.0/26
20.12.0.0/13 140.50.60.0/20 200.0.0.0/27
78.59.12.0/16 172.168.1.0/24 210.200.0.0/28
112.15.0.0/24 180.10.20.0/28 215.0.0.0/29
122.14.25.0/28 185.0.0.0/30 220.220.10.0/30
Step 1

Determine the class of the given address space.

If the value of the first byte is in the range 0-127, 128-191, 192-223, then it belongs to class A, B and C respectively.

Subtract the given network bits from the reserved network bits. This will give us the number of host bits used as network bits in the subnet.

Number of host bits used in the subnet = total number of bits used in the network part – bits reserved for the network part

Subtract the given network bits from 32 (total IP bits). This will give us the number of host bits remaining in the host part.

Host bits remaining in the host part = 32 – Total number of bits used in the network part

Address space given Total number of bits used
in the network section
(Value after slash)
IP class Reserved network bits Number of host bits used in the subnet Bits available in the host section
10.0.0.0/10 ten A 8 10 – 8 = 2 32 – 10 = 22
20.12.0.0/13 13 A 8 13 – 8 = 5 32 – 13 = 19
78.59.12.0/16 16 A 8 16 – 8 = 8 32 – 16 = 16
112.15.0.0/24 24 A 8 24 – 8 = 16 32 – 24 = 8
122.14.25.0/28 28 A 8 28 – 8 = 20 32 – 28 = 4
130.0.0.0/18 18 B 16 18 – 16 = 2 32 – 18 = 14
140.50.60.0/20 20 B 16 20 – 16 = 4 32 – 20 = 12
172.168.1.0/24 24 B 16 24 – 16 = 8 32 – 24 = 8
180.10.20.0/28 28 B 16 28 – 16 = 12 32 – 28 = 4
185.0.0.0/30 30 B 16 30 – 16 = 14 32 – 30 = 2
192.168.1.0/26 26 VS 24 26 – 24 = 2 32 – 26 = 6
200.0.0.0/27 27 VS 24 27 – 24 = 3 32 – 27 = 5
210.200.0.0/28 28 VS 24 28 – 24 = 4 32 – 28 = 4
215.0.0.0/29 29 VS 24 29 – 24 = 5 32 – 29 = 3
220.220.10.0/30 30 VS 24 30 – 24 = 6 32 – 30 = 2

Once we know how many bits are used in the subnet to create the additional networks, we can use the following formulas to calculate the number of networks, the total number of hosts and valid hosts.

Number of networks (subnet) = 2N
Number of total host addresses in each network = 2H
Number of valid host addresses in each network = 2H – 2

Here NOT is the number of host bits used in the subnet and H is the available host bit.

Address given Host bits used
in the subnet
Host bits available Networks (subnets) Total number of guests Valid Hosts
10.0.0.0/10 2 22 4 (22) 4194304 (222) 4194302 (4194304-2)
20.12.0.0/13 5 19 32 (25) 524288 (219) 524286 (524288 – 2)
78.59.12.0/16 8 16 256 (28) 65536 (216) 65534 (65536 – 2)
112.15.0.0/24 16 8 65536 (216) 256 (28) 254 (256-2)
122.14.25.0/28 20 4 1048576 (220) 16 (24) 14 (16-2)
130.0.0.0/18 2 14 4 (22) 16384 (214) 16382 (16384 -2)
140.50.60.0/20 4 12 16 (24) 4096 (212) 4094 (4096 -2)
172.168.1.0/24 8 8 256 (28) 256 (28) 254 (256 -2)
180.10.20.0/28 12 4 4096 (212) 16 (24) 14 (16 -2)
185.0.0.0/30 14 2 16384 (214) 4 (22) 2 (4 -2)
192.168.1.0/26 2 6 4 (22) 64 (26) 62 (64 -2)
200.0.0.0/27 3 5 8 (23) 32 (25) 30 (32 -2)
210.200.0.0/28 4 4 16 (24) 16 (24) 14 (16-2)
215.0.0.0/29 5 3 32 (25) 8 (23) 6 (8 -2)
220.220.10.0/30 6 2 64 (26) 4 (22) 2 (4 -2)

Finding the address type, network ID and broadcast ID

In this type of question, we are asked to determine the address type, the network ID and the broadcast ID from a given address. Let’s take a few examples.

Find the following address type, network ID, and broadcast ID.

Examples of subnet questions

10.0.0.0/8 50.100.255.255/20 150.60.180.0/19 192.168.1.240/25
10.48.0.0/12 1.1.8.255/23 160.0.39.255/21 200.20.10.191/26
20.42.255.255/13 100.100.100.110/25 172.168.8.0/24 210.200.20.100/27
30.6.1.0/16 110.80.20.128/27 180.78.0.64/28 215.0.0.47/28
40.60.240.0/17 120.20.30.15/30 185.0.0.26/29 220.10.10.50/29
Step 1

Find the interesting byte and create two new addresses from the address given in the approximate area of ​​the spreadsheet, as explained below: –

  • If the byte precedes the interesting byte, write it as is.
  • If the byte comes after the interesting byte, in the first address, write 0 and in the second address, write 255.
  • In an interesting byte, write a placeholder character “X”.

An interesting byte is the byte in which given network bits are separated from host bits. To find it, see the value after the slash. If the value is between 1-8, 9-16, 17-24 and 25-32, the byte of interest is the first byte, the second byte, the third byte and the fourth byte, respectively.

search for an intersected byte

Address given Value after forward slash Interesting byte First address Second address
10.0.0.0/8 / 8 First (1-8) x.0.0.0 X.255.255.255
10.48.0.0/12 / 12 Second (9-16) 10.X.0.0 10.X.255.255
20.42.255.255/13 / 13 Second (9-16) 20.X.0.0 20.X.255.255
30.6.1.0/16 / 16 Second (9-16) 30.X.0.0 30.X.255.255
40.60.240.0/17 / 17 Third (17-24) 40.60.X.0 40.60.X.255
50.100.255.255/20 / 20 Third (17-24) 50.100.X.0 50.100.X.255
1.1.8.255/23 / 23 Third (17-24) 1.1.X.0 1.1.X.255
100.100.100.110/25 / 25 Fourth (25-32) 100.100.100.X 100.100.100.X
110.80.20.128/27 / 27 Fourth (25-32) 110.80.20.X 110.80.20.X
120.20.30.15/30 / 30 Fourth (25-32) 120.20.30.X 120.20.30.X
150.60.180.0/19 / 19 Third (17-24) 150.60.X.0 150.60.X.255
160.0.39.255/21 / 21 Third (17-24) 160.0.X.0 160.0.X.255
172.168.8.0/24 / 24 Third (17-24) 172.168.X.0 172.168.X.255
180.78.0.64/28 / 28 Fourth (25-32) 180.78.0.X 180.78.0.X
185.0.0.26/29 / 29 Fourth (25-32) 185.0.0.X 185.0.0.X
192.168.1.240/25 / 25 Fourth (25-32) 192.168.1.X 192.168.1.X
200.20.10.191/26 / 26 Fourth (25-32) 200.20.10.X 200.20.10.X
210.200.20.100/27 / 27 Fourth (25-32) 210.200.20.X 210.200.20.X
215.0.0.47/28 / 28 Fourth (25-32) 215.0.0.X 215.0.0.X
220.10.10.50/29 / 29 Fourth (25-32) 220.10.10.X 220.10.10.X
2nd step

Based on an interesting byte, subtract after the slash value the upper value of the byte range.

  • Subtract it from 8 if the interesting byte is the first octet.
  • Subtract it from 16 if the interesting byte is the second octet.
  • Subtract it from 24 if the interesting byte is the third octet.
  • Subtract it from 32 if the interesting byte is the Fourth octet.
Address given Value after forward slash Interesting byte Upper range value Substraction
10.0.0.0/8 / 8 First (1-8) 8 8 – 8 = 0
10.48.0.0/12 / 12 Second (9-16) 16 16 – 12 = 4
20.42.255.255/13 / 13 Second (9-16) 16 16 – 13 = 3
30.6.1.0/16 / 16 Second (9-16) 16 16 – 16 = 0
40.60.240.0/17 / 17 Third (17-24) 24 24 – 17 = 7
50.100.255.255/20 / 20 Third (17-24) 24 24 – 20 = 4
1.1.8.255/23 / 23 Third (17-24) 24 24 – 23 = 1
100.100.100.110/25 / 25 Fourth (25-32) 32 32 – 25 = 7
110.80.20.128/27 / 27 Fourth (25-32) 32 32 – 27 = 5
120.20.30.15/30 / 30 Fourth (25-32) 32 32 – 30 = 2
150.60.180.0/19 / 19 Third (17-24) 24 24 – 19 = 5
160.0.39.255/21 / 21 Third (17-24) 24 24 – 21 = 3
172.168.8.0/24 / 24 Third (17-24) 24 24 – 24 = 0
180.78.0.64/28 / 28 Fourth (25-32) 32 32 – 28 = 4
185.0.0.26/29 / 29 Fourth (25-32) 32 32 – 29 = 3
192.168.1.240/25 / 25 Fourth (25-32) 32 32 – 25 = 7
200.20.10.191/26 / 26 Fourth (25-32) 32 32 – 26 = 6
210.200.20.100/27 / 27 Fourth (25-32) 32 32 – 27 = 5
215.0.0.47/28 / 28 Fourth (25-32) 32 32 – 28 = 4
220.10.10.50/29 / 29 Fourth (25-32) 32 32 – 29 = 3
Stage 3

Use the result of the subtraction in the following formula to calculate the block size

Block size = 2result of subtraction
Address given Interesting byte Subtraction result Block size
10.0.0.0/8 First 0 (20) = 1
10.48.0.0/12 Second 4 (24) = 16
20.42.255.255/13 Second 3 (23) = 8
30.6.1.0/16 Second 0 (20) = 1
40.60.240.0/17 Third seven (2seven) = 128
50.100.255.255/20 Third 6 (24) = 16
1.1.8.255/23 Third 1 (21) = 2
100.100.100.110/25 Fourth seven (2seven) = 128
110.80.20.128/27 Fourth 5 (25) = 32
120.20.30.15/30 Fourth 2 (22) = 4
150.60.180.0/19 Third 5 (25) = 32
160.0.39.255/21 Third 3 (23) = 8
172.168.8.0/24 Third 0 (20) = 1
180.78.0.64/28 Fourth 4 (24 ) = 16
185.0.0.26/29 Fourth 3 (23) = 8
192.168.1.240/25 Fourth seven (2seven) = 128
200.20.10.191/26 Fourth 6 (26) = 64
210.200.20.100/27 Fourth 5 (25) = 32
215.0.0.47/28 Fourth 4 (24) = 16
220.10.10.50/29 Fourth 3 (23) = 8
Step 4

From 0, calculate the block size until the value given in interesting bytes is not within the range.

In the calculation, the number 0 is used as the first number. For example, if we calculate block size 4, it would be calculated as 0,1,2,3 instead of 1,2,3,4.

Once you have obtained the block size range that covers the given value in interesting bytes, stop the calculation. For example, the value in an interesting byte is 27 and the block size is 8, so the range will be 24-31 (0-7, 8-15, 16-23, 24-31).

Address given Interesting byte Interesting byte value Block size Block size range covering the value of a byte of interest
ten.0.0.0 / 8 First ten 1 0-0, 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10
ten.48.0 / 12 Second 48 16 0-15, 16-31, 32-47, 48-63
20.42.255.255 / 13 Second 42 8 0-7, 8-15, 16-23, 24-31, 32-39, 40-47
30.6.1 / 16 Second 6 1 0-0, 1-1, 2-2, 3-3, 4-4, 5-5, 6-6
40.60.240.0 / 17 Third 240 128 0-127, 128-255
50,100.255.255 / 20 Third 255 16 0-15, 16-31, 32-47, ….. 224-239, 240-255
1.1.8.255 / 23 Third 8 2 0-1, 2-3, 4-5, 6-7, 8-9
100 100 100.110/ 25 Fourth 110 128 0-127, 128-255
110.80.20.128/ 27 Fourth 128 32 0-31, 32-63, 64-95, 96 -127, 128-159
120.20.30.15/ 30 Fourth 15 4 0-3, 4-7, 8-11, 12-15
150.60.180.0 / 19 Third 180 32 0-31, 32-63, 64-95, 96 -127, 128-159, 160 – 191
160.0.39.255 / 21 Third 39 8 0-7, 8-15, 16-23, 24-31, 32-39
172.168.8.0 / 24 Third 8 1 0-0, 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8
180.78.0.64/ 28 Fourth 64 16 0-15, 16-31, 32-47, 48-63, 64-79
185.0.0.26/ 29 Fourth 26 8 0-7, 8-15, 16-23, 24-31
192.168.1.240/ 25 Fourth 240 128 0-127, 128-255
200.20.10.191/ 26 Fourth 191 64 0-63, 64-127, 128- 191
210.200.20.100/ 27 Fourth 100 32 0-31, 32-63, 64-95, 96 -127
215.0.0.47/ 28 Fourth 47 16 0-15, 16-31, 32-47
220.10.10.50/ 29 Fourth 50 8 0-7, 8-15, 16-23, 24-31, 32-39, 40-47, 48-55
Step 5

Update the temporary addresses written in the first step as follows: –

  • In the first address, replace the placeholder character “X” with the starting value of the range.
  • In the second address, replace the placeholder character “X” with the end value of the range.

After this update, the first address and the second address will become the network address and the broadcast address of the given address respectively.

Once done, you can easily determine the type of the given address.

  • If the address given exactly matches the network address, it is a network address.
  • If the address given exactly matches the mailing address, it is a mailing address.
  • If the address given is neither a network address nor a broadcast address, it is a valid host address.
Address given Interesting byte Interesting
byte value
Range of blocks Network address Mailing address Type
10.0.0.0/ 8 First ten 10-10 10.0.0.0 10.255.255.255 Network
10.48.0.0/ 12 Second 48 48-63 10.48.0.0 10.63.255.255 Network
20.42.255.255/13 Second 42 40-47 20.40.0.0 20.47.255.255 Valid host
30.6.1.0/16 Second 6 6-6 30.6.0.0 30.6.255.255 Valid host
40.60.240.0/17 Third 240 128-255 40.60.128.0 40.60.255.255 Valid host
50100255255/ 20 Third 255 240-255 50.100.240.0 50100255255 spread
1.1.8.255/23 Third 8 8-9 1.1.8.0 1.1.9.255 Valid host
100.100.100.110/25 Fourth 110 0-127 100.100.100.0 100100100127 Valid host
110.80.20.128/ 27 Fourth 128 128-159 110.80.20.128 110.80.20.159 Network
120.20.30.15/ 30 Fourth 15 12-15 120.20.30.12 120.20.30.15 spread
150.60.180.0/19 Third 180 160 – 191 150.60.160.0 150.60.191.255 Valid host
160.0.39.255/ 21 Third 39 32-39 160.0.32.0 160.0.39.255 spread
172.168.8.0/ 24 Third 8 8-8 172.168.8.0 172.168.8.255 Network
180.78.0.64/ 28 Fourth 64 64-79 180.78.0.64 180.78.0.79 Network
185.0.0.26/29 Fourth 26 24-31 185.0.0.24 185.0.0.31 Valid host
192.168.1.240/25 Fourth 240 128-255 192.168.1.128 192.168.1.255 Valid host
200.20.10.191/ 26 Fourth 191 128- 191 200.20.10.128 200.20.10.191 spread
210.200.20.100/27 Fourth 100 96 -127 210.200.20.96 210.200.20.127 Valid host
215.0.0.47/ 28 Fourth 47 32-47 215.0.0.32 215.0.0.47 spread
220.10.10.50/29 Fourth 50 48-55 220.10.10.48 220.10.10.55 valid host

Creating the value of the subnet mask

In this type of question, we are asked to create the complete subnet mask from an abbreviated subnet mask. Let’s take a few examples.

Find the full subnet mask of the following networks.

20.10.30.0/8, 111.187.45.34/14, 162.160.46.24/20, 202.100.20.50/30

Step 1

Find the interesting byte as explained above.

Network given Value after forward slash Interesting byte
20.10.30.0/8 8 First
111.187.45.34/14 14 Second
162.160.46.24/20 20 Third
202.100.20.50/27 27 Fourth
2nd step

In the approximate area of ​​the worksheet, write a temporary subnet mask as follows: –

  • If the byte comes before the interesting byte, write 255.
  • In an interesting byte, write “X”.
  • If the byte comes after the interesting byte, write 0.
Network given Value after forward slash Interesting byte Temporary mask
20.10.30.0/8 8 First x.0.0.0
111.187.45.34/14 14 Second 255.X.0.0
162.160.46.24/20 20 Third 255.255.X.0
202.100.20.50/27 27 Fourth 255.255.255.X
Stage 3

Just like we did above, based on an interesting byte, subtract the given value from the upper value of the interesting byte range.

Network given Value after forward slash Interesting byte Interesting byte range Substraction
20.10.30.0/8 8 First 1 – 8 8 – 8 = 0
111.187.45.34/14 14 Second 9 – 16 16 – 14 = 2
162.160.46.24/20 20 Third 17 – 24 24 -20 = 4
202.100.20.50/27 27 Fourth 25 – 32 32 – 27 = 5
Step 4

Use the result of the subtraction in the following formula to get the byte value

Octet value = 256 - 2 Remainder

Network given Value after forward slash Subtraction result Calculation step 1 Calculation step 2
20.10.30.0/8 8 0 20 = 1 256 – 1 = 255
111.187.45.34/14 14 2 22 = 4 256 – 4 = 252
162.160.46.24/20 20 4 24 = 16 256 – 16 = 240
202.100.20.50/27 27 5 25 = 32 256 – 32 = 224
Step 5

Replace the “X“With a byte value in an interesting byte to build the full subnet mask

Network given Value after forward slash Temporary mask Byte value Subnet mask
20.10.30.0/8 8 x.0.0.0 255 255.0.0.0
111.187.45.34/14 14 255.X.0.0 252 255.252.0.0
162.160.46.24/20 20 255.255.X.0 240 255.255.240.0
202.100.20.50/27 27 255.255.255.X 224 255.255.255.224

That’s all for this tutorial. If you need help with this tutorial or have any comments or comments on this tutorial, please email me. If you like this tutorial, don’t forget to share it via your favorite social network.

Author

Write A Comment