Get Your Free IT Resume Guide

Cool Subnetting Tricks with Variable Length Subnet Mask

A few months back, I showed you how to organize your network into smaller subnets. My post covered the details of the concept of subnetting. So if you missed that article, I would suggest taking a look at it to make sure you understand VLSM and this article in its entirety. For now, I will assume that you are already familiar with subnetting and know how to divide a network into smaller subnets.

In today’s article, we’ll subnet an already subnetted network into multiple subnets with variable subnet masks and then allocate them within our sample network.

Variable Length Subnet Mask (VLSM) is a key technology on large scalable networks. Mastering the concept of VLSM is not an easy task, but it’s well worth it. The importance of VLSM and its beneficial contribution to networking design is unquestionable. At the end of this article you will be able to understand the benefits of VLSM and describe the process of calculating VLSMs. I will use a real world example to help you understand the whole process and its beneficial effects.

Benefits of VLSM

VLSM provides the ability to subnet an already subnetted network address. The benefits that arise from this behavior include:

Efficient use of IP addresses: IP addresses are allocated according to the host space requirement of each subnet.

IP addresses are not wasted; for example, a Class C network of 192.168.10.0 and a mask of 255.255.255.224 (/27) allows you to have eight subnets, each with 32 IP addresses (30 of which could be assigned to devices). What if we had a few WAN links in our network (WAN links need only one IP address on each side, hence a total of two IP addresses per WAN link are needed).

Without VLSM that would be impossible. With VLSM we can subnet one of the subnets, 192.168.10.32, into smaller subnets with a mask of 255.255.255.252 (/30). This way we end up with eight subnets with only two available hosts each that we could use on the WAN links.

The /30 subnets created are: 192.168.10.32/30, 192.168.10.36/30, 192.168.10.40/30, 192.168.10.44/30, 192.168.10.48/30, 192.168.10.52/30, 192.168.10.56/30 192.168.10.60/30.

Support for better route summarization: VLSM supports hierarchical addressing design therefore, it can effectively support route aggregation, also called route summarization.

The latter can successfully reduce the number of routes in a routing table by representing a range of network subnets in a single summary address. For example subnets 192.168.10.0/24, 192.168.11.0/24 and 192.168.12.0/24 could all be summarized into 192.168.8.0/21.

Address Waste Without VLSM

The following diagram shows a sample internetwork which uses a network C address 192.168.10.0 (/24) subnetted into 8 equal size subnets (32 available IP addresses each) to be allocated to the various portions of the network.

This specific network consists of 3 WAN links that are allocated a subnet address range each from the pool of available subnets. Obviously 30 IP address are wasted (28 host addresses) since they are never going to be used on the WAN links.

Variable Length Subnet Mask - 1

Implementing VLSM

In order to be able to implement VLSMs in a quick and efficient way, you need to understand and memorize the IP address blocks and available hosts for various subnet masks.

Create a small table with all of this information and use it to create your VLSM network. The following table shows the block sizes used for subnetting a Class C subnet.

Variable Length Subnet Mask - 2

Having this table in front of you is very helpful. For example, if you have a subnet with 28 hosts then you can easily see from the table that you will need a block size of 32. For a subnet of 40 hosts you will need a block size of 64.

Example: Create a VLSM Network

Let us use the sample network provided above to implement VLSM. According to the number of hosts in each subnet, identify the addressing blocks required. You should end up with the following VLSM table for this Class C network 192.168.10.0/24.

Variable Length Subnet Mask - 3

Take a deep breath … we’re almost done. We have identified the necessary block sizes for our sample network.

The final step is to allocate the actual subnets to our design and construct our VLSM network. We will take into account that subnet-zero can be used in our network design, therefore the following solution will really allow us to save unnecessary addressing waste:

Variable Length Subnet Mask - 4

With VLSM we have occupied 140 addresses. Nearly half of the address space of the Class C network is saved. The address space that remains unused is available for any future expansion.

Isn’t that amazing? We have reserved a great amount of addresses for future use. Our sample network diagram is finalized as shown on the following diagram:

Variable Length Subnet Mask - 5

Final Thoughts

Variable Length Subnet Mask is an extremely important chapter in Network Design. Honestly, if you want to design and implement scalable and efficient networks, you should definitely learn how to design and implement VLSM.

It’s not that difficult once you understand the process of block sizes and the way to allocate them within your design. Don’t forget that VLSM relates directly to the subnetting process, therefore mastering the subnetting process is a prerequisite for effectively implementing VLSM. And feel free to go through my subnetting articles a couple of times to get a hang of the whole process.

More Related Posts

  1. Jumpstart Your Career and Use Cool IT Toys: Get CCNA Training!
  2. IP Addressing and Routing Part 2: IP Routing Process
  3. A Short Guide to Internet Control Protocols
  4. Cisco Routing Study Guide: Configuring OSPF in a Single Area
  5. IP Addressing and Routing Part 3: Default and Static Routing

Discussion

27 comments and trackbacks for “Cool Subnetting Tricks with Variable Length Subnet Mask

Comments

  1. Posted by dr.zing on April 14, 2008, 6:46 am

    Superb Article, and nicely explained with helpful diagrams.

  2. Posted by Johan on April 21, 2008, 4:17 pm

    Hi,

    Thanks for this excellent article.

    Can you let us know if Subnetting differs when done in a Cisco environment and Microsoft environment ?

    Someone once told me, that Cisco networks can use Subnet zero while as Microsoft doesn’t encourage that or something along those lines ?

    Can you give some clarity on this please !

    Thanks,
    Johan

  3. Posted by Rajesh kumar on April 27, 2008, 2:14 am

    it’s very nice……understable..

  4. Posted by EB Allen on July 2, 2008, 4:07 pm

    Can you explain the /29 and how it relate to the 248. Is the relationship the same regardless of the number we use?

  5. Posted by karwan on August 19, 2008, 12:44 am

    Thank you dear
    that is realy cool , I hope you be happy in your live .
    best regards…………………………………………………….

  6. Posted by Msizi on September 2, 2008, 8:34 am

    Thanks man! I can now say “WHooo” , this really helped me, well written

  7. Posted by Paul on September 2, 2008, 11:06 am

    Im almost there probably 90% from fully understanding but still have some confusion great diagrams by the way

    where im lost is i can understand which prefix and hence subnet mask to use i.e. a /30 for a WAN link as only 2 hosts needed or a /26 prefix for network E as 40 hosts needed.

    I just dont know how the last digit in the 4th octet is known
    say for network E the 192.168.10.44/26 where does the 44 comes from?
    or for network F the 108 chosen?

  8. Posted by James on September 10, 2008, 1:29 am

    Maybe I am wrong, but your network E is incorrect. 192.168.10.44/26 is not a subnet address but rather a usable IP address within that block. Maybe this will explain better….

    192.168.10.00|101100 (.44 octet in binary, w/ bar separating net and host)

    given the above info your subnet would be as follows:

    subnet address: 192.168.10.0
    broadcast address: 192.168.10.63
    first usable address: 192.168.10.1
    last usable address: 192.168.10.62

    Based on your chart network E has a range of 192.168.10.44 – 107. In order to achieve anything greater than 63, you would have to change a net bit and then would be violating the subnet mask or the /26 part of the network.

    Above where I have .44 written in binary there is a bar between the 26th and 27th bit separating the net and host. As I stated the broadcast address (or highest address) is:

    192.168.10.63 or 192.168.10.00|111111

    Therefore, in order to go any higher (64 – 107), bits to the left of the bar would have to change, but the /26 is saying they cant change.

    I hope this makes sense.

  9. Posted by Stelios Antoniou on September 10, 2008, 12:21 pm

    Very good James,

    You are absolutely right. Well, actually the correct sequence should be:

    E: 192.168.10.0/26
    A: 192.168.10.64/27
    F: 192.168.10.96/27
    B: 192.168.10.128/30
    C: 192.168.10.132/30
    D: 192.168.10.136/30

    In this way we take advantage of the whole address space.

  10. Posted by Adel farid on September 13, 2008, 10:36 pm

    Thats right actually Stelios good job .

  11. Posted by Mark Angelo S. illustrisimo on September 18, 2008, 6:54 am

    110101100.00010000.11111110.00000001
    onebyte= eight bits
    thirty two bits thnxxxx

  12. Posted by franklin on September 25, 2008, 7:19 am

    Good job, I think their is a mistake wirh the network E and F. The reason been that
    192.168.10.44/26 and 192.168.10.108/27 is not a subnet address.

    I stand to be corrected, I think since network E needs 40 hosts, The easiest way to assign the subnet is to assign the largest first. Hence.

    Network E 192.168.10.0/26
    Network F 192.168.10.64/27
    Network A 192.168.10.96/27
    Network B 192.168.10.104/30
    Network C 192.168.10.108/30
    Network D 192.168.10.112/30

    Thank you

  13. Posted by Wushu on February 2, 2009, 1:44 am

    i still don’t get it… T_T

    i need a further explanation… pls help…

  14. Posted by wushu on February 2, 2009, 2:01 am

    i have problem in indicating numbers, what number should i use why should i use it, how did you get?

    huhuhuhu… please help

  15. Posted by chinedu God'swill on September 30, 2009, 11:02 am

    Sir,please explain the difference between RIP and OSPF

  16. Posted by FernanDOG on October 9, 2009, 9:18 pm

    Hi
    This is a very useful artical. Simple and Sweet. Diagrams and tables are simple to
    understand
    thumbs up from me
    Thanks a lot
    fer

  17. Posted by jayaraju on January 22, 2010, 4:15 am

    ultimate…………….

  18. Posted by Ola on April 1, 2010, 4:53 am

    How can you Subnet this :

    Class C :192.168.5.0/24 ?

    1 router :60 host,
    2nd router :28 host,
    3rd router : 12host

    How many subnet do u need in all ?

  19. Posted by lez on July 1, 2010, 6:32 am

    w/c is the private ip adddress here …;
    a.172.168.33.1
    b.10.35.66.70
    c.192.168.99.5
    d.172.18.88.90
    e.192.169.77.89
    f.127.33.55.16 please answer…

  20. Posted by bob on July 28, 2010, 12:10 pm

    Just miss the most important step in your explanation!!!! How you do the allocation!!!! The final step.

  21. Train Signal Team Member
    Posted by Kasia Grabowska on August 6, 2010, 11:16 am

    Good catch Bob! Thanks for letting us know! We’ll try to get a follow up article on VLSM allocation out asap.

  22. Posted by Mark on December 26, 2010, 4:46 pm

    The figures are not visible, I even right click on them and chose Show Picture but still I was not able to see them, so, is there any other link I can see the figures?
    Thanks

  23. Train Signal Team Member
    Posted by Kasia Lorenc on January 5, 2011, 4:31 pm

    Hi Mark,

    Thanks for the heads up! We recently redesigned the site and some images got lost in transition. This post has been fixed but let us know if you notice any other images missing.

    Kasia

  24. Posted by mayur thakkar on July 6, 2011, 2:12 am

    hi Ola

    1 router :-

    subnet subnetmask host range broadcast

    :192.168.5.0 255.255.255.192 192.168.5.1 to 192.168.5.62 192.168.5.63
    192.168.5.64 255.255.255.192 192.168.5.65 to 192.168.5.126 192.168.5.127
    192.168.5.128 255.255.255.192 192.168.5.129 to 192.168.5.190 192.168.5.191
    192.168.5.192 255.255.255.192 192.168.5.193 to 192.168.5.254 192.168.5.255

    2 router:-
    host
    192.168.5.0 255.255.255.224 30 192.168.5.1 to 192.168.5.30 192.168.5.31
    192.168.5.32 255.255.255.224 30 192.168.5.33 to 192.168.5.62 192.168.5.63
    192.168.5.64 255.255.255.224 30 192.168.5.65 to 192.168.5.94 192.168.5.95
    192.168.5.96 255.255.255.224 30 192.168.5.97 to 192.168.5.126 192.168.5.127
    192.168.5.128 255.255.255.224 30 192.168.5.129 to 192.168.5.158 192.168.5.159
    192.168.5.160 255.255.255.224 30 192.168.5.161 to 192.168.5.190 192.168.5.191
    192.168.5.192 255.255.255.224 30 192.168.5.193 to 192.168.5.222 192.168.5.223
    192.168.5.224 255.255.255.224 30 192.168.5.225 to 192.168.5.254 192.168.5.255

    3 router:

    192.168.5.0 255.255.255.240 14 192.168.5.1 to 192.168.5.14 192.168.5.15
    192.168.5.16 255.255.255.240 14 192.168.5.17 to 192.168.5.30 192.168.5.31
    192.168.5.32 255.255.255.240 14 192.168.5.33 to 192.168.5.46 192.168.5.47
    192.168.5.48 255.255.255.240 14 192.168.5.49 to 192.168.5.62 192.168.5.63
    192.168.5.64 255.255.255.240 14 192.168.5.65 to 192.168.5.78 192.168.5.79
    192.168.5.80 255.255.255.240 14 192.168.5.81 to 192.168.5.94 192.168.5.95
    192.168.5.96 255.255.255.240 14 192.168.5.97 to 192.168.5.110 192.168.5.111
    192.168.5.112 255.255.255.240 14 192.168.5.113 to 192.168.5.126 192.168.5.127
    192.168.5.128 255.255.255.240 14 192.168.5.129 to 192.168.5.142 192.168.5.143
    192.168.5.144 255.255.255.240 14 192.168.5.145 to 192.168.5.158 192.168.5.159
    192.168.5.160 255.255.255.240 14 192.168.5.161 to 192.168.5.174 192.168.5.175
    192.168.5.176 255.255.255.240 14 192.168.5.177 to 192.168.5.190 192.168.5.191
    192.168.5.192 255.255.255.240 14 192.168.5.193 to 192.168.5.206 192.168.5.207
    192.168.5.208 255.255.255.240 14 192.168.5.209 to 192.168.5.222 192.168.5.223
    192.168.5.224 255.255.255.240 14 192.168.5.225 to 192.168.5.238 192.168.5.239
    192.168.5.240 255.255.255.240 14 192.168.5.241 to 192.168.5.254 192.168.5.255

  25. Posted by zavieralex on July 11, 2011, 11:24 am

    Great article

Trackbacks

  1. Cool Subnetting Tricks with Variable Length Subnet Mask - David’s Cisco Networking Blog
  2. Technology Trends » Blog Archive » Cool Subnetting Tricks with Variable Length Subnet Mask | Train Signal Training - Free Computer Training Videos

Post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>