1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

ip routing with subnet mask

Discussion in 'Networking (Hardware & Software)' started by jawdoc, 2005/12/30.

  1. 2005/12/30
    jawdoc

    jawdoc Inactive Thread Starter

    Joined:
    2002/10/27
    Messages:
    102
    Likes Received:
    0
    Hello
    Quick question.
    Can I use Class C IP ie 192.168.1.2 with subnet mask 255.255.255.224. Some where I read that routers will not route subnets with last octect all 0s or 1s? I guess what I am asking is..if I use the subnet 255.255.255.224 can I use ip addresses from 192.168.2.2-192.168.2.30?
    Will a nat routers work with these zero subnets?
    Thanks in advance!
     
  2. 2006/01/01
    JamesonProd

    JamesonProd Inactive

    Joined:
    2004/04/10
    Messages:
    57
    Likes Received:
    0
    I have been able to route in my home network using 192.168.0.1 - 192.168.0.50 with subnet 255.255.255.0.

    If you would rather use 192.168.1.2, my calculations say 255.255.255.252 should work.

    Good luck.
     

  3. to hide this advert.

  4. 2006/01/03
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    Yes.

    Strictly it is not the last Octet that needs not to be all zero or all ones, but rather the part of the address that is unique to that node. With a strict Class C network the unique part is the last octet, so the two are the same. However, if you subnet the network using a non 255.255.255.0 mask, the unique part is no longer the last octet.

    The subnet mask is used (with bit logic) to split an IP address into two parts. The part of the address under the 1s is the network part of the address. The bit under the zeros is the unique (to the node) part. That make most sense if you look at an address in binary:

    192.168.0.2
    255.255.255.0

    in binary is

    11000000.10101000.00000000.00000010
    11111111.11111111.11111111.00000000

    So the bit that matches the ones in the mask is:
    11000000.10101000.00000000 or 192.168.0.
    This is the network portion of the address

    The bit that matches the zeros in the mask is:
    00000010 or 2
    This is the portion of the address that is unique to the node.

    On the same subnet all nodes must have the same numbers under the ones, and a unique number under the zeros.

    For your subnet mask of 255.255.255.224 the 192.168.0.2 address looks like this in binary:

    11000000.10101000.00000000.00000010
    11111111.11111111.11111111.11100000

    So now:
    11000000.10101000.00000000.000
    11111111.11111111.11111111.111
    is the network part

    and
    00010
    00000
    is the part unique to the node.

    In decimal this looks no different to the 255.255.255.0 case, but it is different when you start populating the three left most bits of the last octet. Have a look at this:

    192.168.0.40
    11000000.10101000.00000000.00101000
    11111111.11111111.11111111.11100000

    It's network address is:
    11000000.10101000.00000000.001
    11111111.11111111.11111111.111

    or 192.168.0.32

    which is different to 192.168.0.0. 192.168.0.40 is on a different subnet to 192.168.0.2.

    Because of the way nodes work out their unique address they accept both their own node number and a node number of all ones. The later is the broadcast address for the subnet, and all nodes on a subnet will accept packages sent to that address. For 192.168.0.0/255.255.255.0, the broadcase address is 192.168.0.255. For the subnetwork 192.168.0.0/255.255.255.224 the broadcase address is:

    11000000.10101000.00000000.00011111
    11111111.11111111.11111111.11100000

    or 192.168.0.31

    So a node cannot use this address at it will not be unique to that node.

    Also a node of all zeros is reserved as the network address. For the 192.168.0.0/255.255.255.0 subnet, the address is 192.168.0.0. For the 192.168.0.0/255.255.255.224 the network address is:

    11000000.10101000.00000000.00000000
    11111111.11111111.11111111.11100000

    is also 192.168.0.0. As this address is reserved as the network address, this too cannot be used by a node.

    You can use all the addresses in the subnet except the network address and the broadcast address. So from 192.168.2.0 to 192.168.2.31 you can use 192.168.2.1 to 192.168.2.30

    All modern routers should be able to deal with this subnet. Some very old (ten years or more) equipment assumed that only the classic Class A, B and C subnet masks were being used which can cause problems. You'll also find that windows systems will allow 192.168.0.2/255.255.255.224 to talk directly to 192.168.0.3/255.255.255.0 even though strictly they are on different subnets and shouldn't be able to communicate without going through a router.
     
    Last edited: 2006/01/03

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.