Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

Subnetting question

  • Filter
  • Time
  • Show
Clear All
new posts

  • Subnetting question


    I am having a hard time wrapping my head around subnetting and CIDR. I am looking through cisco documentation and I know how to convert dec to bin, and I understand how a IP is set up (host and network). So on the below example, I was trying to figure out the subnet. I figured it out in binary, but where this lost me is how it got .16 as the subnet.

    I got 11111111.11111111.11110000.00000000 as the subnet (which is correct), but how does that correspond to "16"? How does it correspond to "240" as well?


    Determining the Subnet for DeviceA: - 10101100.00010000.00010001.00011110 - 11111111.11111111.11110000.00000000

    subnet = 10101100.00010000.00010000.00000000 =
    Last edited by zang8027; 21st January 2013, 22:38.

  • #2
    Re: Subnetting question

    The network is the masked bits of the IP address, so only count an IP bit if the corresponding subnet bit is 1, otherwise treat as a zero

    That would give you a network of:

    The 240 is the decimal equivalent of the 3rd octet of the mask, i.e. 11110000 = 128+64+32+16+0+0+0+0
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    IT Trainer / Consultant
    Ossian Ltd

    ** Remember to give credit where credit is due and leave reputation points where appropriate **


    • #3
      Re: Subnetting question

      With subnet masks the 1's are important and in subnet masks the 1's are always contiguous as well as the 0's. So where the ones stop and the zeros begin is where the divide between the network portion and the host portion is

      Another easy way to figure this out is with the "magic" number which is 256. If your subnet mask is 240 just subtract 256-240 which is = 16. With that you know that the subnets will increment in 16's. So in your example:

      We know using the magic number calculation that the subnets will increase in values of 16. So your host address above is part of the subnet The broadcast address in that subnet is and the next subnet is

      With wildcard masks we can get even more granular. With wild card masks the 0's matter and the 1's dont (opposite of the subnet mask). The big difference is that the 0's do not have to be contigious. In turn we can match and very specific addresses which can't be done with a subnet mask.


      Say we wanted to match on all even hosts on the network. We could use a wildcard mask of

      Lets break that wildcard mask down:


      Remember with wildcard masks the 0's must match. So what this says is match the least significant bit in the last octet and it must be a zero. So if your write out those hosts last octet in binary.

      00000000 - 0
      00000001 - 1
      00000010 - 2
      00000011 - 3
      00000100 - 4

      As you can see all the even hosts have that last bit set to 0 which matches the wildcard mask. The odd hosts have the last bit set to 1 which does not match.

      Alot of people say that the wildcard mask is just the reverse of the subnet mask

      or the wildcard mask

      This is true in simple cases but like I showed above wildcard masks dont have to have contigious zeros so we can match on specific bits unlike a subnet mask which cannot.
      Last edited by auglan; 22nd January 2013, 14:42.
      CCNA, CCNA-Security, CCNP
      CCIE Security (In Progress)