What is subnetting in networking
What you will learn here about subnetting in networking.
- What is subnetting in networking
- why we do subnetting or why we do subnets in networking
- What is Subnet mask
- IP address classes and default subnet mask
- How to find network and host address from IP address
- Practical example of subnet mask
- How to do subnetting?
What is Subnetting in networking?
Subnetting means creating sub networks or small networks within a network.
Why we do subnetting or subnets?
Assume college has taken internet connection for mechanical depeartment which has 10 students with class C IP address. As the IP address is from class C, you can connect maximum of 254 hosts. After few days college wants, computer department students to use internet. Now buying new internet connection for computer department students is expensive or inconvenient. So as the mechanical depeartment has taken internet already where we connect connect maximum of 254 hosts, since there are only 10 mechanical students, (254-10) host are still available there. If we divide 254 hosts into small small group and asssign small groups to each department then there no need of new internet connection. Subnetting allows us to spilt larger network into several small networks for internal use. This is called subnetting and the networks that result from dividing up a larger network are called subnets.
Below without subnetting what happens is shown. Below IP addresses starting from 192.168.1.1 to 192.168.1.11 are used for mechanical department. but IP addresses starting from 192.168.1.12 to 192.168.1.254 are free to use.
In above image we have seen IP addresses starting from 192.168.1.12 to 192.168.1.254 are free to use. by using subnetting we can form small small networks using those free IP addresses which is shown below. In below image IP addresses starting from 192.168.1.0 to 192.168.1.127 forms the subnet1 and IP addresses starting from 192.168.1.128 to 192.168.1.255 forms the subnet2
What is subnet mask?
We all know IP address consists of two things i.e network address and host address. But from IP address only we are not able to find out which is network address and which is host address. So subnet mask allows us to find out network address and host address from the IP address. The subnet mask is 32 bit number in length. The subnet mask is represented in dotted decimal format. example: 255.255.255.0
IP address classes and default subnet mask
Below IP address classes and default subnet mask table is shown.
How to find network and host address from IP address?
How to find network and host address from IP address is shown below.
Practical example of Subnet mask:
Below practical example of Subnet mask is given.
How to do subnetting?
Subneeting is done by borrowing bits from the host bits. Where borrowed acts as the subnet identifier and remaining bits used as host bits. Below how to do subnetting is exaplained with the help of example.
Requirment: Assume there is Ip address 192.168.1.1 and you have to create 2 sub nets and each subnet should have 128 hosts ?
We know, we need to borrow bits from host bits for subnet identification.
Number of subnets =2n where n is Number of bits required to be borrowed for subnet identification from host bits
In above requirment Number of subnets are 2
n=1 (after sloving 2=2n , n value comes 1)
Since Ip address 192.168.1.1 is from class c, first 24 bit represents network address bits and last 8 bits represents host address bits. But from the host, we are taking one bit for subnets identifier so 7 bits are remaining for hosts. when subnet identifier bit 0 will represent one subnet and subnet identifier bit 1 will represent another subnet. Since there are 7 bits for hosts, so each subnet can have 27 hosts means 128 hosts which is shown below.
Subnetting practical example is shown below. Each network has it’s own gateway and gateway is also the part of the network which is shown below.