Cidr
CIDR stands for classless inter domain routing
there are some disdavntages with calssful addressing cidr will solve those issues
in classfull adressing if we want 100 ip adresses we can go for class c which have 256 hosts,if we want 300 ip’s we can go for class b which has more than 300 ips
cidr solve that issue by giving required number of ip addresses in block form
cidr blocks will always contains addresses in the power of 2 like 2^8,2^9…etc
There’s no classes in cidr,so how can we find network id ,host id?
cidr notation will tell that,cidr notation will look like this 192.168.1.1/24,here 24 bits used for nid,remaining
bits used for host id.
subnetting in cidr
ex:20.30.40.10/25 we need 2 subnets lets find host bits host bits falls on last octet last 7 bits cause nid 25 bits convert last octet to binary
20.30.40.0 0001010
put all zeros in hid part we will get nid
20.30.40.0 0000000 to 20.30.40.0(nid) |
20.30.40.0 1111111 to 20.30.40.127(last ip/brd ip) |
lets do subneting
subnet1 | subnet2 |
---|---|
20.30.40.00000000 | 20.30.40.01000000 |
to | to |
20.30.40.00111111 | 20.30.40.011111111 |
Range of subnet1: 20.30.40.0/26 - 20.30.40.63/26
Range of subnet2: 20.30.40.64/26 - 20.30.40.127/26
/26 beacuse one more bit used for subnetid in previous post we have seen all 1’s represent subnetid&nid
/26 also represent subnet mask Subnet Mask-1111111.1111111.1111111.11000000
vlsm in cidr 20.30.40.10/25
sunet1 | subnet2 | subnet3 |
---|---|---|
20.30.40.00000000 | 20.30.40.10000000 | 20.30.40.11000000 |
to | to | to |
20.30.40.01111111 | 20.30.40.10111111 | 20.30.40.11111111 |
Range of subnet1: 20.30.40.0 - 20.30.40.127
Range of sunet2: 20.30.40.128 - 20.30.40.192
Range of subnet3: 20.30.40.192 - 20.30.40.255