Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VLSM implementation questions 1

Status
Not open for further replies.

khanza

Technical User
Feb 20, 2003
70
US
I was talking to some people regarding VLSM and doing some reading from the cisco site....

So far I know what VLSM does, and I have been told that to implement it you must -
1 - Use a compatable routing protocol ( OSPF for example )
2 - Just set up the PC's to have a different subnet masks cooresponding with the length subnets you need

Here's my 2 questions -

First -- Is that all you need to do to implement it?

Second -- In regular subneting you cannot use the first and last subnets, and you cannot use the first and last ip of each subnet (network addresses and broadcast addresses) -- How do you know which subnet (in VLSM) is the first / last? How do you specify?


If you'd rather post links, I havn't been able to find anything that addresses (hehe, no pun intended) these questions directly...

Thanks guys!
khan
 
you can't use RIP as a routing protocol,

use similar subnets,
if you have 4 networks

10.4.0.0/24
10.4.1.0/24
10.4.2.0/24
10.4.3.0/24

you can pull back on the subnet mask,

10.4.0.0/22

this would create a single network 10.4.0.0 - 10.4.3.255

That's VLSM
 
whoa -- I was assuming you could create a scheme like

8 hosts
16 hosts and
32 hosts

But it looks like you just bridged 4 different subnets together -- would you still need a router to route the different subnets?

Would the router need a secondary and third ip from one int to do it?


Thanks for your reply!
:D
Khan
 
you are combining networks, making one network from several, ther are no subnets. once it's one network, there is no routing issue, as long as all devices on the network have the same net mask.

you can use crazy subnet masks to split apart a network

192.168.1.0

192.168.1.0/26 ip range 192.168.1.1 - 192.168.1.61
to meet the 32 hosts requirement.

192.168.1.64/27 ip range 192.168.1.65 - 192.168.1.94
to meet the 16 hosts requrement.

192.168.1.128/28 ip address range 192.168.1.129 - 192.168.1.142 to mee the 8 host requirement.

A /26 gives 4 subnets at .0, .64, .128, & .192
as long as each of the smaller subnets fits into one of these networks, they are on physically seperate networks within the network structure at the /26 level.
It will work, you do loose a few IP's in the process.

Is this what you are trying to do ?


and yes you would need to create subinterfaces on your router to handle all three networks.

classful, thats the word i couldn't remmber RIP is a classful routing protocol, so router rip 192.168.1.0
won't work on subnets.






 
What I was going for was seperating a subnet into several different networks, of varying sizes...

Here's an excerpt from cisco's site --
"As IP subnets have grown, administrators have looked for ways to use their address space more efficiently. One of the techniques that has resulted is called Variable Length Subnet Masks (VLSM). With VLSM, a network administrator can use a long mask on networks with few hosts and a short mask on subnets with many hosts. However, this technique is more complex than making them all one size, and addresses must be assigned carefully."


I just wanted to know how to do this...
 


"With VLSM, a network administrator can use a long mask on networks with few hosts and a short mask on subnets with many hosts."

The longer the mask (the more bits that are turned 'on'), the less bits left to assign HOST addresses to.

For example
200.157.204.16/28
Wire/Network address is - 200.157.204.16
Host range is - 200.157.204.17 thru 200.157.204.30 Broadcast address - 200.157.204.31
Next Network address - 200.157.204.32

32 possible hosts with .16 (network) unuseable and .31 (broadcast) unuseable for host assignment.

So, you can see that since you used 28 bits to 'mask' the Network, you only have 4 bits left for hosts, hence (2^4)-2 gives you those 14 addresses.

The shorter the mask, (less bits turned 'on'), the more bits left to assign HOST addresses to.

For example
67.4.168.221/8
Host address is 67.0.0.0
Host range is 67.1 0.0 thru 67.255.255.254
Broadcast is 67.255.255.255

Possible hosts are (2^24)-2 or 16,777,214.

So less bits turned 'on' in the Network Mask = more bits left for HOST addressing.

Okay, moving on...

Let's say you own the class B network address
160.44.0.0/16 which if left alone with no VLSMasking would give you 1 Network - 160.44.0.0 and (2^16)-2 or 65,534 HOST addresses.

Perhaps your company has no need for 65,000 + hosts on 1 Network, but instead needs 6 unique Networks that can each contain 6200 HOSTS. Simply change the subnet mask from /16 to /19 -(borrow 3 bits from the 3rd octect which was available for HOSTS).

160.44.0.0/19

Networks now available to you:

160.44.0.0/19
160.44.32.0/19
160.44.64.0/19
160.44.96.0/19
160.44.128.0/19
160.44.160.0/19
160.44.192.0/19
160.44.224.0/19

Now each Network can have 8190 HOSTS instead of 65,534.

So we went from a shorter mask of /16 with MORE hosts (65,534) to a longer mask of /19, with FEWER hosts (8190).

"I just wanted to know how to do this..."

And that is 'how you do this'...


Hope this helps,

Patty [ponytails2]

 
Thanks! That was exactly what I needed.
 
160.44.0.0/19

Networks now available to you:

160.44.0.0/19
160.44.32.0/19
160.44.64.0/19
160.44.96.0/19
160.44.128.0/19
160.44.160.0/19
160.44.192.0/19
160.44.224.0/19

Now each Network can have 8190 HOSTS instead of 65,534.

So we went from a shorter mask of /16 with MORE hosts (65,534) to a longer mask of /19, with FEWER hosts (8190).

Ok I am a bit lost because VLSM are basically breaking down or subneting an already subneted network-

Your example doesn't make sense- you are using the same subnet mask and you have 8 subnet when you should only have 6- you can't use the network ID 0 and you can't use 224 (subnet mask). I am not going to pretend to be lord of subneting- hell I am studying for my CCNA and have a long way to go- but your example does not make sense- can you shed some light on this please? I get /19 3 host bits used 2to 3rd power -2 = 6 subnets and 13 remaining bits for host ID's 2 to 13 power =8192-2 But where did the other 2 subnets come from and this isn't really VLSM is it?
 
Yes, you can use Subnet Zero and the All 1's subnet.

In this post I was simply pointing out that changing the mask will effect the number of hosts available on each network. I used a very simplified example. Sorry if I introduced confusion.

As far as VLSM, no I didn't break it down.


If you took a /24 network and worked with VLSM

255.255.255.0= 254 hosts
255.255.255.128 = 126 hosts
255.255.255.192 = 62 hosts
255.255.255.224 = 30 hosts
255.255.255.240 = 14 hosts
255.255.255.248 = 6 hosts
255.255.255.252 = 2 hosts

If you used the first mask you would have only 1 network with 254 hosts. You could not break it down further as you have used all the addresses in this space.

If you started with the second mask, you could have 2 networks with 126 hosts each or you could have 1 network with 126 hosts and break the other one down to 2 sub-subnetworks with 30 hosts each, i.e.,

192.168.1.0/25 (host range 192.168.1.1 - 192.168.1.126)
192.168.1.128/26 (host range 192.168.1.129 - 192.168.1.190)
192.168.1.192/26 (host range 192.168.1.193 - 192.168.1.254)

Or you could break it down further by increasing the number of bits in the mask

192.168.1.0/25 (host range 192.168.1.1 - 192.168.1.126) 126 useable hosts
192.168.1.128/26 (host range 192.168.1.129 - 192.168.1.190)62 useable hosts
192.168.1.192/27 (host range 192.168.1.192 - 192.168.1.222)30 useable hosts
192.168.1.224/28 (host range 192.168.1.225 - 192.168.1.238)14 useable hosts
192.168.1.240/29 (host range 192.168.1.241 - 192.168.1.246) 6 useable hosts

And so on....

Of course each time you increase the bits in the mask you have fewer bits available for host assignment. So using VLSM with a /24 you can go from a single network with 254 hosts to multiple networks with a smaller number of hosts on each. It all depends on the bit manipulation.

I hope my numbers are right...it's kind of early and the coffee hasn't kicked in yet!
 
Correction,

"If you started with the second mask, you could have 2 networks with 126 hosts each or you could have 1 network with 126 hosts and break the other one down to 2 sub-subnetworks with 30 hosts each, i.e.,"

Should be 62 hosts each....

"192.168.1.192/27 (host range 192.168.1.192 - 192.168.1.222) 30 useable hosts"

Should be 193 as first usable host...

I must have still been asleep!


 
Ok that makes alot more sense- I have regular subneting down but VLSM or superneting is killing me can anyone recommend some good study material on the subject- I don't care if its a book I have to buy. Its just killing me because everything I have learned in subneting has now totally changed.

Thanks Patty!
 
Really nothing has changed. You are simply palying with the bits and making them suit your individual needs.

Lets say your network is designed as follows,



(A) |
Router---Serial-------Router--------|---|18 hosts (B)
| connection | |
| |
| |
------ -------
25 Hosts (C) 160 Hosts (D)

Lets just take a private IP for practice.

192.168.1.0

Start with the needs of the largest network, or D.

1. How many bits will I need to leave for hosts to accommodate 160 hosts? (answer = 8 bits)((2^8)-2)= 254
2. What will the subnet mask be? Simply leave 8 bits for hosts and turn on the rest. i.e., 192.168.1.0/24

Network D
192.168.1.0/24 hosts 192.168.1.1 - 192.168.1.254 (Broadcast = 192.168.1.255)

Move on to the next largest network, or C.

1. How many bits will I need to leave for hosts to accommodate 25 hosts? (answer = 5 bits)((2^5)-2)= 30
2. What will the subnet mask be? Simply leave 5 bits for hosts and turn on the rest. i.e., 192.168.1.*/27

******here, subnet zero is availalbe, but lets just start with subnet 1, which is .32********

Network B
192.168.1.32/27 hosts - 192.168.1.33 - 192.168.1.62 (Broadcast = 192.168.1.63)
Next available subnet is 192.168.1.64

Move on to the next largest network, or B.

1. How many bits will I need to leave for hosts to accommodate 18 hosts? (answer = 5 bits)((2^5)-2)= 30
2. What will the subnet mask be? Simply leave 5 bits for hosts and turn on the rest. i.e., 192.168.1.64/27

Network C
192.168.1.64/27 hosts 192.168.1.65 - 192.168.1.94 (Broadcast = 192.168.1.95)
Next available subnet is 192.168.1.96

Move on to the next largest network, or A.

1. How many bits will I need to leave for hosts to accommodate 2 hosts? (answer = 2 bits)((2^4)-2)= 2
2. What will the subnet mask be? Simply leave 2 bits for hosts and turn on the rest. i.e., 192.168.1.96/30

Network A
192.168.1.96/30 hosts 192.168.1.97 - 192.168.1.98 (Broadcast = 192.168.1.99)
Next available subnet is 192.168.1.100

I hope this helps!

forgive me any typos, after looking at this stuff for a long time it all seems to run together!

Patty [ponytails2}





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top