subnetting
subnet: A logical subdivision of an IP network
Why sub-netting is used?
Setting up logical divisions. Sub-netting helps you maintain clean separations within a network. For example, you can define boundaries between different departments in your organization, with one subnet for production, another for a marketing and for a finance.
Through sub-netting we can reduce wastage of IP addresses for a network
How to subnet a network?
subnet mask consists of 32 bits
a subnet has 2 parts, one is network id and another one is the host id
Network ID: Any address bits which have the corresponding mask bit set to 1
Host ID/node ID: any address bits which have the corresponding mask bits set to 0
Host Id represents No.of devices in a network
for example: you have a class C address 192.168.1.0, the subnet mask for class c is 255.255.255.0 (11111111.11111111.11111111.00000000)
Here 192.168.1 is a network position and 0 is a host position. That means 192.168.1.0 can have 255 devices in a network.
We can use CIDR notation to represent No.of 1's in a network.
ex: 192.168.1.0/24
1. sub-netting by No.of devices
If you have 3 departments/sub networks, you have IP network 192.168.1.0 and each department should consist of 60 devices.
So we use, 2^n-2>no.of devices
Here 'n' represents No.of host bits in a subnet mask
If we set 6 bits to Host ID
:. 2^6-2=>64-2
That means we can set 62 devices per network.
The subnet id is, 11111111.11111111.11111111.11000000 (255.255.255.192)
Network 1: 192.168.1.0/26
first host address 192.168.1.1 255.255.255.192
last host address 192.168.1.62 255.255.255.192
broadcast address 192.168.1.63 255.255.255.192
Network 2: 192.168.1.64/26
first host address 192.168.1.65 255.255.255.192
last host address 192.168.1.126 255.255.255.192
broadcast address 192.168.1.127 255.255.255.192
Network 2: 192.168.1.128/26
first host address 192.168.1.127 255.255.255.192
last host address 192.168.1.190 255.255.255.192
broadcast address 192.168.1.191 255.255.255.192
2.Sub-netting by No.of Networks
If you have 3 departments/sub networks, you have IP network 192.168.1.0
So we use, 2^n>No.of networks
here 'n' represents No.of Host bits that we should convert into network bits from left to right.
If we convert 2 bits into network id, that means 4 sub-networks per a network.
:. 2^2=4
That means if we converts 2 host id bits as network bits, we can devided network into 4 sub-networks
The subnet Id is, 11111111.11111111.11111111.11000000(255.255.255.192)
Network1:192.168.1.0/64
Network2:192.168.1.64/64
Network3:192.168.1.128/64
Network4:192.168.1.192/64
Comments
Post a Comment