CIDR - classless inter-domain routing to overcome the issue of exhaustive Ipv 4 address on the internet (for instance IBM was getting the entire 9.0.0.0/8 class A for its own use)

192.168.0.0/8 = uses 8 bits for subnet mask (number of networks 2 at the power of 8)

= uses 24 bits (32total - 8subnet) for hosts (number of computers 2 at the power of 24)

172.31.0.0/24 = 24 bits for subnet and 8 for hosts

10.0.0.0/32 = 32 bits for subnet and 0 for hosts (2 at the power of 0 equals 1 host)


Let's say we've got CIDR address 10.20.30.40 - that can fall for example into these subnets:

• 10.0.0.0/8 - /8 means only the first byte (10.) in the address is the network address.

• 10.20.0.0/16 - /16 means the first two bytes (10.20.) are network.

• 10.20.30.0/24 - /24 means the first three bytes (10.20.30.) are network.

• 10.20.30.40/32 - /32 covers the whole address (10.20.30.40) and sometimes this notation is used to explicitly say it's a host address. AWS uses that a lot.

https://serverfault.com/questions/943582/aws-flagged-my-subnet-as-invalid-although-it-looks-to-be-within-the-vpc- cidr-blo