Skip to main content

Sub Net Mask Address


As I mention in earlier article network address will give when we make all host side bits zero. The main difference between class full and class less IP addressing is there is no standard bit position to divide network and host side in class less IP. But we had to tell what is the point that network and host side divide in this case. That is why sub net mask address comes to seen. Subnet mask address is also 32 bit binary number. The sub net mask address will give when all network side bits makes 1(one ‘s) and all host side bits makes 0(zero). I think you can take better idea by looking  following e.g.
e.g. 1
IP Addr: 192.168.1.1                                        11000000.10101000.00000001.00000001
Sub net mask: 255.255.255.0                            11111111.11111111.11111111.00000000
We can write both IP and sub net mask or can write like this, 192.168.1.1/24. Number of network side bits are written as “/n “ after the IP.   
e.g.2
Let say 192.168.1.1/26 and ask to find the sub net mask address relevant to this IP.
  11000000.10101000.00000001.00000001  ( IP addr)
  11111111.11111111.11111111.11000000     (there are 26 network bits, so there should be 26 one’s)
  255          .    255     .  255     .      192              (sub net mask address)

This is the way that we find sub net mask.

You may have a question about the difference about these. 192.168.1.1/24 and 192.168.1.1/26. The number of host address that can use in particular network is difference. The first one has (2^8 -2) number of hosts and second one has (2^6-2) number of hosts.The reason for decrease two numbers are the network address and broadcast address can not assign to the computers. 

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 be cre

SSL Certificate

SSL stands as secure socket layer, of the main protocol which is used to secure the data transmission.  In this article I am trying to discuss how this SSL certificate is used in client server architecture. First of all you should know the difference of "Authentication" and "Authorization".  Authentication means validate the correct user, for instance most of times when you tried to log to the system, it will ask user name and password to log it. That is called as authentication. Only user who is given correct user name and password allow to log to the system. When you log to a particular site what are the things you are allowed to do and not to do, in other words the privileges that you have in that site called as Authorization. These two concepts are used when client (your browser) requests from server through SSL protocol.  You may wonder what is the reason of having such a system. This all about trust. Once you type your favorite site, www.facebook

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.      Edit the ports.conf file     $vi /etc/apache2/ports.conf     In thi