Creating networks
- If we stick to decimals the possible subnet masks are
- 255.255.255.0 => 2^8 – 2 = 254
- 255.255.0.0 => 2^16 – 2 ~= 65000
- 255.0.0.0 => 2^24 – 2
- If i want a network of size 500 then subnet mask would tb
255.255.0.0
- To solve this problem we use CIDR (Classless interdomain Routing). The basic idea is to look at subnet mask as sequence of 1’s and 0’s (binary)
255.255.255.0
11111111.11111111.11111111.00000000
- network id is number of bits till we hit 0 starting from 1 bit
- size of network => 2^n – 2
N = number of bits for network id (1's)
n = number of bits for host id (0's)
-
CIDR is represented as
x.x.x.x/N
-
I want a network of size 500
2^n - 2 ~= 500
n = 9
N = 32 - 9 = 23
SM = 11111111.11111111.11111110.00000000
= 255.255.254.0
- I want a network of size 7100 devices
2^n ~= 7100
n = 13
N = 32 - 13 = 19
SM: 11111111.11111111.11100000.00000000
255.255.224.0
- I want a network of size 70000 devices
2^n ~= 70000
n = 17
N = 32 - 17 = 15
SM: 11111111.11111110.00000000.00000000
255.254.0.0
- CIDR Notation => x.x.x.x/N => this defines the range of ip address available in a network
- Expand CIDR 192.168.0.0/24
192.168.0.0/24
N = 24
n = 32 -24 = 8
SM = 11111111.11111111.11111111.0000000 (255.255.255.0)
= 192. 168. 0.xxxxxxx
s = 192. 168. 0.0000000 = 192.168.0.0
e = 192. 168. 0.1111111 = 192.168.0.255
- Expand CIDR 10.10.10.0/23
10.10.10.0/23
N = 23
n = 32 -23 = 9
SM = 11111111.11111111.11111110.0000000
10. 10.0000101x.xxxxxxx
s = 10. 10.00001010.0000000 => 10.10.10.0
e = 10. 10.00001011.1111111 => 10.10.11.255
- Expand CIDR 10.128.0.0/12
10.128.0.0/12
N = 12
n = 32 -12 = 20
SM = 11111111.11110000.0000000.0000000
= 10.1000xxxx.xxxxxxx.xxxxxxx
s= 10.10000000.0000000.0000000 => 10.128.0.0
e= 10.10001111.1111111.1111111 => 10.143.255.255