subnetting issues

jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
Hey guys :) ,
My name is jake and I'm new here .. have visited a few times earlier and now joined a few minutes back..
After having failed miserably at understanding sub-netting earlier, I decided that Id give it another go and so have been practicing some questions .. I can get the majority of them right but still have a couple of issues.

1) Increments are always done in the interesting octet right ? well, the interesting subnet to me is anything that's not a 0 or a 255 .. is that correct or does the interesting subnet vary with the type of class the ip is from ?

2) pls take a look at this question .. this might make me sound real dumb but better that than know at all ..

For 190.175.0.0, what are the subnet mask and the maximum number of hosts per subnet for the network below? 86 subnets are required (You need to allow for maximum number of hosts. Also, you can use subnet zero and all-ones subnet.)

How i would attempt answering it is like this :

86 subnets required so smallest subnet block needed is 128 so no of subnet bits = 7 ( 2^7) = 128

so the rest is the no of hosts. Since the no of host bits left is 9 ( assuming the first 2 octets in the mask is 255.255 ), no of hosts = (2^9)-2 = 510 hosts ..

so that makes the subnet 255.255.254.0 (/23) which is the correct answer but thats where my problem begin..

The question states that we have to get the maximum no of hosts and since the ip is independent of the mask, why cant the mask be 255.254.0.0(/15) ? This way, we get another 8 bits for hosts and the subnet requirement is also fulfilled.. Now, I know that there is something fundamentally wrong with this but I dont know what it is .

Can somebody please throw some light on these questions ? Im sure it could help someone else too ..
Sorry If I have broken any forums rules .. do let me know

Thanks and regards
-jake

Comments

  • gramacorpgramacorp Member Posts: 39 ■■■□□□□□□□
    I will try and answer your second question ok

    so the default mask for 190.175.0.0 is 255.255.0.0 right

    if you were to turn off bits in the second octet (ie use the 255.254.0.0 mask) is refered to as supernetting

    if you turn on bits in the third and fourth octet is subnetting

    hope this helps?
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    @gramacorp, Hmm . . I am not really sure what ya mean ( I havnt really wrapped my head around supernetting) perhaps if you could explain a bit more ...

    With regards to the same question, going through numerous examples trying to find a pattern, this is what i have noticed...

    If the ip is a class A ip, in the subnet mask, the 1st octet will be a 255 and the 2nd is subnetted.
    If the ip is a class B ip, in the subnet mask, the 1st octet and 2nd octets will be 255 and the 3rd is subnetted.
    If the ip is a class C ip, in the subnet mask, the 1st ,2nd and 3rd octets will be 255 and the 4th is subnetted.

    Is this the answer that im looking for or is there something more to it ?
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    Hmm . . I am not really sure what ya mean ( I havnt really wrapped my head around supernetting) perhaps if you could explain a bit more ...

    With regards to the same question, going through numerous examples trying to find a pattern, this is what i have noticed...

    If the ip is a class A ip, in the subnet mask, the 1st octet will be a 255 and the 2nd is subnetted.
    If the ip is a class B ip, in the subnet mask, the 1st octet and 2nd octets will be 255 and the 3rd is subnetted.
    If the ip is a class C ip, in the subnet mask, the 1st ,2nd and 3rd octets will be 255 and the 4th is subnetted.

    Is this the answer that I am looking for or is there something more to it ?
  • gramacorpgramacorp Member Posts: 39 ■■■□□□□□□□
    I think you have the hang of it icon_wink.gif

    subnetting is taking the default mask 255.255.0.0 and turning bits on... (ie 255.255.254.0) your intresting octet is where the on bits and off bits meet...

    disreguard supernetting
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    @Gramacorp,
    Thanks mate . appreciate it :)

    However, I found a couple of ip addresses that don't exactly play by those rules ( i think) but forgot what they are .. will post them tomorrow
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    @ Gramacorp,

    Finally got around to posting it ..
    Take a look at the eg below
    -153.119.204.228/26

    If I do it according to my previous post, since the ip is a class B ip, in the subnet mask, the 1st 2 octets will be 255 and the 3rd will be the interesting octet.

    But the mask is 255.255.255.192 (which is true according to what you said above)

    So What i said is incorrect right ?

    Also, Currently, to find the n/w address, I do an & operation between the ip address and the subnet mask but i need to pull up the scientific calculator to do that.. Is there an easier way it can be done in the head ?
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    Hey guys, anyone knows that the deal is here ?
  • pham0329pham0329 Member Posts: 556
    jaykeub wrote: »
    @ Gramacorp,

    Finally got around to posting it ..
    Take a look at the eg below
    -153.119.204.228/26

    If I do it according to my previous post, since the ip is a class B ip, in the subnet mask, the 1st 2 octets will be 255 and the 3rd will be the interesting octet.

    But the mask is 255.255.255.192 (which is true according to what you said above)

    So What i said is incorrect right ?

    Also, Currently, to find the n/w address, I do an & operation between the ip address and the subnet mask but i need to pull up the scientific calculator to do that.. Is there an easier way it can be done in the head ?

    Sorry if I missed the question, but what are you trying to do with the 153.119.204.228/26 subnet? Are you just trying to find out how to convert the subnet mask to decimal format?

    In regards to your 2nd question regarding the network address, the easiest way (imo) is to work with blocks/increments. Essentially, you find out the increments/block size of the network, which can then be used to find the network address. Todd Lammle or Jeremy from CBT Nuggets both teach this method. I'm sure you can also find it on the internet, but a here's a quick fly by:

    Suppose the ip is 192.168.8.130/26

    First, you need to find the increments. 192.x.x.x is a class C address, with a default mask of /24. This means that the subnetting happens in the 4th octet.

    The last bit in the subnet mask tells you what your increment is going to be. For example, a /26 is 11111111.1111111.1111111.11000000. The last bit in the subnet mask falls in the 2nd position, which means that it's a increment of 64 because the increments are as followed: 128 64 32 16 8 4 2 1

    Once you have your increments, you write out the network range:
    192.168.8.0 - 192.168.8.63
    192.168.8.64 - 192.168.8.127
    192.168.8.128 - 192.168.8.191
    192.168.8.192 - 192.168.8.255

    Once the ranges have be defined, we can see that 192.168.8.130 falls between 192.168.8.128 and 192.168.8.191, thus, the network address is 192.168.8.128. It takes a long time to write all that out, but once you get familiar with it, you can probably do that in your head under 30 seconds.

    I probably just confused you even more so I suggest you google this method to get familiar with it. Man, I do more subnetting on this forum than I do in my job.
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    pham0329 , thanks mate .. U answered the 2nd question perfect .. makes perfect sense .. with a lil more practice, i should be able to do it in my head !

    My other question was regarding which octet to subnet .. but lemme put it this way .. is there any rule at all that says that for a particular class of ip, a particular octet has to be subnetted ? [ eg for a class a ip , the 2nd octet and for a class b ip, the 3rd octet etc ] or should i go on with subnetting disregarding the class of Ip ?
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    Guys .. does anybody have the answer to this ? Ive got sub-netting down pat except for this..
    Is there a direct relation between the class of ip used and the octet which is subnetted ? .. If yes, would you please care to explain ?
    Anyone ?
  • MrBrianMrBrian Member Posts: 520
    The first thing you should do is look at the number in the first octet.. this will tell you which Class of address it is. 0-126 is Class A, (127=loopback), 128-191 is Class B, 192-223 is Class C. So, say you're given the IP of 202.51.39.10, with a mask of 255.255.255.240 (/28 ).. this gives you all the information you need!

    First, it's a Class C, so by default the mask is 255.255.255.0 (/24). However, since the mask it's using has more bits for the network than the default (28>24) then you know it's being "subnetted" or "subdivided" or "split up" etc. Since it's a Class C, the first 3 octets are for the network, and with the subnet mask being /28 it means that it's borrowing bits from the 4th octet.. this is where the subnetting is occuring.

    Now, another example.. You're given the IP of 138.12.68.50, and mask 255.255.248.0.. Well, "138" makes it a Class B, so the default mask is 255.255.0.0.. basically, you take the default mask of the given IP, depending on what Class it resides in, and then go from there to figure out how many bits it's using for the subnet. So, with the mask being a /21, and the default mask for the IP is /16, the subnetting is happening in the 3rd octet. By comparing the subnet mask to the default class mask, you can determine how many bits are being used for the subnet.. In this example, /21 - /16 = using 5 bits for the subnet. The default mask is being extended, going 5 bits deep in the 3rd octet. 2^5 means you could create 32 subnets with this setup. The more you move the mask to the right, the more subnets you get.. From my experience, it's difficult at first to go through the process.. but if you're struggling with it, set some time aside in your studies to do a bunch of practice problems.. find the way you feel comfortable with solving it (there are many ways, shortcuts, etc).. with time you'll get it just by looking at it! hth lol
    Currently reading: Internet Routing Architectures by Halabi
  • gramacorpgramacorp Member Posts: 39 ■■■□□□□□□□
    Subnetting is creating new networks by turning bits on in the host portion of the default mask. so for a class C address the only octet would be the fourth. a class B the third and fourth octet. and a class A the second, third, and fourth octet would be available to create new networks.
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    @ Mrbrian ,Thanks for the reply .. you are talking about cases when the CIDR values are given. That is not a problem. The issue was when we are given an ip and told that we need to have x no of subnets.. dunno If I am confusing you now.. lol

    @Gramacorp.. I think you just summed it up man.
    According to the class of ip, those octets remain 255 and the rest of the octets may be sub-netted.
    The issue I had was that I thought that the octet immediately after the class ip has to be sub-netted
    ( eg for a class b ip, the 1st and 2nd subnets are 255 and the 3rd had to be subnetted..Actually, the 3rd OR 4th maybe subnetted depending on the requirement) .. which solves the my initial problem of why a class b ip has 3 (and not 2) 255 octets in the sub net as expected .. Thanks to all of you guys :)
  • MrBrianMrBrian Member Posts: 520
    jaykeub wrote: »
    @ Mrbrian ,Thanks for the reply .. you are talking about cases when the CIDR values are given. That is not a problem. The issue was when we are given an ip and told that we need to have x no of subnets.. dunno If I am confusing you now.. lol

    I know what you're saying. I think I can help. For those questions, it's just the number of bits you're taking, the more you have, the higher possibiliites (exponentially). You can use the power of 2's rule for this. The concept is that you'd want to move the mask to the right as far as possible. This way we don't allocate a network a whole octet for hosts when it actually only has 20 hosts on the network. It will rescue/save the rest of the octet so you can divy it up for other network portions.

    Say the question says you are required 12 hosts, and asks to use the most efficient mask. Well what if someone wanted to give it a /26 mask. That would provide 2 bits for the subnet address and 6 bits for host address... and 2^6=64... 64-2= 62 possible hosts using that mask. However, that network doesn't need that many host bits, and now 12 hosts are sitting in a pool of 62 possible hosts. Other networks can't be allocated those IP's (but over allocating allows for future growth, so that can be a good thing if you expect growth for that network).

    So, when you're given a host requirement and need to find the mask, it's easiest to calculate bits from right to left. Since it only needs 12 hosts, the answer would be only 4 bits for the host... 2^4=16.. and 16-2=14, which is a nice snug fit. Note why 3 bits wouldn't work because it'd only provide 6 hosts.. 2^3=8 and 8-2=6 hosts. And using 5 bits is more than you need (gives 32 hosts). So knowing how many host bits you want, just push the mask up to those last 4 bits. That's where the subnet ends and the hosts start. The mask would be a /28
    Currently reading: Internet Routing Architectures by Halabi
  • grizzlyboregrizzlybore Registered Users Posts: 5 ■□□□□□□□□□
    jaykeub wrote: »
    @ Mrbrian ,Thanks for the reply .. you are talking about cases when the CIDR values are given. That is not a problem. The issue was when we are given an ip and told that we need to have x no of subnets.. dunno If I am confusing you now.. lol

    Subnetting is actually THE easiest topic in networking. Not to make you look dumb, but to make you feel at ease
    That being said, let me get down to it as brief and concise as possible

    Since you said you have no issues when the CIDR values are given. Then you probably have less work to do
    If an ip is given (Usually the network address) and you are asked for a certain number of subnets or/and hosts, pay attention to which is explicitly requested for and start from there.

    This is what i mean:
    Q. Subnet the address 192.168.3.0 to provide for AT LEAST 6 subnets with NO MORE THAN 20 hosts per subnet

    A. The address above is a CLASS C, so forget entirely about the 192.168.3 part (remember 255.255.255.0)
    Now from the question above, you realise the emphasis is on the number of hosts. It could be less, never more
    but the subnets could be more, since it says "at least"
    The last octet is 00000000
    So we need to save the last 4 bits i.e 2^4 -2 = 14 hosts, and that leaves us with the remaining 4 bits which we set to 1111 for 16 subnets

    But remember this, VERY IMPORTANT:

    1. If you are given a network address like the example above, to get a certain number of subnets or hosts ALWAYS start where the default mask ends
    e.g
    192.168.3.0 start at the last octet
    172.16.0.0 start at the 3rd octet
    124.0.0.0 start at the 2nd octet

    2. If given a mask e.g 185.67.80.0/26 forget about the default mask, focus on the "octet of interest" in this case the last octet


    Phew. . . Hope i didnt ramble??
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    @ Mrbrian , And u just nailed it .. thanks mate .. appreciated :D

    I'm just summarizing here so that it may help anybody who has the same doubts.

    If the requirement given in the question is x no of subnets, subnetting happens from the left side to right ( immediately after the default class octets towards the right)
    if the requirement is x no of hosts, the subnetting happens from the right side to the left.

    Lets take the example of the class B ip 175.171.0.0

    According to the question, we are required to have 98 subnets and we have to determine the subnet mask.
    - Because its a class B, The default mask is 255.255.0.0
    - subnetting may happen in the 3rd & 4th octet depending on the no of subnets required
    - In this case, since no of subnets required is only 98 (which is lesser than 255), we make use of only the 3rd octet since we require only 7 network bits [2^7= 128 subnets] ( If for example the required no of subnets was 320 instead , we would have to use the 3rd and 4th octet as we would require 9 network bits [ 2^9 = 512] )
    -Hence, the mask is 255.255.254.0 [ I.e The 3rd octet is 11111110 ]


    If the same Ip was given and we were given 50 hosts as the requirement, we subnet from the right to left
    - minimum block size to hold 50 hosts is 64 [2^6 = 64]
    - The default class b subnet mask is 255.255.0.0 and since we subnet from the right to left for hosts, the ending 6 bits of the last octet will be 0s and the rest 1s
    - Hence, the subnet mask is 255.255.255.192 [ The last octet is 11000000 ]

    Makes perfect sense to me .. Hope it doesn't confuse anyone further .. Thanks y'all :D
  • gramacorpgramacorp Member Posts: 39 ■■■□□□□□□□
  • jaykeubjaykeub Member Posts: 21 ■□□□□□□□□□
    Yea .. I guess its all good now :)
    I have tried that site earlier .. but i personally think these are better for practice just because it asks you more questions :)
    Try these
    Subnetting Quiz #1
    Subnetting Quiz #2 (CIDR)
  • ccnxjrccnxjr Member Posts: 304 ■■■□□□□□□□
    Wow, thats the same testing center where I sat my exams!
Sign In or Register to comment.