Subnetting

One of the most critical topics in being a network professional is having the ability to subnet in your head and not rely on programs or calculators to do it for you. We are going to approach this one step at a time.

The first is how to convert decimal to binary.

The way that I like to teach subnetting is to use the following table (this table gives you the equivalent if you did)

128 64 32 16 8 4 2 1

Once you have this table down, it gets straightforward from there. Let’s take the decimal number 215; we can subtract it by every number in the table above. If it does subtract, we take the remainder over to the next quadrant; if not, we carry the number from quadrant to quadrant until it does subtract

215-128 87-64 23-32 23-16 7-8 7-4 3-2 1-1
1 1 0 1 0 1 1 1

So the binary equivalent to 215 is 11010111

It\\\’s just that simple. The result (in the 1 column should always equal 0); if it does not, the math is incorrect.

You are tasked with figuring out how many hosts can reside on the following subnet 172.14.20.0/27 and how many subnets you will have; how would you do that?

First, you need to break down the 172.14.20.0 into its default subnet, which would be a class B

11111111 11111111 00000000 00000000

Now, take its actual subnet mask

11111111 11111111 11111111 11100000

Let’s put them together to be easier to look at (Red – Network Bits, Blue – Subnet Bits, and Green – Host bits.)

11111111 11111111 00000000 00000000

11111111 11111111 11111111 11100000

For figuring out the hosts, take the host portion of the subnet mask and do (or 2x2x2x2x2-2), which gives us 30 useable addresses; the full range would be 172.14.20.0 – 172.14.20.31 (but the useable range would be 172.14.20.1 – 172.14.20.30)

To figure out the number of subnets, take the blue subnet numbers (11) and give us 2048 available subnets to use.

Next, how to figure out the subnet number, range of host addresses, and broadcast ID for network 192.168.10.54/23

First, we need to break down the IP address and Subnet Mask into binary.

192.168.10.54 11000000 10101000 00001010 00110110
255.255.254.0 11111111 11111111 11111110 00000000

We are going to perform a technique called the AND result. The AND result is fairly easy; the only thing we have to remember is if there are two matching ones on top of each other (in IP and SM)

192.168.10.54 11000000 10101000 00001010 00110110
255.255.254.0 11111111 11111111 11111110 00000000
AND Result 11000000 10101000 00001010 00000000

The AND result is 11000000 10101000 00001010 00000000 = 192.168.10.0, and this is the subnet number

Now, taking the Subnet number and the subnet mask, we can figure out how many hosts can be on each subnet

Network Number – 11111111 11111111 11111111 00000000
Subnet Number – 11111111 11111111 11111110 00000000
If we take the Green Host bits and perform (9 for 9 host bits), we have 512 (or 510 if we are asked for classful)

Finally, we are going to look at summarization. Summarization is taking multiple network updates and summarizing them as one. As your network grows, you do not want networks to cause your routing protocol to flap” if one network is going down. Let’s say you have a question that looks like this;

Would you please summarize the following to the best available summary-address

  • 192.168.160.0/24
  • 192.168.161.0/24
  • 192.168.162.0/24
  • 192.168.164.0/24

We would break down the IP addresses into binary

192.168.160.0 11000000 10101000 10100000 00000000
192.168.161.0 11000000 10101000 10100001 00000000
192.168.162.0 11000000 10101000 10100010 00000000
192.168.164.0 11000000 10101000 10100100 00000000
 
Our summary address would be all the LIKE numbers (outlined in blue) which would be 192.168.160.0/21 (because there are 21 like numbers)
192.168.160.0 11000000 10101000 10100000 00000000
192.168.161.0 11000000 10101000 10100001 00000000
192.168.162.0 11000000 10101000 10100010 00000000
192.168.164.0 11000000 10101000 10100100 00000000

What if you are given the following and asked to come up with the best available summary address ( I have broken them down into binary right next to the decimal address)

  • 172.30.31.0/24        10101100 00011110 00011111 00000000
  • 172.30.32.0/24        10101100 00011110 00100000 00000000
  • 172.30.33.0/24        10101100 00011110 00100001 00000000
  • 172.30.34.0/24        10101100 00011110 00100010 00000000
  • 172.30.35.0/24        10101100 00011110 00100011 00000000
  • 172.30.36.0/24        10101100 00011110 00100100 00000000
  • 172.30.38.0/24        10101100 00011110 00100110 00000000

How would you summarize this? There is not 1 summary address; there are 4, which are

  • 172.30.31.0/24 (for the 31 network)
  • 172.30.32.0/22 (for the 32, 33, 34, and 35 networks)
  • 172.30.36.0/23 (for the 36 network)
  • 172.30.38.0/24 (for the 38 network)