Subnetting Shortcuts- Part 7

In this, our final look at subnetting for now, we’ll examine more “find the subnet” problems, specifically those in which the subnet/host boundary lies within the second or third octets. Here is the powers of two chart:

n = 8 7 6 5 4 3 2 1
2n = 256 128 64 32 16 8 4 2

Suppose that we’re given an address of 10.20.30.40/20, and told to find the subnet. Since 20 lies between 16 and 24, we can see from the mask that we’re operating in the third octet. Further, since the mask is a “/20″, there are four subnet bits in that octet, as well as four host bits. Per the chart, two to the fourth (the number of host bits) is 16, so the subnets increment by 16 in the third octet. Thus, the subnets are:

  • 10.20.0.0/20
  • 10.20.16.0.0/20
  • 10.20.32.0.0/20
  • (Twelve more subnets incrementing by 16 in the third octet go here)
  • 10.20.240.0.0/20

Remember that we’re interested in the third octet. Since 30 lies between 16 and 32, the host is on the 10.20.16.0/20 subnet, the range is 10.20.16.1 – 10.20.31.254, and the broadcast address is 10.20.31.255 for that subnet.

Let’s do another. This time we’re given the host address 172.16.100.200, and a subnet mask of 255.255.224.0 (a “/19″). We can see from the mask that we’re interested in the third octet. Further, since 256 minus 224 is 32, the subnets increment by 32 in that octet. Thus, the subnets are 172.16.0.0/19 (and counting by 32 in the third octet), 32, 64, 96, 128, etc. Since 100 lies between 96 and 128, the host is on the 172.16.96.0/19 subnet, the range is 172.16.96.1 – 172.16.127.254, and the broadcast address is 172.16.127.255 for that subnet. {Ed note – corrected 8/26/10}

Ready for the next one? Here we go … given the host address 10.20.30.40 and a subnet mask of 255.192.0.0, find the usual items. We can see from the mask (which could also be written as a “/10″) that we are interested in the second octet. Furthermore, since 256 minus 192 is 64, the subnets increment by 64 in the second octet. Thus, the subnets are 10.0.0.0/10, 10.64.0.0/20, 10.128.0.0/10 and 10.192.0.0/10 (since there are only two subnet bits, there are only four subnets). It’s the second octet that we’re interested in, and since 20 lies between 0 and 64, the host is on the 10.0.0.0/10 subnet, the range is 10.0.0.1 – 10.63.255.254, and the broadcast is 10.63.255.255 for that subnet.

Okay, one more: Given a host with an address and mask of 10.200.100.200/14, determine the subnet, range and broadcast. First, since 14 lies between 8 and 16, we’re interested in the second octet. Next, since we’re dealing with a Class “A” (eight network bits), a “/14″ mask means that there are six subnet bits and two host bits in the second octet. Because two to the second power is four, the subnets increment by four in the second octet, thus: 10.0.0.0/14, 10.4.0.0/14, 10.8.0.0/14, etc.

While we could count all the way to 200 in the second octet, we can just use some math to shortcut it. Since 200 is an even multiple of four (four times fifty is 200), 200 is a subnet (and 204 is the next subnet). Thus, the host is on the 10.200.0.0/14 subnet, the range of legal host addresses on that subnet is 10.200.0.1 – 10.203.255.254, and the broadcast is 10.203.255.255 for that subnet.

Note that when using a “/14″ mask with a Class “A” network, there are six subnet bits, allowing for up to 64 subnets, and  eighteen host bits, allowing for 262,142 hosts per subnet (two to the eighteenth minus two). That’s way off the powers of two chart, and not likely to be used in the real world as a subnet mask.

One last thing … since the default mask for a Class “A” is “/8″, you’ll never see a subnet mask of less than “/8″. Thus, you don’t have to worry about doing calculations in the first octet (although it would work exactly the same, with the subnet increment based on the number of host bits in that octet).

Well, that’s it for subnetting for now. Next time, something completely different!

Author: Al Friebe

9 Responses to “Subnetting Shortcuts- Part 7”


  1. 1 CCNA newbie July 29, 2009 at 3:44 am

    u should start publishing CCNA book for beginners. Its THE best notes for subnets/VLSM.

    Many thanks

    PJ

  2. 2 bowarr July 30, 2009 at 2:56 pm

    “Since 100 lies between 96 and 128, the host is on the 172.16.96.0/19 subnet, the range is 172.16.96.1 – 172.16.127.254, and the broadcast address is 172.16.96.255 for that subnet.”

    If the range is from 172.16.96.1 to 172.16.127.254, shouldn’t the broadcast address be 172.16.127.255 and not 172.16.96.255?

    Thanks. I agree with PJ. You really do explain things well.

  3. 3 CCNA Hopeful August 26, 2010 at 9:58 am

    “Let’s do another. This time we’re given the host address 172.31.100.200, and a subnet mask of 255.255.224.0 (a “/19″). We can see from the mask that we’re interested in the third octet. Further, since 256 minus 224 is 32, the subnets increment by 32 in that octet. Thus, the subnets are 172.16.0.0/19 (and counting by 32 in the third octet), 32, 64, 96, 128, etc. Since 100 lies between 96 and 128, the host is on the 172.16.96.0/19 subnet, the range is 172.16.96.1 – 172.16.127.254, and the broadcast address is 172.16.96.255 for that subnet.”

    Shouldn’t the host address be 172.16.100.200? If we are working in the 3rd octet, how do you go from 172.31.100.200/19 to 172.16.0.0/19 for the network id?

    I think maybe it was just a typo but can someone clarify this?
    I think the concepts are great and very helpful for learning subnetting. My only other question is about how to find hosts when given a class A or class B subnetmask. Is there an easy way to calculate hosts for say a /10?

  4. 4 Al Friebe August 26, 2010 at 11:46 am

    You’re right, there are two typos in that one. Sorry! We’ll get them fixed.

    To calculate hosts on a “/10″, you’re operating in the second octet (because “/10″ is between “/8″ and “/16″). With a “/10″ there are six host bits in the second octet, so the subnets increment by 64 in the second octet. For example, given 10.100.200.1/10, the host is on the 10.64.0.0 subnet, the first host is 10.64.0.1, the last host is 10.127.255.254, the broadcast for that subnet is 10.127.255.255, and the next subnet is 10.128.0.0/10. Hope this helps!

    • 5 CCNA Hopeful August 26, 2010 at 12:38 pm

      Hi Mr. Friebe,

      I want to thank you for your quick response to my previous post.
      I understand your method for getting the network increment and calculating host ranges, what I meant to ask about was how do you calculate actual hosts. Here is an example question from a subnet generator I have been using in hopes of getting better at subnetting. This generator was developed by one of the networking instructors at my college. (It randomly generates IP problems but asks the same questions each time.)

      http://david.clauss.us/Subneting/

      IP=126 . 74 . 14 . 44 / 12
      Find the Answers for each

      1. What IP Class is this?
      2. Find the SubNetwork
      3. Find the First usable IP address
      4. Find the Broadcast address
      5. Find the Last usable IP address
      6. What is the Total Number of IPs per Subnet?
      7. How many usable Hosts Addresses per subnet?
      8. What is the Next Subnet Number?

      So, given a /12 mask, how do you calculate the actual hosts for the subnet, not just the host ranges. Can you help with this? I guess my other question is if this is a requirement for the CCNA exams or if you simply have to calculate ranges and broadcasts etc.

      I have not been able to figure out an easy way to calculate the actual hosts and have given in to memorizing powers of 2 beyond your chart. For example, I know that 2 to the 16th is 65,536, so usable hosts would be 65,534, but without memorizing this information, it seems difficult to calculate host numbers in the class A and B ranges.

      Please help if you can!

      Thank you!

  5. 6 Al Friebe August 26, 2010 at 12:55 pm

    By “actual hosts” do you mean what are the legal host addresses on the subnet? If so, it’s every host address within the range between first host and last host.

    Or do you mean the number of hosts on the subnet? If so, it’s two raised to the number of host bits, minus two. With a “/26″ mask, you have six host bits, and therefore 62 hosts per subnet. With a “/18″ mask, you have 14 host bits, and 16382 hosts per subnet. With a “12″ mask, you have 20 host bits, and 1048574 hosts per subnet.

    There’s no shortcut around that, but with real world subnets, you’re generally dealing with masks in the “/16″ to “/32″ range, and with a little practice you get proficient at it. Also, when dealing with large subnets the exact number is generally not important, ballpark numbers are usually good enough.

    • 7 CCNA Hopeful August 26, 2010 at 1:02 pm

      “By “actual hosts” do you mean what are the legal host addresses on the subnet? If so, it’s every host address within the range between first host and last host.”

      I mean the total useable IP’s in the subnet. But you answered my question about an easy way to get the actual number. I do understand that it would equal 2 to the # of hostbits, I was just having trouble figuring out that math, ie what does 2 to the 14 equal. It seems like its just something I will have to memorize.

      I will focus more on answering the questions that you were addressing; host range, broadcast and subnet id instead of trying to calculate the actual number of hosts per subnet. I appreciate your help!

  6. 8 Al Friebe August 26, 2010 at 1:39 pm

    I just remember a few numbers, and work from there. Those numbers are

    2^8 = 256
    2^10 = 1024
    2^16 = 65536
    2^20 = about a million (close enough)

    From these, I can easily get the approximate number of hosts on any subnet. For example, with a “/22″ mask, you have ten host bits, which gives 1022 hosts per subnet. Every bit you move to the left approximately doubles the number of hosts per subnet, so with a “/21″, you have about twice as many hosts per subnet (2046, to be exact), and with a “/20″, you’ll have about 4K hosts per subnet (4094).

    Likewise, each bit you move to the right cuts the number of hosts per subnet in half. For example, if you have a “/12″ mask, you have twenty subnet bits, for about a million hosts per subnet. If you move to a “/13″ mask, you’d have half a million, and a “/14″ gives about a quarter million.

    You just have to work with it, and practice makes better. Now if only practice would reduce my number of typos!

    • 9 CCNA Hopeful August 26, 2010 at 2:24 pm

      That does help a lot. Even with your typos you have helped me tremendously!

      I have one more question for you, about finding broadcast addresses. I am helping a classmate with subnetting and I am having difficulty explaining the rules about 256. I told my classmate that to find the broadcast you subtract one from the next network but for situations where you have a 0 in the octet how do you explain how 1=256. Here is an example of what I am referring to.

      subnet: 10.20.16.0/20
      Host range: 10.20.16.1-10.20.31.255
      next subnet: 10.20.32.0/20
      broadcast for 10.20.16.0/20 = 10.20.31.255/20

      When you subtract 1 from the 4th octet of the next subnet, you have to borrow from 32, to get 31 which makes the value of the 4th octet 256. Then you subtract 1 from 10.20.31.256 and get the broadcast of 10.20.31.255. But how do you explain that borrowing 1 from 32 = 256. I have told my classmate that 1=256 in terms of this math concept but I am wondering if you can provide a better explanation. I hope that my question isn’t too confusing!

      Thanks!


Leave a Reply




Follow us on Twitter

CCNP Prep Kit

Posts by Author & Technology

Archives