ephemeral port的意义(ip_local_port_range )

转载 2015年11月21日 09:38:13


Ephemeral port

From Wikipedia, the free encyclopedia

An ephemeral port is a short-lived transport protocol port for Internet Protocol (IP) communications allocated automatically from a predefined range by the IP software. It is 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 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 services that receive connections initiatied from other clients (such as Remote Desktop Protocol or RDP).

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

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 61000.[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]

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


Linux allows you to view and change the ephemeral port range by simply using the file /proc/sys/net/ipv4/ip_local_port_range.  For example, this shows the default configuration on a kernel 2.2 system:

$ cat /proc/sys/net/ipv4/ip_local_port_range 
1024 4999

Linux服务启动报:Address already in use 解决方法:预留端口避免占用ip_local_reserved_ports

问题描述: 业务遇到这个情况,在重启服务时,出现50020端口被占用而无法启动, 非得等该端口释放后才启动成功。 问题分析: 50020端口被该服务器上的客户端 随机选取源端口给占用掉了。 ...
  • wzb56
  • wzb56
  • 2016年02月25日 08:29
  • 2504


  • bhq2010
  • bhq2010
  • 2013年07月12日 01:10
  • 2750


本文以一个显示柱体的vtk程序介绍vtk编程中的主要对象。 显示柱体的VTK程序CMakeLists.txt文件代码如下:CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PRO...
  • webzhuce
  • webzhuce
  • 2017年04月02日 22:14
  • 499


背景 Openstack不管是Ephemeral Storage还是Block Storage, 其实从接口上看,其实都是块服务。那么为什么要搞两个不同的类型呢,本文从这两种不同类型块存储的实现上来分...
  • u012815727
  • u012815727
  • 2014年03月31日 00:06
  • 3256


OpenStack提供两种块存储: ephemeral storage和volumes storage. ephemeral storage 具有和实例相同的生命周期,重启实例并不会影响epheme...
  • jincm13
  • jincm13
  • 2014年08月21日 16:37
  • 2781


由于socket在linux中也是用文件描述符来表示,因此最大连接数的修改与文件描述符的限制是同一个问题, 1、查看当前文件描述符的限制数目的命令:  ulimit -n   2、修改文件描述符的限制...
  • hjx_1000
  • hjx_1000
  • 2013年10月10日 16:48
  • 4441


端口(Port) 模块和所属环境之间动态通信的通道。 A channel for dynamic communication between a block and its environme...
  • QQ604666459
  • QQ604666459
  • 2017年02月18日 01:39
  • 71


1.zookeeper简介 ZooKeeper(ZK) 是一个高可用分布式应用协调系统(A Distributed Coordination Service forDistributed Applic...
  • wangjianno2
  • wangjianno2
  • 2016年02月27日 01:58
  • 413

AD中entry sheet和port的区别是什么?

1、图纸结构 图纸包括两种结构关系: 一种是层次式图纸,该连接关系是纵向的,也就是某一层次的图纸只能和相邻的上级或下级有关系;另一种是扁平式图纸,该连接关系是横向的,任何两张图纸之间都可以...
  • yrr359910539
  • yrr359910539
  • 2015年01月04日 15:00
  • 921


  • ymc2015
  • ymc2015
  • 2015年09月02日 09:52
  • 942
您举报文章:ephemeral port的意义(ip_local_port_range )