Ephemeral_port

Ephemeral port

Ephemeral port

Short-lived transport protocol port for IP communications


An ephemeral port is a communications endpoint (port) of a transport layer protocol of the Internet protocol suite that is used for only a short period of time for the duration of a communication session. Such short-lived ports are allocated automatically within a predefined range of port numbers by the IP stack software of a computer operating system. The Transmission Control Protocol (TCP), the User Datagram Protocol (UDP), and the Stream Control Transmission Protocol (SCTP) typically use an ephemeral port for the client-end of a client–server communication. At the server end of the communication session, ephemeral ports may also be used for continuation of communications with a client that initially connected to one of the services listening with a well-known port. For example, the Trivial File Transfer Protocol (TFTP)[1] and Remote Procedure Call (RPC) applications can behave in this manner.

The allocation of an ephemeral port is temporary and only valid for the duration of the communication session. After completion of the session, the port is destroyed and the port number becomes available for reuse, but many implementations simply increment the last used port number until the ephemeral port range is exhausted, when the numbers roll over. Ephemeral ports are also called dynamic ports, because they are used on a per request basis, and are only known by number once allocated.

Range

More information Range, Operating system ...

Configuration characteristics

If certain server software is used, that uses non-ephemeral custom port ranges for initiating some further connections, it needs to be ensured by configuration that this custom port range and the ephemeral port range do not overlap.[citation needed]

See also

Notes

  1. The effective range is accessible via procfs at node /proc/sys/net/ipv4/ip_local_port_range.

References

  1. Karen R.Sollins (July 1992). The TFTP Protocol (Revision 2). IETF. doi:10.17487/RFC1350. RFC 1350. Retrieved 2020-10-18.
  2. Cotton, M.; Eggert, L.; Touch, J.; Westerlund, M.; Cheshire, S. (August 2011). "Port Number Ranges". Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry. IETF. sec. 6. doi:10.17487/RFC6335. RFC 6335. Retrieved November 14, 2021. the Dynamic Ports, also known as the Private or Ephemeral Ports, ... 49152-65535 (never assigned)
  3. "IP Sysctl". The Linux Kernel documentation. Retrieved 2021-06-27. The default values are 32768 and 60999 respectively.
  4. M. Larsen; F. Gont (January 2011). Recommendations for Transport-Protocol Port Randomization. sec. 3.2. Ephemeral Port Number Range. RFC 6056. However, ephemeral port selection algorithms should use the whole range 1024–65535.
  5. UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI. Prentice Hall. 1998. pp. 42–43. ISBN 0-13-490012-X.
  6. Mike Gleason (2001). "The Ephemeral Port Range". Retrieved 2018-01-15. note that the Linux 2.4 kernel will default the range of 32768 through 61000 if adequate kernel memory is available

Share this article:

This article uses material from the Wikipedia article Ephemeral_port, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.