Best Subnetting technique to find x amount of hosts/subnets?

yanks4everontopyanks4everontop Member Posts: 106
I've got it down being able to find valid host ranges and what subnet such and such IP address falls in. The only questions I still have some trouble on from time to time are when I'm asked to create X number of subnets with Y number of hosts on each. Is there an easy way to go about doing this?

Comments

  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Yea, memorize how many hosts there are for each bit. Realistically, you just need to memorize 1-12 bits. If you ever have to guy higher, just double the previous value.

    If you need 670 hosts, you know that 9 is 512 and 10 is 1024 (don't forget to subtract 2 to get the usable number), your answer is obviously 10.

    Actually, if you remember that 5 is 32 and 10 is 1024, you can just double to get the next value or half the number to get the previous value. It doesn't get much easier than that.
  • meadITmeadIT Member Posts: 581 ■■■■□□□□□□
    I've got it down being able to find valid host ranges and what subnet such and such IP address falls in. The only questions I still have some trouble on from time to time are when I'm asked to create X number of subnets with Y number of hosts on each. Is there an easy way to go about doing this?

    Memorizing powers of 2 is about the only way to figure it out. If it's for the exam, you probably want to jot down a powers of 2 chart when you start to save time on the exam.

    2^1 = 2
    2^2 = 4
    2^3 = 8
    2^4 = 16
    2^5 = 32
    2^6 = 64
    2^7 = 128
    2^8 = 256
    2^9 = 512
    2^10= 1024
    2^11= 2048
    2^12= 4096
    .
    .
    .
    CERTS: VCDX #110 / VCAP-DCA #500 (v5 & 4) / VCAP-DCD #10(v5 & 4) / VCP 5 & 4 / EMCISA / MCSE 2003 / MCTS: Vista / CCNA / CCENT / Security+ / Network+ / Project+ / CIW Database Design Specialist, Professional, Associate
  • yanks4everontopyanks4everontop Member Posts: 106
    I guess my question is, when they ask for a certain number of subnets with a certain number of hosts on each, what should I be focusing on? Finding the mask for the amount of subnets or for the hosts? Or does it all go hand in hand and I can just pick either one?
  • meadITmeadIT Member Posts: 581 ■■■■□□□□□□
    You need to figure out how many bits are for the subnet and how many are for hosts. If they give CIDR notation, it is easy: 172.17.128.0/25 would have 9 borrowed bit for the subnet (Class B's usually use 16 bits), so 2^n = 2 ^ 9 = 512 subnets. 7 bits are used for the host, so 2 ^ n - 2 = 2 ^ 7 - 2 = 128 - 2 = 126 hosts.

    If they give you a subnet mask, use that to figure out how many bits are being borrowed for the subnet.
    CERTS: VCDX #110 / VCAP-DCA #500 (v5 & 4) / VCAP-DCD #10(v5 & 4) / VCP 5 & 4 / EMCISA / MCSE 2003 / MCTS: Vista / CCNA / CCENT / Security+ / Network+ / Project+ / CIW Database Design Specialist, Professional, Associate
  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    I've found that most questions work out perfectly.

    However, if you get in a place where you have extra bits, you're going to have to use a little deductive reasoning on your part.

    Say you had 16 bits to work with, and the question said you will need at least 30 networks with a maximum of 700 users on each. Well, you're going to need 5 bits to satisfy the network requirement and 10 to satisfy the host requirement. So where do you allocate the extra bit? In this example, I would give it to the networks. Since it was stated that the maximum number of users will never exceed 700, it would be a waste to give it to the hosts. However, the "at least" in the network requirement makes it sound like there might be a need for more in the future. In these cases, you're just going to have to think critically and go with what you feel is correct.
  • yanks4everontopyanks4everontop Member Posts: 106
    Thanks guys, that really answered my question well. Much appreciated.
  • ciscolearnerciscolearner Registered Users Posts: 1 ■□□□□□□□□□
    meadIT wrote: »
    You need to figure out how many bits are for the subnet and how many are for hosts. If they give CIDR notation, it is easy: 172.17.128.0/25 would have 9 borrowed bit for the subnet (Class B's usually use 16 bits), so 2^n = 2 ^ 9 = 512 subnets. 7 bits are used for the host, so 2 ^ n - 2 = 2 ^ 7 - 2 = 128 - 2 = 126 hosts.

    If they give you a subnet mask, use that to figure out how many bits are being borrowed for the subnet.
    why we don't subtract 2 (broadcast address and network address) from the number of subnet??
  • MosGuyMosGuy Member Posts: 195
    why we don't subtract 2 (broadcast address and network address) from the number of subnet??

    In some cases you would still subtract two. If it was specifically stated/asked, or the "no ip subnet-zero" entry exists. These days "ip subnet-zero" command is enabled by default. So you normally don't need to subtract two anymore. The following article explains it in depth: Subnet Zero and the All-Ones Subnet [IP Addressing Services] - Cisco Systems
    ---
    XPS 15: i7-6700HQ, 256 pcie ssd, 32 GB RAM, 2 GB Nvidia GTX 960m, windows 10 Pro

    Cert in progress: CCNA (2016 revision)
  • wbosherwbosher Member Posts: 422
    why we don't subtract 2 (broadcast address and network address) from the number of subnet??

    We only subtract 2 from the hosts because the first and last address in the range is for the subnet address, and broadcast address, these are not valid host address. This is not the case the the subnet address.
Sign In or Register to comment.