+ Reply to Thread
Results 1 to 11 of 11
  1. Senior Member
    Join Date
    Aug 2008
    Posts
    263

    Certifications
    A+ Network+ Security +
    #1

    Default Are these two addresses in the same subnet?

    Are these two addresses in the same subnet?

    192.168.0.23/22

    192.168.3.250/22

    ?
    Reply With Quote Quote  

  2. SS -->
  3. Johan Hiemstra Forum Admin Webmaster's Avatar
    Join Date
    Jun 2002
    Location
    52n31, 6e06
    Posts
    10,383
    Blog Entries
    3

    Certifications
    MCSE NT4 MCSA 2000/2003 Security+ (expired: CWNA, CNA, CCNA)
    #2
    Both are class C addresses that would by default use a subnet mask of 255.255.255.0, which is a prefix of /24. Normally when "subnetting", a larger-than-default prefix is used, simply to allow more bits for subnets (and hence less for hosts). Your class C address with a prefix /22, however, is an example of "supernetting", in which multiple class C networks are combined into a single supernet. You can read more about the math involved in my subnetting guide here but in this case, to a practiced subnetting-eye, it might become somewhat obvious they are in the same subnet (supernet technically) because stealing one network bit (e.g. using /23 instead of /24) results in double the amount of hosts.

    By default 192.168.0.23/24 would be in the range 192.168.0.1 - 192.168.0.254
    with a prefix of /23 it would be in the range 192.168.0.1 - 192.168.1.254
    stealing another bit doubles that again, so with /22 it would be in the range, from 192.168.0.1 - 192.168.3.254 (which as you can see includes both your example addresses)
    /21, from 192.168.0.1 - 192.168.7.254
    /20, from 192.168.0.1 - 192.168.15.254
    and so on.

    IP Subnet Calculator
    Reply With Quote Quote  

  4. Member
    Join Date
    Feb 2012
    Location
    Thousand Oaks, CA
    Posts
    92

    Certifications
    A+, Network+, Security+
    #3
    This is how I determine whether an IP address is acceptable given a certain subnet. I remember that an IP address is 32 bits and that the number after the forward slash represents the number of 1's (left to right) in the 32 bits. With your address that has a /22, that means it must have 10 0's (right to left) at the end to complete the 32 bits of the address. I also know that each number separated by dots in an IP address is 8 bits long. When you have 10 0's at the end that means it fills the last group of 8 binary digits and enters the third group of 8 binary numbers by two. Two binary digits can produce the numbers 0, 1, 2, & 3. Therefore the third number of your IP address can be any of those numbers and be valid for your subnet of /22.
    Reply With Quote Quote  

  5. Registered Member Darril's Avatar
    Join Date
    May 2009
    Location
    Virginia Beach, VA
    Posts
    1,569

    Certifications
    MCT, A+, Net+, Security+, CASP, SSCP, CISSP, MCSE, MCITP...
    #4
    Quote Originally Posted by DoubleD View Post
    Are these two addresses in the same subnet?

    192.168.0.23/22

    192.168.3.250/22

    ?
    No.

    Another way this can be asked is "Are these two addresses in the same network?"

    In other words, one computer has an IP of 192.168.0.23/22 and another computer on the same network is manually assigned an address of 192.168.3.250. Can they communicate with each other? No.

    192.168.0.23/22 has a network ID of 192.168.0.0
    192.168.3.250/22 has a network ID 192.168.3.0

    TCP/IP looks at the source and destination IP address to determine if the destination address is on the local network, or if it needs to be sent to the default gateway to be routed to a different network. In this case, the network IDs are different so the traffic would need to be routed through the default gateway.

    HTH,
    Reply With Quote Quote  

  6. Junior Member
    Join Date
    Sep 2011
    Posts
    23
    #5
    Quote Originally Posted by Darril View Post
    No.
    192.168.0.23/22 has a network ID of 192.168.0.0
    192.168.3.250/22 has a network ID 192.168.3.0
    You are incorrect, the network address for 192.168.0.23/22 is 192.168.0.0, this is also the network address for 192.168.3.250/22.
    Reply With Quote Quote  

  7. Registered Member Darril's Avatar
    Join Date
    May 2009
    Location
    Virginia Beach, VA
    Posts
    1,569

    Certifications
    MCT, A+, Net+, Security+, CASP, SSCP, CISSP, MCSE, MCITP...
    #6
    Quote Originally Posted by nbeacham View Post
    You are incorrect, the network address for 192.168.0.23/22 is 192.168.0.0, this is also the network address for 192.168.3.250/22.
    Good catch. Thanks. That's what I get for doing it in my head and not verifying it with a little math.

    192.168.0.23/22 has a network ID of 192.168.0.0
    192.168.3.250/22 has a network ID 192.168.0.0

    /22 is using the first six bits in the third octect
    0 = 0000 00xx
    3 = 0000 00xx

    Let me modify my answer:
    Quote Originally Posted by DoubleD View Post
    Are these two addresses in the same subnet?

    192.168.0.23/22

    192.168.3.250/22

    ?
    Yes.
    Reply With Quote Quote  

  8. Member
    Join Date
    Feb 2012
    Location
    Thousand Oaks, CA
    Posts
    92

    Certifications
    A+, Network+, Security+
    #7
    Darril, when you wrote what you did in your initial post, I was starting to question myself and was just about to read through subnetting again to get it straight. God knows, I wouldn't question the correctness of your posts. I don't know nearly enough to start doing that yet. Thank God someone else has the guts to do it. I feel much better now.

    BTW, nice job nbeacham!
    Reply With Quote Quote  

  9. Senior Member SubnetZero's Avatar
    Join Date
    Jan 2012
    Location
    Las Vegas
    Posts
    123

    Certifications
    CCIE #32840 (RS), CCNP, CCNA (RS/SEC), FNCNE, BCNE, MCSE, MCSA, MCTS, MCITP:SA, C|EH, CCA, A+, Network+ [working on CCIE SPv3]
    #8
    A very simple way to view this (at least for me) is like this. Basically a /24 is 256 addresses (i included both subnet and broadcast addresses for this example) and every time you decrease the network id you double your range.

    /24 = 256 addresses
    /23 = 512 addresses
    /22 = 1024 addresses
    /21 = 2048 addresses

    etc, etc...

    In the same way you now know that 192.168.0.0/24 is 192.168.0.1 through 192.168.0.254 so what about the others?

    Think about it like this, by using a /23 you're really just taking two back-to-back /24's and adding them together!

    /24 = 192.168.0.1 - 192.168.0.254 (1 /24s)
    /23 = 192.168.0.1 - 192.168.1.254 (2 /24s)
    /22 = 192.168.0.1 - 192.168.3.254 (4 /24s)
    /21 = 192.168.0.1 - 192.168.7.254 (8 /24s)

    If you view them like this you shouldn't have to do any math to figure it out...

    The same holds true when we go in the opposite direction (e.g. /24, /25, /26, etc) The only difference is now we are cutting them in half

    /24 = 256 addresses
    /25 = 128 addresses
    /26 = 64 addresses
    /27 = 32 addresses
    /28 = 16 addresses
    /29 = 8 addresses
    /30 = 4 addresses
    /31 = 2 addresses
    /32 = 1 addresses

    For me thinking about them in doubles means I don't have to think about it!

    HTH
    Reply With Quote Quote  

  10. Senior Member
    Join Date
    Aug 2008
    Posts
    263

    Certifications
    A+ Network+ Security +
    #9
    The way i look at it is this.
    I would say that YES they are on the same subnet.
    How do I know ? By looking at the end it says /22 on both. Therefore they should both be on the same sub net.
    Reply With Quote Quote  

  11. Senior Member SubnetZero's Avatar
    Join Date
    Jan 2012
    Location
    Las Vegas
    Posts
    123

    Certifications
    CCIE #32840 (RS), CCNP, CCNA (RS/SEC), FNCNE, BCNE, MCSE, MCSA, MCTS, MCITP:SA, C|EH, CCA, A+, Network+ [working on CCIE SPv3]
    #10
    Quote Originally Posted by DoubleD View Post
    How do I know ? By looking at the end it says /22 on both. Therefore they should both be on the same sub net.
    DoubleD that's a very incorrect way to approach this problem. For example, if I asked you if the following two addresses are in the same subnet, what would you tell me?

    192.168.1.0/24
    192.168.2.0/24

    Are they on the same subnet? Using your logic they must be since they are both /24's...

    Likewise just because these two addresses have /22's isn't enough for you to say they're on the same subnet, but why?

    Because I could have 192.168.0.0/22 which will encompass 192.168.0.1 - 192.168.3.254 (which is 4 /24s)

    Right?

    So using your logic 192.168.4.33/22 must also be in the same subnet as the other two (192.168.0.23/22 & 192.168.3.250/22), right?

    Wrong...

    Read my post above on how to calculate these and it will make sense, a /22 is only 4 back-to-back /24's

    So 192.168.4.0/22 is a completely different subnet encompassing the next 4 /24's which is 192.168.4.1 - 192.168.7.254

    So just because they both have /22's doesn't mean they are in the same subnet...
    Last edited by SubnetZero; 02-11-2012 at 05:51 PM.
    Reply With Quote Quote  

  12. Senior Member
    Join Date
    Aug 2008
    Posts
    3,951
    #11
    Quote Originally Posted by DoubleD View Post
    The way i look at it is this.
    I would say that YES they are on the same subnet.
    How do I know ? By looking at the end it says /22 on both. Therefore they should both be on the same sub net.
    And if the second address had been 192.168.4.250 instead? (you would be wrong in that case)
    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks