[컴퓨터 네트워크] Subnetting in Networking

Taegang Yun·2023년 12월 16일
1

컴퓨터 네트워크

목록 보기
8/9
  • IP 주소는 점으로 구분된 4개의 숫자로 표시되는 32비트 이진 주소이다
  • 이 4개의 숫자를 옥텟(octet)이라고 하며, 각 옥텟은 8비트이다. 옥텟은 Net ID와 Host ID 두 구성 요소로 나뉜다.
  • 네트워크 ID는 네트워크의 IP 주소를 나타내며, 네트워크를 식별하는 데 사용된다. 호스트 ID는 호스트의 IP 주소를 나타내며, 네트워크 내에서 호스트를 식별하는 데 사용된다.

IP Addressing

  1. Classful Addressing System
  2. Classless Addressing System

Classful Addressing

Class A:

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.)

Class B

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

Class C

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

Class D is not divided into Network ID and Host ID
starts with 1110

Class E

starts with 1111

IP address in networking

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

Classless Addressing

184.13.152.0/22

-> 22가 의미하는 것은
network ID로 22 bits, host ID로 10bits를 사용한다는 것임.

이것이 의미하는 것은 255.255.252.0 subnet mask를 사용한다는 것과 동일하다.

Rules for creating CIDR Block

규칙-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

profile
언젠간 전문가가 되겠지

0개의 댓글