컴퓨터공학/데이터통신

[데이터 통신] IPv4 Addressing Example

NIMHO 2022. 12. 15. 14:00
728x90

복습하기 위해 학부 수업 내용을 필기한 내용입니다.
이해를 제대로 하지 못하고 정리한 경우 틀린 내용이 있을 수 있습니다.
그러한 부분에 대해서는 알려주시면 정말 감사하겠습니다.

2022.12.15 - [컴퓨터공학/데이터통신] - [데이터 통신] IPv4 Addressing - Internet Protocol Version 4

 

[데이터 통신] IPv4 Addressing - Internet Protocol Version 4

복습하기 위해 학부 수업 내용을 필기한 내용입니다. 이해를 제대로 하지 못하고 정리한 경우 틀린 내용이 있을 수 있습니다. 그러한 부분에 대해서는 알려주시면 정말 감사하겠습니다. ▶Content

dhalsdl12.tistory.com

Contents

  • Services
  • Packet Switching
  • Performance
  • Internet Protocol Version 4
  • Next Generation (IPV6)
  • Transition from IPV4 To IPV6
 

Classless Address

Example 7.1

A classless address is given as 167.199.170.82/27.

We can find the desired three pieces of information as follows.

The number of addresses in the network is 2^(32 – n) = 2^5 = 32 addresses.

The first address can be found by keeping the first 27 bits and changing the rest of the bits to 0s.

 

Solution

classless address에서 27비트는 네트워크의 주소가 된다.

그럼 32비트 중 27비트는 제외하고 나머지 5비트만 가지고 주소를 할당하게 된다.

5비트를 모두 0으로 할당해주면 첫 주소가 나온다. (167.199.170.64/24)

그리고 5비트를 모두 1로 할당해주면 마지막 주소이다. (167.199.170.95/27)

728x90

Address Mask

Example 7.2

We repeat Example 7.1 using the mask.

The mask in dotted-decimal notation is 255.255.255.224.

The AND, OR, and NOT operations can be applied to individual bytes using calculators and applets at the book website.

 

Solution

 

Example 7.3

In classless addressing, an address cannot per se define the block the address belongs to.

For example, the address 230.8.24.56 can belong to many blocks.

Some of them are shown below with the value of the prefix associated with that block.

 

Solution

 

Block Allocation

Example 7.4

An ISP has requested a block of 1000 addresses.

Since 1000 is not a power of 2, 1024 addresses are granted.

The prefix length is calculated as n = 32 – log2 1024 = 22.

An available block, 18.14.12.0/22, is granted to the ISP.

It can be seen that the first address in decimal is 302,910,464, which is divisible by 1024.

 

Solution

address : 0001 0010 | 0000 1110 | 0000 1100 | 0000 0000

first bit   : 0001 0010 | 0000 1110 | 0000 1100 | 0000 0000 (18.14.12.0)

last bit   : 0001 0010 | 0000 1110 | 0000 1111 | 1111 1111 (18. 14. 15. 255)

Example 7.5

An organization is granted a block of addresses with the beginning address 14.24.74.0/24.

The organization needs to have 3 subblocks of addresses to use in its three subnets:

one subblock of 10 addresses, one subblock of 60 addresses, and one subblock of 120 addresses.

Design the subblocks.

 

Solution

address : 0000 1100 | 0001 1000 | 0100 1010 | 0000 0000

32 - 24 = 8

2^8 = 256 -> 256개의 주소를 가질 수 있다.

 

first address : 14.24.74.0/24

last address : 14.24.74.255/24

 

블록의 크기가 큰 것부터 작은 것의 순서대로 배치해줘야 한다.

120, 60, 10 순서대로 해준다.

 

1.

120보다 크고 가장 가까운 2^n = 128 -> n = 7

prefix = 32 - 7 = 25

first address : 14.24.74.0/25

last address : 14.24.74.127/25

 

2.

0~127까지 할당해주었기에 다음 주소는 128부터 가능하다.

60보다 크고 가장 가까운 2^n = 64 -> n = 6

prefix = 32 - 6 = 26

first address : 14.24.74.128/26

last address : 14.24.74.191/26

 

3.

128~191까지 할당해주었기에 다음 주소는 192부터 가능하다.

10보다 크고 가장 가까운 2^n = 16 -> n = 4

prefix = 32 - 4 = 28

first address : 14.24.74.192/28

last address : 14.24.74.207/28

 

총 256개 중 208개가 할당되었고, 48개가 남아있다.

남은 것들의 주소를 보면

first address : 14.24.74.208

last address : 14.24.74.255

 

Address Aggregation

Example 7.6

10진수의 첫 번째 주소는 302,910,464로 1024로 나눗셈할 수 있다.
아래 그림은 ISP가 4개의 조직에 4개의 작은 주소 블록을 할당하는 방법을 보여준다.
ISP는 이 네 개의 블록을 하나의 블록으로 결합하고 더 큰 블록을 나머지 세계에 광고한다.
이 더 큰 블록으로 향하는 모든 패킷은 이 ISP로 전송되어야 한다.


우편 네트워크에서 찾을 수 있는 라우팅과 유사하다.
한 나라 밖에서 오는 모든 패키지는 먼저 서울로 전송된 후 해당 목적지로 배포된다.

외국 -> 한국(서울) -> 대구 -> 수성구...

728x90