Can anyone please help me out in understanding VLSM. i am having a hard time understanding it. spent alot of time on it and still got nothing out of it. I have the lammle book and i didnt get it right into my head.
i want plain and simple method please.
consider this example
we have 7 networks and we require 120 users on first network, 60 on the second , 30 on the third, 13 on the 4th and the last 3 networks have 2 hosts on each. and we have class C ip adress of 192.168.10.0.
Whats really bothering me is that how do they come up with a new number in the last octet of the ip adress for each network.
Thank you
Solved! Go to Solution.
Ahmed
You have the following values within each octet ie. if you look at an octet in binary you get -
128 64 32 16 8 4 2 1
so to get 120 hosts first. Look at the binary values in the octet and you can see that 128 is the only number that covers 120.
So you first subnet is -
192.168.10.0 255.255.255.128 this covers hosts 192.168.10.1 -> 126 with a broadcast of 127
so the next available subnet is -
192.168.10.128. We now need to work out the subnet mask for this. You need 60 hosts so again looking at binary values you can see 64 is the number we need. To get the subnet mask from this you need to add 128 + 64 = 192. So -
192.168.10.128 255.255.255.192 this covers hosts 192.168.10.129 -> 190 broadcast 191
your next subnet is therefore 192.168.10.192
30 host needed. 32 is the binary number so 128 + 64 + 32 = 224 so
192.168.10.192 255.255.255.224 - hosts 192.168.10.193 -> 222 broadcast 223
next available subnet = 192.168.10.224
13 hosts needed. 16 is the relevant binary figure so 128 + 64 + 32 + 16 = 240
192.168.10.224 255.255.255.240 - hosts 192.168.10.225 -> 238 broadcast 239
next subnet = 192.168.10.240
i'll leave you to work out the last networks
Does this make sense ?
Edit - just to clarify. When you are looking at the hosts needed vs the binary value as we have done always be aware you need at least 2 spare. What i mean by this is when we looked at 30 hosts then we chose 32 as the binary value which is fine because 255.255.255.224 gives you 30 uesable host addresses. However if we had needed 31 hosts then we would have had to go to a 64 because as i say 255.255.255.224 only gives you 30 host address. So for 31 hosts you would need 64 ie. 255.255.255.192. So if you have 192.168.10.0/24 and you needed 31 hosts you would do -
192.168.10.0 255.255.255.192 but even though you have a lot of spare addresses unused ie. this range actually gives you 62 useable address these addresses cannot be used in another subnet.
Even though you aren't using them you still need to start the next subnet at 192.168.10.64.
Jon
Hi Ahmed,
I suppose the main network is 192.168.10.0/24.
let's consider the subnet with the most hosts which is networkB with 30 hosts.
30 hosts means we must borrow 5 bits for host so we have a mask of /27 or 255.255.255.224 because 32-5=27
magic number is 256-224=32 = subnet increment so the subnets are:
-192.168.10.0/27, 192.168.10.32/27,192.168.10.64/27, and so on by increment of 32
we can use first subnet for subnet B: 192.168.10.0/27
now for subnet C we still need 5 bits for hosts so same mask as before and use the second subnet which gives 192.168.10.32/27
Now for subnet A with 14 hosts we need 4 host bits so a mask of /28 or 255.255.255.240 because 32-4=28 and we will use the 192.168.10.64/27 to get the new subnet.
magic is 256-240=16 so subnet increment so we get 192.168.10.64/28,192.168.10.80/28,192.168.10.96/28
lets take first one 192.168.10.64/28
Now for subnet A with 6 hosts so 3 host bits we have 32-3=29 so /29 or 255.255.255.248 with magic = 256-248=8 so subnet increment which gives 192.168.10.80/29,192.168.10.88/29, lets use first so 192.168.10.80/29
We're left with the P2P networks with a /30 mask or 255.255.255.252
Which subnets are still available to us?
let's use 192.168.10.96/28 so we'll get 192.168.10.96/30, 192.168.10.100/30,192.168.10.104/30,192.168.10.108/30
That's how I would use vlsm in this network. But Todd reserved the first 192.168.10.0/27 to subnet for both bottom subnets and then did the same way i did. I think this maybe has to do with summarization but I'll take a closer look to see if this is the case versus my way.
Regards.
Alain.
Ahmed
You have the following values within each octet ie. if you look at an octet in binary you get -
128 64 32 16 8 4 2 1
so to get 120 hosts first. Look at the binary values in the octet and you can see that 128 is the only number that covers 120.
So you first subnet is -
192.168.10.0 255.255.255.128 this covers hosts 192.168.10.1 -> 126 with a broadcast of 127
so the next available subnet is -
192.168.10.128. We now need to work out the subnet mask for this. You need 60 hosts so again looking at binary values you can see 64 is the number we need. To get the subnet mask from this you need to add 128 + 64 = 192. So -
192.168.10.128 255.255.255.192 this covers hosts 192.168.10.129 -> 190 broadcast 191
your next subnet is therefore 192.168.10.192
30 host needed. 32 is the binary number so 128 + 64 + 32 = 224 so
192.168.10.192 255.255.255.224 - hosts 192.168.10.193 -> 222 broadcast 223
next available subnet = 192.168.10.224
13 hosts needed. 16 is the relevant binary figure so 128 + 64 + 32 + 16 = 240
192.168.10.224 255.255.255.240 - hosts 192.168.10.225 -> 238 broadcast 239
next subnet = 192.168.10.240
i'll leave you to work out the last networks
Does this make sense ?
Edit - just to clarify. When you are looking at the hosts needed vs the binary value as we have done always be aware you need at least 2 spare. What i mean by this is when we looked at 30 hosts then we chose 32 as the binary value which is fine because 255.255.255.224 gives you 30 uesable host addresses. However if we had needed 31 hosts then we would have had to go to a 64 because as i say 255.255.255.224 only gives you 30 host address. So for 31 hosts you would need 64 ie. 255.255.255.192. So if you have 192.168.10.0/24 and you needed 31 hosts you would do -
192.168.10.0 255.255.255.192 but even though you have a lot of spare addresses unused ie. this range actually gives you 62 useable address these addresses cannot be used in another subnet.
Even though you aren't using them you still need to start the next subnet at 192.168.10.64.
Jon
thanks for the reply Mr Jon. i will do some couple more examples and one more thing i would like to ask is that in solving VLSMs examples do i always have to start from the network with the highest no of hosts and go all the way down to network with lowest no of hosts? or it can be any order?
Thank you
Ahmed
It's always recommended to start with the highest number of hosts. The reason being that if you had 192.168.10.0 and you needed 30 hosts and 120. If you started with 30 then you would use 32 as discussed so -
192.168.10.0 255.255.255.224 next subnet is then
192.168.10.32
but now you need to have 120 hosts. You cannot simply do this -
192.168.10.32 255.255.255.128 because this will not work. The router would interpret this as 192.168.10.0 255.255.255.128 and so would report an overlap with your subnet used for 32 hosts. It's to do with bit boundaries within the octet but i didn't mention it earlier as i didn't want to confuse you. We can cover it later if needed but for now always start with the network that needs the most hosts and work down from there.
Jon
thanks again Mr. jon. one last thing i would like to ask is that in this book by lammle for ccna 7th edition, in fig 5.4 he solves the vlsm example by randomly moving to different networks. I can show you the image if you like to see it for yourself.
Thanks
Ahmed
By all means post it if needed but i would try out a few examples yourself to get the hang of it.
Jon
Yes i will show you the image of that example and i did tried some examples but i want to see what technique he is using to get the task done.
P.s actually there are like 2-3 examples i would like to show you so your reply to this issue will be highly anticipated.
Thank you
Ahmed,
Ahmed
Okay, can you post the relevant details then.
Jon
Here is one of the example thats been confusing me. what i dont understand is the ip scheme he used for these networks. we have 8 networks and you can see the hosts on each network from the Figure too. The main ip is a class C ip.
Looking forward to hear from you.
Thank you
Ahmed
Hi Ahmed,
I suppose the main network is 192.168.10.0/24.
let's consider the subnet with the most hosts which is networkB with 30 hosts.
30 hosts means we must borrow 5 bits for host so we have a mask of /27 or 255.255.255.224 because 32-5=27
magic number is 256-224=32 = subnet increment so the subnets are:
-192.168.10.0/27, 192.168.10.32/27,192.168.10.64/27, and so on by increment of 32
we can use first subnet for subnet B: 192.168.10.0/27
now for subnet C we still need 5 bits for hosts so same mask as before and use the second subnet which gives 192.168.10.32/27
Now for subnet A with 14 hosts we need 4 host bits so a mask of /28 or 255.255.255.240 because 32-4=28 and we will use the 192.168.10.64/27 to get the new subnet.
magic is 256-240=16 so subnet increment so we get 192.168.10.64/28,192.168.10.80/28,192.168.10.96/28
lets take first one 192.168.10.64/28
Now for subnet A with 6 hosts so 3 host bits we have 32-3=29 so /29 or 255.255.255.248 with magic = 256-248=8 so subnet increment which gives 192.168.10.80/29,192.168.10.88/29, lets use first so 192.168.10.80/29
We're left with the P2P networks with a /30 mask or 255.255.255.252
Which subnets are still available to us?
let's use 192.168.10.96/28 so we'll get 192.168.10.96/30, 192.168.10.100/30,192.168.10.104/30,192.168.10.108/30
That's how I would use vlsm in this network. But Todd reserved the first 192.168.10.0/27 to subnet for both bottom subnets and then did the same way i did. I think this maybe has to do with summarization but I'll take a closer look to see if this is the case versus my way.
Regards.
Alain.
Alain is it ok to reserve the first subnet like todd did for the lower subnets or not? the other thing is would like to ask is that for the network A we get 2 subnets i.e 192.168.10.80/29 and 192.168.10.88/29 and we used the first subnet for network A now for the point-to-point networks you started from 192.168.10.96/30, how you started with this .96 ip??
Thanks
Ahmed
Ahmed
You can use VLSM with any major network ie. Class A, B or C.
When designing the addressing for an organisation it depends on the size of the organisation really. Last place i worked we had 4 Class B networks which we then used VLSM on to create the subnets as and when we needed.
What you need to do is pick a big enough network space for the company with obviously spare addressing for future use. Then for each site allocate a certain set of subnets that can be summarised. Then within those subnets you can use VLSM to allocate how you need.
The key thing is summarisation. If you summarise properly you avoid a lot of headaches.
Jon
Ahmed
In addition to Alain's reply. Using 192.168.10.0/24 as an example -
with a 255.255.255.128 (/25) subnet mask you can get 2 subnets -> 192.168.10.0/25 and 192.168.10.128/25
the key thing to understand is that you cannot just do 192.168.10.32/25 because with a /25 mask only the 2 above subnets are available.
so with a 255.255.255.192 (/26) mask you can have -
192.168.10.0/26
192.168.64.0/26
192.168.128.0/26
192.168.192.0/26
but again you couldn't have 192.168.32.0/26 because that isn't one of the available subnets. If you entered 192.168.10.32. 255.255.255.192 then the outer would actually think this was 192.168.10.0/26.
This is why you should always start with the most hosts and work your way down.
Jon
thanks again jon, other thing i ould like to ask is that vlsm is only for class c ip or it can be used with Class B too?
Secondly if i were to design a netwok of an organization, should i be using VLSM classless network or a classful network (Class A adresses)?
Ahmed,
In addition to what Jon has provided, have a look at this document. It goes over VLSM in details.
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800a67f5.shtml
HTH