Ephemeral port

An ephemeral port is a short-lived transport protocol port for Internet Protocol (IP) communications. 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.

On servers, ephemeral ports may also be used as the port assignment on the server end of a communication. This is done to continue communications with a client that initially connected to one of the server's well-known service listening ports. File Transfer Protocol (FTP) and Remote Procedure Call (RPC) applications are two protocols that can behave in this manner. Note that the term "server" here includes workstations running network services that receive connections initiated from other clients (e.g. Remote Desktop Protocol).

The allocations are temporary and only valid for the duration of the communication session. After completion (or timeout) of the communication session, the ports become available for reuse.[note 1] Since the ports are used on a per request basis they are also called dynamic ports.

Range

The Internet Assigned Numbers Authority (IANA) suggests the range 49152 to 65535 (215+214 to 216−1) for dynamic or private ports.[1]

Many Linux kernels use the port range 32768 to 60999.[note 2] FreeBSD has used the IANA port range since release 4.6. Previous versions, including the Berkeley Software Distribution (BSD), use ports 1024 to 5000 as ephemeral ports.[2][3]

Microsoft Windows operating systems through Windows XP use the range 10255000 as ephemeral ports by default.[4] Windows Vista, Windows 7, and Server 2008 use the IANA range by default.[5] Windows Server 2003 uses the range 10255000 by default, until Microsoft security update MS08-037 from 2008 is installed, after which it uses the IANA range by default.[6] Windows Server 2008 with Exchange Server 2007 installed has a default port range of 102560000.[7] In addition to the default range, all versions of Windows since Windows 2000 have the option of specifying a custom range anywhere within 102565535.[8][9]

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.

See also

Notes

  1. Most implementations may simply increment the last used port number until the ephemeral port range is exhausted.
  2. The effective range is accessible via procfs at node /proc/sys/net/ipv4/ip_local_port_range.

References

  1. IANA port number assignments
  2. UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI. Prentice Hall. 1998. pp. 42–43. ISBN 0-13-490012-X.
  3. 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
  4. Microsoft Windows Technet Library
  5. Microsoft KB Article 929851
  6. Microsoft KB Article 956188
  7. Microsoft KB Article 929851
  8. Microsoft KB Article 929851
  9. Microsoft KB Article 196271

This article is based on material taken from the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.