Subnetting

What is a subnet?  It is a sub network of a larger network.

First thing to understand is there are basically 3 defined blocks of network addresses. Class A, Class B and Class C. An example of each would be.....

Class A 10.x.x.x
Class B 172.16.x.x
Class C 192.168.10.x

There are also Class D and Class E which occupy the upper end of the range.  In general - people don't refer to IPs by their classes any more.  They are referred to by their subnet bits.  A /24 (often called a Class C) has 3 bytes masked (255.255.255.0).  A /16 (often called a Class B) has 2 bytes masked (255.255.0.0).

The addresses listed above are all private addresses suitable for use on a private LAN. 

Class A uses the first dotted quad as the network address, and the last 3 for host addresses. 
Class B
uses the first 2 dotted quad as the network address, and the last 2 for host addresses. 
Class C
uses the first 3 dotted quads as the network address, and the last 1 for host addresses.. 

 Often, people confuse the terms. A Class A address is a specific block of addresses from 1.x.x.x to 126.x.x.x. These can be subnetted down to a 254 host segment, which is often called a Class C, even though it is a subnetted A.   The address 10.50.62.1 with a mask of 255.255.255.0 is technically a Class A address, but it has the first 24 bits masked (8 + 8 + 8) providing the last 8 bits for hosts.

There are several ways to express a subnet. A Class C could also be called a "/24" or "Subnet 255.255.255.0". The last is the easiest to read. Lets say you have a 192.168.10.x Class C address block. The subnet mask is 255.255.255.0. If you were to overlap these two, like masking tape, what would the 255's overwrite? The first 3 dotted quads. What would the 0 overwrite? Nothing. That last dotted quad (8 bits) (shown as x) is the host address. Each machine on your network will have a host address, and they all will have the same network address.

You want to know how to split up a /24 into 4 or 8 or 16 equal parts so you can use it in different buildings connected by routers.

Once you understand the concept, this becomes pretty easy.

Lets take our sample /24. 192.168.50.0. 

2 equal subnets

So, lets split this /24 into 2 equal /25 networks of 128 addresses each. Although they will look like the same /24, they are in reality 2 independent networks.

If you were on network one, same hub as network two, and tried to ping 192.168.0.180 you would get no response. Think of these as PHYSICALLY SEPARATE NETWORKS! You will need a router between them to communicate.

Another example - 4 equal subnets

Lets split this /24 into 4 equal /26 networks of 63 addresses each. Although they will look like the same /24, they are in reality 4 independent networks.

Almost 100 subnets!

You can subnet them down all the way to a /30 (called a slash 30) which is basically a point to point connection - 2 addresses. An example would be

Variable Subnets

It is possible to variably subnet an address space.  That is to give one segment hat is physically separate a /30 mask, and the other two segments /25 masks.  This will be explained a little further down the road.