Calculating Subnet Mask

Discussion in 'Network Infrastructure' started by Nimbus, Nov 27, 2007.

  1. Nimbus

    Nimbus Bit Poster

    10
    0
    2
    Question about subnetting, I know the process of borrowing host bits from an octet to create subnets and how to calculate the subnet mask for the desired number of subnets.

    I have seen questions in the MSpress book that asks you to calculate the subnet from a given network or host address?? can someone advise me on how this is calculated

    For example, say if I had a network destination of 172.16.8.0 - how do I calculate the mask?

    Thanks in Advance :)
     
  2. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    You would have to assume the question is asking for the default subnet mask for the ip address stated unless it says otherwise.

    The default for a 172 is 255.255.0.0 which is a class B

    The defaults are class A = 255.0.0.0 with IP numbers from 1.0.0.0 - 126.0.0.0
    Class B 255.255.0.0 IP range 128.0.0.0 - 191.0.0.0
    Class C 255.255.255.0 Ip range 192.0.0.0 - 223.0.0.0

    No 127.0.0.0 network, this is reserved

    Hope this helps
     
    WIP: LIFE
  3. Nimbus

    Nimbus Bit Poster

    10
    0
    2
    Sorry for the bad explanation, I am aware of the above. What I am really asking is that if 172.16.8.0 was a network address from a network with a non-default mask. Is it posible to work out what the mask is?
     
  4. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    If all you are given is a network address and a told its a non default subnet mask, then no, I doubt you can figure out the subnet mask. I may be wrong.

    IMO you would need to know the number of hosts or networks that the given ip and sn mask can support to work it out.

    i.e the following network address "172.16.8.0 " supports 16 hosts, what is the subnet mask.

    Answer 255.255.255.240
     
    WIP: LIFE
  5. r.h.lee

    r.h.lee Gigabyte Poster

    1,011
    52
    105
    Nimbus,

    Which "MSpress book" are you referring to?
     
    Certifications: MCSE, MCP+I, MCP, CCNA, A+
    WIP: CCDA
  6. Tinus1959

    Tinus1959 Gigabyte Poster

    1,539
    42
    106
    It could be several. Easiest way is to write down the (in this case) thirth octet in binairy. 00001000
    The most right '1' here is the border for the subnetmask, so that would give you 11111000 which is 248.

    To be correct, also 252 would be valid for network 8 (the first network would be 4, 8 would be the second), and 254 (here 8 would be the fourth network with 2, 4 and 6 as the first three), 255 (as the eighth network), 255.128, 255.192, 255.224 and so on and so on.
     
    Certifications: See my signature
    WIP: MCSD, MCAD, CCNA, CCNP
  7. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    Kinda defeats the purpose of having a subnet mask, if you can determine the network and host part of an ip unless you are using defaults.
     
    WIP: LIFE
  8. Tinus1959

    Tinus1959 Gigabyte Poster

    1,539
    42
    106
    No it does not. If you read my reaction again, you will see that I start with "Could be several". Just having the network address could give you a clue, but the subnetmask gives you certainty.
    What's more, it also tells the computer exactly what the network address is.
     
    Certifications: See my signature
    WIP: MCSD, MCAD, CCNA, CCNP
  9. Tinus1959

    Tinus1959 Gigabyte Poster

    1,539
    42
    106
    There is no subnetmask which supports exactly 16 hosts. A network with mask 255.255.255.240 supports a maximum of 14 hosts.
     
    Certifications: See my signature
    WIP: MCSD, MCAD, CCNA, CCNP
  10. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    You are guessing though and given that the network address 172.16.8.0 could be subnetted 255.255.248.0 - 255.255.255.254, that would be a very lucky guess if you got the question right.

    Only if defaults sub net masks were used, would the router know the network address.

    255.255.255.240 = 16 host, 14 are usable, but if subnet zero is used then 16 are usable.

    You could reword the question

    i.e the following network address "172.16.8.0 " has to support at least 16 usable hosts, what is the subnet mask.

    Answer 255.255.255.224


    Any question on an exam will give more information than the question posted by the author of the thread.
     
    WIP: LIFE
  11. Nimbus

    Nimbus Bit Poster

    10
    0
    2
    Thanks Tinus,

    Thats is a great explanation, I never thought of looking at the third octet of the network address in that way before when trying to figure out the subnet address

    I have dug up the question that confused me originally, I assume the subnet mask is 248 here also. Using the same reasoning - the subnets go in 8 with 248 being the most right bit in 11001000.

    This question has an exact answer though as it has an end to the address pool.

    Using Calculator, determine which subnet mask you must assign to the
    address pool 207.46.200.0–207.46.207.255


    255.255.248.0

    Thanks to everyone who replied
     
  12. Tinus1959

    Tinus1959 Gigabyte Poster

    1,539
    42
    106
    I suggest you reread the chapter on subnetting.


    No it has not 16 hosts, it has 16 addresses and only 14 of these can be used for hosts.
    You are correct here, but that was not the original question.
     
    Certifications: See my signature
    WIP: MCSD, MCAD, CCNA, CCNP
  13. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    My subnetting is more than fine tbh, why go reread something i already know?

    I suggest you read this
    http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080093f18.shtml


    At least Im right here lol, what was the original question again, oh yeah, "how do you correctly guess a subnet mask"
     
    WIP: LIFE
  14. Tinus1959

    Tinus1959 Gigabyte Poster

    1,539
    42
    106
    Maybe you did not understand?



    Read it. They are talking about subnets there, not about hosts. And when mentioning host ranges there they specificly leave out the 0 address and the 255 address.



    Funny. I suggest you reread the original question to.
     
    Certifications: See my signature
    WIP: MCSD, MCAD, CCNA, CCNP
  15. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    You're right enough with the host Tinus, got mixed up with address there :oops:

    But the original question is guessing a subnet mask

    I.e network admin needs 256 networks with 256 addresses

    Subnets ip 172.16.8.0 with 255.255.255.0
     
    WIP: LIFE
  16. Tinus1959

    Tinus1959 Gigabyte Poster

    1,539
    42
    106
    Thank you. Never argue with a trainer:biggrin.
    Well, I don't see the word 'guessing' there.
    But maybe you are right. Lets have another look.

    Nope, no guessing. Simple question: How can I calculate the mask.
     
    Certifications: See my signature
    WIP: MCSD, MCAD, CCNA, CCNP
  17. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    What I mean is to calculate the mask you would need to be Guessing/assuming that the network is subnetted a certain way.

    Like you said in your original reply, it could be several masks.

    The main point I'm making is, that the question that started this thread would never be asked in an exam with just that information alone, more would be needed to be able to calculate the answer, without that extra information you would have to give the answer as a best guess.

    And that if you could determine an network and host portion of an IP address by just the network address only (where default mask are not being used), then there would be hardly any point in having a subnet mask.
     
    WIP: LIFE
  18. kevicho

    kevicho Gigabyte Poster

    1,219
    58
    116
    Hey just some random musings here, working (on an assumption this is the first address on this subnet) out the grouping of the 3rd octet (ie from 172.168.0.0 to 172.168.7.255), that could give you 32 networks (ie 256/8 ) so to get 32 subnets, that is 2 to the power of 5 (which gives us 32) which means 5 network bits are used, which is 248, so the subnet mask could be 255.255.248.0

    Also the hosts per network would be 2 to the power of 11 (as we have 11 host bits) which is 2048, take away the broadcast and the network address you 2046 per subnet (which is you time 256 by 8, number of networks, and remove the 2 addresses) you get the same answer)
     
    Certifications: A+, Net+, MCSA Server 2003, 2008, Windows XP & 7 , ITIL V3 Foundation
    WIP: CCNA Renewal

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.