What is IP Class, Subnet mask and CIDR?

 IP Class

IPv4 consists of a logical address system consisting of 255.255.255.255 32 bits (4 bytes) in length, and one IP consists of a Network Address and a Host Address. In particular, here, Network Address divides its scope into areas that are easy to manage, and we call it Class. This class consists of five classes from A to E as follows, and the Network Address area and Host Address area of each class are shown in the figure. 


The starting range of each class is easy to remember by calculating the following equation.

  • There are 256 ranges to input into IP (0 to 255)
  • Divide by 2 from 256.
  • 256 / 2 = 128 - 1 = 127 (range of A class: 0 ~ 127)
  • 128 / 2 = 64 + 127 = 191 (range of B class: 128 ~ 191)
  • 64 /2 = 32 + 191 = 223 (range of C class: 192 ~ 223)
  • the rest of the number of 32 is divided by 16 and separated into a D class and an E class each.

 Subnet

Subnet Mask is used to raise or lower the Network Address value by masking the value to Network Address. In other words, the Subnet mask is used for grouping and managing the assigned Network Address and Host Address by Masking with arbitrary values (finding the original value that is only 1 by using logical AND arithmetic operation).
For example, if the C class IP value of 210.100.100.1 is expressed as a binary number, it is as follows.

(*** The logical AND arithmetic operation is like this: 1 AND 1 = 1, 1 AND 0 = 0, 0 AND 1 = 0, 0 AND 0 = 0 ***)

1101 0010.0110 0100.0110 0100.0000 0001 = 210.100.100.1 (the basic subnet mask of C class is 255.255.255.0)
1111 1111.1111 1111.1111 1111.0000 0000 = 255.255.255.0 (use the logical AND) 
--- AND calculation ---
1101 0010.0110 0100.0110 0100.0000 0000 = 210.100.100.0 (It's the network value of subnet.)

 CIDR

CIDR is an IP address allocation method introduced in 1993 as a classless interdomain routing technique. Sider replaced the network class, which was the existing IP address allocation method, and by using Sider, the flexibility of dividing the area of the IP address into several networks is increased compared to the existing method. The notation of the sider is the same as that of the subnet mask.


The IP address can be used after /24 digits, so it can be used from 143.7.65.0 to 143.7.65.255.


The table above defines the number of Hosts (i.e., the number of devices) that can be used according to the CIDR value and the MASK value in advance.

Comments

Popular posts from this blog

[Kubernetes] Node Overcommitted

[AWS] What is the Cloud Formation?

How to Install jenkins using Helm chart on instance