# What range of IP addresses is represented by the CIDR block 172.16.0.0/12?

A solution I was given for this question...

*THE CIDR block includes all addresses of the form 1010 1010 0001 **** **** **** **** **** (where * may be 0 or 1). Thus this block represents the IP addresses from 172.16.0.0 to 172.31.255.255. The netid is 1010 1010 0001 and the CIDR block contains 2^20 addresses.*

I fully understand that the CIDR block has 2^20 host ID addresses and that it is in a Class B network. I thought I could simply state that the netid is 172.16 but I am meant to provide it in binary form, however I cannot understand how this translates to 1010 1010 0001.

I understand that 00010000 represents 16 and I understand why there are only 12 bits of the netid but I don't understand where 1010 1010 came from as this represents 170. I would have put 1010 1100 representing 172.

I also don't understand how the block represents the IP addresses from 172.16.0.0 to 172.31.255.255. I have done alot of research on the internet but I can't seem to find anything that will help out.

If anyone could possibly provide an explanation I would really appreciate it.

• Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. Commented Aug 8, 2017 at 3:07

The answer is incorrect (hey, it happens).

You are right that 172 is 0x10101100. That was a mistake on their part.

The 20 bits of host address, when added to the netid, give you all the addresses from 172.16.0.0 to 172.31.255.255.

Honestly, IMO, they're making it more complicated than it needs to be. I've been doing this a long time and the only time I see things like "netid" is in textbooks.

One more point: Address classes (A,B, C) were replaced by CIDR (The C stands for Classless), so it makes no sense to say it's a class B address. Furthermore all that happened in 1993 (I'm guessing before you were born), so address classes are very much obsolete. Yet, for some reason, they keep teaching it.

I don't understand where 1010 1010 came from as this represents 170. I would have put 1010 1100 representing 172."

You are right and the solution sheet is wrong. Probably just a typo on the part of whoever wrote the solution sheet.

also don't understand how the block represents the IP addresses from 172.16.0.0 to 172.31.255.255.

1010 1100 0001 0000 0000 0000 0000 0000 is 172.16.0.0
1010 1100 0001 1111 1111 1111 1111 1111 is 172.31.255.255

While I cannot see that this in security related in any way:

172 in binary should be 10101100, as you stated. This looks like a mistake in writing of the source you got the answer from.