www.howtonetwork.org

CCNA & CCNP Certifcation Training

  • About
  • Contact
  • FAQ
  • Join
  • Home
  • CCNA
    • ICND1
    • ICND2
    • 101 CCNA LABS
  • CCNP
    • ROUTE
    • SWITCH
    • TSHOOT
    • 101 CCNP LABS
  • CompTIA
    • Security+
    • Network+
  • Design
    • CCDA
    • CCDP
You are here: Home / ICND1 / Day 5 – IP Addressing / Day 5 Tasks / Subnetting

Subnetting

Subnetting allows you to steal bits of an IP address which were traditionally used for hosts on the network. You can now carve smaller networks from your larger network space, and these smaller networks are referred to as subnetworks, or subnets for short.

If you apply the default subnet masks to the three usable address classes, you will see the portions of the address you can’t use for carving out subnets, as illustrated in the chart below:

A – 255

0

0

0

Can’t Use

Can Use

Can Use

Can Use

B – 255

255

0

0

Can’t Use

Can’t Use

Can Use

Can Use

C – 255

255

255

0

Can’t Use

Can’t Use

Can’t Use

Can Use

For example, if you take a Class C network with the default subnet mask

IP Address 192 168 1 0
Subnet Mask 255 255 255 0
In Binary 11111111 11111111 11111111 00000000

and steal some of the available host bits on the last octet

IP Address 192 168 1 0
Subnet Mask 255 255 255 192
In Binary 11111111 11111111 11111111 11000000

you get two stolen bits on the last octet. This gives you the following subnets, each with 62 hosts:

Network

Network

Network

Subnet

Hosts

Broadcast Address

192

168

1

0

1–62

63

192

168

1

64

65–126

127

192

168

1

128

129–190

191

192

168

1

192

193–254

255

With a bigger network, you could have used host numbers 1 to 254, so you have less available host numbers to use here but the trade-off is more networks. The chart below shows how the four subnets were determined:

128 64 32 16 8 4 2 1 Subnet
0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 64
1 0 0 0 0 0 0 0 128
1 1 0 0 0 0 0 0 192

 

Delving into binary math, you can see that using the first two bits of the host address lets you use the binary combinations 00, 01, 10, and 11, and writing these out in full, as you see in the subnets column, gives you the subnets 0, 64, 128, and 192. To clarify this further, the first two rows in grey are subnet numbers and the remaining six rows are for use by host numbers on each subnet.

If you feel your head spinning right about now, this is normal. It takes a while for all of this to finally click, I’m afraid.

Easy Subnetting

Come exam day, or when troubleshooting a subnetting issue on a live network, you will want to get to your answer quickly and accurately. For these reasons, I devised an easy way to subnet, which is the subject of my Subnetting Secrets Amazon Kindle book. You won’t need to read it though to be honest, as I cover what you need to know in this book.

A very useful resource I’ve created is www.subnetting.org, which gives you free challenge questions to solve around subnetting and network design.

Classless Inter-Domain Routing

Classless Inter-Domain Routing (CIDR) was created by the Internet Engineering Task Force as a method to allocate blocks of IP addresses and to route IP packets. The main feature of CIDR we will examine here is using slash address notation to represent subnet masks. This is important because it saves time, it is used in the real world, and, if that isn’t enough, you will be given exam questions involving CIDR addresses.

With CIDR, instead of using the full subnet mask, you write down the number of binary bits used. For 255.255.0.0, for example, there are two lots of eight binary bits used, so this would be represented with a /16. For 255.255.240.0, there are 8 + 8 + 4 bits used, giving you /20.

When you refer to subnet masks or network masks in the context of internetworking, you would say “slash sixteen” or “slash twenty” to work colleagues and they would know that you are referring to a CIDR mask.

The Subnetting Secrets Chart

I’m about to save you many weeks of subnetting frustration. My Subnetting Secrets cheat chart has been used by thousands of CCNA and CCNP students all over the world to pass exams and ace technical interviews for networking roles.

Seriously. Until I stumbled across the easy way while studying for my CCNA several years ago, students were forced to write out network addresses in binary or go through painful calculations in order to get to the correct answer.

In order to write out the Subnetting Secrets chart, you will need a pencil and paper. You need to be able to write it out from memory because in your exam you will be given a whiteboard to use for any working out. You can also use pen and paper in any technical interviews.

On the top right side of your paper, write the number 1, and then to the left of that double it to 2, then 4, then 8, and keep doubling up to number 128. This is one binary octet:

128 64 32 16 8 4 2 1

Under the 128 and going down, write out the number you would get if you put a tick in the first box (the 128 box). Then the next number below that will be what you would get if you ticked the next box (64), and the next (32), and the next (16), and so on until you had ticked all eight boxes:

128
192
224
240
248
252
254
255

If you put together both parts, you will have the upper portion of the Subnetting Secrets cheat sheet:

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

248

252

254

255

The top row represents your subnet increment and the left column your subnet mask. Using this part of the chart, you could answer any subnetting question in a few seconds. If you want to add the part of the chart which tells you how to answer any design question, such as “How many subnets and hosts will subnet mask ‘X’ give you,” just add a “powers of two” section.

One column will be “powers of two” and another will be “powers of two minus two.” The minus two is meant to cover the two addresses you can’t use, which are the subnet and the Broadcast addresses on the subnet. You start with the number 2 and double it as many times as you need to in order to answer the question.

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

For working out which subnet a host is in

248

252

254

255

Subnets

Hosts -2

2

For working out how many subnets and how many hosts per subnet

4

8

16

32

64

You will probably learn best by jumping straight into an exam-style question:

Which subnet is host 192.168.1.100/26 in?

Well, you know that this is a Class C address and the default mask is 24 binary bits, or 255.255.255.0. You can see that instead of 24 there are 26 bits, so 2 bits have been stolen to make the subnet. Simply write down your Subnetting Secrets cheat sheet and tick two places (from the left) along the top row. This will reveal in what amount your subnets go up. You can then tick down two places in the subnets column to reveal the actual subnet mask.

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

248

252

254

255

Subnets

Hosts -2

2

4

8

16

32

64

Now you know two things: subnets will go up in increments of 64 (you can use 0 as the first subnet value) and your subnet mask for /26 ends in 192, so, in full, it is 255.255.255.192:

192.168.100.0 is your first subnet
192.168.100.64 is your second subnet
192.168.100.128 is your third subnet
192.168.100.192 is your last subnet

You can’t go any further than your actual subnet value, which is 192 in this example. But remember that the question is asking you to find host 100. You can easily see that the subnet ending in 64 is where host 100 would lie because the next subnet is 128, which is too high.

Just for completeness, I will add the host addresses and the Broadcast addresses. You can quickly work out the Broadcast address by taking the next subnet value and subtracting 1:

Subnet

First Host

Last Host

Broadcast

192.168.100.0 192.168.100.1 192.168.100.62 192.168.100.63
192.168.100.64 192.168.100.65 192.168.100.126 192.168.100.127
192.168.100.128 192.168.100.129 192.168.100.190 192.168.100.191
192.168.100.192 192.168.100.193 192.168.100.254 192.168.100.255

Consider the IP addresses to be values of anything from 0 to 255. Much like an odometer in a car, each number rolls up until it rolls back to 0 again, but the next box rolls over 1. Below are two sample octets. I jump up when we get to 0 2 to save space:

Octet 1

Octet 2

0

0

0

1

0

2  (jump up)

0

255

1

0

1

1

1

2

If you wanted to use the design part of the chart, you could. There is no need to for this question, but to see how it works, you just tick down two places in the subnets column because you stole 2 bits. From 8 bits in the last octet, that leaves you 6 bits for hosts, so tick down six places in the Hosts -2 column to reveal that you get 64 minus 2 bits per subnet, or 4 subnets, and 62 hosts per subnet:

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

248

252

254

255

Subnets

Hosts -2

2

4

8

16

32

64

Ready for another question? Of course you are.

Which subnet is host 200.100.2.210/25 in?

Same drill as before. You know this is a Class C address, and that to get from 24 to 25 bits, you need to steal 1 bit. Tick one across in the top row and then one down in the left column:

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

248

252

254

255

Therefore, your mask will be 255.255.255.128, and your subnets will go up in increments of 128. You can’t actually steal less than 1 bit for a Class C address; this will give you only two subnets:

200.100.2.0

and

200.100.2.128

You can already answer the question because you can see that host 210 will be in the second subnet. Just to demonstrate, I will write out the host and Broadcast addresses again:

Subnet

First Host

Last Host

Broadcast

200.100.2.0 200.100.2.1 200.100.2.126 200.100.2.127
200.100.2.128 200.100.2.129 200.100.2.254 200.100.2.255

Next question: Which subnet is 172.16.100.11/19 in?

You need to add 3 to 16 (the default Class B mask) to get to 19. Tick across three places in the top row of the chart to get the subnet increment, and then down three in the left column to get the subnet mask. You don’t need the lower portion of the chart for these types of questions.

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

248

252

254

255

Your subnet mask is 255.255.224.0, and you are subnetting on the third octet because the first two are reserved for the network address/default subnet mask.

Your subnets will be as follows:

172.16.0.0
172.16.32.0
172.16.64.0
172.16.96.0*
172.16.128.0
172.16.160.0
172.16.192.0
172.16.224.0

In the exam, please stop once you get to one subnet past the one your host is in, because going one past will make sure you have the right subnet. You are looking for host 100.11 on the 172.16 network; the asterisk in the list of subnets above denotes the subnet that the host number resides in.

If, for some reason, in the exam they asked you to identify the host addresses and Broadcast address (for extra points), you can easily add these. I will put them in for the first few subnets:

Subnet

First Host

Last Host

Broadcast

172.16.0.0 172.16.0.1 172.16.31.254 172.16.31.255
172.16.32.0 172.16.32.1 172.16.63.254 172.16.63.255
172.16.64.0 172.16.64.1 172.16.95.254 172.16.95.255
172.16.96.0 172.16.96.1 172.16.127.254 172.16.127.255

In the exam, they may well try to trick you by adding Broadcast addresses as options for host addresses, or even subnet addresses for host addresses. This is why you need to be able to identify which is which. You will also come across the same issue on live networks, where other engineers have tried to add the wrong address to an interface.

Next question: Which subnet is host 172.16.100.11/29 in?

As you can see by now, you can use any mask you wish with most any subnet. I could have asked you about the address 10.100.100.1/29, so don’t let the fact that you have a Class A address with subnet bits going into the second, third, or fourth octet put you off.

You need to steal 13 bits for the subnet mask but the subnetting chart has only eight places. Since you are looking at the easy way to subnet, just focus on the part of the chart which the remaining numbers spill over into. If you drew another chart next to the one you had just filled up, you would have five places filled up (8 + 5 = 13 bits):

Bits

128

64

32

16

8

4

2

1

Subnets

128

192

224

240

248

252

254

255

From the chart above, you can see that the subnet mask is 255.255.255.248. The 255 in the third octet is there because you filled it up whilst moving over into the fourth octet. The subnets are also going up in increments of 8.

You could start off with 172.16.0.0, but the problem with that is it would take quite some time to count up in multiples of 8 before you got to 172.16.100.11 this way, and the exam is a timed one. Therefore, you need to fast track the counting process.

If you start counting up in increments of 8, you would get the following:

172.16.0.0
172.16.0.8
172.16.0.16, and you could keep counting up to
172.16.1.0
172.16.1.8, and keep counting up to
172.16.20.0
172.16.20.8

This would take a very long time because there are over 8000 subnets (2 to the power of 13 gives you 8192, and you can check this using the design section of the Subnetting Secrets cheat sheet).

Let’s presume that each third octet is going up one digit at a time (which it is). Why not jump up to 172.16.100.x to start with?

172.16.100.0
172.16.100.8*
172.16.100.16

From the above, you can see which subnet host 11 is in, and if you were asked to work out the Broadcast address, it would look like the chart below:

Subnet

First Host

Last Host

Broadcast

172.16.100.0 172.16.100.1 172.16.100.6 172.16.100.7
172.16.100.8 172.16.100.9 172.16.100.14 172.16.100.15
172.16.100.16 172.16.100.17 172.16.100.22 172.16.100.23

That is enough subnetting for now. We will revisit this subject many times over. For some network design examples using the lower part of the chart, please check out www.in60days.com.

Remember also that there are a few subnetting resources available for you to use:

www.subnetting.org – subnetting question generator
www.youtube.com/user/paulwbrowning – my YouTube channel with free videos

Prev

Next

About Us

This is a free bonus site for members of www.howtonetwork.com

Copyright

The content on this copyright Reality Press Ltd.
Copyright Reality Press Ltd.