dev@glassfish.java.net

mysterious ports

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Fri, 10 Sep 2010 09:53:15 -0500

  I've been looking at the ports that cluster members listen on, and I'm
seeing some mysterious ports. Can someone please identify what these
ports are being used for? Also, how are the port numbers allocated?

Here are the ports used by a typical instance, running without GMS
enabled and with JMS in embedded mode:

TCP *:28081 (LISTEN) < HTTP_LISTENER_PORT
TCP *:28182 (LISTEN) < HTTP_SSL_LISTENER_PORT
TCP *:24849 (LISTEN) < ASADMIN_LISTENER_PORT
TCP 127.0.0.1:26667 (LISTEN) < OSGI_SHELL_TELNET_PORT
TCP *:27677 (LISTEN) < JMS_PROVIDER_PORT
TCP *:27777 (LISTEN) < ?????
TCP *:16426 (LISTEN) < ?????
TCP *:52978 (LISTEN) < ?????
TCP *:32874 (LISTEN) < ?????
TCP *:4910 (LISTEN) < ?????
TCP *:28687 (LISTEN) < JMX_SYSTEM_CONNECTOR_PORT

The concern that I have with these ports is that they appear to be
dynamically allocated, because they change each time the instance is run
and for different instances, but except for one, they are allocated from
the outside the region for allocating dynamic ports (which is 49152 to
65535). And if the port number chosen happens to be the one that another
instance on the same system is going to use, then that instance will
fail to start because it can't bind to it's port.

I also curious as to what determines the address that these sockets are
bound too, for the multihomed server use case.

Thanks.
Tom