Skip to content

Port

다른 의미는 (동음이의어) MacPort 참조

TCP 및 UDP 포트는 인터넷 프로토콜 스위트의 전송 계층 프로토콜 중 TCP나 UDP 등의 프로토콜이 사용하는 가상의 논리적 통신 연결단이다. 각 포트는 번호로 구별되며 이 번호를 포트 번호라고 한다. 포트 번호는 IP 주소와 함께 쓰여 해당하는 프로토콜에 의해 사용된다.

Well-known port number

잘 알려진 포트(well-known port)는 특정한 쓰임새를 위해서 IANA에서 할당한 TCP 및 UDP 포트 번호의 일부이다. 일반적으로 포트 번호는 다음과 같이 세 가지로 나눌 수 있다.

  • 0번 ~ 1023번: 잘 알려진 포트 (well-known port)
  • 1024번 ~ 49151번: 등록된 포트 (registered port)
  • 49152번 ~ 65535번: 동적 포트 (dynamic port) - 이 부분이 아마도(?) 임시 포트 (Ephemeral port) 일듯...

대부분의 유닉스 계열 운영 체제의 경우, 잘 알려진 포트를 열려면 루트 권한이 있어야 한다. 이 번호는 강제적으로 지정된 것은 아니며, IANA의 권고안일 뿐이다. 가끔 각 포트 번호를 그대로 사용하지 않고 다른 용도로 사용하기도 한다. 이 경우, 트로이 목마와 같은 프로그램들이 악의적인 목적으로 포트를 변경하여 사용하는 경우도 있다.

Wikipedia 설명:

The registered ports are those from 1024 through 49151. IANA maintains the official list of well-known and registered ranges.

The dynamic or private ports are those from 49152 through 65535. One common use for this range is for ephemeral ports. 

임시 포트 (Ephemeral port)

An ephemeral port is a short-lived port number used by an Internet Protocol (IP) transport protocol. Ephemeral ports are allocated automatically from a predefined range by the IP stack software. An ephemeral port is typically used by the Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or the Stream Control Transmission Protocol (SCTP) as the port assignment for the client end of a client–server communication to a particular port (usually a well-known port) on a server.

Dynamic port range

Following command will list the ephemeral port range in Linux system

sysctl -A | grep ip_local_port_range 

If we don't want to reboot, after editing /etc/sysctl.conf file if we execute following command it will be effective.

sysctl -p /etc/sysctl.conf .

The truth of the matter of effective range is output of

sysctl net.ipv4.ip_local_port_range 

as mentioned by eckes in comment.

열린 포트 번호 찾기

Port scanner#열린 포트 번호 찾기 예제 항목 참조.

See also

Favorite site

References


  1. List_of_tcp_and_udp_port_numbers.pdf