Subnet mask
A subnet or subnetwork is a smaller network inside a large
network. Subnetting makes network routing much more
efficient.
Subnets make networks more efficient. Through subnetting,
network traffic can travel a shorter distance without passing
through unnecessary routers to reach its destination.
Every device that connects to internet will be given id which
is known as ip address
Ip address shows up 4 bytes = 32 bits
(Ex) 192.168.124.2
Which will be 11000000.10101000.01111100.00000010 in
binary
These 32 bytes will be divided into two parts :
Network and host part ,
IPv4 are divided in 4 IP classes. The class of an IP address
determines how the address is allocated and how it is used. It
defines also the subnet mask that fixes the size of the
network.
For instance,systems in the network under class c ,there
may be millions of host,sending data within network will be
traffic,so subnetting makes it easy to identify range of
devices and can send and receive data efficiently
1.Subnetting allows allocating properly IP addresses to
prevent from large amounts of IP addresses going unused.
IP address can’t identify the network range to be
communicated by host .
Subnet mask makes it easy to identify the range to be
communicated
(ex): 192.168.186.19/32
32 represents 11111111.11111111.11111111.11111111
which is 255.255.255.255
2^0=1
This makes clear that only ip 192.168.186.19 is present
By borrowing 1 bit makes 2 subnets
/31
255.255.255.254
11111111.11111111.11111111.11111110
Here 1 host bit is present ,so we can make 2 subnetrs
2^1=2
192.168.186.19 and 192.168.186.20 can communicate
So,subnet limits number of hosts to be connected
And decides the range to be connected,so network traffic can
be reduced
As in above table, 32 is the