0
$\begingroup$

An ISP has following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20
The ISP wants to give half of this chunk addresses to Organization A, and a quarter to Organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?

A) 245.248.136.0/21 and 245.248.128.0/22
B) 245.248.128.0/21 and 245.248.128.0/22
C) 245.248.132.0/21 and 245.248.132.0/21
D) 245.248.136.0/24 and 245.248.132.0/21

It is easy to make out that option 'C' and 'D' are wrong. Option 'B' is not possible due to address overlapping. The answer is 'A' for sure, but I'm unable to understand how. How is 245.248.136.0/21 and 245.248.128.0/22 calculated? I've been trying to solve this the whole day but found no solution to it, any help on how to solve this problem would be appreciated.

Also, how can I determine the range of addresses that can be allocated to organizations A and B?

$\endgroup$
  • 2
    $\begingroup$ Let me just note that this is borderline for a cs.stackexchange question, as it is more about the specifics of CIDR than science in the abstract. In the future these questions may be more suited to stackoverflow or networkengineering.stackexchange $\endgroup$ – cody Jul 30 '14 at 0:05
  • 2
    $\begingroup$ @cody I agree about being borderline for Computer Science SE. However, this has nothing to do with programming so it is absolutely off-topic for Stack Overflow. $\endgroup$ – David Richerby Jul 30 '14 at 0:06
  • $\begingroup$ @cody, cs.stackexchange wasn't my first preference anyway, I posted this question at networkengineering.stackexchange, there the users voted it as off-topic, where am I supposed to go? $\endgroup$ – Siddharth Thevaril Jul 30 '14 at 5:03
  • $\begingroup$ @Sidsec9 I hear you, but "there is no SE site for my question" is not a good reason to post it at one. That said, I know that the specifics of these things are taught at universities, and this is a question about a principle (even though it's probably a homework exercise almost-dump) so I see no reason to close it outright myself. ThHe community may decide differently. (Also note that reverting formatting-improving edits won't make you friends on any SE site.) $\endgroup$ – Raphael Jul 30 '14 at 6:56
1
$\begingroup$

Hints:

  • Try working out the binary representation of 245.248.136.0 (it's 32 bits) and of 245.248.128.0.

  • Re-read what the /21 and /22 notation means and how CIDR works.

  • What is the range of IP addresses included in 245.248.128.0/22? in 245.248.136.0/21?

I think once you understand the concepts you'll find that this question is straightforward.


Advice: Rather than asking a question about this specific exercise, you might do better to ask a question about some concept you don't understand: e.g., what /N notation means, how CIDR works, etc. But make sure to do your research first. There's lots written on CIDR, /N notation, etc. You can probably clear up your confusion on your own by doing proper reading on those concepts.

$\endgroup$
  • $\begingroup$ I understand CIDR notation, this is the reason I could eliminate options C and D. What I couldn't understand was how the addresses were allocated. $\endgroup$ – Siddharth Thevaril Jul 30 '14 at 5:00
  • 1
    $\begingroup$ @Sidsec9, if you can't answer the third question ("what's the range of IP addresses included in...?"), I recommend you do some more reading -- you still have more to learn about CIDR notation. It will help you understand this question. $\endgroup$ – D.W. Jul 30 '14 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.