Port selection interactions

You can assign or reserve ports by using several methods, and the various methods interact in the following ways:

Because ports that are reserved by using some of these methods cannot be used by the stack as ephemeral ports, the actual number of available ephemeral ports might not equal the number of ports that are specified in the EPHEMERALPORTS range. You can use the Netstat STATS/-S command to display the actual number of ephemeral ports that are available for assignment by the stack. The CONFIGURED EPHEMERAL PORTS field of the Netstat STATS/-S report accounts for ports that are in the EPHEMERALPORTS range that are unavailable because they are reserved by some other method. This field reflects the actual number of ports that are available for assignment by the stack.

For example, consider the following portion of a TCP/IP profile:

GLOBALCONFIG EXPLICITBINDPORTRANGE 30200 100
;
TCPCONFIG EPHEMERALPORTS 30000 39999
;
UDPCONFIG EPHEMERALPORTS 30000 39999
;
PORT      30005       TCP TCPAPPL2
PORT      30015       TCP TCPAPPL3
;
PORTRANGE 30025 5     TCP TCPAPPL6
PORTRANGE 30100 50    TCP AUTHPORT   ; FTP passive data ports
PORTRANGE 30500 300   TCP OMVS       ; INADDRANYPORT/INADDRANYCOUNT ports
;
PORT      30010       UDP UDPAPPL2
PORT      30015       UDP UDPAPPL3
;
PORTRANGE 30030 5     UDP UDPAPPL6
PORTRANGE 30500 300   UDP OMVS       ; INADDRANYPORT/INADDRANYCOUNT ports

This configuration results in the following values for the CONFIGURED EPHEMERAL PORTS field of the Netstat STATS/-S report:

d tcpip,tcpcs1,netstat,stats
EZD0101I NETSTAT CS V2R1 TCPCS1
.
.
.
TCP STATISTICS
.
.
.
  CONFIGURED EPHEMERAL PORTS          = 9543
  EPHEMERAL PORTS IN USE              = 0
  EPHEMERAL PORTS MAX USAGE           = 0
  EPHEMERAL PORTS EXHAUSTED           = 0
UDP STATISTICS
.
.
.
  CONFIGURED EPHEMERAL PORTS          = 9693
  EPHEMERAL PORTS IN USE              = 0
  EPHEMERAL PORTS MAX USAGE           = 0
  EPHEMERAL PORTS EXHAUSTED           = 0
END OF THE REPORT

For TCP, the total number of configured ephemeral ports is 10000 (ports 30000 – 39999), and this number is reduced by the following amounts:

Subtracting these ports results in the CONFIGURED EPHEMERAL PORTS value of 9543. The CONFIGURED EPHEMERAL PORTS value is not affected by any PORT and PORTRANGE statements that include ports outside of the EPHEMERALPORTS range.

For UDP, the total number of configured ephemeral ports is 10000 (ports 30000 – 39999), and this number is reduced by the following amounts:

Subtracting these ports results in the CONFIGURED EPHEMERAL PORTS value of 9693. The CONFIGURED EPHEMERAL PORTS value is not affected by any PORT and PORTRANGE statements that include ports outside of the EPHEMERALPORTS range.