20250212 122410
How system can divide network and host portion, and how it find network id
Subnet Mask:
System use Subnet Mask to Divides ip address into network and host portion
Tells network id of ip address
Subnet mask uses AND gate(logical gate) Operation
By default Default Subnet mask
Class A:0-127(1-126):N.H.H.H: 255.0.0.0 :2^24-2 = 16777214
Class B:128-191 :N.N.H.H: 255.255.0.0 :2^16-2 = 65534
Class C:192-223 :N.N.N.H: 255.255.255.0:2^8-2=254
- In Subnet Mask 1’s represent Network Bit, 0’s represent Host Bit
- 255 – 1111 1111, 0 – 0000 0000
AND Gate
A B Y=A.B
0 0 0
0 1 0
1 0 0
1 1 1
—------------------------------------------------------
192.168.1.0 – Network ID, can’t assign to any device, entire host portion is 0’s
192.168.1.1 – 1st valid host id, ip address, can assign to device
192.168.1.2
..
192.168.1.254 – last valid host id/ip address
192.168.1.255 – Broadcast ID, can’t assign, entire host portion is 1’s
192.168.2.0 – other network
How to find Network ID of a IP Address
IP Address: 183.15.33.44 - 1011 0111.0000 1111.0010 0001.0010 1100
Subnet Mask: 255.255.0.0 - 1111 1111.1111 1111.0000 0000.0000 0000
Network ID: 183.15.0.0 - 1011 0111.0000 1111.0000 0000.0000 0000
Subnetting: Divided one network into multiple subnets
No of hosts per subnet will reduce
How to do subnetting, by changing the subnet mask.
183.15.22.6 1011 0111.0000 1111.0001 0110.0000 0110
255.255.0.0 1111 1111.1111 1111.0000 0000.0000 0000
183.15.0.0 -- 1011 0111.0000 1111.0000 0000.0000 0000
183.15.33.44 & 183.15.22.6 systems can communicate with each other due to the same Network ID’s.
I have changed the subnet mask
183.15.33.44 1011 0111.0000 1111.0010 0001.0010 1100
255.255.255.0 1111 1111.1111 1111.1111 1111.0000 0000
183.15.33.0 1011 0111.0000 1111.0010 0001.0000 0000
183.15.22.6 1011 0111.0000 1111.0001 0110.0000 0110
255.255.255.0 1111 1111.1111 1111.1111 1111.0000 0000
183.15.22.0 1011 0111.0000 1111.0001 0110.0000 0000
183.15.33.44 & 183.15.22.6 systems can’t communicate with each other due to different Network ID’s.
—------------------------------------------------------------------------------------
You tell your ip address in different, with subnet mask
Ex. ip addr is 192.168.2.23 and SM is 255.255.255.0
Ip addr is 172.16.0.112, means SM is default SM - 255.255.0.0
If you use different subnet mask than default (mean customized subnet mask) you must mention the subnet mask
Ex. ip addr 172.16.23.33 and SM is 255.255.240.0 or Same you can mention like this 172.16.23.33/20
/n – slash notation , represent Subnet mask , n - no. of 1’s as subnet mask
/n – Prefix – CIDR Method
255.0.0.0 – 1111 1111.0000 0000. 0000 0000. 0000 0000 – /8
255.255.0.0 – 1111 1111. 1111 1111.0000 0000.0000 0000 – /16
255.255.255.0 – 1111 1111.1111 1111.1111 1111.0000 0000 – /24
255.255.240.0 – /20 - 1111 1111.1111 1111.1111 0000.0000 0000 240 - 1111 0000
255.255.255.192 – /26 -1111 1111.1111 1111.1111 1111.1100 0000 192 - 1100 0000
172.16.1.23/16 – 172.16.1.23 , 255.255.0.0
172.16.17.34/22 – 172.16.17.34, 255.255.252.0 1111 1100 – 252
/22 - 1111 1111.1111 1111.1111 1100.0000 0000 - 255.255.252.0
—-------------------------------------------------------------------------