## Networking contd

• We have classes to define ip ranges
• Class A
• Class B
• Class C
• Class D
• Class E

### CIDR (Classless inter domain routing)

• Quick revision
``````ip: 192.168.0.118
sm: 255.255.255.0

n (host id) = 1 octet = 8 bits
N (Network id) = 32 - n  = 24 bits
``````
• Find subnet mask for a network of 500 devices
``````500

2^n - 2 ~= 500

2^n ~= 500

n = 9
N = 32 - 9 = 23

SM: 11111111.11111111.11111110.00000000
255.255.254.0
``````
• Find subnet mask for a network of 5000 devices
``````5000

2^n - 2 ~= 5000

2^n ~= 5000

n = 13
N = 32-13 = 19

SM: 11111111.11111111.11100000.00000000
255.255.224.0
``````
• Find subnet mask for a network of 50000 devices
``````2^n - 2 ~= 50000
2^n ~= 50000
n = 16
N = 32-16 = 16
SM: 11111111.11111111.00000000.00000000
255.255.0.0
``````
• Find a subnet mask for a network with 8 devices
``````2^n -2 = 8
2^n ~= 10
n = 4
N = 28
SM: 11111111.11111111.11111111.11110000
255.255.255.240
``````
• Find a subnet mask for a network with 80000 devices
``````2^n -2 = 80000
2^n ~= 80000
n = 17
N = 32-17 = 15
SM: 11111111.11111110.00000000.00000000
255.254.0.0
``````
• In this notation ip is expressed as `x.x.x.x/N`
``````192.168.0.0/24
N (network id) = 24 bits
n (host id) = 32 - 24 = 8
ip: 192.168.0.x => 192.168.0.0 to 192.168.0.255
SM: 11111111.11111111.11111111.00000000

10.0.0.0/16
N = 16
n = 32 -16 = 16
ip: 10.0.x.x => 10.0.0.0 to 10.0.255.255
SM: 11111111.11111111.00000000.00000000

10.0.0.0/8
N = 8
n = 32-8 = 24
ip: 10.x.x.x => 10.0.0.0 to 10.255.255.255
SM: 11111111.00000000.00000000.00000000

192.168.0.0/22
N = 22
n = 32-22 = 10

ip: 192.168.(0+x).x => 192.168.(0+0).0 to 192.168.(0+3).255
=> 192.168.0.0 to 192.168.3.255
SM: 11111111.11111111.11111100.00000000

172.16.0.0/26
N = 26
n = 32-26 = 6

ip: 172.16.0.(0+x) => 172.16.0.(0+0) to 172.16.0.(0+63)
=> 172.16.0.0 to 172.16.0.63
SM: 11111111.11111111.11111111.11000000

172.16.0.0/12
N = 12
n = 32-12 = 20
ip: 172.(16+x).x.x => 172.(16+0).0.0 to 172.(16+15).255.255
=> 172.16.0.0 to 172.31.255.255
SM: 11111111.11110000.00000000.00000000

192.168.64.0/22

N = 22
n = 10

ip: 192.168.(64+x).x => 192.168.(64+0).0 to 192.168.(64+3).255
=> 192.168.64.0 to 192.168.67.255
SM: 11111111.11111111.11111100.00000000

172.16.0.0/15

N = 15
n = 17

ip:  172.(16+x).x.x => 172.16.0.0 to 172.17.255.255
SM: 11111111.11111110.00000000.00000000

192.168.8.0/22

N = 22
n = 10

ip: 192.168.(8+x).0 to 192.168.8.0 to 192.168.11.255
SM: 11111111.11111111.11111100.00000000
``````

This site uses Akismet to reduce spam. Learn how your comment data is processed. 