If the 32-bit binary address starts with a bit 0, then IP Address belongs to class A.
The first 8 bits are used for the Network ID.
The remaining 24 bits are used for the Host ID.
Total number of networks available in class A
= Numbers possible due to remaining available 7 bits in the Net ID – 2
= 2^7 – 2
= 126
Total Number Of Hosts-
Total number of hosts that can be configured in class A
= Numbers possible due to available 24 bits in the Host ID – 2
= 2^24 – 2 (The reason of subtracting 2 is explained later.)
The first 16 bits are used for the Network ID.
The remaining 16 bits are used for the Host ID.
always starts with 10
min = 10000000
max = 10111111
The first 24 bits are used for the Network ID.
The remaining 8 bits are used for the Host ID.
always starts with 110
min = 11000000
max = 11011111
Class D is not divided into Network ID and Host ID
starts with 1110
starts with 1111
IP Address: 1.2.3.4
IP Address belongs to class A
Network IP Address = 1.0.0.0
Direct Broadcast Address = 1.255.255.255
IP Address: 130.1.2.3
IP Address belongs to class B
Network IP Address = 130.1.0.0
Direct Broadcast Address = 130.1.255.255
IP Address: 220.15.1.10
IP Address belongs to class C
Network IP Address = 220.15.1.0
Direct Broadcast Address = 220.15.1.255
184.13.152.0/22
-> 22가 의미하는 것은
network ID로 22 bits, host ID로 10bits를 사용한다는 것임.
이것이 의미하는 것은 255.255.252.0 subnet mask를 사용한다는 것과 동일하다.
규칙-01: CIDR 블록 내의 모든 IP 주소는 연속적이어야 한다.
규칙-02: 블록의 크기는 2의 제곱으로 표현할 수 있어야 한다. 블록의 크기는 블록에 포함된 총 IP 주소의 개수입니다. 어떤 CIDR 블록의 크기도 항상 21, 22, 23, 24, 25와 같은 형태여야 한다.
규칙-03: 블록의 첫 번째 IP 주소는 블록의 크기로 나누어 떨어져야 합니다.
Q. Consider a block of IP Addresses ranging from 100.1.2.32 to 100.1.2.47
47 - 32 + 1 = 16 = 2^4
Number of bits present in Network ID part = 32 - 4 = 28
CIDR Representation = 100.1.2.32 / 28
Q. Consider a block of IP addresses ranging from 150.10.20.64 to 150.10.20.127
127 - 64 + 1 = 64 = 2^6
CIDR Representation = 150.10.20.64 / 26
Q.
Perform CIDR aggregation on the following IP Addresses-
128.56.24.0/24
128.56.25.0/24
128.56.26.0/24
128.56.27.0/24
2^8 * 2^2 = 2^10 -> Network ID가 10bit -> Host -> 22비트
-> 128.56.24.0 / 22