Setting Up Linux Web Server | Affordable Web Hosting Plans | Cheap Domain Name Registration

How to Set Up Linux Apache Server

Page 4: Sub-network and Netmask Basic Concept

1. Sub-network

For example, if an ISP had a class B network of 129.62, the ISP can provide a total of 256 different subnetworks ranging from:

129.62.0
129.62.1
129.62.2
..............
.............
129.62.253
129.62.254
129.62.255

Each subnetwork can also provide 256 different IP addresses.

For example, the 129.62.0 can provide the following 256 different addresses ranging from:

129.62.0.0
129.62.0.1
129.62.0.2
..............
.............
129.62.0.253
129.62.0.254
129.62.0.255

2. Netmasks (or Network mask, or Sub-network mask, or Sub-netmask)

The above subnetworking is a bit confusion. If a host has a IP address 18.121.52.156, how can we know that if it is:

  • on Class A network with the first number 18, or
  • on Class B Subnetwork 18.121, or
  • on Class C Subnetwork 18.121.52

This confusion can be solved by the use of a Netmask. There are only three generic Netmask:

  • 255.0.0.0
  • 255.255.0.0
  • 255.255.255.0

Take the above IP address 18.121.52.156 as an example:

Case (i):

IP Address: 18.121.52.156
Netmask: 255.0.0.0

We can easily know the network information:

Network Address: 18.0.0.0

Range of addresses on this network are:

18.0.0.1
18.0.0.2
18.0.0.3
..............
.............
18.121.52.156
.......................
.......................
18.255.255.252
18.255.255.253
18.255.255.254

Case (ii):

IP Address: 18.121.52.156
Netmask: 255.255.0.0

We can easily know the network information:

Network Address: 18.121.0.0

Range of addresses on this network are:

18.121.0.1
18.121.0.2
18.121.0.3
.................
.................
18.121.52.156
.......................
.......................
18.121.255.252
18.121.255.253
18.121.255.254

Case (iii):

IP Address: 18.121.52.156
Netmask: 255.255.255.0

We can easily know the network information:

Network Address: 18.121.52.0

Range of addresses on this network are:

18.121.52.1
18.121.52.2
18.121.52.3
...................
...................
18.121.52.156
.......................
.......................
18.121.52.252
18.121.52.253
18.121.52.254

When a host routes a message, it has an IP address. If it also has the Network Mask, it knows where to send that IP address.

set up linux web server