Skip to main content

Variable Length Subnet Mask


I think it is better to tell the difference of Subnet Mask and Variable Length Subnet Mask(VLSM) at the beginning. As I discuss in earlier article Subnet Mask is there to split one IP address into several IP’s which can use in difference LAN’s. But the question is it limit the number of accessible hosts(computers) in each LAN.  Let takes the previous example,  192.168.5.0/26 (LAN A) can only have 62 (2^6 -2) computers(hosts). But Imagine that we need to keep 100 computers in LAB A? Now I think you can understand how Subnet Mask is questioned. The answer is Variable Length Subnet Mask. I try to discuss how we use VLSM in practice in this article.
I rearrange the previous example as following.
ISP given address -> 192.168.5.0 /24
LAN A -> 100  (lets think LAN A need 100 computers).
LAN B ->50
LAN C -> 50
LAN D ->50


Let see how we solve this problem.
192.168.5.0 /24 is the given IP and we take one bit from host side of that IP. We can define two different IP’s by using that.
192.168.5.00000000 /25     and  192.168.5.10000000 /25
192.168.5.0 /25                   and   192.168.5.128 /25
We can take 192.168.5.0/25 as LAN A network address because in that IP there are 7 bits available for hosts. That mean there are 126 (2^7 -2) different hosts can be used.

In 192.168.5.128 /25 address we take another bit from available hosts bits to network side. So there are another three address can be identified. And each of them can be assigned 62 (2^6 -2) different hosts.

192.168.5.01000000 /26  -> 192.168.5.64/26 -> LAN B -> note 6 bits are available in host side.
192.168.5.10000000 /26 -> 192.168.5.128/26 -> LAN C
192.168.5.11000000 /26 -> 192.168.5.192/26 -> LAN D

with this I think I discuss all basic parts in IP addressing. Hope you may have better idea regarding this now.


Comments

Popular posts from this blog

IP based vertual hosting in apache2

I think most of the people used ubuntu as their linux OS. There will be a little bit conflict when you are trying to use virtual hosting in apache2 according to centOS. In this article I will try to explain how it should done in ubuntu apache2. Anyway there is a few more things to know before you start. 1. httpd.conf  file is equal to apache2.conf in /etc/apache2/ 2. In apache2.conf includes some other conf file so that necessary settings should be done those files. e.g. changing port numbers should be done in ports.conf I will explain step by step vertual hosting using apacge2. I take /etc/var/www as a DocumentRoot any way if you want to change it, Change the default file which locate in /etc/apache2/sites-available/default file. To easy access create a folder called www.bict.lk (any choice)  and create htdocs and logs two folders inside www.bict.lk. Don't forget to create index.html file in htdocs folder. (html file which shows www.bict.lk ). These folders should b...

Name Based Virtual Hosting in apache2

In name based virtual hosting we run several web sites in one IP address.To do that request from browser should come in HTTP/1.1 protocol. To demonstrate this process I used this scenario. Imagine we have three web sites called as www.bict,lk , www.ucsc.lk and www.scs.lk. And our apache server runs in 192.168.1.1IP address and 8080 port. Following document roots are used. www.bict.lk    /var/opt/www.bict.lk/htdocs www.ucsc.lk   /var/opt/www.ucsc.lk/htdocs www.scs.lk   /var/opt/www.scs.lk/htdocs In an each htdocs directory you should create separate index.html files. note : You can change those document root in /etc/apache/sites-available/default file. And it has default document root as /var/www . To edit that use $ vi /etc/apache/sites-available/default    command. There should be a index files (index.html) relevant to each web site. To make easy understand I explain this step by step . step 1.      ...

Subnetting In Practice

Imagine that you need to make four different networks(LAN’s). Then you ask form ISP(Internet Service Provider) to four different IP’s. But each of network has less than 20 computers. So ISP will say we cannot give four IP’s and we give you one IP and Split it into four difference networks. Let see how we done it. ISP given network address: 192.168.5.0 255.255.255.0                                                                                                         ...