CIDR

 Classless Inter-Domain Routing CIDR

  • Each IPv4 address contains 4 parts
  • Represented by 8 bits for each part
  • Every 8 bits represent part of the address as the picture below


In the example above, the 192 =128 (2 to power 7) + 64 (2 to power 6)

  • IP addresses are 32 bit. The total bits are 8x4 =32 in any IP address.
  • The masking /n works as follows, the mask represents the number of bits that are reserved for the network. 


Examples:


Mask 24

192.168.0.0/24
  • This means the first 24 bits are reserved for the network address, and the last 8 bits go to the hosts. Addresses will be in the range (192.168.0.0) to (192.168.0.255). The number of hosts=255. ( 8 bits, hosts = 2 to power 8)

Mask 16:

192.168.0.0/16
  • This means the first 16 bits are reserved for the network address, and the last 16 bits go to the hosts. Addresses will be in the range (192.168.0.0) to (192.168.255.255). Number of hosts =255x255 (8+8 bits, hosts = 2 to power 16)

Mask 27:

192.168.0.0/27
  • This means the first 27 bits are reserved for the network address, and the last 5 bits (32-27) goes to the hosts. Addresses will be in the range (192.168.0.0) to (192.168.255.32). Number of hosts =32 (5 bits, hosts= 2 to power 5)

Mask 12:

192.0.0.0/12
  • This means the first 12 bits are reserved for the network address, and the last 20 bits go to the hosts. Addresses will be in the range (192.0.0.0) to (192.8.255.255). Number of hosts =8x255x255 (8+8+4 bits, hosts=2 to power 20)

RFC 1918

A set of Private IP addresses that do not get routed on the internet. Divided into three categories:
  • Class A, 8 bits network: 10.0.0.0/8
  • Class B, 16 bits network: 192.168/16
  • Class C, 24 bits network: 192.168.1.0/24
  • Others: 172.16.0.0/12


Comments

Popular posts from this blog

Exam Study