[네트워크] IPv4

Parker cho·2022년 6월 16일
0

chapter 5

IPv4

Features

  • Address is 32 bits long
  • addresses are unique and universal
  • address space is 2 ^ 32 or 4,294,967,296

Dotted-demical notation

32 2진수 ip 주소를 8비트씩 4그룹으로 나눠 10진수로 표현 함

Binary : 10000000 00001011 00000011 00011111

Dotted decimal: 128.11.3.31

규칙

  • 255 이상일 수 없음
  • 10진법으로 표현할 때는 앞에 0 을 명시하지 않음 ex) 45 (o) 045(x)

Number of address

Q. Find the number of address in a range if the first address is 146.102.29.0 and the last address is 146.102.32.255

result : last address - first address = 0.0.3.255

Number of address = (02563+02562+3256+2552560)(0 * 256^3 + 0 * 256^2 + 3* 256 + 255 * 256^0)

Last address

Q. The first address in a range of addresses is 14.11.45.96 if the number of address in the range is 32, what is the last address?

Last address = (14.11.45.96+0.0.0.31)256=14.11.45.127(14.11.45.96 + 0.0.0.31)_{256} = 14.11.45.127

Classful addressing

class A: 2312^{31} (50 %) 0 ~ 127

class B: 2302^{30} (25 %) 128 ~ 191

class C: 2292^{29} (12.5 %) 192 ~ 223

Net id and hostid

Class A

0 ~ 127

0.0.0.0 ~ 127.0.0.0

128 blocks: 16,777,216 addresss in each block

Class B

128 ~ 191

16bit 를 봄

255 * 64: 16,384 blocks (65,536 address in each block)

Class C

192 ~ 223

32 255 255 = 2,097,152 blocks (256 address in each block)

Information extraction in classful addressing

Q. An address in a block is given as 73.22.17.25. Find the number of address in the block, the first address, and the last address.

Solution

73.22.17.25 is class A

address number is 1600만

First address: 앞에 8비트 살리고 다 0으로 만들어

Last address: 앞에 8비트도 살리고 뒤에 24비트 다 1로 만들어

Network address

Network address is the identifier of a network.

Network mask

destination address 에서 network address 를 찾기 위해 사용

Network address: Destination address | Default Mask

Subnetworking

  • subnetwork mask bit: origin mask bit + log2(Ns)log_2(N_s)

ex) 141.14.00000000.00000000 → subnet 4

  • 141.14.00000000.00000000 = 141.14.0.0
  • 141.14.01000000.00000000 = 141.14.64.0
  • 141.14.10000000.00000000 = 141.14.128.0
  • 141.14.11000000.00000000 = 141.14.192.0

Classless addressing

  • 클래스가 정해져 있지않은 주소방법
  • subblock을 정할때 subblock 크기가 큰 숫자 부터 정해야 함
  • block을 정의하기 위해 prefix 길이를 알아야 함

In classless addressing, the prefix defines the network and the suffix defines the host

Subnetworking

  • 네트워크는 항상 prefix가 같은 것 끼리 묶여있어야 함!!
  • 위와 같은 이유로 address 개수가 큰 서브네트워크부터 주소를 정해줌

Special addresses

In classful addressing some addresses were reserved for special purposes. The classless addressing scheme inherits some of these special addresses from classful addresssing

all-zero address

  • instead of putting no IP address into the network area of a program can be used to mean anything from accept all IP address or block all IP addresses to the default route

The 0.0.0.0 IP address is sometimes called a wildcard address, unspecified address, or INADDR_ANY

limited broadcast address

특정 패킷을 불특정 모두에게 보낼때 사용

NAT (Network Address Translation)

: 포트포워딩을 자동으로 해주는 것이라고 생각

profile
true nobility is being superior to your former self

0개의 댓글