Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found this problem in a textbook, and I do not understand the solution:

Find the subnet which the IP: belongs to.
Here is what they did:

  1. for and do a binary AND operation.
  2. Then take the subnet mask because of postfix /27 CIDR postfix in the IP.

But why? In the problem definition, the number /27 was not given. How did they come up with that?

share|improve this question

migrated from May 4 '13 at 8:20

This question came from our site for professional and enthusiast programmers.

Must be a misprint then. The CIDR postfix indicates the mask bits, e.g. means 27 mask bits; this corresponds to the subnet mask – John Willemse May 3 '13 at 14:55
up vote 3 down vote accepted

They know that the the /27 CIDR is 27 as they used the subnet mask of The CIDR is the number of available IP's since is 31. This is a number range 0-31 or a range of 32 possible values. This corresponds to 2^5. So therefore 2^32 - 2^5 = 2^27 with 27 being your CIDR.

share|improve this answer
To look at it another way an IPV4 address is made up of 4 bytes = 8 x 4 bits = 32 bits. A /27 means the left most 27 bits are 1 (or if you prefer 32-27=5 0 bits on the right), so in binary it would look like 11111111.11111111.1110000 which converts in decimal to – davidgo May 4 '13 at 8:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .