Thursday, October 21, 2010

Ephemeral ports

Just learned about the so-called "ephemeral port range," which for years has been causing my servers on my local Windows machine to not start. Even after killing the process that has captured the server port, for whatever reason, I can't get a Java application to be able to listen on the newly closed port. This problem - not being able to use ports even when the netstat command reports them usable - seems to be a pretty common problem, and not Java-specific: see one of these five articles for more.

Anyway, the "traditional" (who knew? After running BSD all these years, I had no idea) "ephemeral port" range is 1024-4999. I knew ports below 1024 were essentially reserved for root on Unix systems, but I didn't know there were any other allocations. In the 1024-4999 range, applications (often client applications) claim ports for their own use.

Someone generously took the time to compose a very detailed overview of, and reference guide for, ephemeral ports on many operating systems. It certainly was helpful for me.

It is possible to reconfigure the ephemeral port range on Windows by hacking the registry. But simpler for me to just change my port numbers.

No comments:

Post a Comment