SubNetting in Computer Networks

## SubNetting in Computer Networks

### What is SubNetting?

The 32 bit IP address is divided into two parts as Network part and Host part. That is the netid indicate the network part and the host id indicate the host part.To reach a host on the network we must first reach the network by using the netid. Then we must reach the host using the hostid.

• Network id
• Host id

A network can be divided into several subnetworks (subnets).This is achieved by taking some bits form the host part.

For example consider a university where the hosts are grouped according to department. University network has a specific networkid. Inside this network, we can create different subnetworks to identify various departments and each department has a subnetid.

Thus the 32 bit IP address is divided into three parts, namely network id, subnet id, host id.The bits from the host part is borrowed to generate the subnetid.

• Network id
• Subnet id
• Host id

Now to reach a host on the network we must first reach the network by using the netid, then to the subnetwork using subnetid and finally to the host using the host id.

Borrowing n bits  from host part yields   2n – 2 subnets.
Leaving n bits in host part  yields           2n – 2 hosts.

Example:

Class C address is divided into network and host portions as follows:
N  .  N  .  N  .  H

For a class C, we can borrow from 2 to 6 bits. But not possible to borrow 1 bit or 7 bits from host part.

Why not borrowing 1 bit or 7 bits from host part in  subneeting a class C IP addresss.

When borrowing 1 bit , the number of subnet possible= 2n - 2=21 - 2 = 0

When borrowing 7 bits, the number of hosts possible on each subnet = 2n - 2=21 - 2 = 0