Subnetting |
Subnetting
Subnetting
is to divide network in smaller parts. Subnetting provide security and it
minimize the broadcast domain. Every network has its own subnet and before
sub-netting it can’t be changed. It is called class-full IP addressing and it
doesn’t provide any flexibility to modify the hosts as per requirement.
In this
concept we can modify the host bits into network bits and borrow few bits for
network to change the host as per requirement. CIDR (Classless inter domain
routing) provides the flexibility to use few part of host bits for a network
bit.it is called subnet. Sub-netting provides better network management
capabilities.
There are
two main reasons of subnetting which are mentioned below.
1.
Security
Purpose
2.
Minimize
the Broadcast domain
Possible
Subnets of all Classes
Class
A Subnets: -
As we know
in IP address we have 4 octets (Each octet have 8 bits) and in Class A we have
only one octet of network and remaining 3 octets is for hosts. It is used for
large scale organizations but with the help of sub-netting we can manage the
small networks in same class along with required hosts. When the bit from host
part will be borrowed subnet will be changed. All possible subnets and hosts
for Class A are mentioned below.
Network Bits |
Bits borrowed |
Subnet Mask |
Possible subnets |
Total Host per subnet |
8 |
0 |
255.0.0.0 |
1 |
16777214 |
9 |
1 |
255.128.0.0 |
2 |
8388606 |
10 |
2 |
255.192.0.0 |
4 |
4194302 |
11 |
3 |
255.224.0.0 |
8 |
2097150 |
12 |
4 |
255.240.0.0 |
16 |
1048574 |
13 |
5 |
255.248.0.0 |
32 |
524286 |
14 |
6 |
255.252.0.0 |
64 |
262142 |
15 |
7 |
255.254.0.0 |
128 |
131070 |
16 |
8 |
255.255.0.0 |
256 |
65534 |
17 |
9 |
255.255.128.0 |
512 |
32766 |
18 |
10 |
255.255.192.0 |
1024 |
16382 |
19 |
11 |
255.255.224.0 |
2048 |
8190 |
20 |
12 |
255.255.240.0 |
4096 |
4094 |
21 |
13 |
255.255.248.0 |
8192 |
2046 |
22 |
14 |
255.255.252.0 |
16384 |
1022 |
23 |
15 |
255.255.254.0 |
32768 |
510 |
24 |
16 |
255.255.255.0 |
65536 |
254 |
25 |
17 |
255.255.255.128 |
131072 |
126 |
26 |
18 |
255.255.255.192 |
262144 |
62 |
27 |
19 |
255.255.255.224 |
524288 |
30 |
28 |
20 |
255.255.255.240 |
1048576 |
14 |
29 |
21 |
255.255.255.248 |
2097152 |
6 |
30 |
22 |
255.255.255.252 |
4194304 |
2 |
Class
B Subnets: -
In class B
we have 2 octets of network and 2 for hosts. It is used for medium scale
networks. All possible subnets and hosts for Class B are mentioned below.
Network Bits |
Bits borrowed |
Subnet Mask |
Possible subnets |
Total Host per subnet |
16 |
0 |
255.255.0.0 |
0 |
65534 |
17 |
1 |
255.255.128.0 |
2 |
32766 |
18 |
2 |
255.255.192.0 |
4 |
16382 |
19 |
3 |
255.255.224.0 |
8 |
8190 |
20 |
4 |
255.255.240.0 |
16 |
4094 |
21 |
5 |
255.255.248.0 |
32 |
2046 |
22 |
6 |
255.255.252.0 |
64 |
1022 |
23 |
7 |
255.255.254.0 |
128 |
510 |
24 |
8 |
255.255.255.0 |
256 |
254 |
25 |
9 |
255.255.255.128 |
512 |
126 |
26 |
10 |
255.255.255.192 |
1024 |
62 |
27 |
11 |
255.255.255.224 |
2048 |
30 |
28 |
12 |
255.255.255.240 |
4096 |
14 |
29 |
13 |
255.255.255.248 |
8192 |
6 |
30 |
14 |
255.255.255.252 |
16384 |
2 |
Class
C Subnets: -
In Class C
we have 3 octets for network and only one octet for hosts. It is use for small
scale organizations.
All
possible subnets and hosts for Class C are mentioned below.
Network Bits |
Bits borrowed |
Subnet Mask |
Possible subnets |
Total Host per subnet |
24 |
0 |
255.255.255.0 |
1 |
254 |
25 |
1 |
255.255.255.128 |
2 |
126 |
26 |
2 |
255.255.255.192 |
4 |
62 |
27 |
3 |
255.255.255.224 |
8 |
30 |
28 |
4 |
255.255.255.240 |
16 |
14 |
29 |
5 |
255.255.255.248 |
32 |
6 |
30 |
6 |
255.255.255.252 |
64 |
2 |
Types
of Subnetting: -
There are
two types of subnetting which are mentioned below.
1.
FLSM
(Fixed Length Subnet Mask)
2. VLSM (Variable Length Subnet Mask)
FLSM:
- (Fixed Length Subnet Mask)
FLSM can
do with two types one is network base it means when we have required networks
quantity we will use this approach to design networks and subnetworks and
second is host base it means when we have exact requirement of hosts then we
can use this approach.
If we want
to use FLSM then we will first see on the requirement, then we will decide
which approach will be feasible for subnetting. Both approaches are mentioned
below
1.
Network
base
2.
Host
Base
Network
Base: - (FLSM)
The formula of Network based FLSM is 2n,
here n=bits of the network. There are 3 main rules of network based subnetting.
1. Bit
Borrow
2. From
the nearest host
3. Add
to the network
We will discuss this in our next topic.
Host
Base: - (FLSM)
The formula of Host based FLSM is 2n - 2 =
H, here n=bits of the network and H is hosts of the network. There are 4 main
rules of network based subnetting.
1. Bit
Borrow
2. From
the Farest host
3. And
discard the borrowed bits
4. Add
remaining bits in the network
We will discuss this in our next topic.
VLSM:
- (Variable Length Subnet Mask)
VLSM is used with both network & host. For this
approach you should have total network and hosts for your network then you will
design subnets as per requirement according to required networks and hosts.
For example, we have a network of 192.168.10.0/24 and
we have 4 departments it means we require 4 networks and every department has
different quantity of hosts. First department is Finance and required host are
50, Second department is Supply chain and required hosts are 30, third
department is HR and required hosts are 20 and fourth department is Ecommerce
and required hosts are 15.
Possible networks of all 4 departments are mentioned
below.
Network
of Finance department: - (First Network)
2n =
Host, in this department we require 50 host 26 = 64 which is greater than from host
requirement.
Network will be
192.168.10.0/26
Network
ID 192.168.10.0
Usable
Host IP 192.168.10.1 to 192.168.10.62
Broadcast
ID 192.168.10.63
Subnet
Mask 255.255.255.192
CIDR
Notation /26
Network
of Supply Chain department: - (Second Network)
, in this department we require 30 host 24 =
32 which is greater than from host requirement.
Network will be
192.168.10.64/28
Network
ID 192.168.10.64
Usable
Host IP 192.168.10.65 to
192.168.10.78
Broadcast
ID 192.168.10.79
Subnet
Mask 255.255.255.240
CIDR
Notation /28
Network
of Human Resource department: - (Third Network)
, in this department we require 20 host 24 =
32 which is greater than from host requirement.
Network will be
192.168.10.80/28
Network
ID 192.168.10.80
Usable
Host IP 192.168.10.81 to
192.168.10.94
Broadcast
ID 192.168.10.95
Subnet
Mask 255.255.255.240
CIDR
Notation /28
Network
of Ecommerce department: - (Fourth Network)
, in this department we require 15 host 24 =
32 which is greater than from host requirement.
Network will be
192.168.10.96/28
Network
ID 192.168.10.96
Usable
Host IP 192.168.10.97 to
192.168.10.110
Broadcast
ID 192.168.10.111
Subnet
Mask 255.255.255.240
CIDR
Notation /28