Shocker!!! Subnetting again!

Discussion in 'Network+' started by derkit, Jan 11, 2009.

  1. derkit

    derkit Gigabyte Poster

    1,480
    58
    112
    Just been practising these with some questions from a rather old thread (March 07!) and seem to have come up with an understanding but I followed the same process for an example I made up, and have seemed to have failed, can anyone say whether I'm right or the "other" answers are right - and if I'm wrong where did I get lost??

    192.168.1.104 with subnet mask 255.255.255.224.
    Find the subnet, 1st usable, last usable and broadcase address this IP sits in.

    I always put the subnet mask in CIDR notation - just a habit I wanted to start with CIDR and dotted-notation:

    255-224 = 31

    31 in binary is:
    Code:
    128 64 32 16  8  4  2  1
     0   0  0  1  1  1  1  1
    
    which means the CIDR is /8 + /8 + /8 + /3 = /27

    So
    1st subnet, last octet is: 0 -> 31
    2nd subnet, last octet is: 32 -> 63
    3rd subnet, last octet is: 64 -> 95
    4th subnet, last octet is: 96 -> 127 (which 104 is in)

    ===
    Another way of achieving this level (especially if I need to go to 200, I would take the number 104 and divide it by the number of IPs in each subnet 32 ie, 104/32 = 3.25

    3 x 32 = 96 - which is the start of the subnet.
    add 32 IPs in reaches the top end of 127.
    ===


    Accordingly,
    subnet: 192.168.1.96
    1st usable: 192.168.1.97
    last usable: 192.168.1.126
    broadcast: 192.168.1.127

    I have also checked this with this site IP Calculator

    But trying the same with:
    192.104.183.62 /21, my answer conflict with this site and I don't understand why, and this is where I need assistance? Is it late and my brain is fried or am I missing something blinding obvious??

    /21 is /8 + /8 + /5

    Using binary again
    Code:
    128 64 32 16  8  4  2  1
     1   1  1  1  1  0  0  0
    
    this completes the subnet mask, or 255.255.248.0

    255-248 = 7

    IP is 183, so 183/7 = 26.1....

    Using the 26: 26*7 = 182, so the subnet starts at 182
    Subnet: 192.104.182.0

    Adding the 8 third octet numbers available, gives: 189
    Broadcasr: 192.104.189.255

    which would give
    1st usable: 192.104.182.1
    last usable: 192.104.189.254


    So as far as I can see, my numbers add up, my explanation may not be clear, but I think it reads correct.... but the IP calculator gives:

    Subnet: 192.104.176.0
    1st: 192.104.176.1
    last: 192.104.183.254
    broadcast: 192.104.183.255

    So where did I fail?
    Many thanks in advance gents/gals! :biggrin
     
    Certifications: MBCS, BSc(Hons), Cert(Maths), A+, Net+, MCDST, ITIL-F v3, MCSA
    WIP: 70-293
  2. albertc30

    albertc30 Kilobyte Poster

    423
    1
    37

    Hello and good morning.
    biggrin, like myself you are exausting yourself with this subneting subject but again like myself, it is only cause you love it so here we go, let me try to explain this.

    The address you are subneting already is part of a subnetwork, the 192.104.176.0/21. why is this?
    You are using a class C ip address and you can only subnet it by using the last available 8 bits from the las octet 255.255.255.(0) but you want to use /21 so you are going after bits from the network portion of the address in this case you are using VLSM (variable lenth subnet masking) wich is ok.

    Now don't forget that /21 = 128-64-32-16-8-4-2-1
    so we have------------------1--1--1--1--1-0-0-0=248
    so subnetmask is 255.255.248.0

    The third octet in your ip address .183 fits in a block of IPs from .176 to .183.
    So therefore your network should be in fact 192.104.176.0/21, you have to subnet your third octect in your IP address, that's where you went wrong.
    Remember that you are using a /21 not a /25. On a /17, /18, /19, /20, /21, /22, /23 you are using the third octet in your address to subnet.

    Hope it helps and hopefully I haven't made it worst for you.

    Surelly someone here can writte it in an easier to understand way.

    You take care and good luck.
     
    Certifications: CCNA
    WIP: 220-701 - A+
  3. albertc30

    albertc30 Kilobyte Poster

    423
    1
    37

    Se above the 4th subnet? You have got it right, the same applies but in the third octet by using /21.
     
    Certifications: CCNA
    WIP: 220-701 - A+
  4. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    First let me say i'm no network engineer ! :D

    But i'll do my best...

    Here is IP calcs output...

    Nework Host
    Address: 192.104.183.62 11000000.01101000.10110 111.00111110
    Netmask: 255.255.248.0 = 21 11111111.11111111.11111 000.00000000
    Wildcard: 0.0.7.255 00000000.00000000.00000 111.11111111
    =>
    Network: 192.104.176.0/21 11000000.01101000.10110 000.00000000 (Class C)
    Broadcast: 192.104.183.255 11000000.01101000.10110 111.11111111
    HostMin: 192.104.176.1 11000000.01101000.10110 000.00000001
    HostMax: 192.104.183.254 11000000.01101000.10110 111.11111110
    Hosts/Net: 2046


    First the address in binary is ->

    Address: 192.104.183.62 11000000.01101000.10110 111.00111110

    This is because it is /21 and you correctly state 5 bits of third octet get allocated to network. Three to hosts portion.

    Network: 192.104.176.0/21 11000000.01101000.10110 000.00000000 (Class C)

    To get the network we keep address but mask off all the host bits.
    192.104.183.62

    183 ->

    124 64 32 16 8 4 2 1
    1 0 1 1 0 1 1 1

    Since the last three bits are part of host portion we lose them.

    Giving :- 1 0 1 1 0 0 0 0 = 124+32+16= 176

    So start of Network is 176.

    Broadcast is network plus all host bits.
    Hostmin is net plus one for address of first host.
    HostMax is last host address before broadcast.

    Thers no subnetting / supernetting etc being done by the calc which is where I think you might be getting confused ?

    Obviously you can subnet if you want but then you'd need to state how many subnets you need etc and how many hosts in each sub-network ?

    The MS 70-291 training kit explains all the tricks for manipulating the addresses quite well.
     
  5. david248005

    david248005 Bit Poster

    18
    0
    9
    Hi Derkit
    I'm in the same situation as I have my CCNA Exploration exam on Tesday and I have been struggking with subnetting. As the others have said the octet which is interesting is the 3rd one. /21 means it is in between /16 and /24 so we take teh boundary as /24. 24-21 = 3 so your block size is 2^3=8. 182 is between 176 and 184 so the newtork is 192.168.176.0 and the rest you know.

    I know the binary method works well and it is good to understand it but I find it takes too long. A method which I take no credit for but after reading I find I can subnet easily now is as follows. I hope it helps :biggrin

    We need to start with the fundamentals of IP addressing. An IP address is made up of 32 bits, split into 4 octets (oct = 8, yes?). Some bits are reserved for identifying the network and the other bits are left to identify the host.

    There are 3 main classes of IP address that we are concerned with.

    Class A Range 0 - 127 in the first octet (0 and 127 are reserved)
    Class B Range 128 - 191 in the first octet
    Class C Range 192 - 223 in the first octet

    Below shows you how, for each class, the address is split in terms of network (N) and host (H) portions.

    NNNNNNNN . HHHHHHHH . HHHHHHHH . HHHHHHHH Class A
    NNNNNNNN . NNNNNNNN . HHHHHHHH . HHHHHHHH Class B
    NNNNNNNN . NNNNNNNN . NNNNNNNN . HHHHHHHH Class C

    At each dot I like to think that there is a boundary, therefore there are boundaries after bits 8, 16, 24, and 32. This is an important concept to remember.

    We will now look at typical questions that you may see on subnetting. More often than not they ask what a host range is for a specific address or which subnet a certain address is located on. I shall run through examples of each, for each class of IP address.

    What subnet does 192.168.12.78/29 belong to?

    You may wonder where to begin. Well to start with let's find the next boundary of this address.

    Our mask is a /29. The next boundary is 32. So 32 - 29 = 3. Now 2^3 = 8 which gives us our block size i.e. 2 to the power of 3 equals 8.

    We have borrowed from the last octet as the 29th bit is in the last octet. We start from zero and count up in our block size. Therefore it follows that the subnets are:-

    192.168.12.0
    192.168.12.8
    192.168.12.16
    192.168.12.24
    192.168.12.32
    192.168.12.40
    192.168.12.48
    192.168.12.56
    192.168.12.64
    192.168.12.72
    192.168.12.80
    .............etc

    Our address is 192.168.12.78 so it must sit on the 192.168.12.72 subnet.

    What subnet does 172.16.116.4/19 sit on?

    Our mask is /19 and our next boundary is 24. Therefore 24 - 19 = 5. The block size is 2^5 = 32.

    We have borrowed into the third octet as bit 19 is in the third octet so we count up our block size in that octet. The subnets are:-

    172.16.0.0
    172.16.32.0
    172.16.64.0
    172.16.96.0
    172.16.128.0
    172.16.160.0
    .............etc

    Our address is 172.16.116.4 so it must sit on the 172.16.96.0 subnet. Easy eh?

    What subnet does 10.34.67.234/12 sit on?

    Our mask is 12. Our next boundary is 16. Therefore 16 - 12 = 4. 2^4 = 16 which gives us our block size.

    We have borrowed from the second octet as bit 12 sits in the second octet so we count up the block size in that octet. The subnets are:-

    10.0.0.0
    10.16.0.0
    10.32.0.0
    10.48.0.0
    .............etc

    Our address is 10.34.67.234 which must sit on the 10.32.0.0 subnet.

    Hopefully the penny is starting to drop and you are slapping the side of your head realising that you were a fool to think that subnetting was hard. We will now change the type of question so that we have to give a particular host range of a subnet.

    What is the valid host range of of the 4th subnet of 192.168.10.0/28?

    Easy as pie! The block size is 16 since 32 - 28 = 4 and 2^4 = 16. We need to count up in the block size in the last octet as bit 28 is in the last octet.

    192.168.10.0
    192.168.10.16
    192.168.10.32
    192.168.10.48
    192.168.10.64
    .................etc

    Therefore the 4th subnet is 192.168.10.48 and the host range must be 192.168.10.49 to 192.168.10.62, remembering that the subnet and broadcast address cannot be used.

    What is the valid host range of the 1st subnet of 172.16.0.0/17?

    /17 tells us that the block size is 2^(24-17) = 2^7 = 128. We are borrowing in the 3rd octet as bit 17 is in the 3rd octet. Our subnets are:-

    172.16.0.0
    172.16.128.0

    The first subnet is 172.16.0.0 and the valid host range is 172.16.0.1 to 172.16.127.254. You must remember not to include the subnet address (172.16.0.0) and the broadcast address (172.16.127.255).

    What is the valid host range of the 7th subnet of address 10.0.0.0/14?

    The block size is 4, from 16 - 14 = 2 then 22 = 4. We are borrowing in the second octet so count in the block size from 0 seven times to get the seventh subnet.

    The seventh subnet is 10.24.0.0. Our valid host range must be 10.24.0.1 to 10.27.255.254 again remembering not to include our subnet (10.24.0.0) and the broadcast address (10.27.255.255).

    What if they give me the subnet mask in dotted decimal?

    If you're lucky and they give you a mask in dotted decimal format then you should have an even easier time. All you need again is your block size.

    Let's say they have given a mask of 255.255.255.248 and you wish to know the block size. Here's the technique:

    1. Starting from the left of the mask find which is the first octet to NOT have 255 in it.
    2. Subtract the number in that octet from 256 to get your block size e.g. above it is 256 - 248 = block size of 8.
    3. Count up from zero in your block size in the octet identified in step 1 as you have learned above (the example above would be in the last octet).

    Another example is a mask of 255.255.192.0 - you would simply count up in 256 - 192 = 64 in the third octet.

    One more example is 255.224.0.0 - block size is 256 - 224 = 32 in the second octet.
     
    WIP: MCDST, OU T175 & M150,
  6. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    Gosh - what a lot of complications for what should be a simple thing! :p

    My view is that once the CIDR notation is used as part of a question then classes fly out of the window.

    So - a mask of /21 is 16 + 5 bits - ie 5 bits in the 3rd byte. I find masking easier when using hex - so that represents a value of 0xF8.

    The 3rd byte of the address is 183, so 'anding' (after all - this is what the mask is for!) the mask and this value:
    183 & 0xF8 gives 176. So the network is 192.104.176.0. Basicaly as dmarsh has said - but a little more concise! :biggrin

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  7. derkit

    derkit Gigabyte Poster

    1,480
    58
    112
    Thanks for the input guys - really helped me understand where I went wrong.

    Found the flaw in my calculations -

    It should have been 183/8 = 22.......

    22*8 = 176 - ie, in the correct range.

    After reading another thread, the Network+ exam doesn't need to calculate but as dmarsh says, the 70-291 needs it so good to get my head around it now!!
     
    Certifications: MBCS, BSc(Hons), Cert(Maths), A+, Net+, MCDST, ITIL-F v3, MCSA
    WIP: 70-293
  8. derkit

    derkit Gigabyte Poster

    1,480
    58
    112
    cheers for bragging Harry :twisted: :p

    I suppose there are many ways of getting to the answer, by using the binary system and writing it out, by using the method I came up with and possibly others - I'm guessing it'll become 2nd nature when I use it daily/at work and it'll come naturally.

    Thanks for the input though! 8)
     
    Certifications: MBCS, BSc(Hons), Cert(Maths), A+, Net+, MCDST, ITIL-F v3, MCSA
    WIP: 70-293
  9. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    Well I wasn't too sure what you were doing for a minute, I think I understand now...

    Every right shift is a division by 2, every left shift is a multiply by 2.

    So 183/8 -> 183/2/2/2 -> Or 183 right shifted three times.

    So 183 10110111 Right shift -> 1011011.1 (The . or point here is a decimal point.)

    = 64+16+8+2+1+(1/2) = 91.5


    So 91.5 1011011.1 Right shift again -> 101101.11
    Right shift again -> 10110.111

    Now if at this point we throw away the decimal/fractional part we are throwing away the bottom 3 bits, its another way to mask basically.

    Then we multiply by 8, ie left shift three times...

    So 10110 -> 101100
    101100 -> 1011000
    1011000 -> 10110000

    10110000 -> 176

    Its just another way to mask, we've used rounding to perform our mask, rather than a bitwise operation, personally I prefer to just bitmask directly...

    You need only basic knowledge of network types and addressing for Network+ as far as I can remember. Like what is a class C address, what is an APIPA address etc.

    I find Hex useful for larger numbers but the octet scheme for IPv4 addresses means this isn't really necessary. Some people also like to use Octal for stuff, again not really my thing...
     
  10. derkit

    derkit Gigabyte Poster

    1,480
    58
    112
    Well dmarsh you definitely lost me on that last post, moving the decimal point places..... definitely wasn't in my thinking - I suppose we just look at the same thing in different ways, but I'm with you using the bitmask is definitely easier.

    Got my head around the classful addresses/subnets, and APIPA so all sorted on that front!
     
    Certifications: MBCS, BSc(Hons), Cert(Maths), A+, Net+, MCDST, ITIL-F v3, MCSA
    WIP: 70-293
  11. derkit

    derkit Gigabyte Poster

    1,480
    58
    112
    Just realised where you were going, and no that wasn't my direction.

    I divided by 8 as that was the size between each subnet, 0->7 is 8 hosts (inc. the 2 special ones), 8->15, 16->23 etc
    By using the number (was 183 in the previous example), 19, I can find out what subnet it belongs in:

    19/8 = 2 and something....
    2*8 = 16, so I know that the subnet mask will contain 16 in the octet that contains 19. From that I know the b'cast address will have 23 in said octet.

    I understand what I mean, I'm just not showing it in a good manner!
    Once I've passed the exam (hopefully next week-ish) I was going to publish my materials etc. on the forums, so will be a nice diagram for all to use! (and understand how I'm getting to my thinking).
     
    Certifications: MBCS, BSc(Hons), Cert(Maths), A+, Net+, MCDST, ITIL-F v3, MCSA
    WIP: 70-293
  12. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    Believe me you are using decimal arithmetic and rounding to perform a binary bitmask :wink:

    Best of luck with the exam !
     
  13. albertc30

    albertc30 Kilobyte Poster

    423
    1
    37
    Hello hbroomhall.
    Damn man, I must have passed aside this in the class rom, what I do know now is that the way you have put it will defenlly save me alot of time in my further exams to come. alote of time indeed.
    Cheers for the input, much easier indeed.
     
    Certifications: CCNA
    WIP: 220-701 - A+
  14. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    IPv6 addresses are normally given in hex, so perhaps we'll need to get used to it! :ohmy

    These days I see little point to octal - but I'm willing to be proved wrong.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  15. XamirX

    XamirX New Member

    1
    0
    11

    Actually ,
    I don't really understand what is the Problem,i don't even understand how many subnets do you want to make.
    if you can,please write down the complete question and i'll try to help you.
    thx,
    amir jubran.
     
    Certifications: A+ , CCENT
    WIP: CCNA
  16. Sepher

    Sepher Bit Poster

    31
    1
    13
    I am currently studying custom subnetting out of interest, as I could never grasp it and I am now starting to get the hang of it. The question I would like to know is how are VLSM's implemented into a network?

    At the moment, the only way I know how to type in subnets is using network connections in XP but Im guessing VLSM is something implemeted into more advanced networks?
     
    Certifications: CompTIA A+, CompTIA N+, MCTS Windows 7
    WIP: CompTIA Security+
  17. simonp83

    simonp83 Kilobyte Poster

    254
    4
    32
    I have Network+ to look forward to after i complete my A+, networks are something i've never had much experience in but from the looks of it, i'm sure i'm gonna enjoy it :ohmy
     
    Certifications: A+, MCP, MCDST, MCTS, MCITP
    WIP: 70-291

Share This Page

Loading...
  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.